Browse Source

修改导出,导入

yusm 1 week ago
parent
commit
1ebe1f515e

+ 101 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -833,7 +833,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 boolean TypeExists = false;
                 for (int i = 0; i < 30; i++) {
                     if (row.getCell(i) != null) {
-                        if (i == 12 || i == 13 || i == 14 || i == 15) {
+                        if (i == 12 || i == 13 || i == 14 || i == 15||i==26) {
                             //日期类型的
                             row.getCell(i).setCellType(CellType.NUMERIC);
                         } else {
@@ -930,6 +930,48 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 String remarks = row.getCell(22)==null?null:row.getCell(22).getStringCellValue();
                 customItem.setStampDutyItems(row.getCell(23)==null?null:row.getCell(23).getStringCellValue());
                 Contract item = new Contract();
+                //采购方式
+                if (row.getCell(24)==null){
+                    item.setProcurementWay(null);
+                }else if (row.getCell(24).getStringCellValue().equals("公开招标")){
+                    item.setProcurementWay(0);
+                }else if (row.getCell(24).getStringCellValue().equals("邀请招标")){
+                    item.setProcurementWay(1);
+                }else if (row.getCell(24).getStringCellValue().equals("询比价")){
+                    item.setProcurementWay(2);
+                }else if (row.getCell(24).getStringCellValue().equals("竞争性谈判")){
+                    item.setProcurementWay(3);
+                }else if (row.getCell(24).getStringCellValue().equals("单一来源")){
+                    item.setProcurementWay(4);
+                }
+                //印花税缴纳状态
+                if (row.getCell(25)==null){
+                    customItem.setStampDutyStatus(null);
+                }else if (row.getCell(25).getStringCellValue().equals("无需缴纳")){
+                    customItem.setStampDutyStatus(0);
+                }else if (row.getCell(25).getStringCellValue().equals("未缴纳")){
+                    customItem.setStampDutyStatus(1);
+                }else if (row.getCell(25).getStringCellValue().equals("已缴纳")){
+                    customItem.setStampDutyStatus(2);
+                }else if (row.getCell(25).getStringCellValue().equals("部分缴纳")){
+                    customItem.setStampDutyStatus(3);
+                }
+                if(customItem.getStampDutyStatus()!=null&&customItem.getStampDutyStatus()<2&&row.getCell(26)!=null){
+                    msg.setError("印花税缴纳状态为无需缴纳或未缴纳状态无需设置印花税缴纳时间");
+                    return msg;
+                }
+                //印花税缴纳时间
+                if (row.getCell(26)==null){
+                    customItem.setStampDutyTime(null);
+                }else if (row.getCell(26).getCellTypeEnum().equals(CellType.NUMERIC)){
+                    //日期类型的
+                    Date cellValue = row.getCell(26).getDateCellValue();
+                    LocalDate localDate = cellValue.toInstant()  // 转换为Instant
+                            .atZone(ZoneId.systemDefault())  // 转换为ZonedDateTime
+                            .toLocalDate();  // 转换为LocalDate
+                    customItem.setStampDutyTime(localDate);
+                }
+
                 //检查合同编号是否存在
                 if (StringUtils.isNotBlank(No)){
                     for (Contract contract : contractList) {
@@ -1272,12 +1314,14 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             headList.add("合同状态(是否结清)");
             headList.add("备注");
             headList.add("印花税税目");
-
+            headList.add("采购方式");
+            headList.add("印花税缴纳状态");
 //            headList.add("付款日期");
             headList.add("已付款金额(元)");
             headList.add("付款类型");
             headList.add("凭证号");
             headList.add("待付款金额(元)");
+            headList.add("印花税缴纳时间");
             allList.add(headList);
 
             List<Integer> contractIds = data.stream().map(Contract::getId).filter(Objects::nonNull).collect(Collectors.toList());
@@ -1360,6 +1404,32 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                             }
 
 //                            item.add(payCustomizedList.get(j).getPayDate()==null?"":payCustomizedList.get(j).getPayDate());
+                            //采购方式:0公开招标、1邀请招标、2询比价、3竞争性谈判、4单一来源
+                            if (contract.getProcurementWay()==null){
+                                item.add("");
+                            }else if (contract.getProcurementWay()==0){
+                                item.add("公开招标");
+                            }else if (contract.getProcurementWay()==1){
+                                item.add("邀请招标");
+                            }else if (contract.getProcurementWay()==2){
+                                item.add("询比价");
+                            }else if (contract.getProcurementWay()==3){
+                                item.add("竞争性谈判");
+                            }else if (contract.getProcurementWay()==4){
+                                item.add("单一来源");
+                            }
+                            //印花税缴纳状态 0无需缴纳、1未缴纳、2已缴纳、3部分缴纳
+                            if (contract.getStampDutyStatus()==null){
+                                item.add("");
+                            }else if (contract.getStampDutyStatus()==0){
+                                item.add("无需缴纳");
+                            }else if (contract.getStampDutyStatus()==1){
+                                item.add("未缴纳");
+                            }else if (contract.getStampDutyStatus()==2){
+                                item.add("已缴纳");
+                            }else if (contract.getStampDutyStatus()==3){
+                                item.add("部分缴纳");
+                            }
                             item.add(payCustomizedList.get(j).getPayedAmount()==null?"":payCustomizedList.get(j).getPayedAmount()+"");
                             if (payCustomizedList.get(j).getPayType().booleanValue()){
                                 item.add("预付");
@@ -1368,11 +1438,12 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                             }
                             item.add(payCustomizedList.get(j).getBillNumber()==null?"":payCustomizedList.get(j).getBillNumber());
                             item.add(payCustomizedList.get(j).getPendingAmounts()==null?"":payCustomizedList.get(j).getPendingAmounts()+"");
+                            item.add(payCustomizedList.get(j).getStampDutyTime()==null?"":payCustomizedList.get(j).getStampDutyTime()+"");
                             allList.add(item);
                         }
                         else {
                             ArrayList<String> item = new ArrayList<>();
-                            for (int i1 = 0; i1 < 24; i1++) {
+                            for (int i1 = 0; i1 < 26; i1++) {
                                 item.add("" );
                             }
 
@@ -1385,6 +1456,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                             }
                             item.add(payCustomizedList.get(j).getBillNumber()==null?"":payCustomizedList.get(j).getBillNumber());
                             item.add(payCustomizedList.get(j).getPendingAmounts()==null?"":payCustomizedList.get(j).getPendingAmounts()+"");
+                            item.add(payCustomizedList.get(j).getStampDutyTime()==null?"":payCustomizedList.get(j).getStampDutyTime()+"");
                             allList.add(item);
                         }
                     }
@@ -1456,6 +1528,32 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                     }else {
                         item.add("");
                     }
+                    //采购方式:0公开招标、1邀请招标、2询比价、3竞争性谈判、4单一来源
+                    if (contract.getProcurementWay()==null){
+                        item.add("");
+                    }else if (contract.getProcurementWay()==0){
+                        item.add("公开招标");
+                    }else if (contract.getProcurementWay()==1){
+                        item.add("邀请招标");
+                    }else if (contract.getProcurementWay()==2){
+                        item.add("询比价");
+                    }else if (contract.getProcurementWay()==3){
+                        item.add("竞争性谈判");
+                    }else if (contract.getProcurementWay()==4){
+                        item.add("单一来源");
+                    }
+                    //印花税缴纳状态 0无需缴纳、1未缴纳、2已缴纳、3部分缴纳
+                    if (contract.getStampDutyStatus()==null){
+                        item.add("");
+                    }else if (contract.getStampDutyStatus()==0){
+                        item.add("无需缴纳");
+                    }else if (contract.getStampDutyStatus()==1){
+                        item.add("未缴纳");
+                    }else if (contract.getStampDutyStatus()==2){
+                        item.add("已缴纳");
+                    }else if (contract.getStampDutyStatus()==3){
+                        item.add("部分缴纳");
+                    }
 
                     item.add("");
                     item.add("");

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -277,7 +277,8 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
-        }else if(dingding != null && dingding.getContactNeedTranslate() == 1){
+        }
+        else if(dingding != null && dingding.getContactNeedTranslate() == 1){
             User user = userMapper.selectById(request.getHeader("token"));
             String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
             String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
@@ -402,7 +403,8 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
-        }else if(dingding != null && dingding.getContactNeedTranslate() == 1){
+        }
+        else if(dingding != null && dingding.getContactNeedTranslate() == 1){
             User user = userMapper.selectById(request.getHeader("token"));
             String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
             String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);

+ 24 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectMainServiceImpl.java

@@ -14,6 +14,7 @@ import com.management.platform.service.ProjectMainService;
 import com.management.platform.service.ProjectService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -67,6 +68,17 @@ public class ProjectMainServiceImpl extends ServiceImpl<ProjectMainMapper, Proje
                 httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
+            if (companyId==4215){
+                if (projectMain.getWorkOrderNumType()!=null&& StringUtils.isNotEmpty(projectMain.getWorkOrderNum())){
+                    Integer count2 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
+                            .eq("work_order_num", projectMain.getWorkOrderNum()).eq("work_order_num_type", projectMain.getWorkOrderNumType())
+                            .ne("id", projectMain.getId()));
+                    if(count2>0){
+                        httpRespMsg.setError(MessageUtils.message("other.AlreadyExistsPackage"));
+                        return httpRespMsg;
+                    }
+                }
+            }
             boolean nameChanged = !oldProject.getName().equals(projectMain.getName());
             boolean categoryChanged = !oldProject.getCategoryId().equals(projectMain.getCategoryId());
             projectMainMapper.updateById(projectMain);
