Преглед на файлове

项目,合同,分包相关修改

chenjun преди 10 месеца
родител
ревизия
8118692077

+ 135 - 125
client_h5/src/pages/project/index.vue

@@ -1,138 +1,148 @@
 <template>
   <flow-form :data="formData" @submit="submitNextActivity">
     <card title="基础信息" style="height: auto">
-      <van-form  ref="form">
+      <van-form ref="form">
         <van-cell-group inset>
           <van-field
-              v-model="formData.applyWorkerName"
-              name="发起人"
-              label="发起人"
-              placeholder="发起人"
-              readonly
+            v-model="formData.applyWorkerName"
+            name="发起人"
+            label="发起人"
+            placeholder="发起人"
+            readonly
           />
           <van-field
-              v-model="formData.applyWorkerDept"
-              name="所在部门"
-              label="所在部门"
-              placeholder="所在部门"
-              readonly
+            v-model="formData.applyWorkerDept"
+            name="所在部门"
+            label="所在部门"
+            placeholder="所在部门"
+            readonly
           />
           <van-field
-              v-model="formData.xmmc"
-              name="项目名称"
-              label="项目名称"
-              placeholder="项目名称"
-              readonly
+            v-model="formData.xmmc"
+            name="项目名称"
+            label="项目名称"
+            placeholder="项目名称"
+            readonly
           />
           <van-field
-              v-model="formData.xmjl"
-              name="项目经理"
-              label="项目经理"
-              placeholder="项目经理"
-              readonly
+            v-model="formData.xmjl"
+            name="项目经理"
+            label="项目经理"
+            placeholder="项目经理"
+            readonly
           />
 
           <van-field
-              v-model="formData.zrbm"
-              name="责任部门"
-              label="责任部门"
-              placeholder="责任部门"
-              readonly
+            v-model="formData.zrbm"
+            name="责任部门"
+            label="责任部门"
+            placeholder="责任部门"
+            readonly
           />
           <van-field
-              v-model="formData.xmbh"
-              name="项目编号"
-              label="项目编号"
-              placeholder="项目编号"
-              readonly
+            v-model="formData.xmbh"
+            name="项目编号"
+            label="项目编号"
+            placeholder="项目编号"
+            readonly
           />
           <van-field
-              v-model="formData.lxsjc"
-              name="立项时间"
-              label="立项时间"
-              placeholder="立项时间"
-              readonly
+            v-model="formData.lxsjc"
+            name="立项时间"
+            label="立项时间"
+            placeholder="立项时间"
+            readonly
           />
           <van-field
-              v-model="formData.planContractAmount"
-              name="预估合同额(万元)"
-              label="预估合同额(万元)"
-              placeholder="预估合同额(万元)"
-              readonly
+            v-model="formData.planContractAmount"
+            name="预估合同额(万元)"
+            label="预估合同额(万元)"
+            placeholder="预估合同额(万元)"
+            readonly
           />
           <van-field
-              v-model="formData.xzqmc"
-              name="行政区"
-              label="行政区"
-              placeholder="行政区"
-              readonly
+            v-model="formData.xzqmc"
+            name="行政区"
+            label="行政区"
+            placeholder="行政区"
+            readonly
           />
           <van-field
-              v-model="formData.projectTypeName"
-              name="项目类型"
-              label="项目类型"
-              placeholder="项目类型"
-              readonly
+            v-model="formData.projectTypeName"
+            name="项目类型"
+            label="项目类型"
+            placeholder="项目类型"
+            readonly
           />
           <van-field
-              v-model="formData.hyIdText"
-              name="行业"
-              label="行业"
-              placeholder="行业"
-              readonly
+            v-model="formData.hyIdText"
+            name="行业"
+            label="行业"
+            placeholder="行业"
+            readonly
           />
           <van-field
-              v-model="formData.yggq"
-              name="预估工期(天)"
-              label="预估工期(天)"
-              placeholder="预估工期(天)"
-              readonly
+            v-model="formData.yggq"
+            name="预估工期(天)"
+            label="预估工期(天)"
+            placeholder="预估工期(天)"
+            readonly
           />
           <van-field
-              v-model="formData.xsry"
-              name="销售人员"
-              label="销售人员"
-              placeholder="销售人员"
-              readonly
+            v-model="formData.xsry"
+            name="销售人员"
+            label="销售人员"
+            placeholder="销售人员"
+            readonly
           />
           <van-field
