Ver Fonte

分包外包签订受托方为供应商

yewc há 1 ano atrás
pai
commit
a998cbc8e6

+ 4 - 3
zjugis-business/src/main/java/com/zjugis/business/bean/entity/ContractSub.java

@@ -1,6 +1,7 @@
 package com.zjugis.business.bean.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.zjugis.business.mybatis.entity.BaseEntity;
 import lombok.Data;
@@ -103,7 +104,7 @@ public class ContractSub extends BaseEntity {
 /**
      * 供应商ID
      */
-    private Object customerId;
+    private String customerId;
 
 /**
      * 项目id
@@ -168,8 +169,8 @@ public class ContractSub extends BaseEntity {
     private String areaManager;
     private String paymentTerms;
 
-
-
+    @TableField(exist = false)
+    private String customerName;
 
 
 

+ 11 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/contractSub/service/FlowContractSubService.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSON;
 import com.zjugis.business.bean.entity.Contract;
 import com.zjugis.business.bean.entity.ContractSub;
 import com.zjugis.business.bean.entity.Project;
+import com.zjugis.business.bean.entity.Supplier;
 import com.zjugis.business.constants.ContractApplyConstants;
 import com.zjugis.business.constants.DictConstants;
 import com.zjugis.business.constants.FlowStatusConstants;
@@ -28,6 +29,7 @@ import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -73,6 +75,9 @@ public class FlowContractSubService {
     @Autowired
     AreaClient areaCLient;
 
+    @Resource
+    private SupplierService supplierService;
+
     @Autowired
     ProjectTypeService projectTypeService;
 
@@ -94,6 +99,12 @@ public class FlowContractSubService {
             Contract main = contractService.selectByPrimaryKey(entity.getParentId());
             map.put("mainContract", main);
         }
+        if (StringUtils.isNotBlank(entity.getCustomerId())) {
+            Supplier supplier=supplierService.queryById(entity.getCustomerId());
+            if(supplier!=null){
+                entity.setCustomerName(supplier.getCustomerName());
+            }
+        }
         map.put("formEntity", entity);
         List<Select> isSignList = SelectConvert.INSTANCE.convertList(dictDataApi.getDictDataList(DictConstants.TYPE_CONTRACT_IS_SIGN).getCheckedData());
         map.put("isSignList", JSON.toJSONString(isSignList));

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ContractSubServiceImpl.java

@@ -6,6 +6,7 @@ import com.zjugis.business.bean.dto.ContractSubDto;
 import com.zjugis.business.bean.entity.Contract;
 import com.zjugis.business.bean.entity.ContractApply;
 import com.zjugis.business.bean.entity.ContractSub;
+import com.zjugis.business.bean.entity.Supplier;
 import com.zjugis.business.bean.response.ContractSubResp;
 import com.zjugis.business.bean.response.ContractSubStatisticResp;
 import com.zjugis.business.constants.ContractApplyConstants;
@@ -165,6 +166,7 @@ public class ContractSubServiceImpl implements ContractSubService {
             contract.setReason(contractApply.getReason());
             contract.setApplicantName(userResp.getCheckedData().getNickname());
             contract.setApplicantId(userId);
+            contract.setCustomerId(contractApply.getSupplierId());
             contract.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
             insert(contract);
             return returnUrl;
@@ -216,6 +218,7 @@ public class ContractSubServiceImpl implements ContractSubService {
             contract.setQualityControllerId(contractApply.getQualityControllerId());
             contract.setApplicantName(userResp.getCheckedData().getNickname());
             contract.setApplicantId(userId);
+            contract.setCustomerId(contractApply.getSupplierId());
             contract.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
             insert(contract);
             return returnUrl;

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

@@ -78,11 +78,11 @@
     function initClient(){
         z.ui.ajax({
             type: "get",
-            url: "/customer-tree",
+            url: "/supplier-tree",
             data: {},
             success: function (res) {
                 if(res && res.code === 0 && res.data.length > 0){
-                    selecttree("[name='client']",res.data,clickClient)
+                    selecttree("[name='customer']",res.data,clickClient)
                 }
             },
             error: function () {
@@ -176,9 +176,9 @@
     }
 
     function clickClient(even, treeId, treeNode) {
-        $("[name='contractSub$clientName']").val(treeNode.name);
-        $("[name='contractSub$clientId']").val(treeNode.id);
-        $("[name='contractSub$clientNumber'] input").val(treeNode.extendData.customerNumber);
+        $("[name='contractSub$customerName']").val(treeNode.name);
+        $("[name='contractSub$customerId']").val(treeNode.id);
+        //$("[name='contractSub$customerNumber'] input").val(treeNode.extendData.customerNumber);
     }
 
     function clickAssignee(even, treeId, treeNode) {

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

@@ -78,11 +78,11 @@
     function initClient(){
         z.ui.ajax({
             type: "get",
-            url: "/customer-tree",
+            url: "/supplier-tree",
             data: {},
             success: function (res) {
                 if(res && res.code === 0 && res.data.length > 0){
-                    selecttree("[name='client']",res.data,clickClient)
+                    selecttree("[name='customer']",res.data,clickClient)
                 }
             },
             error: function () {
@@ -176,9 +176,9 @@
     }
 
     function clickClient(even, treeId, treeNode) {
-        $("[name='contractSub$clientName']").val(treeNode.name);
-        $("[name='contractSub$clientId']").val(treeNode.id);
-        $("[name='contractSub$clientNumber'] input").val(treeNode.extendData.customerNumber);
+        $("[name='contractSub$customerName']").val(treeNode.name);
+        $("[name='contractSub$customerId']").val(treeNode.id);
+        //$("[name='contractSub$clientNumber'] input").val(treeNode.extendData.customerNumber);
     }
 
     function clickAssignee(even, treeId, treeNode) {

+ 4 - 4
zjugis-business/src/main/resources/templates/FlowContractSub/outsourcingApply.ftl

@@ -255,11 +255,11 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css' ]>
                                 </td>
                                 <td>
                                     <div class="form-group">
-                                        <div class="z-comp-selecttree" name="client">
-                                            <input type="hidden" name="contractSub$clientId" value="${formEntity.clientId!}">
-                                            <input type="hidden" name="contractSub$clientName" value="${formEntity.clientName!}">
+                                        <div class="z-comp-selecttree" name="customer">
+                                            <input type="hidden" name="contractSub$customerId" value="${formEntity.customerId!}">
+                                            <input type="hidden" name="contractSub$customerName" value="${formEntity.customerName!}">
                                             <div class="z-inputselect-bar">
-                                                <span> ${formEntity.clientName!} </span><i></i>
+                                                <span> ${formEntity.customerName!} </span><i></i>
                                             </div>
                                         </div>
                                     </div>

+ 4 - 4
zjugis-business/src/main/resources/templates/FlowContractSub/subcontractApply.ftl

@@ -269,11 +269,11 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css' ]>
                                 </td>
                                 <td>
                                     <div class="form-group">
-                                        <div class="z-comp-selecttree" name="client">
-                                            <input type="hidden" name="contractSub$clientId" value="${formEntity.clientId!}">
-                                            <input type="hidden" name="contractSub$clientName" value="${formEntity.clientName!}">
+                                        <div class="z-comp-selecttree" name="customer">
+                                            <input type="hidden" name="contractSub$customerId" value="${formEntity.customerId!}">
+                                            <input type="hidden" name="contractSub$customerName" value="${formEntity.customerName!}">
                                             <div class="z-inputselect-bar">
-                                                <span> ${formEntity.clientName!} </span><i></i>
+                                                <span> ${formEntity.customerName!} </span><i></i>
                                             </div>
                                         </div>
                                     </div>