委托加工更新提交erp优化
This commit is contained in:
@@ -61,8 +61,8 @@ public enum DictEnum {
|
||||
BSE_CTRT_STS_ARCHIVED("已归档","ARCHIVED","不允许任何操作"),
|
||||
BSE_CTRT_STS_TERMINATED("已完结","TERMINATED","只允许归档"),
|
||||
BSE_CTRT_STS_WAIT_AUDIT("待审核","WAIT_AUDIT",null),
|
||||
BSE_CTRT_STS_VOID("已作废","VOID",null);
|
||||
|
||||
BSE_CTRT_STS_VOID("已作废","VOID",null),
|
||||
CONTRACT_PUSH_CODE("合同消息推送模版编码","CONTRACT_PUSH_CODE","合同消息推送模版编码");
|
||||
|
||||
DictEnum(String label, String code, String remark) {
|
||||
this.label = label;
|
||||
|
||||
@@ -248,5 +248,14 @@ public class ContractController implements BusinessControllerMarker {
|
||||
ContractRespVO contractRespVO = contractService.getNoPermission(id);
|
||||
return success(contractRespVO);
|
||||
}
|
||||
//推送合同消息给对方
|
||||
@GetMapping("/push-msg-by-id")
|
||||
@Operation(summary = "推送合同消息")
|
||||
@PreAuthorize("@ss.hasAnyPermissions({'base:contract:get','purchaseContract:detail'})")
|
||||
public CommonResult<Boolean> pushMsgById(@RequestParam("id") Long id,@RequestParam("userId") Long userId) {
|
||||
contractService.pushMsgById(id,userId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,13 @@ import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
|
||||
import com.zt.plat.module.infra.api.file.FileApi;
|
||||
import com.zt.plat.module.receivedeliver.api.bill.BillMainApi;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.notify.NotifyMessageSendApi;
|
||||
import com.zt.plat.module.system.api.sequence.SequenceApi;
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(value = "contractorderRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, BpmProcessInstanceApi.class, AdminUserApi.class, BpmTaskApi.class, BusinessFileApi.class, FileApi.class, BillMainApi.class, MaterialInfomationApi.class})
|
||||
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, BpmProcessInstanceApi.class, AdminUserApi.class, BpmTaskApi.class, BusinessFileApi.class, FileApi.class, BillMainApi.class, MaterialInfomationApi.class, NotifyMessageSendApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
@@ -267,4 +267,10 @@ public interface ContractService {
|
||||
* @param relationContractVO 关联合同信息
|
||||
*/
|
||||
void relationContract(RelationContractVO relationContractVO);
|
||||
/**
|
||||
* 推送消息
|
||||
*
|
||||
* @param id 合同id
|
||||
*/
|
||||
void pushMsgById(Long id,Long userId);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ import com.zt.plat.module.erp.service.erp.ErpContractService;
|
||||
import com.zt.plat.module.infra.api.file.FileApi;
|
||||
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.notify.NotifyMessageSendApi;
|
||||
import com.zt.plat.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -130,6 +132,8 @@ public class ContractServiceImpl implements ContractService {
|
||||
private AmountDismantleService amountDismantleService;
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
@Resource
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
|
||||
private static final Map<String, String> VALID_RELATIONS = new HashMap<>();
|
||||
|
||||
@@ -154,7 +158,7 @@ public class ContractServiceImpl implements ContractService {
|
||||
throw exception(PARAMETER_ID_EMPTY);
|
||||
}
|
||||
ContractMainDO contractMainDO = contractMainMapper.selectById(pageReqVO.getId());
|
||||
if (contractMainDO == null){
|
||||
if (contractMainDO == null) {
|
||||
return PageResult.empty();
|
||||
}
|
||||
String businessType = VALID_RELATIONS.getOrDefault(contractMainDO.getBusinessType(), null);
|
||||
@@ -2219,30 +2223,50 @@ public class ContractServiceImpl implements ContractService {
|
||||
updateWrapper.eq(ContractMainDO::getId, contractMainDO.getRelatedContractId())
|
||||
.set(ContractMainDO::getRelatedContractId, null); // 强制设置为null
|
||||
int update = contractMainMapper.update(updateWrapper);
|
||||
log.info("解绑合同订单成功,合同ID:{},影响行数:{}", contractMainDO.getRelatedContractId(),update);
|
||||
log.info("解绑合同订单成功,合同ID:{},影响行数:{}", contractMainDO.getRelatedContractId(), update);
|
||||
}
|
||||
contractMainDO.setRelatedContractId(relationContractVO.getRelationContractId());
|
||||
contractMainMapper.updateById(contractMainDO);// 绑定合同订单
|
||||
ContractMainDO relationContract = contractMainMapper.selectById(relationContractVO.getRelationContractId());
|
||||
if (relationContract != null) {
|
||||
if (relationContract.getRelatedContractId()!=null) {
|
||||
if (relationContract.getRelatedContractId() != null) {
|
||||
LambdaUpdateWrapper<ContractMainDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ContractMainDO::getId, relationContract.getId())
|
||||
.set(ContractMainDO::getRelatedContractId, null); // 强制设置为null
|
||||
int update = contractMainMapper.update(updateWrapper);
|
||||
log.info("解绑合同订单成功,合同ID:{},影响行数:{}", relationContract.getId(),update);
|
||||
log.info("解绑合同订单成功,合同ID:{},影响行数:{}", relationContract.getId(), update);
|
||||
}
|
||||
// 绑定合同订单
|
||||
relationContract.setRelatedContractId(relationContractVO.getContractId());
|
||||
contractMainMapper.updateById(relationContract);
|
||||
log.info("绑定合同订单成功,合同ID:{}", relationContractVO.getRelationContractId());
|
||||
}else {
|
||||
} else {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@Override
|
||||
public void pushMsgById(Long id,Long userId) {
|
||||
ContractRespVO contractRespVO = get(id);
|
||||
if (contractRespVO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
Map<String,Object > parms = new HashMap<>();
|
||||
//放入合同编号,纸质合同编号,合同名称,甲方乙方
|
||||
parms.put("系统合同编号",contractRespVO.getSystemContractNumber());
|
||||
parms.put("纸质合同编号",contractRespVO.getSystemContractNumber());
|
||||
parms.put("合同名称",contractRespVO.getSystemContractNumber());
|
||||
parms.put("合同主体1",contractRespVO.getSystemContractNumber());
|
||||
parms.put("合同主体2",contractRespVO.getSystemContractNumber());
|
||||
NotifySendSingleToUserReqDTO notifySendSingleToUserReqDTO = new NotifySendSingleToUserReqDTO();
|
||||
notifySendSingleToUserReqDTO.setTemplateCode(DictEnum.CONTRACT_PUSH_CODE.getCode());//消息模版编码
|
||||
notifySendSingleToUserReqDTO.setUserId(userId);
|
||||
notifySendSingleToUserReqDTO.setTemplateParams(parms);//放入模版消息
|
||||
notifyMessageSendApi.sendSingleMessageToMember(notifySendSingleToUserReqDTO);
|
||||
}
|
||||
|
||||
/**Object
|
||||
* 校验合同内容
|
||||
*
|
||||
* @param contract 合同数据
|
||||
|
||||
@@ -402,6 +402,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
item.setVend_mat(TOKEN_.contentEquals(vendMat) ? null : vendMat.toString());
|
||||
// 3.2 行项目扩展信息(Itex)
|
||||
ErpOrderSaveReqVO.Itex itex = new ErpOrderSaveReqVO.Itex();
|
||||
itex.setPo_item(detail.getLineNum().intValue());
|
||||
itex.setZmatnr(detail.getSaleMtrlNum()); // 销售物料号 -> 销售物料号
|
||||
itex.setZaufnr(detail.getInOrd()); // 统计型内部订单 -> 统计型内部订单
|
||||
itex.setZpurty(detail.getPrchCtgr()); // 采购类别 -> 采购类别
|
||||
|
||||
Reference in New Issue
Block a user