@@ -82,7 +94,8 @@ public class ProjectMainServiceImpl extends ServiceImpl<ProjectMainMapper, Proje
             if (nameChanged || categoryChanged) {
                 projectService.update(updateP, new QueryWrapper<Project>().eq("project_main_id", projectMain.getId()));
             }
-        }else {
+        }
+        else {
             Integer count2 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
                     .eq("code", projectMain.getCode()));
             Integer count3 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
@@ -97,6 +110,16 @@ public class ProjectMainServiceImpl extends ServiceImpl<ProjectMainMapper, Proje
                 httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
+            if (companyId==4215){
+                if (projectMain.getWorkOrderNumType()!=null&& StringUtils.isNotEmpty(projectMain.getWorkOrderNum())){
+                    Integer count4 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
+                            .eq("work_order_num", projectMain.getWorkOrderNum()).eq("work_order_num_type", projectMain.getWorkOrderNumType()));
+                    if(count4>0){
+                        httpRespMsg.setError(MessageUtils.message("other.AlreadyExistsPackage"));
+                        return httpRespMsg;
+                    }
+                }
+            }
             projectMainMapper.insert(projectMain);
         }
         return httpRespMsg;

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

@@ -14297,7 +14297,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             dataList.add(numString);
         }
         totalMap.put("dataList", dataList);
