提交 66c89423 authored 作者: 000516's avatar 000516

发货单物流轨迹回写勤策后,推送状态变更

上级 d3e3e987
......@@ -13,4 +13,6 @@ public interface IOrdersSentDao {
List<OrdersSentDto> findByPushqcStatus();
OrdersSentDto getSent(String sentNo);
void updatePushqcByAhSentNo(String ahSentNo);
}
......@@ -38,4 +38,9 @@ public class OrdersSentDaoImpl implements IOrdersSentDao {
}
return BeanUtils.transitionDto(sentDo, OrdersSentDto.class);
}
@Override
public void updatePushqcByAhSentNo(String ahSentNo) {
ordersSentMapper.updatePushqcByAhSentNo(ahSentNo);
}
}
......@@ -18,6 +18,8 @@ public interface OrdersSentMapper extends BaseMapper<OrdersSent> {
List<OrdersSent> findUnsyncQc();
OrdersSent selectBySentNo(String sentNo);
void updatePushqcByAhSentNo(String ahSentNo);
}
......
......@@ -28,7 +28,9 @@ public class OrdersSentQueryServiceImpl implements IOrdersSentQueryService {
@Override
public void ordersSentToQince() {
// 查询所有未push到勤策的发货单
List<OrdersSentDto> sents = ordersSentDao.findByPushqcStatus();
log.info("查询未推送到勤策的发货单:{}", sents.size());
for (OrdersSentDto sent : sents) {
// 修改勤策物流https地址
pushQc(sent);
......@@ -42,15 +44,18 @@ public class OrdersSentQueryServiceImpl implements IOrdersSentQueryService {
private void pushQc(OrdersSentDto sent){
try {
log.info("start push qc sent no [{}] 物流轨迹", sent.getAhSentNo());
String wlHtmlPath = qinCeUtils.wlHtmlPath;
wlHtmlPath += sent.getAhSentNo();
// 勤策中发货单按安徽匹配
Map<String, Object> params = qinCeUtils.modifySentDefinedValParams(sent.getAhSentNo(), wlHtmlPath);
String url = qinCeUtils.builderUrl(QinCeUtils.MODIFY_SENT_DEFINED_VAL, params);
JSONObject request = qinCeUtils.postQC(url, params);
qinCeUtils.postQC(url, params);
// 推送成功
ordersSentDao.updatePushqcByAhSentNo(sent.getAhSentNo());
log.info("end push qc sent no [{}] 物流轨迹", sent.getAhSentNo());
}catch (Exception e) {
log.error("勤策推送物流地址失败,物流信息:{}", JSONObject.toJSONString(sent));
}
}
}
......@@ -48,4 +48,8 @@
</if>
</where>
</select>
<update id="updatePushqcByAhSentNo" parameterType="java.lang.String">
update orders_sent set push_qc = 0 where ah_sent_no = #{ahSentNo}
</update>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论