-              v-model="formData.belongCompanyname"
-              name="归属公司"
-              label="归属公司"
-              placeholder="归属公司"
-              readonly
+            v-model="formData.belongCompanyname"
+            name="归属公司"
+            label="归属公司"
+            placeholder="归属公司"
+            readonly
+          />
+          <van-field
+            v-model="formData.bz"
+            name="备注"
+            label="备注"
+            placeholder="备注"
+            type="textarea"
+            rows="3"
+            autosize
+            :rules="[{ message: '未获取备注' }]"
           />
         </van-cell-group>
       </van-form>
     </card>
     <card title="产值信息" style="height: auto">
-      <van-form  ref="form">
+      <van-form ref="form">
         <van-cell-group inset>
           <van-field
-              v-model="formData.isSignc"
-              name="是否签合同"
-              label="是否签合同"
-              placeholder="是否签合同"
-              readonly
+            v-model="formData.isSignc"
+            name="是否签合同"
+            label="是否签合同"
+            placeholder="是否签合同"
+            readonly
           />
           <van-field
-              v-model="formData.shareRatioc"
-              name="利益分成(公司/部门)"
-              label="利益分成(公司/部门)"
-              placeholder="利益分成(公司/部门)"
-              readonly
+            v-model="formData.shareRatioc"
+            name="利益分成(公司/部门)"
+            label="利益分成(公司/部门)"
+            placeholder="利益分成(公司/部门)"
+            readonly
           />
         </van-cell-group>
       </van-form>
     </card>
     <card title="项目里程碑信息">
       <template #default>
-        <div v-for="(item,index) in formData.detail" :key="index">
+        <div v-for="(item, index) in formData.detail" :key="index">
           <van-swipe-cell>
             <card-cell>
-              <van-cell title="里程碑信息" :value="item.name"/>
-              <van-cell title="计划完成时间" :value="item.planFinishTime"/>
-              <van-cell title="项目进度" :value="item.process"/>
+              <van-cell title="里程碑信息" :value="item.name" />
+              <van-cell title="计划完成时间" :value="item.planFinishTime" />
+              <van-cell title="项目进度" :value="item.process" />
             </card-cell>
           </van-swipe-cell>
         </div>
@@ -142,77 +152,81 @@
 </template>
 
 <script setup lang="ts">
-import {useRoute} from 'vue-router';
-import {FlowDTO, getNextActivity} from '@/service/flow';
+import { useRoute } from "vue-router";
+import { FlowDTO, getNextActivity } from "@/service/flow";
 import reqest from "@/utils/request";
-import FlowForm from '@/components/flowForm.vue';
-import Card from '@/components/card.vue';
-import CardCell from '@/components/cardCell.vue';
-import {DICT_TYPE, getDictLabel} from "@/utils/dict";
-
+import FlowForm from "@/components/flowForm.vue";
+import Card from "@/components/card.vue";
+import CardCell from "@/components/cardCell.vue";
+import { DICT_TYPE, getDictLabel } from "@/utils/dict";
 
 const route = useRoute();
 const form = ref(null);
 
-interface FormDataType {
-}
-
-const formData = ref<FormDataType>({})
+interface FormDataType {}
 
+const formData = ref<FormDataType>({});
 
-const {activityInstanceId, participant, flowInstanceId, read} = route.query as {
-  activityInstanceId: string;
-  participant: string;
-  flowInstanceId: string;
-  read: string;
-};
+const { activityInstanceId, participant, flowInstanceId, read } =
+  route.query as {
+    activityInstanceId: string;
+    participant: string;
+    flowInstanceId: string;
+    read: string;
+  };
 const activityData: FlowDTO = {
   activityInstanceId,
   participantId: participant,
-  flowOpinion: ''
-}
+  flowOpinion: "",
+};
 const submitNextActivity = async (NextActivity: () => Promise<any>) => {
   NextActivity();
 };
 
 const jsonToFormData = (json: any): FormData | null => {
-  const keys: string[] = Object.keys(json)
+  const keys: string[] = Object.keys(json);
   if (keys.length > 0) {
     const formData = new FormData();
     keys.forEach((key) => {
-      formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
+      formData.append(
+        key,
+        json[key] instanceof Object ? JSON.stringify(json[key]) : json[key]
+      );
     });
     return formData;
   }
   return null;
-}
-
+};
 
 function formatDate(timestamp: number) {
   const date = new Date(timestamp);
   const year = date.getFullYear();
   let month = (1 + date.getMonth()).toString();
-  month = month.length > 1 ? month : '0' + month;
+  month = month.length > 1 ? month : "0" + month;
   let day = date.getDate().toString();
-  day = day.length > 1 ? day : '0' + day;
+  day = day.length > 1 ? day : "0" + day;
   return `${year}-${month}-${day}`;
 }
 