-        return excelExportService.exportShanghaiHangKongList(wxCorpInfo,dingding,"工作包令号_主项目个人工时统计表",totalMap,path);
+        try {
+            return excelExportService.exportShanghaiHangKongList(wxCorpInfo,dingding,"工作包令号_主项目个人工时统计表",totalMap,path);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return new HttpRespMsg();
     }
 
     //导出FTE报表数据

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -64,6 +64,7 @@ other.billNoExist=票据编号已存在
 other.infoEmpty=未检查到相关信息
 other.recordNoExist=该记录不存在
 other.NumAlreadyExists=编号已存在
+other.AlreadyExistsPackage =该包令号类型下已存在相同的包令号
 other.operationFail=操作失败
 other.tokenError=token错误
 other.tokenOverdue=token过期失效

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -64,6 +64,7 @@ other.billNoExist=Bill No. already exists.
 other.infoEmpty=No relevant information is checked.
 other.recordNoExist=The record does not exist.
 other.NumAlreadyExists=Number already exists.
+other.AlreadyExistsPackage=Already exists package.
 other.operationFail=operation failed
 other.tokenError=Token error
 other.tokenOverdue=Token expires

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

@@ -3034,7 +3034,7 @@
                  LEFT JOIN project p on r.project_id=p.id
                  LEFT JOIN project_main pm on p.project_main_id=pm.id
         where u.role_id in (25750,53996)
-          and u.company_id=4215 and u.is_active=1
+          and u.company_id=4215 and u.is_active=1 and r.state=1
           and pm.work_order_num_type is not null
         <if test="startDate!=null and startDate !='' and endDate!=null and endDate !='' ">
             and r.create_date BETWEEN #{startDate} and #{endDate}