Pārlūkot izejas kodu

权限添加过滤,修改

yusm 1 nedēļu atpakaļ
vecāks
revīzija
cea42d9575

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ContractController.java

@@ -54,8 +54,8 @@ public class ContractController {
      */
     @RequestMapping("/exportContract")
     public HttpRespMsg exportContract (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
-                                       String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus){
-        return contractService.ExportContract(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+                                       String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,Integer stampDutyStatus){
+        return contractService.ExportContract(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
     }
 
     /**
@@ -63,8 +63,8 @@ public class ContractController {
      */
     @RequestMapping("/exportContractOneToMany")
     public HttpRespMsg exportContractOneToMany (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
-                                                String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus){
-        return contractService.exportContractOneToMany(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+                                                String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,Integer stampDutyStatus){
+        return contractService.exportContractOneToMany(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
     }
 
     /**

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ContractPayCustomizedController.java

@@ -30,7 +30,7 @@ public class ContractPayCustomizedController {
     @RequestMapping("/getStampDutyTimeNullList")
     public HttpRespMsg getStampDutyTimeNullList(Integer contractId,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
-        List<ContractPayCustomized> list = contractPayCustomizedService.list(new QueryWrapper<ContractPayCustomized>().eq("contract_id", contractId).isNotNull("stamp_duty_time"));
+        List<ContractPayCustomized> list = contractPayCustomizedService.list(new QueryWrapper<ContractPayCustomized>().eq("contract_id", contractId).isNotNull("bill_number").isNull("stamp_duty_time"));
         httpRespMsg.setData(list);
         return httpRespMsg;
     }

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Contract.java

@@ -192,9 +192,9 @@ public class Contract extends Model<Contract> {
     private Integer stampDutyStatus;
 
     @TableField(exist = false)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime stampDutyTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate stampDutyTime;
 
 
     @Override

+ 4 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ContractCustom.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -137,9 +138,9 @@ public class ContractCustom extends Model<ContractCustom> {
      * 部分缴纳、已缴纳时,启用。
      */
     @TableField("stamp_duty_time")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime stampDutyTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate stampDutyTime;
 
 
     @Override

+ 4 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ContractPayCustomized.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -98,9 +99,9 @@ public class ContractPayCustomized extends Model<ContractPayCustomized> {
      * 印花税缴纳时间
      */
     @TableField("stamp_duty_time")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime stampDutyTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate stampDutyTime;
 
 
     @Override

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ContractService.java

@@ -23,7 +23,7 @@ public interface ContractService extends IService<Contract> {
 
     HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus );
 
-    HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
+    HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
 
     HttpRespMsg addContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr);
 
@@ -40,5 +40,5 @@ public interface ContractService extends IService<Contract> {
     HttpRespMsg deleteContract(HttpServletRequest request, Integer id);
 
     HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate,
-                                        String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
+                                        String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
 }

+ 31 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -1,6 +1,7 @@
 package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -198,6 +199,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 contractPageVO.setRemarks(contract.getRemarks());
                 contractPageVO.setAmounts(contract.getAmounts());
                 contractPageVO.setProjectId(contract.getProjectId());
+                contractPageVO.setStampDutyStatus(contract.getStampDutyStatus());
+                contractPageVO.setStampDutyTime(contract.getStampDutyTime());
+                contractPageVO.setProcurementWay(contract.getProcurementWay());
                 if (contract.getProjectId() != null) {
                     projectList.stream().filter(project -> project.getId().equals(contract.getProjectId())).findFirst().ifPresent(project -> contractPageVO.setProjectName(project.getProjectName()));
                 }
@@ -258,7 +262,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
      */
     @Override
     public HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status,
-                                      String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus) {
+                                      String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
@@ -268,7 +272,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
-        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<String> headList = new ArrayList<String>();
@@ -384,6 +388,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         if (StringUtils.isNotBlank(paymentListStr)){
             if (user.getCompanyId()==4215){
                 List<ContractPayCustomized> payCustomizedList = JSON.parseArray(paymentListStr, ContractPayCustomized.class);
+                // 2. 检查 billNumber 是否重复
+                Map<String, Long> billNumberCountMap = payCustomizedList.stream().filter(c->StringUtils.isNotEmpty(c.getBillNumber()))
+                        .collect(Collectors.groupingBy(ContractPayCustomized::getBillNumber, Collectors.counting()));
+                List<String> duplicateBillNumbers = billNumberCountMap.entrySet().stream()
+                        .filter(entry -> entry.getValue() > 1)
+                        .map(Map.Entry::getKey)
+                        .collect(Collectors.toList());
+                if (!duplicateBillNumbers.isEmpty()){
+                    httpRespMsg.setError("[" + contract.getNumber() + "]" + MessageUtils.message("凭证号重复"));
+                    return httpRespMsg;
+                }
                 BigDecimal bg = new BigDecimal("0");
                 for (ContractPayCustomized payCustomized:payCustomizedList) {
                     payCustomized.setContractId(contract.getId());
@@ -438,7 +453,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
-        boolean isAddPayRecord=false;
         if(functionContractList.size() <= 0){
             httpRespMsg.setError(MessageUtils.message("access.operationError"));
             return httpRespMsg;
@@ -472,7 +486,19 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             //更新回款计划
             if (StringUtils.isNotBlank(paymentListStr)){
                 if (user.getCompanyId()==4215){
+                    System.out.println("===>"+paymentListStr);
                     List<ContractPayCustomized> payCustomizedList = JSON.parseArray(paymentListStr, ContractPayCustomized.class);
+                    // 2. 检查 billNumber 是否重复
+                    Map<String, Long> billNumberCountMap = payCustomizedList.stream().filter(c->StringUtils.isNotEmpty(c.getBillNumber()))
+                            .collect(Collectors.groupingBy(ContractPayCustomized::getBillNumber, Collectors.counting()));
+                    List<String> duplicateBillNumbers = billNumberCountMap.entrySet().stream()
+                            .filter(entry -> entry.getValue() > 1)
+                            .map(Map.Entry::getKey)
+                            .collect(Collectors.toList());
+                    if (!duplicateBillNumbers.isEmpty()){
+                        httpRespMsg.setError("[" + contract.getNumber() + "]" + MessageUtils.message("凭证号重复"));
+                        return httpRespMsg;
+                    }
                     payCustomizedMapper.delete(new QueryWrapper<ContractPayCustomized>().eq("contract_id",contract.getId()));
                     BigDecimal bg = new BigDecimal("0");
                     for (ContractPayCustomized payCustomized:payCustomizedList) {
@@ -481,9 +507,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                         if (payCustomized.getIsPayed()) {
                             bg = bg.add(payCustomized.getPayedAmount());
                         }
-                        if (payCustomized.getReservedAmounts()==null){
-                            isAddPayRecord=true;
-                        }
                     }
                     contract.setPayment(bg);
                 }else {
@@ -529,10 +552,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             contractLogMapper.insert(contractLog);
             if (user.getCompanyId() == 4215) {
                 custom.setContractId(contract.getId());
-                ContractCustom customSelect = contractCustomMapper.selectOne(new QueryWrapper<ContractCustom>().eq("contract_id", contract.getId()));
-                if (!customSelect.getIsAmountFixed()&&customSelect.getStampDutyStatus()==2&&isAddPayRecord){
-                    custom.setStampDutyStatus(3);
-                }
                 contractCustomMapper.updateById(custom);
             }
             httpRespMsg.msg = MessageUtils.message("contract.editSuc");
@@ -1201,7 +1220,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     }
 
     @Override
-    public HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus) {
+    public HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
@@ -1211,7 +1230,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
-        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<String> headList = new ArrayList<String>();

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/PermissionServiceImpl.java

@@ -304,6 +304,9 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
             if(company.getId()!=3092&&fun.getName().equals("审核预估工时")){
                 resultFunList.remove(fun);
             }
+            if(company.getId()!=4215&&(fun.getName().equals("印花税管理")||fun.getName().equals("工作包令号工时统计表"))){
+                resultFunList.remove(fun);
+            }
         }
         for (SysModule module : moduleList) {
             if(timeType.getProjectCustom()==0){

+ 15 - 15
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -14155,52 +14155,52 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<String> typeNum1= typeCollect1.stream().map(ProjectMain::getWorkOrderNum).collect(Collectors.toList());
         List<String> typeNum2= typeCollect2.stream().map(ProjectMain::getWorkOrderNum).collect(Collectors.toList());
         LinkedHashMap<String, Object> totalMap = new LinkedHashMap<>();
-        totalMap.put("totalRow",projectMainList.size());//总列数
-        totalMap.put("mainFly",typeCollect0.size());
+//        totalMap.put("totalRow",projectMainList.size());//总列数
+//        totalMap.put("mainFly",typeCollect0.size());
         totalMap.put("mainFlyNumStrs",typeNum0);//主飞控包令号列表
-        totalMap.put("auto",typeCollect1.size());
+//        totalMap.put("auto",typeCollect1.size());
         totalMap.put("autoNumStrs",typeNum1);//自动
-        totalMap.put("high",typeCollect2.size());
+//        totalMap.put("high",typeCollect2.size());
         totalMap.put("highNumStrs",typeNum2);//高升力包令号列表
 
         List<WorkOrderNumVo> list= projectMapper.getWorkOrderNumStatistics(null,null,startDate,endDate);
         Map<String, List<WorkOrderNumVo>> userCollect = list.stream().collect(Collectors.groupingBy(WorkOrderNumVo::getUserId));
         Set<Map.Entry<String, List<WorkOrderNumVo>>> entries = userCollect.entrySet();
 
-        ArrayList<ArrayList<String>> dataList = new ArrayList<>();
+        ArrayList<HashMap<String,String>> dataList = new ArrayList<>();
         for (Map.Entry<String, List<WorkOrderNumVo>> entry : entries) {
             List<WorkOrderNumVo> voList = entry.getValue();
             double total = voList.stream()
                     .mapToDouble(v -> v.getSumWorkTime())  // 转为 DoubleStream
                     .reduce(0.0, Double::sum);
-            ArrayList<String> numString = new ArrayList<>();
-            numString.add(voList.get(0).getRoleName());
-            numString.add(voList.get(0).getUserName());
+            HashMap<String,String> numString = new HashMap<>();
+            numString.put("roleName",voList.get(0).getRoleName());
+            numString.put("name",voList.get(0).getUserName());
             for (String s : typeNum0) {
                 Optional<WorkOrderNumVo> first = voList.stream().filter(v -> v.getWorkOrderNum().equals(s)).findFirst();
                 if (first.isPresent()){
-                    numString.add(first.get().getSumWorkTime().toString());
+                    numString.put(s,first.get().getSumWorkTime().toString());
                 }else {
-                    numString.add("");
+                    numString.put(s,"");
                 }
             }
             for (String s : typeNum1) {
                 Optional<WorkOrderNumVo> first = voList.stream().filter(v -> v.getWorkOrderNum().equals(s)).findFirst();
                 if (first.isPresent()){
-                    numString.add(first.get().getSumWorkTime().toString());
+                    numString.put(s,first.get().getSumWorkTime().toString());
                 }else {
-                    numString.add("");
+                    numString.put(s,"");
                 }
             }
             for (String s : typeNum2) {
                 Optional<WorkOrderNumVo> first = voList.stream().filter(v -> v.getWorkOrderNum().equals(s)).findFirst();
                 if (first.isPresent()){
-                    numString.add(first.get().getSumWorkTime().toString());
+                    numString.put(s,first.get().getSumWorkTime().toString());
                 }else {
-                    numString.add("");
+                    numString.put(s,"");
                 }
             }
-            numString.add(total+"");//合计
+            numString.put("sumTime",total+"");//合计
             dataList.add(numString);
         }
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractMapper.xml

@@ -30,7 +30,7 @@
         select contract.id,contract.company_id,contract.creator_id,contract.number,contract.name,contract.amounts,contract.type_id,contract_type.type_name,contract.status,contract.indate,contract.remarks,
         contract.start_date as startDate,contract.end_date as endDate,contract_type_sec.sec_type_name,contract.sec_type_id,
         user.name as creatorName,user.corpwx_userid as creatorWxCorpId, contract.project_id, contract.payment, cp.pay_date AS next_payment_date, cp.amount AS next_payment_amount,
-        cc.stamp_duty_status stampDutyStatus,cc.stamp_duty_time stampDutyTime
+        cc.stamp_duty_status stampDutyStatus,cc.stamp_duty_time stampDutyTime,contract.procurement_way procurementWay
         from contract
         left join contract_type
         on contract.type_id = contract_type.id