diff --git a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftGoodsBo.java b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftGoodsBo.java index b1cb51c..71ad068 100644 --- a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftGoodsBo.java +++ b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftGoodsBo.java @@ -22,9 +22,6 @@ public class OmsPromotionGiftGoodsBo implements Serializable { private static final long serialVersionUID = 1L; - /** id */ - private Long id; - /** 商品类型: brand,category,series,spu,sku */ @Length(max = 255,message = "商品类型长度不能超过255字") private String goodsType; diff --git a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftItemBo.java b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftItemBo.java index f5f7c0f..82e4d56 100644 --- a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftItemBo.java +++ b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/bo/OmsPromotionGiftItemBo.java @@ -20,10 +20,6 @@ public class OmsPromotionGiftItemBo implements Serializable { private static final long serialVersionUID = 1L; - /** id */ - @TableId(type = IdType.AUTO) - private Long id; - /** 商品类型 */ @Length(max = 255,message = "商品类型长度不能超过255字") private String goodsType; diff --git a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/dto/PromotionGiftDTO.java b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/dto/PromotionGiftDTO.java index 9d051bf..cbb1293 100644 --- a/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/dto/PromotionGiftDTO.java +++ b/cms-modules/cms-order/cms-order-api/src/main/java/com/qs/serve/modules/oms/entity/dto/PromotionGiftDTO.java @@ -23,5 +23,6 @@ public class PromotionGiftDTO { List subjectList; List itemList; List scopeList; - + List> centerMapList; + List> subjectMapList; } diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/oms/service/impl/OmsPromotionGiftOptionsServiceImpl.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/oms/service/impl/OmsPromotionGiftOptionsServiceImpl.java index c95377f..4832520 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/oms/service/impl/OmsPromotionGiftOptionsServiceImpl.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/oms/service/impl/OmsPromotionGiftOptionsServiceImpl.java @@ -67,7 +67,11 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio SysUser sysUser = sysUserService.getById(userId); String templateCode = this.getTemplateCode(); - String mainTableCode = "formmain_xx"; + String mainTableCode = "formmain_2383"; + // 成本中心明细表 + String subTableCode = "formson_2384"; + // 科目明细表 + String subTableCode2 = "formson_2385"; PromotionGiftDTO promotionGiftDTO = validAndBuildDTO(giftId,sysUser); @@ -75,6 +79,8 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio Map newWayData = new HashMap<>(); newWayData.put(mainTableCode,mainTableData); + newWayData.put(subTableCode,promotionGiftDTO.getCenterMapList()); + newWayData.put(subTableCode2,promotionGiftDTO.getSubjectMapList()); OaFormMainProcess mainProcess = new OaFormMainProcess(); mainProcess.setTargetId(giftId); @@ -104,6 +110,7 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio } // 更新主表专题 OmsPromotionGift uploadStatusEntity = new OmsPromotionGift(); + uploadStatusEntity.setId(Long.parseLong(giftId)); uploadStatusEntity.setSyFormId(formId); uploadStatusEntity.setGiftStatus(OmsPromGitStatus.STATUS_1_Checking); uploadStatusEntity.setSubmitTime(LocalDateTime.now()); @@ -136,12 +143,27 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio Map> scopeMap = scopeList.stream() .collect(Collectors.groupingBy(OmsPromotionGiftScope::getRegionType)); - String cmsUrl = "https://shop.gdjsl.com/pcOrder/#/"; + String cmsUrl = "https://crm.gdjsl.com/pcOrder/#/"; String saleRegion = ""; String bizRegion = ""; String supplierName = ""; String supplierCode = ""; + List> centerMapList = new ArrayList<>(); + for (OmsPromotionGiftCenter center : centerList) { + Map centerMap = new HashMap<>(); + centerMap.put("chengBenZhongXin",center.getCenterName()); + centerMap.put("chengBenZhongXinId",center.getCenterType()+"-"+center.getCenterCode()); + centerMapList.add(centerMap); + } + + List> subjectMapList = new ArrayList<>(); + for (OmsPromotionGiftSubject giftSubject : subjectList) { + Map subjectMap = new HashMap<>(); + subjectMap.put("keMuName",giftSubject.getSubjectName()); + subjectMapList.add(subjectMap); + } + for (String regionType : scopeMap.keySet()) { if ("saleRegion".equals(regionType)){ saleRegion = scopeMap.get(regionType).stream() @@ -183,7 +205,7 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio // data.put("exsp3","exsp3"); // data.put("exsp4","exsp4"); // data.put("exsp5","exsp5"); -// data.put("ext1","ext1"); + data.put("ext1",getTemplateCode()); // data.put("ext2","ext2"); // data.put("ext3","ext3"); // data.put("ext4","ext4"); @@ -195,6 +217,8 @@ public class OmsPromotionGiftOptionsServiceImpl implements OmsPromotionGiftOptio .scopeList(scopeList) .subjectList(subjectList) .mainTableData(data) + .centerMapList(centerMapList) + .subjectMapList(subjectMapList) .build(); } diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/SeeYonController.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/SeeYonController.java index 53fb585..90b8450 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/SeeYonController.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/SeeYonController.java @@ -6,6 +6,7 @@ import com.qs.serve.framework.base.model.R; import com.qs.serve.framework.base.util.*; import com.qs.serve.common.utils.PageUtil; import com.qs.serve.common.utils.ServletUtils; +import com.qs.serve.modules.oms.service.OmsPromotionGiftService; import com.qs.serve.modules.seeyon.entity.CtpAffair; import com.qs.serve.modules.seeyon.entity.bo.CheckTargetDTO; import com.qs.serve.modules.seeyon.entity.bo.SeeYonApproveQuery; @@ -55,6 +56,7 @@ public class SeeYonController { private CommonCheckService commonCheckService; private TbsCostTodoService tbsCostTodoService; private VtbVerificationBatchService vtbVerificationBatchService; + private OmsPromotionGiftService omsPromotionGiftService; /** * 我的审批列表 @@ -222,6 +224,8 @@ public class SeeYonController { info = tbsCostTodoService.getById(obj.getTargetId()); }else if (tempCode.equals("BatchCheckCost")){ info = vtbVerificationBatchService.getById(obj.getTargetId()); + }else if (tempCode.equals("GiftCostBill")){ + info = omsPromotionGiftService.getById(obj.getTargetId()); } obj.setValueInfo(info); affairList.add(obj); diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestServiceImpl.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestServiceImpl.java index 926cf0a..67ce859 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestServiceImpl.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestServiceImpl.java @@ -290,7 +290,7 @@ public class SeeYonRequestServiceImpl implements SeeYonRequestService { @Override public R getTargetIdByFormId(String code, String formId) { String title = "【获取targetID】"; - String url = TbsSeeYonConst.API_GET_TARGET_ID+"?templateCode="+code +"&formid="+formId; + String url = TbsSeeYonConst.API_GET_TARGET_ID+"?templateCode="+code +"&formId="+formId; R result = seeYonRequestBaseService.getBase(url,title); if(result.getStatus()==200){ try { diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java index 9e71d32..b2529b1 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java @@ -85,7 +85,7 @@ public interface TbsSeeYonConst { /** 搭赠通案 */ class GitApplyConf{ public static String Code(){ - return DevEnvironmentConfig.isDev()?"budgetBatch_Test":"budgetBatch"; + return DevEnvironmentConfig.isDev()?"GiftCostBill_Test":"GiftCostBill"; } } diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java index 20680c3..923bec6 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java @@ -65,6 +65,17 @@ public class TbsActivityController { private final TbsCostApplyService tbsCostApplyService; TbsActivityDebugApplicationService tbsActivityDebugApplicationService; + + /** + * 跳过支付 + * @param id + * @return + */ + @PostMapping("/skipToPay/{id}") + public R skipToPay(@PathVariable("id") Long id){ + return R.ok(); + } + @GetMapping("/reset/{id}") public R reset(@PathVariable("id") Long id){ String msg = tbsActivityDebugApplicationService.reset(id); diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java index 483382c..6b68f2a 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java @@ -110,7 +110,6 @@ public class TbsCostApplyController { return R.ok(costApplyPart1Service.copyById(id)); } - /** * 作废费用申请 * @param id diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/entity/TbsActivityTemplate.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/entity/TbsActivityTemplate.java index be56ab7..c69d008 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/entity/TbsActivityTemplate.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/tbs/entity/TbsActivityTemplate.java @@ -66,6 +66,9 @@ public class TbsActivityTemplate implements Serializable { /** 合同类型:0->常规;1->协议类;2->进场费 */ private Integer contractFlag; + /** 支付标识(用于费用的核销) */ + private Integer payFlag; + /** 费用申请主题 */ @Length(max = 255,message = "费用申请主题长度不能超过255字") private String costTheme; diff --git a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/third/PortalFlowController.java b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/third/PortalFlowController.java index 86a22b4..cf67a88 100644 --- a/cms-modules/cms-system/src/main/java/com/qs/serve/modules/third/PortalFlowController.java +++ b/cms-modules/cms-system/src/main/java/com/qs/serve/modules/third/PortalFlowController.java @@ -6,16 +6,16 @@ import com.qs.serve.modules.seeyon.service.SeeYonRequestService; import com.qs.serve.modules.sys.entity.SysSyncLog; import com.qs.serve.modules.sys.service.SysSyncLogService; import com.qs.serve.modules.tbs.common.TbsSeeYonConst; +import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo; import com.qs.serve.modules.tbs.service.impl.*; import com.qs.serve.modules.tzc.service.impl.TzcPolicyOperationServiceImpl; import com.qs.serve.modules.vtb.service.VtbVerificationBatchOperationService; import com.qs.serve.modules.vtb.service.impl.VtbVerificationOperationServiceImpl; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; /** * @author YenHex @@ -39,22 +39,96 @@ public class PortalFlowController { private final VtbVerificationBatchOperationService vtbVerificationBatchOperationService; private final OmsOrderOptionsService omsOrderOptionsService; - @GetMapping("/compenstate/{flowCode}/{formId}") - public R compenstate(@PathVariable("flowCode")String flowCode, + /** + * 跳过流程审批,特定节点触发该接口,使CMS单据为完成状态 + * @param flowCode + * @param formId + * @return + */ + @PostMapping("/success/{flowCode}/{formId}") + public R doSuccess(@PathVariable("flowCode")String flowCode, @PathVariable("formId") String formId ){ + log.info("开始补偿流程:{}",flowCode); SysSyncLog syncLog = new SysSyncLog(); - syncLog.setFromPlat("flow:"+flowCode); + syncLog.setFromPlat("flow-success:"+flowCode+":"+formId); syncLog.setUrl(formId); //请求转换ID String targetId = seeYonRequestService.getTargetIdByFormId(flowCode,formId).getData(); if(targetId==null){ - syncLog.setFailReason("targetIdNull"); + syncLog.setFailReason("formTableId或templateCode无效"); } syncLog.setRemark(targetId); sysSyncLogService.save(syncLog); + if(targetId==null){ + return R.error("formTableId或templateCode无效"); + } + TbsAffairCommitBo param = new TbsAffairCommitBo(targetId); + if(TbsSeeYonConst.PolicyConf.Code().equals(flowCode)){ + //政策申请模板 + tzcPolicyOperationService.doFinished(param); + }else if(TbsSeeYonConst.CostApplyConf.Code().equals(flowCode)){ + //费用申请 + tbsCostApplyOperationService.doFinished(param); + }else if(TbsSeeYonConst.CostApplyContractConf.Code().equals(flowCode)){ + //费用申请2-协议类 + tbsCostApplyOperationService.doFinished(param); + }else if(TbsSeeYonConst.CostCheckConf.Code().equals(flowCode)){ + //核销 + verificationOperationService.doFinished(param); + }else if(TbsSeeYonConst.BudgetApplyConf.Code().equals(flowCode)){ + //预算申请 + tbsBudgetApplyOperationService.doFinished(param); + }else if(TbsSeeYonConst.CheckCostAgreeConf.Code().equals(flowCode)){ + //协议条款申请 + tbsCostTodoOperationService.doFinished(param); + }else if(TbsSeeYonConst.BudgetChangeConf.Code().equals(flowCode)){ + //预算 变更申请 + tbsBudgetChangeOperationService.doFinished(param); + }else if(TbsSeeYonConst.BudgetBatchApplyConf.Code().equals(flowCode)){ + //预算 批量变更申请 + tbsBudgetBatchOperationService.doFinished(param); + }else if(TbsSeeYonConst.BatchCostCheckConf.Code().equals(flowCode)){ + //核销 批量申请 + vtbVerificationBatchOperationService.doFinished(param); + }else if(TbsSeeYonConst.ExpiredOrderConf.Code().equals(flowCode)){ + //核销 批量申请 + omsOrderOptionsService.doFinished(param); + }else { + syncLog.setRemark("业务["+flowCode+"]未被收录"); + sysSyncLogService.updateById(syncLog); + return R.error("业务["+flowCode+"]未被收录"); + } + + syncLog.setSuccessStatus(1); + syncLog.setRemark("调用成功"); + sysSyncLogService.updateById(syncLog); + return null; + } + /** + * OA流程审批完成后触发该接口,避免CMS单据状态不更新 + * @param flowCode + * @param formId + * @param request + * @return + */ + @GetMapping("/compenstate/{flowCode}/{formId}") + public R compenstate(@PathVariable("flowCode")String flowCode, + @PathVariable("formId") String formId, HttpServletRequest request){ + log.info("开始补偿流程:{}",flowCode); + SysSyncLog syncLog = new SysSyncLog(); + syncLog.setFromPlat("flow-compenstate:"+flowCode+":"+formId); + syncLog.setUrl(request.getRequestURI()); + syncLog.setEntityClass(PortalFlowController.class.getName()); + //请求转换ID + String targetId = seeYonRequestService.getTargetIdByFormId(flowCode,formId).getData(); + if(targetId==null){ + syncLog.setFailReason("formTableId或templateCode无效"); + } + syncLog.setRemark(targetId); + sysSyncLogService.save(syncLog); if(targetId==null){ - return R.error("formId无效"); + return R.error("formTableId或templateCode无效"); } if(TbsSeeYonConst.PolicyConf.Code().equals(flowCode)){ @@ -88,9 +162,14 @@ public class PortalFlowController { //核销 批量申请 omsOrderOptionsService.runCompensate(targetId); }else { + syncLog.setRemark("业务["+flowCode+"]未被收录"); + sysSyncLogService.updateById(syncLog); return R.error("业务["+flowCode+"]未被收录"); } - return R.ok(flowCode); + syncLog.setSuccessStatus(1); + syncLog.setRemark("调用成功"); + sysSyncLogService.updateById(syncLog); + return R.ok(); } }