回调问题修复
continuous-integration/drone/push Build is passing Details

畅捷通同步方案更新
YXY 1 year ago
parent 4c622ebd1d
commit 119745516d

@ -78,6 +78,16 @@ public class EdiController extends BaseController {
iEventLogService.insertBatchEventLog(Arrays.asList(log1, log2)); iEventLogService.insertBatchEventLog(Arrays.asList(log1, log2));
} }
/**
*
*/
// @PostMapping("/cjtTicket")
// public void receiveCjtTicket(Long id) {
// ErpLarkTempRelation erpLarkTempRelation = erpLarkTempRelationMapper.selectErpLarkTempRelationById(id);
// JSONObject jsonObject = JSONObject.parseObject(erpLarkTempRelation.getRemark());
// execeuteByType(jsonObject);
// }
/** /**
* *
*/ */

@ -65,7 +65,8 @@ public interface ErpLarkTempRelationMapper
public Long selectMaxId(@Param("method") String method, @Param("flag") Long flag,@Param("key") String key); public Long selectMaxId(@Param("method") String method, @Param("flag") Long flag,@Param("key") String key);
public int updateByMethod(@Param("method") String method, @Param("flag") Long flag,@Param("id") Long id,@Param("key") String key); public int updateByMethod(@Param("method") String method, @Param("flag") Long flag,@Param("id") Long id,@Param("key") String key);
public int updateForCjt(@Param("flag") Long flag,@Param("id") Long id,@Param("remark") String remark); public int updateForCjt(@Param("flag") Long flag,@Param("id") Long id);
public int updateForCjtError(@Param("flag") Long flag,@Param("id") Long id,@Param("remark") String remark);
public int deleteByMethod(@Param("method") String method,@Param("flag") Long flag,@Param("id") Long id,@Param("key") String key); public int deleteByMethod(@Param("method") String method,@Param("flag") Long flag,@Param("id") Long id,@Param("key") String key);

@ -90,7 +90,7 @@ public abstract class CJTOperateCallBackAbstract {
} }
} }
private void preHandle(CJTEdiCallbackRequestVo req) { public void preHandle(CJTEdiCallbackRequestVo req) {
if (req.getRetryCount() > 0) { if (req.getRetryCount() > 0) {
return; return;
} }
@ -109,22 +109,26 @@ public abstract class CJTOperateCallBackAbstract {
private void endHandle(CJTEdiCallbackRequestVo req) { private void endHandle(CJTEdiCallbackRequestVo req) {
if (req.getTempId() != null) { if (req.getTempId() != null) {
erpLarkTempRelationMapper.updateForCjt(FlagStatus.DELETED.getCode(), req.getTempId(), ""); erpLarkTempRelationMapper.updateForCjt(FlagStatus.DELETED.getCode(), req.getTempId());
} }
} }
private void errorHandle(CJTEdiCallbackRequestVo req, Exception e) { private void errorHandle(CJTEdiCallbackRequestVo req, Exception e) {
if (req.getTempId() != null) { if (req.getTempId() != null) {
erpLarkTempRelationMapper.updateForCjt(FlagStatus.OK.getCode(), req.getTempId(), e.getMessage()); erpLarkTempRelationMapper.updateForCjtError(FlagStatus.OK.getCode(), req.getTempId(), e.getMessage());
} }
} }
private void sync(CJTEdiCallbackRequestVo req) { private void sync(CJTEdiCallbackRequestVo req) {
CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum(); CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum();
String msgType = req.getMsgType();
JSONObject jsonObject = null;
if (!msgType.contains("Delete")){
LarkCJTRequestBody cjtRequestBody = new LarkCJTRequestBody(req.getVoucherId()); LarkCJTRequestBody cjtRequestBody = new LarkCJTRequestBody(req.getVoucherId());
LarkCJTRequest cjtRequest = new LarkCJTRequest(getRequestUrl(), cjtAccountEnum.getAppKey(), cjtAccountEnum.getAppSecret(), generateToken(req), cjtRequestBody); LarkCJTRequest cjtRequest = new LarkCJTRequest(getRequestUrl(), cjtAccountEnum.getAppKey(), cjtAccountEnum.getAppSecret(), generateToken(req), cjtRequestBody);
LarkOkHttpHelper.post(cjtRequest); LarkOkHttpHelper.post(cjtRequest);
JSONObject jsonObject = requestCjt(cjtRequest); jsonObject = requestCjt(cjtRequest);
}
syncRecord(req, jsonObject); syncRecord(req, jsonObject);
} }

@ -76,6 +76,7 @@ public class CJTOperateCallBackFactory {
break; break;
default: default:
saleDispatchSyncCallOperate.preHandle(cjtEdiCallbackRequestVo);
break; break;
} }
} }

@ -44,7 +44,7 @@ public class ManufactureOrderSyncCallOperate extends CJTOperateCallBackAbstract
if (cjtAccountEnum.getCode().equals(CjtAccountEnum.TWO.getCode())){ if (cjtAccountEnum.getCode().equals(CjtAccountEnum.TWO.getCode())){
sb.append(detail.get("Quantity")).append("_"); sb.append(detail.get("Quantity")).append("_");
sb.append(getSpecialKey(detail, "pubuserdefnvc2")).append("_"); sb.append(getSpecialKey(detail, "pubuserdefnvc2")).append("_");
sb.append(getSpecialKey(detail, "priuserdefnvc1")).append("_"); sb.append(getSpecialKey(detail, "priuserdefnvc1"));
}else { }else {
sb.append(detail.get("SourceVoucherCode")).append("_"); sb.append(detail.get("SourceVoucherCode")).append("_");
sb.append(header.get("Code")).append("_"); sb.append(header.get("Code")).append("_");

@ -128,6 +128,12 @@
and #{id} >= id and #{id} >= id
</update> </update>
<update id="updateForCjt"> <update id="updateForCjt">
update erp_lark_temp_relation
set flag = #{flag}
where #{id} = id
</update>
<update id="updateForCjtError">
update erp_lark_temp_relation update erp_lark_temp_relation
set flag = #{flag},remark = #{remark} set flag = #{flag},remark = #{remark}
where #{id} = id where #{id} = id

Loading…
Cancel
Save