-
 /** 初始化表单数据 */
 const initFormData = async () => {
-  const result = await reqest.get(`/business/flow/project/mobileAdd?flowInstanceId=${flowInstanceId}`)
-  formData.value = result.data
+  const result = await reqest.get(
+    `/business/flow/project/mobileAdd?flowInstanceId=${flowInstanceId}`
+  );
+  formData.value = result.data;
 
-  formData.value.lxsjc = formatDate(formData.value.lxsj)
-  formData.value.hyIdText = getDictLabel(DICT_TYPE.PROJECT_HY, formData.value.hyId);
+  formData.value.lxsjc = formatDate(formData.value.lxsj);
+  formData.value.hyIdText = getDictLabel(
+    DICT_TYPE.PROJECT_HY,
+    formData.value.hyId
+  );
 
   let signc;
   const sign = formData.value.isSign;
   if (sign != null) {
     switch (sign) {
       case 0:
-        signc = "否"
+        signc = "否";
         break;
       case 1:
         signc = "是";
@@ -228,27 +242,23 @@ const initFormData = async () => {
   if (shareRatio != null) {
     let shareRatioc;
 
-
     if (shareRatio == 0.42) {
       shareRatioc = "58% / 42%";
     } else if (shareRatio == 0.375) {
       shareRatioc = "62.5% / 37.5%";
     } else if (shareRatio != 0.42 && shareRatio != 0.375) {
-      shareRatioc = (100 - 100 * shareRatio) + "% / " + (100 * shareRatio) + "%";
+      shareRatioc = 100 - 100 * shareRatio + "% / " + 100 * shareRatio + "%";
     } else {
       shareRatioc = "";
     }
     formData.value.shareRatioc = shareRatioc;
   }
-
-
-}
-
+};
 
 /** 初始化 */
 onMounted(() => {
-  initFormData()
-})
+  initFormData();
+});
 </script>
 
 <style lang="scss" scoped>

+ 38 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/response/ContractApplyExcelResponse.java

@@ -0,0 +1,38 @@
+package com.zjugis.business.bean.response;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.zjugis.business.excel.ContractApplyConverter;
+import lombok.Data;
+
+/**
+ * @Author 陈俊
+ * @Date 2024/9/5 14:28
+ * @Version 1.0
+ */
+@Data
+public class ContractApplyExcelResponse {
+
+    @ExcelProperty("主合同编号")
+    private String contractNumber;
+
+    @ExcelProperty("主合同名称")
+    private String name;
+
+    @ExcelProperty("分包供应商")
+    private String supplierName;
+
+    @ExcelProperty("分包金额")
+    private String contractAmount;
+
+    @ExcelProperty("已支付")
+    private String payAmount;
+
+    @ExcelProperty("未支付")
+    private String unpaidAmount;
+
+    @ExcelProperty(value = "是否可提供专票", converter = ContractApplyConverter.class)
+    private Integer invoice;
+
+    @ExcelProperty("税点")
+    private String taxPoints;
+}

+ 20 - 0
zjugis-business/src/main/java/com/zjugis/business/controller/ContractApplyController.java

@@ -3,14 +3,22 @@ package com.zjugis.business.controller;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zjugis.business.bean.dto.ContractApplyDto;
 import com.zjugis.business.bean.entity.ContractApply;
+import com.zjugis.business.bean.response.ContractApplyExcelResponse;
 import com.zjugis.business.bean.response.ContractApplyResp;
 import com.zjugis.business.bean.response.SumResponse;
 import com.zjugis.business.service.ContractApplyService;
 import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.excel.core.util.ExcelUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -81,5 +89,17 @@ public class ContractApplyController {
         return CommonResult.success(contractApplyService.processOut(projectId));
     }
 
