diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java index a6f8573df5..25c131f6bf 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java @@ -138,6 +138,7 @@ import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.UnCollectionDto; import com.yxt.anrui.flowable.api.flow.FlowSelectVo; import com.yxt.anrui.flowable.api.flow.FlowableFeign; import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flow2.FlowFeign; import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; import com.yxt.anrui.flowable.api.flowtask.FlowableQuery; @@ -252,6 +253,8 @@ public class BusSalesOrderService extends MybatisBaseService voResultBean = flowableFeign.startProcess(bv); + ResultBean voResultBean = flowFeign.startProcess(bv); if (!voResultBean.getSuccess()) { return rb.setMsg(voResultBean.getMsg()); } @@ -4819,7 +4825,7 @@ public class BusSalesOrderService extends MybatisBaseService resultBean = flowableFeign.handleProsess(bv); + ResultBean resultBean = flowFeign.handleProsess(bv); if (!resultBean.getSuccess()) { return rb.setMsg(resultBean.getMsg()); } UpdateFlowFieldVo ufVo = resultBean.getData(); updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); - + busSalesOrder = fetchBySid(bv.getBusinessSid()); //极光推送 if (!"Event_end".equals(resultBean.getData().getTaskDefKey())) { - //极光推送 - busSalesOrder = fetchBySid(bv.getBusinessSid()); - MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); - MessageFlowVo messageFlowVo = new MessageFlowVo(); - BeanUtil.copyProperties(ufVo, messageFlowVo); - ufVo.setProcInsId(busSalesOrder.getProcInstId()); - messageFlowableQuery.setUfVo(messageFlowVo); - messageFlowableQuery.setAppMap((Map) variables.get("app")); - messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); - messageFlowableQuery.setModuleName("销售订单申请"); - messageFlowableQuery.setMsgContent(busSalesOrder.getStaffName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); - messageFlowableQuery.setMsgTitle("销售订单"); - ResultBean stringResultBean = messageFeign.pushMessage(messageFlowableQuery); + try { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService pool = new ThreadPoolExecutor(2, 100, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + BusSalesOrder finalBusSalesOrder = busSalesOrder; + Future future1 = pool.submit(() -> { + //极光推送 + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + ufVo.setProcInsId(finalBusSalesOrder.getProcInstId()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap((Map) variables.get("app")); + messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); + messageFlowableQuery.setModuleName("销售订单申请"); + messageFlowableQuery.setMsgContent(finalBusSalesOrder.getStaffName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("销售订单"); + ResultBean stringResultBean = messageFeign.pushMessage(messageFlowableQuery); + }); + } catch (Exception e) { + e.printStackTrace(); + } } else { ResultBean details = getSaleOrderDetails(bv.getBusinessSid()); AppOrderDetailsVo vo = details.getData(); diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java new file mode 100644 index 0000000000..ab513d7fa7 --- /dev/null +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java @@ -0,0 +1,15 @@ +package com.yxt.anrui.fin.api.finfundscarriedforwardapply; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class FinCustNameAndPhone { + + @ApiModelProperty("付款人姓名") + private String draweeName; + @ApiModelProperty("付款人联系电话") + private String draweeMobile; + @ApiModelProperty("业务员sid") + private String staffSid; +} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java new file mode 100644 index 0000000000..8a186ac345 --- /dev/null +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java @@ -0,0 +1,35 @@ +package com.yxt.anrui.fin.api.finfundscarriedforwardapply; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TzDto { + + @ApiModelProperty("业务sud") + private String busSid; + @ApiModelProperty("调账类型") + private String tzType; + @ApiModelProperty("合同编号") + private String conNo; + @ApiModelProperty("客户sid") + private String custSid; + @ApiModelProperty("客户名称") + private String name; + @ApiModelProperty("客户编码") + private String custNo; + @ApiModelProperty("物料编码") + private String vinNo; + @ApiModelProperty("调出金额") + private Integer dcje = 0; + @ApiModelProperty("调入金额") + private Integer drje = 0; + + public TzDto(String busSid, String zc, String conNo, String name, String custNo, String vinNo, int i) { + + } +} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java deleted file mode 100644 index e1e60a2632..0000000000 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yxt.anrui.fin.api.finfundscarriedforwardapply; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class ZC { - - @ApiModelProperty("调账类型") - private String zc; - @ApiModelProperty("合同编号") - private String conNo; - @ApiModelProperty("客户名称") - private String name; - @ApiModelProperty("物料编码") - private String vinNo; - @ApiModelProperty("调出金额") - private String dcje; - @ApiModelProperty("调入金额") - private String drje; - @ApiModelProperty("调出前余额") - private String dcqye; - @ApiModelProperty("调出后余额") - private String dchye; -} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java deleted file mode 100644 index aa6e1f8e3a..0000000000 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yxt.anrui.fin.api.finfundscarriedforwardapply; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class ZR { - - @ApiModelProperty("调账类型") - private String zr; - @ApiModelProperty("合同编号") - private String conNo; - @ApiModelProperty("客户名称") - private String name; - @ApiModelProperty("物料编码") - private String vinNo; - @ApiModelProperty("调出金额") - private String dcje; - @ApiModelProperty("调入金额") - private String drje; - @ApiModelProperty("调出前余额") - private String dcqye; - @ApiModelProperty("调出后余额") - private String dchye; -} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java index 465c2d72a7..3a665cd530 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java @@ -15,6 +15,8 @@ import java.util.List; @Data public class OtherReceivable { + @ApiModelProperty("单据编号") + public String billNo; @ApiModelProperty("单据类型") public String billType = "QTYSD01_SYS"; @ApiModelProperty("往来单位类型") diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml index 726a99f597..87f012c889 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml @@ -201,13 +201,13 @@ - + SELECT bd.`draweeName`, + bd.draweeMobile, + ffa.`staffSid` FROM fin_funds_carried_forward_veh ffv + LEFT JOIN fin_funds_carried_forward_apply ffa + ON ffv.`mainSid` = ffa.`sid` + LEFT JOIN fin_selected_receivables_detailed fsrd + ON ffv.`busSid` = fsrd.`sid` LEFT JOIN fin_collection_confirmation fcc - ON ffv.`busSid` = fcc.`sid` + ON fsrd.`collSid` = fcc.`sid` + AND fcc.`pushMessgae` = 1 LEFT JOIN anrui_buscenter.`bus_deposit` bd ON fcc.`busSid` = bd.`billSid` - WHERE ffv.`mainSid` = #{sid} - GROUP BY bd.`draweeMobile` - - - - - \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java index 721e7dd228..b5897781f1 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java @@ -43,6 +43,7 @@ import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModel; import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; import com.yxt.anrui.buscenter.api.bussalesordersubmit.BusSalesOrderSubmit; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; +import com.yxt.anrui.fin.api.finfundscarriedforwardapply.FinCustNameAndPhone; import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; import com.yxt.anrui.portal.api.sysorganization.SysOrganization; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; @@ -162,15 +163,7 @@ public class FinFundsCarriedForwardVehService extends MybatisBaseService fetchByMainSidAndGroupCustPhone(String sid) { - return baseMapper.fetchByMainSidAndGroupCustPhone(sid); - } - - public List fetchJzMoneyByContractNoAndMainSid(String jzCustNo, String sid) { - return baseMapper.fetchJzMoneyByContractNoAndMainSid(jzCustNo,sid); - } - - public List fetchJzMoneyByCustSidAndMainSid(String custSid, String sid) { - return baseMapper.fetchJzMoneyByCustSidAndMainSid(custSid,sid); + public List fetchNameAndPhoneByBusSid(String busSid) { + return baseMapper.fetchNameAndPhoneByBusSid(busSid); } } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java index e23da0bbed..ff50224259 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java @@ -161,4 +161,6 @@ public interface FinSelectedReceivablesDetailedMapper extends BaseMapper selectPageLists(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw, @Param("name") String name); + + FinSelectedReceivablesDetailed fetchYeBySid(String busSid); } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml index d8c33850db..ccfc30c0b6 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml @@ -487,4 +487,21 @@ WHERE fsr.`contractNo` = #{ysCustNo} AND fsr.`collSid` = #{sid} + + \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java index dd497f100d..5140c6d1a2 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java @@ -622,4 +622,8 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService fetchJzMoneyByContractNoAndMainSid(String ysCustNo, String sid) { return baseMapper.fetchJzMoneyByContractNoAndMainSid(ysCustNo,sid); } + + public FinSelectedReceivablesDetailed fetchYeBySid(String busSid) { + return baseMapper.fetchYeBySid(busSid); + } } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java index e4b3f64dea..dd450efe67 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java @@ -27,6 +27,11 @@ public class OtherReceivableBillService extends FinKingDeeService { //业务表的主表数据集合 Map map_fEntityModel_=new HashMap<>(); //物料的数组集合 + //单据编号 + if(otherReceivable.getBillNo()==null){ + return rb.setMsg("单据编号不能为空"); + } + map_fEntityModel_.put("FBillNo",otherReceivable.getBillNo()); //业务日期 if(otherReceivable.getBussDate()==null){ return rb.setMsg("业务日期不能为空"); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json index 37cc654b5d..d1ec9e70ad 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json @@ -3,7 +3,7 @@ "FBillTypeID": { "FNUMBER": "QTYSD01_SYS" }, - "FBillNo": "", + "FBillNo": "@KD_FBillNo", "FDATE": "@KD_FDATE", "FENDDATE_H": "1900-01-01", "FISINIT": "false", diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java new file mode 100644 index 0000000000..9e4f439e5f --- /dev/null +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java @@ -0,0 +1,34 @@ +package com.yxt.anrui.flowable.api.flow2; + +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@FeignClient( + contextId = "anrui-flowable-Flow", + name = "anrui-flowable", + path = "v2/flow", + fallback = FlowFeignback.class) +public interface FlowFeign { + + @ApiOperation(value = "启动流程") + @PostMapping(value = "/startProcess") + @ResponseBody + ResultBean startProcess(@RequestBody BusinessVariables dto); + + @ApiOperation(value = "处理流程") + @PostMapping(value = "/handleProsess") + @ResponseBody + ResultBean handleProsess(@RequestBody BusinessVariables bv); +} diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java new file mode 100644 index 0000000000..4c644465b3 --- /dev/null +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java @@ -0,0 +1,9 @@ +package com.yxt.anrui.flowable.api.flow2; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +public class FlowFeignback { +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java index c2353ab93b..4286cafc9f 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java @@ -205,6 +205,13 @@ public class FlowableRest implements FlowableFeign { if (processVariables.containsKey("sendRecommendSid")) {//增加的其他的抄送人 userSids.append(processVariables.get("sendRecommendSid").toString()).append(","); } + //查询是否有设置转办的,抄送给设置转办人员 + List zbUserSids = processCommentService.selectByIdAndComment("转办",bv.getInstanceId()); + zbUserSids.removeAll(Collections.singleton(null)); + if(!zbUserSids.isEmpty()){ + String zbUser = String.join(",",zbUserSids); + userSids.append(zbUser).append(","); + } userSids.deleteCharAt(userSids.length() - 1); mfq.setUserSids(userSids.toString()); mfq.setOrgPath(createrOrgPath); @@ -284,11 +291,9 @@ public class FlowableRest implements FlowableFeign { public ResultBean startProcess(BusinessVariables dto) { log.info("startProcess.dto:{}", dto); ResultBean rb = ResultBean.fireFail(); - if (StringUtils.isBlank(dto.getBusinessSid())) { return rb.setMsg("businessSid 不能为空!"); } - if (dto.getFormVariables() == null) dto.setFormVariables(new HashMap()); Map formVariables = dto.getFormVariables(); @@ -296,20 +301,17 @@ public class FlowableRest implements FlowableFeign { String orgPath = dto.getOrgSidPath(); formVariables.put("createrOrgPath", orgPath);//发起人的组织结构sid } - dto.getFormVariables().put("businessSid", dto.getBusinessSid()); String nextNodeUserSids_ = dto.getNextNodeUserSids(); if (StringUtils.isBlank(nextNodeUserSids_)) { ResultBean nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreate(dto); boolean success = nextNodeUserSidsOfCreate.getSuccess(); if (!success) { -// return rb.setMsg(nextNodeUserSidsOfCreate.getMsg()); nextNodeUserSids_ = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); } else { nextNodeUserSids_ = nextNodeUserSidsOfCreate.getData().getUserSid(); dto.getFormVariables().put(BusinessVariables.ORGPATH, nextNodeUserSidsOfCreate.getData().getOrgPath()); } - } dto.setNextNodeUserSids(nextNodeUserSids_); ResultBean resultBean1 = flowableService.businessStart(dto); @@ -431,7 +433,7 @@ public class FlowableRest implements FlowableFeign { //若下一环节用户与系统管理员一致,则自动审批 if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { adminContains = true; - }else{ + } else { //下一环节不为空,查询下一环节用户是否有转办人 if (nextUserSid != null) { List nextUserList = Arrays.asList(nextUserSid.split(",")); @@ -531,6 +533,7 @@ public class FlowableRest implements FlowableFeign { dto.setTaskId(vo.getTaskId()); dto.setTaskDefKey(taskDefKey); dto.setComment("系统自动跳过"); + dto.setNextNodeUserSids(""); return handleProsess(dto, false); } List flowElements = processService.calApprovePath(dto.getModelId(), dto.getModelId(), diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java new file mode 100644 index 0000000000..75a54ab80c --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java @@ -0,0 +1,14 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.anrui.flowable.api.flow.Flowable; +import org.apache.ibatis.annotations.Mapper; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@Mapper +public interface FlowMapper extends BaseMapper { +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml new file mode 100644 index 0000000000..155d9f2b05 --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java new file mode 100644 index 0000000000..255bfa6c0a --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java @@ -0,0 +1,104 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONObject; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flow2.FlowFeign; +import com.yxt.anrui.flowable.biz.process.ProcessService; +import com.yxt.anrui.flowable.feign.MessageFeign; +import com.yxt.anrui.flowable.feign.form.MessageFlowVo; +import com.yxt.anrui.flowable.feign.form.MessageFlowableQuery; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccFeign; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccVo; +import com.yxt.anrui.portal.api.sysuser.SysUserFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserVo; +import com.yxt.anrui.portal.api.sysuser.UserByRolesAndOrgQuery; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import org.apache.tomcat.util.threads.ThreadPoolExecutor; +import org.flowable.engine.HistoryService; +import org.flowable.task.api.history.HistoricTaskInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.*; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@RestController +@RequestMapping("v2/flow") +public class FlowRest implements FlowFeign { + Logger log = LoggerFactory.getLogger(FlowRest.class); + + @Autowired + private FlowService flowService; + + @Autowired + private SysUserFeign sysUserFeign; + + @Override + public ResultBean startProcess(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + //获取表单中的参数 + Map formVariables = bv.getFormVariables(); + formVariables = formVariables == null ? new HashMap<>() : formVariables; + //发起人的组织全路径 + String orgPath = bv.getOrgSidPath(); + formVariables.put("createrOrgPath", orgPath); + formVariables.put("businessSid", bv.getBusinessSid()); + //获取下一环节待办人 + ResultBean userResultBean = flowService.getNextNodeUser(bv); + bv.setNextNodeUserSids(userResultBean.getData()); + //启动流程实例 + ResultBean startResultBean = flowService.businessStartProcessInstanceById(bv); + return startResultBean; + } + + @Override + public ResultBean handleProsess(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + ResultBean updateFlowFieldVoResultBean = flowService.handleProsess(bv, true); + //添加抄送 + log.info("流程返回:{}", JSONObject.toJSONString(updateFlowFieldVoResultBean)); + //需要判断办结后再执行 TODO + if (updateFlowFieldVoResultBean.getSuccess()) { + log.info("流程返回:{}", JSONObject.toJSONString(updateFlowFieldVoResultBean)); + if ("Event_end".equals(updateFlowFieldVoResultBean.getData().getTaskDefKey())) { + try { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService pool = new ThreadPoolExecutor(2, 100, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + + Future future1 = pool.submit(() -> { + HashMap map = new HashMap<>(); + map.put("bv", bv); + UpdateFlowFieldVo ufVo = updateFlowFieldVoResultBean.getData(); + ufVo.setTaskId(bv.getTaskId()); + map.put("uff", ufVo); + flowService.cc(map, bv.getTaskDefKey()); + }); + } catch (Exception e) { + e.printStackTrace(); + return rb.setMsg("抄送失败"); + } + } + } + return updateFlowFieldVoResultBean; + } + + +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java new file mode 100644 index 0000000000..2ef8b208b8 --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java @@ -0,0 +1,719 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yxt.anrui.flowable.api.flow.Flowable; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flowcomment.FlowComment; +import com.yxt.anrui.flowable.api.flowtask.FlowTask; +import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; +import com.yxt.anrui.flowable.api.processcomment.ProcessCommentDto; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.biz.flowtask.FlowTaskService; +import com.yxt.anrui.flowable.biz.process.ExpressionCmd; +import com.yxt.anrui.flowable.biz.process.ProcessService; +import com.yxt.anrui.flowable.biz.processcomment.ProcessCommentService; +import com.yxt.anrui.flowable.common.ProcessConstants; +import com.yxt.anrui.flowable.feign.MessageFeign; +import com.yxt.anrui.flowable.feign.form.MessageFlowVo; +import com.yxt.anrui.flowable.feign.form.MessageFlowableQuery; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigFeign; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccFeign; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccVo; +import com.yxt.anrui.portal.api.sysuser.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import lombok.extern.slf4j.Slf4j; +import org.flowable.bpmn.model.*; +import org.flowable.engine.*; +import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.flowable.engine.repository.ProcessDefinition; +import org.flowable.engine.runtime.ProcessInstance; +import org.flowable.task.api.DelegationState; +import org.flowable.task.api.Task; +import org.flowable.task.api.history.HistoricTaskInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@Service +@Slf4j +public class FlowService extends MybatisBaseService { + + @Autowired + RepositoryService repositoryService; + @Autowired + RuntimeService runtimeService; + + @Autowired + ManagementService managementService; + @Autowired + ProcessEngineConfigurationImpl processEngineConfiguration; + @Autowired + private SysUserFeign sysUserFeign; + + @Autowired + protected IdentityService identityService; + @Autowired + protected TaskService taskService; + @Autowired + private SysFlowableConfigFeign sysFlowableConfigFeign; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private ProcessCommentService processCommentService; + + @Autowired + protected HistoryService historyService; + + @Autowired + private ProcessService processService; + + @Autowired + private MessageFeign messageFeign; + @Autowired + private SysFlowccFeign sysFlowccFeign; + + public ResultBean getNextNodeUser(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + //根据业务参数取流程流转的环节 信息 + List> list = (List>) getProcessCirculationNodesByMap(bv).getData(); + if (list == null || list.size() < 2) { + return rb.setMsg("流程设计问题"); + } + //取第二个环节的配置角色 + Object o = list.get(1).get("candidateGroups"); + if (o == null) { + return rb.setMsg("流程设计问题"); + } + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); + String roleSid = jsonArray.get(0).toString(); + //根据组织架构、角色两个参数取相关符合条件的用户信息 + UserQuery userQuery = new UserQuery(); + userQuery.setRoleSid(roleSid); + userQuery.setOrgSidPath(bv.getOrgSidPath()); + String nextNodeUserSids_ = ""; + List sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + nextNodeUserSids_ = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); + } else { + StringBuilder nextNodeUserSids = new StringBuilder(); + for (SysUserVo su : sysUserVos) { + nextNodeUserSids.append(su.getSid()).append(","); + } + //符合条件的用户的sid,拼接的字符串 + nextNodeUserSids_ = nextNodeUserSids.toString(); + nextNodeUserSids_ = nextNodeUserSids_.substring(0, nextNodeUserSids_.length() - 1); + } + return rb.success().setData(nextNodeUserSids_); + + } + + public ResultBean getProcessCirculationNodesByMap(BusinessVariables bv) { + ResultBean>> rb = new ResultBean>>(); + String modelId = bv.getModelId(); + List flowElements = calApprovePath(modelId, bv.getFormVariables()); + List> list = new ArrayList<>(); + for (FlowElement f : flowElements) { + Map map = new HashMap<>(); + map.put("name", f.getName()); + map.put("id", f.getId()); + String s = JSON.toJSONString(f); + JSONObject jsonObject = JSONObject.parseObject(s); + log.info("item:{}", jsonObject); + Object candidateGroups = jsonObject.get("candidateGroups"); + map.put("candidateGroups", candidateGroups); + list.add(map); + } + return rb.setData(list); + } + + /** + * 1. 首先拿到BpmnModel,所有流程定义信息都可以通过BpmnModel获取;若流程尚未发起,则用modelId查询最新部署的流程定义数据; + * 若流程已经发起,可以通过流程实例的processDefinitionId查询流程定义的历史数据。 + * + * @param variableMap 流程变量,用于计算条件分支 + */ + public List calApprovePath(String modelId, Map variableMap) { + BpmnModel bpmnModel = repositoryService.getBpmnModel(modelId); + Collection flowElements = new ArrayList<>(); + Collection flowElements2 = bpmnModel.getMainProcess().getFlowElements(); + flowElements.addAll(flowElements2); + List passElements = new ArrayList<>(); + dueStartElement(passElements, flowElements, variableMap); + return passElements; + } + + /** + * 2. 找到开始节点,通过它的目标节点,然后再不断往下找。 + */ + private void dueStartElement(List passElements, Collection flowElements, Map variableMap) { + Optional startElementOpt = flowElements.stream().filter(flowElement -> flowElement instanceof StartEvent).findFirst(); + startElementOpt.ifPresent(startElement -> { + flowElements.remove(startElement); + List outgoingFlows = ((StartEvent) startElement).getOutgoingFlows(); + String targetRef = outgoingFlows.get(0).getTargetRef(); + // 根据ID找到FlowElement + FlowElement targetElementOfStartElement = getFlowElement(flowElements, targetRef); + if (targetElementOfStartElement instanceof UserTask) { + this.getPassElementList(passElements, flowElements, targetElementOfStartElement, variableMap); + } + }); + } + + /** + * 3. 我只用到了UserTask、ExclusiveGateway、ParallelGateway,所以代码里只列举了这三种,如果用到了其他的,可以再自己补充 + */ + private void getPassElementList(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + // 任务节点 + if (curFlowElement instanceof UserTask) { + this.dueUserTaskElement(passElements, flowElements, curFlowElement, variableMap); + return; + } + // 排他网关 + if (curFlowElement instanceof ExclusiveGateway) { + this.dueExclusiveGateway(passElements, flowElements, curFlowElement, variableMap); + return; + } + // 并行网关 + if (curFlowElement instanceof ParallelGateway) { + this.dueParallelGateway(passElements, flowElements, curFlowElement, variableMap); + } + } + + private void dueUserTaskElement(List passElements, Collection flowElements, + FlowElement curFlowElement, Map variableMap) { + passElements.add(curFlowElement); + List outgoingFlows = ((UserTask) curFlowElement).getOutgoingFlows(); + String targetRef = outgoingFlows.get(0).getTargetRef(); + if (outgoingFlows.size() > 1) { + // 找到表达式成立的sequenceFlow + SequenceFlow sequenceFlow = getSequenceFlow(variableMap, outgoingFlows); + targetRef = sequenceFlow.getTargetRef(); + } + // 根据ID找到FlowElement + FlowElement targetElement = getFlowElement(flowElements, targetRef); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + + private void dueExclusiveGateway(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + // 获取符合条件的sequenceFlow的目标FlowElement + List exclusiveGatewayOutgoingFlows = ((ExclusiveGateway) curFlowElement).getOutgoingFlows(); + flowElements.remove(curFlowElement); + // 找到表达式成立的sequenceFlow + SequenceFlow sequenceFlow = getSequenceFlow(variableMap, exclusiveGatewayOutgoingFlows); + // 根据ID找到FlowElement + FlowElement targetElement = getFlowElement(flowElements, sequenceFlow.getTargetRef()); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + + private void dueParallelGateway(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + FlowElement targetElement; + List parallelGatewayOutgoingFlows = ((ParallelGateway) curFlowElement).getOutgoingFlows(); + for (SequenceFlow sequenceFlow : parallelGatewayOutgoingFlows) { + targetElement = getFlowElement(flowElements, sequenceFlow.getTargetRef()); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + } + + private FlowElement getFlowElement(Collection flowElements, String targetRef) { + return flowElements.stream().filter(flowElement -> targetRef.equals(flowElement.getId())).findFirst().orElse(null); + } + + /** + * 4. 根据传入的变量,计算出表达式成立的那一条SequenceFlow + * + * @param variableMap + * @param outgoingFlows + * @return + */ + private SequenceFlow getSequenceFlow(Map variableMap, List outgoingFlows) { + Optional sequenceFlowOpt = outgoingFlows.stream().filter(item -> { + try { + return this.getElValue(item.getConditionExpression(), variableMap); + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + }).findFirst(); + return sequenceFlowOpt.orElse(outgoingFlows.get(0)); + } + + private boolean getElValue(String exp, Map variableMap) { + return managementService.executeCommand(new ExpressionCmd(runtimeService, processEngineConfiguration, null, exp, variableMap)); + } + + public ResultBean businessStartProcessInstanceById(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + UpdateFlowFieldVo updateFlowFieldVo = new UpdateFlowFieldVo(); + String procDefId = bv.getModelId(); + String userSid = bv.getUserSid(); + String nextNodeUserSids = bv.getNextNodeUserSids(); + Map variables = bv.getFormVariables(); + Map variablesSeconds = bv.getFormVariables(); + //根据流程定义id查询 + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId) + .latestVersion().singleResult(); + if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) { + return rb.setMsg("流程已被挂起,请先激活流程"); + } + // 设置流程发起人Id到流程中 + ResultBean sysUserVoResultBean = sysUserFeign.fetchBySid(userSid); + SysUserVo sysUser = sysUserVoResultBean.getData(); + identityService.setAuthenticatedUserId(sysUser.getSid()); + variables.put(ProcessConstants.PROCESS_INITIATOR, userSid); + variables.put(ProcessConstants.USER_TYPE_ASSIGNEE, userSid); + ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables); + // 给第一步申请人节点设置任务执行人和意见 todo:第一个节点不设置为申请人节点有点问题? + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); + if (Objects.nonNull(task)) { + taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.START.getType(), + sysUser.getName() + "发起流程申请"); + taskService.setAssignee(task.getId(), userSid); + taskService.setVariablesLocal(task.getId(), variables); + taskService.complete(task.getId(), variables); + } + + //根据流程实例的id查询最新的待办环节 + ResultBean> latestTasksNew = flowTaskService.getLatestTasksNew(processInstance.getId()); + List data = latestTasksNew.getData(); + LatestTaskVo latestTaskVo = data.get(0); + String id_ = latestTaskVo.getId_(); + String task_def_key_ = latestTaskVo.getTask_def_key_(); + //查询下一环节是否有转办并添加评论 + nextNodeUserSids = change(nextNodeUserSids, processInstance.getProcessInstanceId()); + taskService.setAssignee(id_, nextNodeUserSids); + if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextNodeUserSids)) { + bv.setModelId(procDefId); + bv.setInstanceId(task.getProcessInstanceId()); + bv.setTaskId(id_); + bv.setUserSid(nextNodeUserSids); + bv.setBusinessSid(bv.getBusinessSid()); + bv.setTaskDefKey(task_def_key_); + bv.setFormVariables(variables); + bv.setOrgSidPath(bv.getOrgSidPath()); + bv.setComment("系统自动跳过!"); + bv.setFormVariables(variablesSeconds); + bv.setNextNodeUserSids(""); + ResultBean updateFlowFieldVoResultBean = handleProsess(bv, false); + if (updateFlowFieldVoResultBean.getSuccess() && updateFlowFieldVoResultBean.getData() != null) { + UpdateFlowFieldVo vo = updateFlowFieldVoResultBean.getData(); + updateFlowFieldVo.setProcInsId(vo.getProcInsId()); + updateFlowFieldVo.setNodeState(vo.getNodeState()); + updateFlowFieldVo.setTaskId(vo.getTaskId()); + updateFlowFieldVo.setTaskDefKey(vo.getTaskDefKey()); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + } + if (bv.getUserSid().equals(nextNodeUserSids)) { + //如果申请人与下一环节审批人相同,则自动审批 + bv.setModelId(procDefId); + bv.setInstanceId(task.getProcessInstanceId()); + bv.setTaskId(id_); + bv.setUserSid(nextNodeUserSids); + bv.setBusinessSid(bv.getBusinessSid()); + bv.setTaskDefKey(task_def_key_); + bv.setFormVariables(variables); + bv.setOrgSidPath(bv.getOrgSidPath()); + bv.setFormVariables(variablesSeconds); + bv.setComment("因与申请人相同,系统自动处理,需以下一级审批人审批意见为准!"); + bv.setNextNodeUserSids(""); + ResultBean updateFlowFieldVoResultBean = handleProsess(bv, false); + if (updateFlowFieldVoResultBean.getSuccess() && updateFlowFieldVoResultBean.getData() != null) { + UpdateFlowFieldVo vo = updateFlowFieldVoResultBean.getData(); + updateFlowFieldVo.setProcInsId(vo.getProcInsId()); + updateFlowFieldVo.setNodeState(vo.getNodeState()); + updateFlowFieldVo.setTaskId(vo.getTaskId()); + updateFlowFieldVo.setTaskDefKey(vo.getTaskDefKey()); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + } + updateFlowFieldVo.setProcInsId(task.getProcessInstanceId()); + updateFlowFieldVo.setNodeState(latestTaskVo.getName_()); + updateFlowFieldVo.setTaskId(id_); + updateFlowFieldVo.setTaskDefKey(task_def_key_); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + + /** + * 查询下一环节用户是否有转办用户,若有转办用户则添加转办评论 + * + * @param nextNodeUserSids 下一环节用户 + * @param instanceId 实例id + * @return + */ + public String change(String nextNodeUserSids, String instanceId) { + //查询下一环节是否有转办 + String firstSid = ""; + String firstName = ""; + //默认无转办 + boolean isChange = false; + if (StringUtils.isNotBlank(nextNodeUserSids)) { + List nextUserList = Arrays.asList(nextNodeUserSids.split(",")); + if (nextUserList.size() == 1) { + firstSid = nextUserList.get(0); + ResultBean userVoResultBean = sysUserFeign.fetchBySid(firstSid); + if (userVoResultBean.getData() != null) { + firstName = userVoResultBean.getData().getName(); + } + SysFlowableConfigQuery sysFlowableConfigQuery = new SysFlowableConfigQuery(); + sysFlowableConfigQuery.setUserSid(firstSid); + sysFlowableConfigQuery.setNowDate(new Date()); + ResultBean sysFlowableConfigVvoResultBean = sysFlowableConfigFeign.selectByUserSid(sysFlowableConfigQuery); + if (sysFlowableConfigVvoResultBean.getData() != null) { + if (StringUtils.isNotBlank(sysFlowableConfigVvoResultBean.getData().getChangeUserSid())) { + nextNodeUserSids = sysFlowableConfigVvoResultBean.getData().getChangeUserSid(); + isChange = true; + } + } + } + } + if (isChange) {//添加评论 + ResultBean userVoResultBean = sysUserFeign.fetchBySid(nextNodeUserSids); + ProcessCommentDto processCommentDto = new ProcessCommentDto(); + processCommentDto.setReviewerSid(firstSid); + if (userVoResultBean.getData() != null) { + String changeName = userVoResultBean.getData().getName(); + processCommentDto.setReviewer(firstName); + processCommentDto.setContent("交" + changeName + "转办"); + } + processCommentDto.setTime(new Date()); + processCommentDto.setProcessId(instanceId); + processCommentService.saveOrUpdateDto(processCommentDto); + } + return nextNodeUserSids; + } + + public ResultBean handleProsess(BusinessVariables bv, boolean b) { + ResultBean rb = ResultBean.fireFail(); + UpdateFlowFieldVo vo = new UpdateFlowFieldVo(); + //获取表单中的参数 + Map formVariables = bv.getFormVariables(); + formVariables = formVariables == null ? new HashMap<>() : formVariables; + formVariables.put("businessSid", bv.getBusinessSid()); + String nextUserSid = bv.getNextNodeUserSids(); + String taskId = bv.getTaskId(); + String userSid = bv.getUserSid(); + String instanceId = bv.getInstanceId(); + String comment = bv.getComment(); + String nodeState = ""; + String taskDefKey = ""; + String orgPath = bv.getOrgSidPath(); + //设置下一环节审批人是否自动审批通过,默认否 + boolean contains = false; + //设置是否是管理员自动审批,默认否 + boolean adminContains = false; + if (StringUtils.isBlank(nextUserSid)) { + ResultBean stringResultBean = getNextNodeUserSidsOfSubmit(bv); + if (!stringResultBean.getSuccess()) { + //下一环节用户为空的情况 + nextUserSid = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); + adminContains = true; + } else { + nextUserSid = stringResultBean.getData(); + } + } else { + //若下一环节用户与系统管理员一致,则自动审批 + if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { + adminContains = true; + } + } + //查询任务id为taskId的任务是否存在 + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + if (Objects.isNull(task)) { + return rb.setMsg("任务不存在"); + } + String assignee = task.getAssignee(); + if (b && (StringUtils.isNotBlank(assignee) && assignee.indexOf(userSid) < 0)) { + return rb.setMsg("当前用户不是环节的待办人,不能进行办理操作!"); + } + + if (DelegationState.PENDING.equals(task.getDelegationState())) { + //加签 + taskService.addComment(taskId, instanceId, + FlowComment.DELEGATE.getType(), comment); + taskService.resolveTask(taskId, formVariables); + } else { + //当前环节办理通过,且将下一环节用户放入流程中 + taskService.addComment(taskId, instanceId, FlowComment.NORMAL.getType(), comment); + log.error("taskid:{},userSid:{}", taskId, userSid); + log.error("formVariables:{}", JSON.toJSONString(formVariables)); + taskService.setAssignee(taskId, userSid); + taskService.complete(taskId, formVariables);//当前用户办理通过 + //根据流程实例的id取最新的待办环节,给环节设置上用户sid + ResultBean> ll = flowTaskService.getLatestTasksNew(instanceId); + if (ll.getData().size() > 0) { + LatestTaskVo latestTaskVo = ll.getData().get(0); + String id_ = latestTaskVo.getId_(); + //查询下一环节用户是否有转办人 + nextUserSid = change(nextUserSid, bv.getInstanceId()); + taskService.setAssignee(id_, nextUserSid);//将下一环节用户放入流程中 + vo.setTaskId(id_); + //在act_ru_variable表中增加环节上的业务参数的变量 + taskService.setVariablesLocal(id_, formVariables); + nodeState = latestTaskVo.getName_(); + taskDefKey = latestTaskVo.getTask_def_key_(); + } else { + nodeState = FlowComment.SETTLE.getRemark(); + taskDefKey = "Event_end"; + vo.setNodeState(FlowComment.SETTLE.getRemark()); + } + } + //设置管理员是否自动审批的字段是否是是。//若下一环节用户与系统管理员一致,则自动审批 + if (adminContains) { + bv.setUserSid(nextUserSid); + bv.setTaskId(vo.getTaskId()); + bv.setTaskDefKey(taskDefKey); + bv.setComment("系统自动跳过"); + bv.setNextNodeUserSids(""); + return handleProsess(bv, false); + } + //获取该流程所有要走的环节节点 + List flowElements = calApprovePath(bv.getModelId(), + bv.getFormVariables()); + for (int i = 0; i < flowElements.size(); i++) { + FlowElement flowElement = flowElements.get(i); + String id = flowElement.getId(); + if (taskDefKey.equals(id) && i + 1 < flowElements.size()) { + //获取下下一环节 + FlowElement flowElement1 = flowElements.get(i + 1); + List sysUserVoLists2 = new ArrayList<>(); + if (i + 2 < flowElements.size()) { + //获取下下下一环节用户 + FlowElement flowElement2 = flowElements.get(i + 2); + if (flowElement2 instanceof UserTask) { + UserTask userTask = (UserTask) flowElement2; + List candidateGroups = userTask.getCandidateGroups(); + UserssQuery userssQuery = new UserssQuery(); + userssQuery.setCandidateGroups(candidateGroups); + userssQuery.setOrgSidPath(orgPath); + sysUserVoLists2 = sysUserFeign.getUsersByRoles(userssQuery).getData(); + if (sysUserVoLists2 == null) { + sysUserVoLists2 = new ArrayList<>(); + } + } + } + if (flowElement1 instanceof UserTask) { + UserTask userTask = (UserTask) flowElement1; + List candidateGroups = userTask.getCandidateGroups(); + List sysUserVoLists = new ArrayList<>(); + UserssQuery userssQuery = new UserssQuery(); + userssQuery.setCandidateGroups(candidateGroups); + userssQuery.setOrgSidPath(orgPath); + sysUserVoLists = sysUserFeign.getUsersByRoles(userssQuery).getData(); + if (sysUserVoLists == null) { + sysUserVoLists = new ArrayList<>(); + } + //当前环节运营部总经理 刘丽艳 点击同意 下一环节 事业部副总经理 (nextUserSid) 和事业部总经理(sysUserVoLists.get(0).getSid()) + //判断查询回来的用户的集合size是1 并且用户的sid和下一环节的用户的sid相同。 + if (sysUserVoLists.size() == 1 && sysUserVoLists.get(0).getSid().equals(nextUserSid)) { + contains = true; + break; + } + //如果下下一环节无用户,下下下一环节用户与下一环节用户相同且只有一个,则下一环节用户自动审批。 + if (sysUserVoLists.size() == 0 && sysUserVoLists2.size() == 1 && sysUserVoLists2.get(0).getSid().equals(nextUserSid)) { + contains = true; + break; + } + } + } + if (contains) { + break; + } + } + if (contains) { + bv.setUserSid(nextUserSid); + bv.setTaskId(vo.getTaskId()); + bv.setTaskDefKey(taskDefKey); + bv.setComment("因与下一级审批人相同,系统自动处理,需以下一级审批人审批意见为准!"); + return handleProsess(bv, false); + } + vo.setProcInsId(instanceId); + vo.setProcDefId(bv.getModelId()); + vo.setNodeState(nodeState); + vo.setTaskDefKey(taskDefKey); + vo.setSid(bv.getBusinessSid()); + return rb.success().setData(vo); + } + + /** + * 获取下一环节用户 + * + * @param bv + * @return + */ + public ResultBean getNextNodeUserSidsOfSubmit(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + String orgPath = bv.getOrgSidPath(); + String taskDefKey = bv.getTaskDefKey(); + //根据业务参数取流程流转的环节 信息 + List> list = (List>) getProcessCirculationNodesByMap(bv).getData(); + Map task_map = new HashMap<>(); + boolean endTask = true; + for (int i = 0; i < list.size(); i++) { + String id = list.get(i).get("id").toString(); + if (id.equals(taskDefKey) && i + 1 < list.size()) { + task_map = list.get(i + 1); + endTask = false; + } + } + if (endTask) { + task_map.put("name", "结束"); + return rb.success(); + } else { + Object o = task_map.get("candidateGroups"); + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); + String roleSid = jsonArray.get(0).toString(); + //根据组织架构、角色两个参数取相关符合条件的用户信息 + UserQuery userQuery = new UserQuery(); + userQuery.setRoleSid(roleSid); + userQuery.setOrgSidPath(orgPath); + String nextNodeUserSids_ = ""; + List sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + return rb; + } else { + StringBuilder nextNodeUserSids = new StringBuilder(); + for (SysUserVo su : sysUserVos) { + nextNodeUserSids.append(su.getSid()).append(","); + } + //符合条件的用户的sid,拼接的字符串 + nextNodeUserSids_ = nextNodeUserSids.toString(); + nextNodeUserSids_ = nextNodeUserSids_.substring(0, nextNodeUserSids_.length() - 1); + } + return rb.success().setData(nextNodeUserSids_); + } + } + + /** + * 流程抄送的功能 + * + * @param map + * @return + */ + public ResultBean cc(Map map, String taskDefKey) { + ResultBean rb = ResultBean.fireFail(); + log.info("FlowableRest-cc:{}", JSONObject.toJSONString(map)); + Object bv1 = map.get("bv"); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(bv1, bv); + Object uff1 = map.get("uff"); + UpdateFlowFieldVo uff = new UpdateFlowFieldVo(); + BeanUtil.copyProperties(uff1, uff); + uff.setTaskDefKey(taskDefKey); + + //流程定义的id + String modelId = bv.getModelId(); + //将modelId根据冒号:分成三部分,取第一部分作为key + List stringList = Arrays.asList(modelId.split(":")); + modelId = stringList.get(0); + //抄送的角色的sid + ResultBean roleSidByModelId = sysFlowccFeign.getRoleSidByModelId(modelId); + //组织机构sid + String orgSidPath = bv.getOrgSidPath(); + if (roleSidByModelId.getData() == null) { + log.info("抄送失败,没有配置对应的角色!"); + return rb.setMsg("抄送失败,没有配置对应的角色!"); + } + SysFlowccVo data = roleSidByModelId.getData(); + if (StringUtils.isBlank(data.getRoleSid())) { + log.info("抄送失败,没有配置对应的角色!"); + return rb.setMsg("抄送失败,没有配置对应的角色!"); + } + List list = Arrays.asList(data.getRoleSid().split(",")); + UserByRolesAndOrgQuery userQuery = new UserByRolesAndOrgQuery(); + userQuery.setRoleSids(list); + userQuery.setOrgSidPath(orgSidPath); + List sysUserVos = sysUserFeign.getUserByRoles(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + log.info("抄送失败,没有用户!"); + return rb.setMsg("抄送失败,没有用户!"); + } + StringBuilder userName = new StringBuilder(); + StringBuilder userSids = new StringBuilder(); + sysUserVos.forEach(f -> { + userName.append(f.getName()).append(","); + userSids.append(f.getSid()).append(","); + }); + + //抄送的业务逻辑 + MessageFlowableQuery mfq = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(uff, messageFlowVo); + mfq.setUfVo(messageFlowVo); + //移动端的参数 + HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() + .includeProcessVariables().taskId(bv.getTaskId()).singleResult(); + if (historicTaskInstance == null) { + log.info("抄送失败:没有获取到业务参数!"); + return rb.setMsg("抄送失败!"); + } + Map processVariables = historicTaskInstance.getProcessVariables(); + String createrOrgPath = (String) processVariables.get("createrOrgPath"); + if (historicTaskInstance == null) { + log.info("抄送失败:没有获取到业务参数!"); + return rb.setMsg("抄送失败!"); + } + Map app = new HashMap<>(); + if (processVariables.get("app") != null) { + app = (Map) processVariables.get("app"); + } + log.info("抄送方法-historicTaskInstance:{}", JSONObject.toJSONString(historicTaskInstance)); + mfq.setAppMap(app); + mfq.setBusinessSid(bv.getBusinessSid()); + + mfq.setMsgContent("系统抄送的流程审批,请查看"); +// act_re_procdef + Map process = processService.getProcessDefByDefId(historicTaskInstance.getProcessDefinitionId()); + log.info("抄送成功-process:{}", process); + if (process == null) { + log.info("抄送失败,流程定义不存在!"); + return rb.setMsg("抄送失败,流程定义不存在!"); + } + mfq.setModuleName(process.get("NAME_")); + if (processVariables.containsKey("orderNames")) { + mfq.setMsgTitle(processVariables.get("orderNames").toString()); + } else { + mfq.setMsgTitle(process.get("NAME_")); + } + if (processVariables.containsKey("sendRecommendSid")) {//增加的其他的抄送人 + userSids.append(processVariables.get("sendRecommendSid").toString()).append(","); + } + //查询是否有设置转办的,抄送给设置转办人员 + List zbUserSids = processCommentService.selectByIdAndComment("转办",bv.getInstanceId()); + zbUserSids.removeAll(Collections.singleton(null)); + if(!zbUserSids.isEmpty()){ + String zbUser = String.join(",",zbUserSids); + userSids.append(zbUser).append(","); + } + userSids.deleteCharAt(userSids.length() - 1); + mfq.setUserSids(userSids.toString()); + mfq.setOrgPath(createrOrgPath); + ResultBean resultBean = messageFeign.pushMessageCC(mfq); + log.info("抄送成功:{}", userName.toString()); + log.info("抄送成功-resultBean:{}", resultBean); + if (!resultBean.getSuccess()) { + log.info("抄送失败,同送消息异常!:{}", JSONObject.toJSONString(resultBean)); + return rb.setMsg("抄送失败,同送消息异常!"); + } + return rb.success().setMsg("抄送" + userName.toString() + "成功!"); + } +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java index 2974556ee8..dcc3730a67 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java @@ -69,4 +69,6 @@ public interface ProcessCommentMapper extends BaseMapper { ProcessComment fetchBySid(@Param("sid")String sid); void insertByDto(ProcessCommentDto dto); + + List selectByIdAndComment(@Param("comment") String comment, @Param("instanceId") String instanceId); } \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml index 3551c99e56..b44df399cb 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml @@ -17,4 +17,8 @@ insert into `process_comment` ( `sid`, `reviewer`, `reviewerSid`, `time`, `content`, `processId`, `processInstSid`,processFile) values(#{sid},#{reviewer},#{reviewerSid},#{time},#{content},#{processId},#{processInstSid},#{processFile}); + + \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java index 05da790cc9..4095efe52f 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java @@ -135,4 +135,8 @@ public class ProcessCommentService extends MybatisBaseService selectByIdAndComment(String comment, String instanceId) { + return baseMapper.selectByIdAndComment(comment, instanceId); + } } \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java index 643aff62d2..1e3a7ca81c 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java @@ -67,4 +67,8 @@ public class LoanPreloanCreditApplyVo implements Vo { private String zffkjg; @ApiModelProperty("申诉结果") private String ssjg; + @ApiModelProperty("是否可以办理") + private Boolean isEdit; + @ApiModelProperty("是否可以删除") + private Boolean isDelete; } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java index baec720838..3d5e7f2c4c 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java @@ -141,6 +141,16 @@ public class LoanPreloanCreditApplyService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (LoanPreloanCreditApplyVo record : pagging.getRecords()) { + String state = record.getState(); + if ("1".equals(state)){ + record.setIsEdit(true); + record.setIsDelete(true); + }else { + record.setIsEdit(false); + record.setIsDelete(false); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } @@ -224,6 +234,16 @@ public class LoanPreloanCreditApplyService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (LoanPreloanCreditApplyVo record : pagging.getRecords()) { + String state = record.getState(); + if ("0".equals(state)){ + record.setIsEdit(true); + record.setIsDelete(false); + }else { + record.setIsEdit(false); + record.setIsDelete(false); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } diff --git a/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl b/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl index 60c3b5ecae..173b1ef07d 100644 --- a/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl +++ b/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl @@ -75,7 +75,6 @@ - @@ -86,15 +85,13 @@ - - - - - - - - - + + + + + + + @@ -106,7 +103,6 @@ - @@ -121,14 +117,13 @@ - + - @@ -178,7 +173,6 @@ - @@ -193,14 +187,13 @@ - + - @@ -247,7 +240,6 @@ - @@ -256,19 +248,20 @@ + - + + - @@ -314,14 +307,13 @@ - + - @@ -367,14 +359,13 @@ - + - @@ -420,61 +411,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 物料编码 - - - - - - + @@ -482,166 +419,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出金额 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调入金额 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出前余额 - - - - - - - - - - - - - @@ -652,442 +429,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出后余额 - - - - - <#list zcList as zc> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.zc!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.conNo!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.name!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.vinNo!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dcje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.drje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dcqye!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dchye!} - - - - - - <#list zrList as zr> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 物料编码 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 调出金额 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 调入金额 + + + + + <#list tzList as tz> @@ -1098,7 +578,6 @@ - @@ -1107,19 +586,20 @@ + - + + - @@ -1155,20 +635,19 @@ - ${zr.zr!} + ${tz.tzType!} - + - @@ -1199,20 +678,19 @@ - ${zr.conNo!} + ${tz.conNo!} - + - @@ -1230,6 +708,7 @@ + @@ -1243,13 +722,13 @@ - ${zr.name!} + ${tz.name!} - + @@ -1257,7 +736,6 @@ - @@ -1275,6 +753,7 @@ + @@ -1288,21 +767,19 @@ - ${zr.vinNo!} + ${tz.vinNo!} - - + - @@ -1338,124 +815,25 @@ - ${zr.dcje!} + ${tz.dcje!} - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zr.drje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zr.dcqye!} - - - - - - - - - - - - - - - - - - @@ -1480,7 +858,7 @@ - ${zr.dchye!} + ${tz.drje!} @@ -1496,7 +874,6 @@ - @@ -1517,7 +894,6 @@ - @@ -1571,7 +947,6 @@ - @@ -1611,14 +986,12 @@ - - @@ -1662,14 +1035,13 @@ - + - @@ -1731,7 +1103,7 @@ - + @@ -1745,14 +1117,14 @@ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"> 1 - 65 - 260 + 45 + 140 0 0 - 2 + 0 false false - 260 + 140 WPS Office_11.1.0.14309_F1E327BC-269C-435d-A152-05C5408002CA 0 @@ -1768,7 +1140,7 @@ 2023-07-10T06:09:57Z God 文档存本地丢失不负责 - 2023-07-10T06:34:23Z + 2023-07-21T00:59:39Z @@ -1781,7 +1153,7 @@ 2052-11.1.0.14309 - 90FD13DE91554DE7BE7213573AD98205_13 + 7D19BE92512D49FCAB02D5921C488073_13 @@ -1873,11 +1245,11 @@ xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:wpsCustomData="http://www.wps.cn/officeDocument/2013/wpsCustomData" mc:Ignorable="w14"> - + @@ -1915,14 +1287,20 @@ + + - - - - + + + + + + + + + - @@ -2336,6 +1714,7 @@ + @@ -2350,7 +1729,7 @@ - + @@ -2360,39 +1739,39 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -2471,131 +1850,160 @@ - - - + + - + - - - + + - - - + + - + - - - + + - + - - - + + - - - + + - + - + - + + + + - - + - - + - - + + + + + + + - + + + + + + + - + - + + + + + + + + + + + + - - - - - - - - - - + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + diff --git a/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc b/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc index 3a10aca0ec..7773da139b 100644 --- a/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc +++ b/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc @@ -1,6 +1,9 @@ |调账申请 | |${saleDate!} | -|调账类|合同编号 |客户 |物料编码 | -|型 | |名称 | | +|调账类型 |合同编号 |客户名称 |物料编码 |调出金额 |调入金额 | +|${tz.tzTyp|${tz.conNo|${tz.name!|${tz.vinNo|${tz.dcje!|${tz.drje!| +|e!} |!} |} |!} |} |} | +|申请人|${makeName!} |审核 |${spName!} | +|: | |人: | |