Pārlūkot izejas kodu

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy 1 gadu atpakaļ
vecāks
revīzija
c521b2b996

+ 0 - 26
zjugis-business/src/main/java/com/zjugis/business/bean/dto/AmountDto.java

@@ -1,26 +0,0 @@
-package com.zjugis.business.bean.dto;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-/**
- * @author ljy
- * @version 1.0
- * @date 2024/3/6 9:26
- */
-@Data
-public class AmountDto {
-
-    private String projectId;
-
-    private BigDecimal contractAmount;
-
-    private BigDecimal invoiceAmount;
-
-    private BigDecimal returnAmount;
-
-    private BigDecimal receivableAmount;
-
-    private BigDecimal contractBalance;
-}

+ 6 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/response/ContractInfoResp.java

@@ -23,4 +23,10 @@ public class ContractInfoResp {
     private BigDecimal subToPay;
 
     private BigDecimal outToPay;
+
+    private BigDecimal paymentCost;
+
+    private BigDecimal reimbursementCost;
+
+    private BigDecimal travelCost;
 }

+ 10 - 6
zjugis-business/src/main/java/com/zjugis/business/flow/common/event/CommonEvent.java

@@ -58,11 +58,7 @@ public class CommonEvent extends BaseController {
                 String activityInstanceName = activityInstance.get("name").toString();
                 CommonResult<List<IActivityInsParticiPantDto>> parRes = workflowClient.getActivityParticipants(activityInstanceId);
                 List<IActivityInsParticiPantDto> parts = parRes.getCheckedData();
-                IFlowInstanceReq iFlowInstanceReq = new IFlowInstanceReq();
-                iFlowInstanceReq.setFlowInstanceId(flowInstanceId);
-                iFlowInstanceReq.setMobile(true);
-                iFlowInstanceReq.setUserId(currentUserId);
-                CommonResult<String> flowUrlRes = workflowClient.getFlowUrl(iFlowInstanceReq);
+
                 int index = 0;
                 while(describtion == null || StringUtils.isBlank(describtion.toString()) || index < 5){
                     Thread.sleep(200);
@@ -71,8 +67,16 @@ public class CommonEvent extends BaseController {
                     describtion = checkedData.getDescribtion();
                     index ++;
                 }
-                String mobileUrl = flowUrlRes.getCheckedData();
                 for (int i = 0; i < parts.size(); i++) {
+                    IFlowInstanceReq iFlowInstanceReq = new IFlowInstanceReq();
+                    iFlowInstanceReq.setFlowInstanceId(flowInstanceId);
+                    iFlowInstanceReq.setMobile(true);
+                    iFlowInstanceReq.setUserId(currentUserId);
+                    iFlowInstanceReq.setParticipantId(parts.get(i).getId());
+                    iFlowInstanceReq.setUserId(parts.get(i).getUserId());
+                    iFlowInstanceReq.setActivityInsId(activityInstanceId);
+                    CommonResult<String> flowUrlRes = workflowClient.getFlowUrl(iFlowInstanceReq);
+                    String mobileUrl = flowUrlRes.getCheckedData();
                     IActivityInsParticiPantDto item = parts.get(i);
                     String content = "";
                     if(describtion == null){

+ 4 - 0
zjugis-business/src/main/java/com/zjugis/business/mapper/ProjectAmountMapper.java

@@ -1,7 +1,9 @@
 package com.zjugis.business.mapper;
 
 import com.zjugis.business.bean.dto.ParentDto;
+import com.zjugis.business.bean.dto.ProjectDto;
 import com.zjugis.business.bean.entity.ProjectAmount;
+import com.zjugis.business.bean.response.ContractInfoResp;
 import com.zjugis.framework.mybatis.core.mapper.BaseMapperX;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,4 +21,6 @@ public interface ProjectAmountMapper extends BaseMapperX<ProjectAmount> {
     List<ParentDto> selectInsertIds();
 
     List<ProjectAmount> selectAmountList(@Param("ids") List<String> projectIds);
+
+    ContractInfoResp selectCostSum(@Param("params") ProjectDto dto);
 }

+ 4 - 0
zjugis-business/src/main/java/com/zjugis/business/service/ProjectAmountService.java

@@ -1,7 +1,9 @@
 package com.zjugis.business.service;
 
 import com.zjugis.business.bean.dto.ParentDto;
+import com.zjugis.business.bean.dto.ProjectDto;
 import com.zjugis.business.bean.entity.ProjectAmount;
+import com.zjugis.business.bean.response.ContractInfoResp;
 
 import java.util.List;
 
@@ -30,4 +32,6 @@ public interface ProjectAmountService {
     List<ParentDto> selectInsertIds();
 
     List<ProjectAmount> selectAmountList(List<String> projectIds);
+
+    ContractInfoResp selectCostSum(ProjectDto projectAmountDto);
 }

+ 7 - 4
zjugis-business/src/main/java/com/zjugis/business/service/impl/ContractServiceImpl.java

@@ -3,10 +3,7 @@ package com.zjugis.business.service.impl;
 import com.alibaba.excel.util.StringUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zjugis.business.bean.dto.ContractApplyDto;
-import com.zjugis.business.bean.dto.ContractApplyToPayDto;
-import com.zjugis.business.bean.dto.ContractDto;
-import com.zjugis.business.bean.dto.ContractMessageDto;
+import com.zjugis.business.bean.dto.*;
 import com.zjugis.business.bean.entity.Contract;
 import com.zjugis.business.bean.entity.Project;
 import com.zjugis.business.bean.entity.ProjectAmount;
@@ -187,8 +184,10 @@ public class ContractServiceImpl implements ContractService{
         DeptDataPermissionRespDTO deptPermissions = deptDataPermissionRes.getCheckedData();
         ContractMessageDto dto = new ContractMessageDto();
         ContractApplyDto applyDto = new ContractApplyDto();
+        ProjectDto projectAmountDto = new ProjectDto();
         if(!deptPermissions.getAll()){
             dto.setDeptIds(deptPermissions.getDeptIds());
+            projectAmountDto.setDeptIds(deptPermissions.getDeptIds());
             applyDto.setDeptIds(deptPermissions.getDeptIds());
         }
         if(infoRequest.getYear() != null) {
@@ -205,6 +204,10 @@ public class ContractServiceImpl implements ContractService{
         resp.setNetAmount(resp.getSignAmount().subtract(yearDto.getSubAmount()));
         resp.setSubToPay(subToPayDto.getSubToPay());
         resp.setOutToPay(subToPayDto.getOutToPay());
+        ContractInfoResp cost =  projectAmountService.selectCostSum(projectAmountDto);
+        resp.setPaymentCost(cost.getPaymentCost());
+        resp.setReimbursementCost(cost.getReimbursementCost());
+        resp.setTravelCost(cost.getTravelCost());
         return resp;
     }
 

+ 11 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectAmountServiceImpl.java

@@ -1,8 +1,10 @@
 package com.zjugis.business.service.impl;
 
 import com.zjugis.business.bean.dto.ParentDto;
+import com.zjugis.business.bean.dto.ProjectDto;
 import com.zjugis.business.bean.entity.ContractInvoiceRelation;
 import com.zjugis.business.bean.entity.ProjectAmount;
+import com.zjugis.business.bean.response.ContractInfoResp;
 import com.zjugis.business.mapper.ProjectAmountMapper;
 import com.zjugis.business.service.ContractInvoiceRelationService;
 import com.zjugis.business.service.ContractService;
@@ -111,4 +113,13 @@ public class ProjectAmountServiceImpl implements ProjectAmountService {
         }
         return res;
     }
+
+    /**
+     * @param
+     * @return
+     */
+    @Override
+    public ContractInfoResp selectCostSum(ProjectDto dto) {
+        return projectAmountMapper.selectCostSum(dto);
+    }
 }

+ 17 - 0
zjugis-business/src/main/resources/mapper/oracle/ProjectAmountMapper.xml

@@ -36,4 +36,21 @@
     <select id="selectInsertIds" resultType="com.zjugis.business.bean.dto.ParentDto">
         SELECT ID,PID FROM PROJECT WHERE ISVALID = 1 AND FLOW_STATUS IN (90,99) AND ID NOT IN (SELECT PROJECT_ID FROM PROJECT_AMOUNT)
     </select>
+
+    <select id="selectCostSum" resultType="com.zjugis.business.bean.response.ContractInfoResp">
+        select COALESCE(SUM(COALESCE(t.PAYMENT_COST,0)),0) AS paymentCost,
+        COALESCE(SUM(COALESCE(t.REIMBURSEMENT_COST,0)),0) AS reimbursementCost,
+        COALESCE(SUM(COALESCE(t.TRAVEL_COST,0)),0) AS travelCost
+        FROM PROJECT_AMOUNT t
+        RIGHT JOIN PROJECT t1 on t1.ID = t.PROJECT_ID
+        <where>
+            t1.ISVALID = 1 AND t1.FLOW_STATUS = 90
+            <if test="params != null  and params.deptIds != null  and params.deptIds.size > 0">
+                AND t1.ZRBM_ID in
+                <foreach collection="params.deptIds" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
 </mapper>

+ 23 - 8
zjugis-business/src/main/resources/templates/FlowContract/js/apply.js

@@ -26,21 +26,36 @@
 
     function bindGenerateSerial(){
         $("#generateSerial").on("click",function(){
-            var genFlag = true;
             var serial = $("[name='contract$contractNumber'] input").val();
+            var projectTypeCode = $("[name=projectTypeCode]").val();
+            var xzqh = $("[name=xzqh]").val();
+            var params = {"projectType": projectTypeCode,"xzqh": xzqh};
+            var postdata = {"name": '合同编号',"params": params}
             if(serial) {
                 z.ui.confirm("confirm").init({
                     content: '已有编号[' +serial + '],重新生成会覆盖原有编号,是否继续?',
+                    onConfirm: function() {
+                        z.ui.ajax({
+                            type: "post",
+                            contentType: "application/json",
+                            url: "/common/generate-serial-number",
+                            data: JSON.stringify(postdata),
+                            success: function (res) {
+                                if(res && res.code === 0){
+                                    $("[name='contract$contractNumber'] input").val(res.data)
+                                } else {
+                                    z.ui.alertWarning(res.msg);
+                                }
+                            },
+                            error: function (res) {
+                            }
+                        })
+                    },
                     onCancel: function () {
-                        genFlag = false;
+
                     }
                 })
-            }
-            var projectTypeCode = $("[name=projectTypeCode]").val();
-            var xzqh = $("[name=xzqh]").val();
-            var params = {"projectType": projectTypeCode,"xzqh": xzqh};
-            var postdata = {"name": '合同编号',"params": params}
-            if(genFlag){
+            } else {
                 z.ui.ajax({
                     type: "post",
                     contentType: "application/json",

+ 19 - 6
zjugis-business/src/main/resources/templates/FlowContractInvoice/js/apply.js

@@ -69,19 +69,32 @@
 
     function bindGenerateSerial(){
         $("#generateSerial").on("click",function(){
-            var genFlag = true;
             var serial = $("[name='contractInvoice$invoiceNumber'] input").val();
+            var postdata = {"name": '开票单号'};
             if(serial) {
                 z.ui.confirm("confirm").init({
                     content: '已有编号[' +serial + '],重新生成会覆盖原有编号,是否继续?',
+                    onConfirm: function() {
+                        z.ui.ajax({
+                            type: "post",
+                            contentType: "application/json",
+                            url: "/common/generate-serial-number",
+                            data: JSON.stringify(postdata),
+                            success: function (res) {
+                                if(res && res.code === 0){
+                                    $("[name='contractInvoice$invoiceNumber'] input").val(res.data)
+                                } else {
+                                    z.ui.alertWarning(res.msg);
+                                }
+                            },
+                            error: function () {
+                            }
+                        })
+                    },
                     onCancel: function () {
-                        genFlag = false;
                     }
                 })
-            }
-
-            var postdata = {"name": '开票单号'}
-            if(genFlag){
+            } else {
                 z.ui.ajax({
                     type: "post",
                     contentType: "application/json",

+ 15 - 23
zjugis-business/src/main/resources/templates/FlowContractSub/js/outsourcingApply.js

@@ -20,17 +20,14 @@
 
     function bindGenerateSerial(){
         $("#generateSerial").on("click",function(){
-            var genFlag = true;
             var serial = $("[name='contractSub$contractNumber'] input").val();
+            var postdata = {"name": '外包合同编号'}
             if(serial) {
                 z.ui.confirm("confirm").init({
                     content: '已有编号[' +serial + '],重新生成会覆盖原有编号,是否继续?',
                     onCancel: function () {
-                        genFlag = false;
                     },
                     onConfirm: function () {
-                        var postdata = {"name": '外包合同编号'}
-                        if(genFlag){
                             z.ui.ajax({
                                 type: "post",
                                 contentType: "application/json",
@@ -46,29 +43,24 @@
                                 error: function () {
                                 }
                             })
-                        }
                     }
                 })
             }else{
-                var params = {"projectType": 'WB',"xzqh": ''};
-                var postdata = {"name": '外包合同编号',"params": params}
-                if(genFlag){
-                    z.ui.ajax({
-                        type: "post",
-                        contentType: "application/json",
-                        url: "/common/generate-serial-number",
-                        data: JSON.stringify(postdata),
-                        success: function (res) {
-                            if(res && res.code === 0){
-                                $("[name='contractSub$contractNumber'] input").val(res.data)
-                            } else {
-                                z.ui.alertWarning(res.msg);
-                            }
-                        },
-                        error: function () {
+                z.ui.ajax({
+                    type: "post",
+                    contentType: "application/json",
+                    url: "/common/generate-serial-number",
+                    data: JSON.stringify(postdata),
+                    success: function (res) {
+                        if(res && res.code === 0){
+                            $("[name='contractSub$contractNumber'] input").val(res.data)
+                        } else {
+                            z.ui.alertWarning(res.msg);
                         }
-                    })
-                }
+                    },
+                    error: function () {
+                    }
+                })
             }
 
         })

+ 29 - 37
zjugis-business/src/main/resources/templates/FlowContractSub/js/subcontractApply.js

@@ -20,55 +20,47 @@
 
     function bindGenerateSerial(){
         $("#generateSerial").on("click",function(){
-            var genFlag = true;
             var serial = $("[name='contractSub$contractNumber'] input").val();
+            var postdata = {"name": '分包合同编号'}
             if(serial) {
                 z.ui.confirm("confirm").init({
                     content: '已有编号[' +serial + '],重新生成会覆盖原有编号,是否继续?',
                     onCancel: function () {
-                        genFlag = false;
                     },
                     onConfirm: function () {
-                        var postdata = {"name": '分包合同编号'}
-                        if(genFlag){
-                            z.ui.ajax({
-                                type: "post",
-                                contentType: "application/json",
-                                url: "/common/generate-serial-number",
-                                data: JSON.stringify(postdata),
-                                success: function (res) {
-                                    if(res && res.code === 0){
-                                        $("[name='contractSub$contractNumber'] input").val(res.data)
-                                    } else {
-                                        z.ui.alertWarning(res.msg);
-                                    }
-                                },
-                                error: function () {
+                        z.ui.ajax({
+                            type: "post",
+                            contentType: "application/json",
+                            url: "/common/generate-serial-number",
+                            data: JSON.stringify(postdata),
+                            success: function (res) {
+                                if(res && res.code === 0){
+                                    $("[name='contractSub$contractNumber'] input").val(res.data)
+                                } else {
+                                    z.ui.alertWarning(res.msg);
                                 }
-                            })
-                        }
+                            },
+                            error: function () {
+                            }
+                        })
                     }
                 })
             }else{
-                var params = {"projectType": 'FB',"xzqh": ''};
-                var postdata = {"name": '分包合同编号',"params": params}
-                if(genFlag){
-                    z.ui.ajax({
-                        type: "post",
-                        contentType: "application/json",
-                        url: "/common/generate-serial-number",
-                        data: JSON.stringify(postdata),
-                        success: function (res) {
-                            if(res && res.code === 0){
-                                $("[name='contractSub$contractNumber'] input").val(res.data)
-                            } else {
-                                z.ui.alertWarning(res.msg);
-                            }
-                        },
-                        error: function () {
+                z.ui.ajax({
+                    type: "post",
+                    contentType: "application/json",
+                    url: "/common/generate-serial-number",
+                    data: JSON.stringify(postdata),
+                    success: function (res) {
+                        if(res && res.code === 0){
+                            $("[name='contractSub$contractNumber'] input").val(res.data)
+                        } else {
+                            z.ui.alertWarning(res.msg);
                         }
-                    })
-                }
+                    },
+                    error: function () {
+                    }
+                })
             }
 
         })

+ 20 - 5
zjugis-business/src/main/resources/templates/FlowProject/js/apply.js

@@ -33,19 +33,34 @@
            z.ui.alertWarning("请选择责任部门!");
            return;
          }
-         var genFlag = true;
          var xmbh = $("[name='project$xmbh'] input").val();
+         var postdata = {"name": '立项项目编号',
+          "deptId": zrbmId}
          if(xmbh) {
            z.ui.confirm("confirm").init({
              content: '已有编号[' +xmbh + '],重新生成会覆盖原有编号,是否继续?',
+             onConfirm: function() {
+               z.ui.ajax({
+                 type: "post",
+                 contentType: "application/json",
+                 url: "/common/generate-serial-number",
+                 data: JSON.stringify(postdata),
+                 success: function (res) {
+                   if(res && res.code === 0){
+                     $("[name='project$xmbh'] input").val(res.data)
+                   } else {
+                     z.ui.alertWarning(res.msg);
+                   }
+                 },
+                 error: function () {
+                 }
+               })
+             },
              onCancel: function () {
                genFlag = false;
              }
            })
-         }
-        var postdata = {"name": '立项项目编号',
-            "deptId": zrbmId}
-         if(genFlag){
+         } else {
            z.ui.ajax({
              type: "post",
              contentType: "application/json",

+ 1 - 0
zjugis-framework/zjugis-spring-boot-starter-workflow/src/main/java/com/zjugis/framework/workflow/model/IFlowInstanceReq.java

@@ -16,6 +16,7 @@ public class IFlowInstanceReq {
     String flowInstanceId;
     String activityInsId;
     String userId;
+    String participantId;
     Boolean view = false;
     Boolean mobile = false;
 }

+ 1 - 8
zjugis-workflow/src/main/java/com/zjugis/z_workflow/serviceApi/FlowInstanceApiController.java

@@ -291,14 +291,7 @@ public class FlowInstanceApiController extends BaseController {
 
     @PostMapping
     public CommonResult<String> getFlowUrl(@Valid @RequestBody IFlowInstanceReq iFlowInstanceReq){
-        String participantId = "";
-        if (StringUtils.isNotBlank(iFlowInstanceReq.getUserId())) {
-            IActivityInsParticiPant particiPant = iActivityInsParticiPantService.getByActivityInsIdAndUserId(iFlowInstanceReq.getActivityInsId(), iFlowInstanceReq.getUserId());
-            if (Objects.nonNull(particiPant)) {
-                participantId = particiPant.getId();
-            }
-        }
-        String flowUrl = iActivityInstanceService.getHandlerUrl(iFlowInstanceReq.getActivityInsId(),iFlowInstanceReq.getFlowInstanceId(),participantId,iFlowInstanceReq.getUserId(),iFlowInstanceReq.getMobile(),iFlowInstanceReq.getView(),null);
+        String flowUrl = iActivityInstanceService.getHandlerUrl(iFlowInstanceReq.getActivityInsId(),iFlowInstanceReq.getFlowInstanceId(),iFlowInstanceReq.getParticipantId(),iFlowInstanceReq.getUserId(),iFlowInstanceReq.getMobile(),iFlowInstanceReq.getView(),null);
         return CommonResult.success(flowUrl);
     }
 }