+    @GetMapping("/contract-apply/list/excel")
+    public void export(ContractApplyDto contractApplyDto,
+                       HttpServletResponse response) throws IOException {
+        List<ContractApplyExcelResponse> excelList = contractApplyService.excelList(contractApplyDto);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String format = simpleDateFormat.format(new Date());
+        response.setContentType("multipart/form-data");
+        response.setCharacterEncoding(String.valueOf(StandardCharsets.UTF_8));
+        response.setHeader("Content-Disposition",
+                "attachment;filename*=utf-8'zh-cn'" + URLEncoder.encode("分包" + format + ".xlsx", String.valueOf(StandardCharsets.UTF_8)));
+        ExcelUtils.write(response, "分包" + format + ".xlsx", "分包列表", ContractApplyExcelResponse.class, excelList);
+    }
 }
 

+ 63 - 0
zjugis-business/src/main/java/com/zjugis/business/excel/ContractApplyConverter.java

@@ -0,0 +1,63 @@
+package com.zjugis.business.excel;
+
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author ljy
+ * @version 1.0
+ * @date 2023/11/23 15:26
+ */
+public class ContractApplyConverter implements Converter<Integer> {
+
+
+    private final String[] dictFieldName = {"invoice"};
+
+    private final Map<String,Map<Integer,String>> dictMap = new HashMap<>();
+
+    private final Map<Integer,String> invoiceDict = new HashMap<>();
+
+    public ContractApplyConverter() {
+        this.invoiceDict.put(1,"是");
+        this.invoiceDict.put(0,"否");
+
+
+        dictMap.put("invoice",invoiceDict);
+
+    }
+
+    @Override
+    public Class<?> supportJavaTypeKey() {
+        return Integer.class;
+    }
+
+    /**
+     * @param value               Java Data.NotNull.
+     * @param contentProperty     Content property.Nullable.
+     * @param globalConfiguration Global configuration.NotNull.
+     */
+    @Override
+    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+
+        Field field = contentProperty.getField();
+        String fieldName = field.getName();
+        String excelValue;
+        if (StringUtils.equalsAnyIgnoreCase(fieldName,dictFieldName)) {
+            Map<Integer, String> dict = dictMap.get(fieldName);
+            Set<Integer> dictKeys = dict.keySet();
+            excelValue = dictKeys.contains(value) ? dict.get(value) : "";
+        } else {
+            excelValue = String.valueOf(value);
+        }
+        return new WriteCellData<>(excelValue);
+    }
+}

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/mapper/ContractApplyMapper.java

@@ -7,6 +7,7 @@ import com.zjugis.business.bean.dto.ContractApplyToPayDto;
 import com.zjugis.business.bean.dto.ContractSubCostDto;
 import com.zjugis.business.bean.dto.ManageSegmentDto;
 import com.zjugis.business.bean.entity.ContractApply;
+import com.zjugis.business.bean.response.ContractApplyExcelResponse;
 import com.zjugis.business.bean.response.ContractApplyResp;
 import com.zjugis.business.bean.response.SumResponse;
 import org.apache.ibatis.annotations.Param;
@@ -33,5 +34,7 @@ public interface ContractApplyMapper extends BaseMapper<ContractApply> {
     List<ContractSubCostDto> selectSubCostByProjectIds(@Param("ids") List<String> projectIds);
 
     List<ManageSegmentDto> infoGroupBySegment();
+
+    List<ContractApplyExcelResponse> excelList(@Param("params") ContractApplyDto contractApplyDto);
 }
 

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

@@ -6,6 +6,7 @@ import com.zjugis.business.bean.dto.ContractApplyToPayDto;
 import com.zjugis.business.bean.dto.ContractSubCostDto;
 import com.zjugis.business.bean.dto.ManageSegmentDto;
 import com.zjugis.business.bean.entity.ContractApply;
+import com.zjugis.business.bean.response.ContractApplyExcelResponse;
 import com.zjugis.business.bean.response.ContractApplyResp;
 import com.zjugis.business.bean.response.SumResponse;
 
@@ -68,5 +69,7 @@ public interface ContractApplyService {
     List<ContractSubCostDto> selectSubCostByProjectIds(List<String> projectIds);
 
     List<ManageSegmentDto> infoGroupBySegment();
+
+    List<ContractApplyExcelResponse> excelList(ContractApplyDto contractApplyDto);
 }
 

+ 6 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ContractApplyServiceImpl.java

@@ -8,6 +8,7 @@ import com.zjugis.business.bean.dto.ContractSubCostDto;
 import com.zjugis.business.bean.dto.ManageSegmentDto;
 import com.zjugis.business.bean.entity.Contract;
 import com.zjugis.business.bean.entity.ContractApply;
+import com.zjugis.business.bean.response.ContractApplyExcelResponse;
 import com.zjugis.business.bean.response.ContractApplyResp;
 import com.zjugis.business.bean.response.SumResponse;
 import com.zjugis.business.constants.ContractApplyConstants;
@@ -211,5 +212,10 @@ public class ContractApplyServiceImpl implements ContractApplyService {
         }
         return subDtos;
     }
+
+    @Override
+    public List<ContractApplyExcelResponse> excelList(ContractApplyDto contractApplyDto) {
+        return contractApplyMapper.excelList(contractApplyDto);
+    }
 }
 

+ 39 - 0
zjugis-business/src/main/resources/mapper/oracle/ContractApplyMapper.xml

@@ -115,5 +115,44 @@
         </where>
         GROUP BY D.SEGMENT
     </select>
+    <select id="excelList" resultType="com.zjugis.business.bean.response.ContractApplyExcelResponse">
+        SELECT
+            t1.CONTRACT_NUMBER,
+            t1.name,
+            t5.CUSTOMER_NAME AS SUPPLIER_NAME,
+            t.CONTRACT_AMOUNT,
+            t.PAY_AMOUNT,
+            t.CONTRACT_AMOUNT-t.PAY_AMOUNT AS UNPAID_AMOUNT,
+            t5.INVOICE,
+            t5.TAX_POINTS
+        FROM
+            CONTRACT_APPLY t
+                LEFT JOIN CONTRACT t1 ON t1.ID = t.CONTRACT_ID
+                LEFT JOIN PROJECT t2 ON t2.ID = t.PROJECT_ID
+                LEFT JOIN SUPPLIER t5 ON t5.ID = t.SUPPLIER_ID
+                LEFT JOIN ZJUGIS_OA.SYSTEM_DEPT t3 ON t3.ID = t2.ZRBM_ID
+                LEFT JOIN CONTRACT_SUB t4 ON t4.CONTRACT_APPLY_ID = t.ID AND t4.ISVALID = 1 AND t4.FLOW_STATUS = 90
+        <where>
+            t.ISVALID = 1 and t.FLOW_STATUS = 90
+            <if test="params != null and params.projectName != null and params.projectName != ''">
+                <bind name="xmmc" value="'%'+params.projectName+'%'"/>
+                AND t2.XMMC LIKE #{xmmc}
+            </if>
+            <if test="params != null and params.projectNumber != null and params.projectNumber != ''">
+                <bind name="xmbh" value="'%'+params.projectNumber+'%'"/>
+                AND t2.XMBH LIKE #{xmbh}
+            </if>
+            <if test="params != null and params.isSign != null">
+                AND t.IS_SIGN = #{params.isSign,jdbcType=INTEGER}
+            </if>
+            <if test="params != null and params.applyType != null">
+                AND t.APPLY_TYPE = #{params.applyType,jdbcType=INTEGER}
+            </if>
+            <if test="params != null and params.userId != null  and params.userId != ''">
+                AND t.APPLY_WORKER_ID = #{params.userId}
+            </if>
+        </where>
+        ORDER BY t.APPLY_DATE DESC
+    </select>
 </mapper>
 

+ 14 - 0
zjugis-business/src/main/resources/templates/FlowProject/apply.ftl

@@ -221,6 +221,20 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css' ]>
                               </div>
                           </td>
                       </tr>
+                      <tr>
+                          <td class="th">
+                              <div class="form-label">备注:</div>
+                          </td>
+                          <td colspan="3">
+                              <div class="form-group">
+                                  <div class="form-item" style="margin: 10px 0;">
+                                      <div class="z-comp-textarea" name="project$bz">
+                                          <textarea>${formEntity.bz!}</textarea>
+                                      </div>
+                                  </div>
+                              </div>
+                          </td>
+                      </tr>
                   </table>
               </div>
               <div class="form-title">