Explorar el Código

财务核算针对赛元微电子增加核销月薪中的奖金功能

QuYueTing hace 2 días
padre
commit
2e30d466b7
Se han modificado 27 ficheros con 477 adiciones y 425 borrados
  1. 1 0
      fhKeeper/formulahousekeeper/ArticleOperation/build_package.bat
  2. 1 1
      fhKeeper/formulahousekeeper/attendance-data/src/main/resources/application.yml
  3. 1 1
      fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/controller/DataCollectController.java
  4. 4 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinanceImportController.java
  5. 31 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  6. 7 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/FinanceImport.java
  7. 27 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/ProduceTime.java
  8. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/FinanceImportService.java
  9. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java
  10. 7 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DeviceLogServiceImpl.java
  11. 223 136
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceImportServiceImpl.java
  12. 3 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  13. 149 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  14. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FinanceImportMapper.xml
  15. 4 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/financeComponents/salaryDetails.vue
  16. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/application.properties
  17. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/customerNew.html
  18. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/dynamic.html
  19. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeField copy.html
  20. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeField.html
  21. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/moduleView/header.html
  22. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/customerNew.html
  23. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/dynamic.html
  24. 0 266
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/homemovement.html
  25. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeField copy.html
  26. 1 1
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeField.html
  27. 2 2
      fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/moduleView/header.html

+ 1 - 0
fhKeeper/formulahousekeeper/ArticleOperation/build_package.bat

@@ -0,0 +1 @@
+mvn package

+ 1 - 1
fhKeeper/formulahousekeeper/attendance-data/src/main/resources/application.yml

@@ -15,7 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
-    url: jdbc:sqlserver://172.10.31.161:1433;database=ecology;encrypt=false
+    url: jdbc:sqlserver://172.10.10.200:1433;database=ecology;encrypt=false
     username: sa
     password: cdsc@703
 

+ 1 - 1
fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/controller/DataCollectController.java

@@ -74,7 +74,7 @@ public class DataCollectController {
     public List<TisTimeVO> checkCisData(@RequestBody List<TisTimeVO> toSendList) {
         if(!CollectionUtils.isEmpty(toSendList)){
             for (TisTimeVO tisTimeVO : toSendList) {
-                String sqlQuery = "select max(iRealCOID) from ca_batchmap where cMOCode = ? and iMOSubSN = ? ";
+                String sqlQuery = "select max(iRealCOID) as iRealCOID from ca_batchmap where cMOCode = ? and iMOSubSN = ? ";
                 try (Connection connection = sqlServerDataSource.getConnection()) {
                     PreparedStatement queryStmt = connection.prepareStatement(sqlQuery);
                     queryStmt.setString(1, tisTimeVO.getOrderId());

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

@@ -10,6 +10,7 @@ import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -35,9 +36,9 @@ public class FinanceImportController {
 
     @RequestMapping("submitImport")
     public HttpRespMsg submitImport(Integer companyId, String yearMonth,
-                                  Boolean syncUserCost, Boolean syncHistoryReport,
-                                  MultipartFile file, HttpServletRequest request) {
-        return financeImportService.submitImport(companyId, yearMonth, syncUserCost, syncHistoryReport, file, request);
+                                    Boolean syncUserCost, Boolean syncHistoryReport,
+                                    MultipartFile file, @RequestParam(required = false, defaultValue = "false" ) Boolean isVerification, HttpServletRequest request) {
+        return financeImportService.submitImport(companyId, yearMonth, syncUserCost, syncHistoryReport, file, isVerification, request);
     }
 
     @RequestMapping("list")

+ 31 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1338,6 +1338,7 @@ public class ReportController {
             }
         }
 
+
         //如果开启了项目人天
         String warningPercentProjects = "";
         String warningLackProjects = "";
@@ -1617,6 +1618,16 @@ public class ReportController {
 
             }
         }
+        //校验,分组是否属于该项目下
+        for (Report report : reportList) {
+            TaskGroup tgp = taskGroupService.getById(report.getGroupId());
+            if (tgp != null && !tgp.getProjectId().equals(report.getProjectId())) {
+                HttpRespMsg httpRespMsg = new HttpRespMsg();
+                httpRespMsg.setError("所选分组不属于当前项目,请刷新重新填报");
+                return httpRespMsg;
+            }
+        }
+
         //针对泓浒(苏州),需要按照工单号的部门来设置工时所属部门,同时设置是否是协作工时
         if (Constant.HONG_HU_COMPANY_ID == company.getId()) {
             for (Report report : reportList) {
@@ -1640,6 +1651,16 @@ public class ReportController {
                     httpRespMsg.setError("选择了工单号["+report.getExtraField4()+"],对应的行号必填");
                     return httpRespMsg;
                 }
+                if (!StringUtils.isEmpty(report.getExtraField4())) {
+                    //校验工单号是否为当前项目相关的工单号
+                    Project curProject = projectList.stream().filter(p -> p.getId().intValue() == report.getProjectId()).findFirst().get();
+                    int count = erpOrderInfoMapper.selectCount(new QueryWrapper<ErpOrderInfo>().eq("order_id", report.getExtraField4()).eq("project_id", curProject.getProjectCode()));
+                    if (count == 0) {
+                        HttpRespMsg httpRespMsg = new HttpRespMsg();
+                        httpRespMsg.setError("所选工单号不属于当前项目,请刷新重新填报");
+                        return httpRespMsg;
+                    }
+                }
             }
 
             List<String> collect = reportList.stream().filter(r -> !StringUtils.isEmpty(r.getExtraField4())).map(Report::getExtraField4).collect(Collectors.toList());
@@ -3316,7 +3337,17 @@ public class ReportController {
         return reportService.exportReportRateOfTask(projectId,userIds,user.getCompanyId(),type);
     }
 
+    @RequestMapping("/getProduceTimeReport")
+    public HttpRespMsg getProduceTimeReport(Integer projectId, String startDate,String endDate) {
+        User user = userMapper.selectById(request.getHeader("TOKEN"));
+        return reportService.getProduceTimeReport(user.getCompanyId(), projectId,startDate,endDate);
+    }
 
+    @RequestMapping("/exportProduceTimeReport")
+    public HttpRespMsg exportProduceTimeReport(Integer projectId, String startDate,String endDate) {
+        User user = userMapper.selectById(request.getHeader("TOKEN"));
+        return reportService.exportProduceTimeReport(user.getCompanyId(), projectId,startDate,endDate);
+    }
 
 }
 

+ 7 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/FinanceImport.java

@@ -1,6 +1,5 @@
 package com.management.platform.entity;
 
-import com.alibaba.fastjson.annotation.JSONField;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -19,7 +18,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2022-03-22
+ * @since 2025-07-09
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -95,6 +94,12 @@ public class FinanceImport extends Model<FinanceImport> {
     @TableField("reject_reason")
     private String rejectReason;
 
+    /**
+     * 是否为核销奖金
+     */
+    @TableField("is_verification")
+    private Boolean isVerification;
+
 
     @Override
     protected Serializable pkVal() {

+ 27 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/ProduceTime.java

@@ -0,0 +1,27 @@
+package com.management.platform.entity.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class ProduceTime {
+    private Integer projectId;
+    private String projectCode;
+    private String projectName;
+    private String userId;
+    private String userName;
+    private String departmentName;
+    private double totalTime;
+    private double produceTime;
+    private BigDecimal produceCost;
+    //工单部门
+    private String worksheetDeptName;
+    private double manufactureTime;
+    private BigDecimal manufactureCost;
+    private double rdTime;
+    private BigDecimal rdCost;
+    private double salesTime;
+    private BigDecimal salesCost;
+    private double projectTime;
+}

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/FinanceImportService.java

@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
  */
 public interface FinanceImportService extends IService<FinanceImport> {
 
-    HttpRespMsg submitImport(Integer companyId, String yearMonth, Boolean syncUserCost, Boolean syncHistoryReport, MultipartFile file, HttpServletRequest request);
+    HttpRespMsg submitImport(Integer companyId, String yearMonth, Boolean syncUserCost, Boolean syncHistoryReport, MultipartFile file, Boolean isVerification, HttpServletRequest request);
 
     HttpRespMsg list(Integer companyId, HttpServletRequest request);
 

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -183,4 +183,8 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg getReportRateOfTaskNew(Integer projectId, String userId, Integer companyId, Integer type);
 
     HttpRespMsg exportReportRateOfTask(Integer projectId, String userIds, Integer companyId, Integer type);
+
+    HttpRespMsg getProduceTimeReport(Integer companyId, Integer projectId, String startDate, String endDate);
+
+    HttpRespMsg exportProduceTimeReport(Integer companyId, Integer projectId, String startDate, String endDate);
 }

+ 7 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DeviceLogServiceImpl.java

@@ -102,6 +102,13 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
                 httpRespMsg.setError("该设备当前被占用,请换其他设备扫码");
                 return httpRespMsg;
             }
+            //检查开始时间是否已经在已有记录中存在
+            List<DeviceLog> deviceLogs = deviceLogMapper.selectList(new QueryWrapper<DeviceLog>().eq("device_id", selectedDevice.getId()).le("start_time", device.getStartTime()).ge("end_time", device.getStartTime()));
+            if (!deviceLogs.isEmpty()){
+                DeviceLog deviceLog = deviceLogs.get(0);
+                httpRespMsg.setError("已存在使用记录["+deviceLog.getStartTime()+"-"+deviceLog.getEndTime()+"],请换其他时间段扫码");
+                return httpRespMsg;
+            }
             DeviceLog deviceLog = new DeviceLog();
             deviceLog.setStartTime(device.getStartTime());
             deviceLog.setCreateDate(LocalDate.now());

+ 223 - 136
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceImportServiceImpl.java

@@ -62,19 +62,26 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
     private UserService userService;
     @Resource
     private ReportService reportService;
+    @Resource
+    private FinanceFixedcolnameMapper financeFixedcolnameMapper;
 
 
     @Override
     @Transactional
-    public HttpRespMsg submitImport(Integer companyId, String yearMonth, Boolean syncUserCost, Boolean syncHistoryReport, MultipartFile multipartFile, HttpServletRequest request) {
+    public HttpRespMsg submitImport(Integer companyId, String yearMonth, Boolean syncUserCost, Boolean syncHistoryReport,
+                                    MultipartFile multipartFile, Boolean isVerification,HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("TOKEN"));
         //检查当月是否已经存在审核通过的
-        FinanceImport oldItem = financeImportMapper.selectOne(new QueryWrapper<FinanceImport>().eq("company_id", companyId).eq("ymonth", yearMonth).orderByDesc("indate").last("limit 1"));
+        FinanceImport oldItem = financeImportMapper.selectOne(new QueryWrapper<FinanceImport>().eq("company_id", companyId).eq("ymonth", yearMonth).eq("is_verification", isVerification).orderByDesc("indate").last("limit 1"));
         if (oldItem != null) {
             if (oldItem.getState() == 1) {
                 //msg.setError(yearMonth+"月薪资已审核通过,无法上传。");
-                msg.setError(MessageUtils.message("salary.uploadErrorByAdopt"));
+                if (oldItem.getIsVerification()) {
+                    msg.setError(yearMonth + "核销数据已审核通过,无法上传。");
+                } else {
+                    msg.setError(yearMonth + MessageUtils.message("salary.uploadErrorByAdopt"));
+                }
                 return msg;
             } else {
                 if (oldItem.getState() == 0) {
@@ -159,7 +166,7 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
             }
 
             //如果有必要,更新该月份的日报相关的成本
-            if (syncHistoryReport) {
+            if (syncHistoryReport && !isVerification) {
                 List<Report> reportList = reportMapper.selectSimpleTime(companyId, startStr, endStr);
                 if (reportList.size() > 0) {
                     for (Report r : reportList) {
@@ -226,6 +233,7 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
             log.setYmonth(yearMonth);
             log.setRecoverMonthcost(syncUserCost?1:0);
             log.setRecoverReport(syncHistoryReport?1:0);
+            log.setIsVerification(isVerification);
             financeImportMapper.insert(log);
         } catch (IOException e) {
             e.printStackTrace();
@@ -289,14 +297,7 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                 List<Finance> financeList = new ArrayList<Finance>();
                 List<Finance> oldFinanceList = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
                 //获取月成本列表
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String dateStr = yearMonth+"-01 00:00:00";
-                LocalDateTime startDate = LocalDateTime.parse(dateStr,df);
-                LocalDateTime endDate = LocalDateTime.parse(dateStr,df);
-                endDate = endDate.plusMonths(1);
-
                 TimeType timeType = timeTypeMapper.selectById(companyId);
-                BigDecimal monthHours = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
 
                 //需要更新成本的人员数据
                 List<User> updateUserList = new ArrayList<>();
@@ -308,9 +309,16 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                 if (financeImport.getRecoverMonthcost()==1 || financeImport.getRecoverReport()==1) {
                     userTimeList = reportMapper.getUserWorkingTimeByRange(companyId, startStr, endStr);
                 }
-
+//                List<FinanceFixedcolname> fixedcolnameList = financeFixedcolnameMapper.selectList(new QueryWrapper<FinanceFixedcolname>().eq("company_id", companyId));
                 List<FinanceTblcuscol> cusColList = financeTblcuscolMapper.selectList(new QueryWrapper<FinanceTblcuscol>().eq("company_id", companyId));
                 FinanceFixedcolname financeConfig = financeFixedcolnameService.getFixed(companyId);
+                int verCusColIndex = 0;
+                for (int i = 0; i < cusColList.size(); i++) {
+                    if ("奖金核销".equals(cusColList.get(i).getFieldName())) {
+                        verCusColIndex = i ;
+                        break;
+                    }
+                }
                 if (cusColList.size() > 0) {
                     financeConfig.setField1(cusColList.get(0).getFieldName());
                     financeConfig.setField1Calculate(cusColList.get(0).getNeedCalculate());
@@ -353,6 +361,7 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                     if ((name.equals("姓名") || name.equals("name")) && rowIndex == 0) {
                         continue;
                     }
+
                     Cell houseFundCell = row.getCell(8);
                     Cell field1 = cusColList.size() > 0?row.getCell(9):null;
                     Cell field2 = cusColList.size() > 1?row.getCell(10):null;
@@ -389,109 +398,174 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                         Optional<Finance> matchItem = oldFinanceList.stream().filter(o -> o.getName().equals(finance.getName())).findFirst();
                         if (matchItem.isPresent()) {
                             finance.setId(matchItem.get().getId());
+                            finance.setTotalCost(matchItem.get().getTotalCost());
+                        } else {
+                            throw new Exception("当前月份该员工:"+name+"尚无月薪记录,无法核销");
                         }
+                        if (oldItem.getIsVerification()) {
+                            finance.setMonthCost(null);
+                            BigDecimal value = null;
+                            BigDecimal oldValue = null;
+                            //奖金核销导入,只更新核销部分
+                            if (verCusColIndex == 0 && field1 != null) {
+                                field1.setCellType(CellType.STRING);
+                                String item = field1.getStringCellValue();
+                                value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField1(value);
+                                oldValue = matchItem.get().getCustomField1();
+                            }
+                            else if (verCusColIndex == 1 && field2 != null) {
+                                field2.setCellType(CellType.STRING);
+                                String item = field2.getStringCellValue();
+                                value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField2(value);
+                                oldValue = matchItem.get().getCustomField2();
+                            }
+                            else if (verCusColIndex == 2 && field3 != null) {
+                                field3.setCellType(CellType.STRING);
+                                String item = field3.getStringCellValue();
+                                value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField3(value);
+                                oldValue = matchItem.get().getCustomField3();
+                            }
+                            else if (verCusColIndex == 3 && field4 != null) {
+                                field4.setCellType(CellType.STRING);
+                                String item = field4.getStringCellValue();
+                                value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField4(value);
+                                oldValue = matchItem.get().getCustomField4();
+                            }
+                            else if (verCusColIndex == 4 && field5 != null) {
+                                field5.setCellType(CellType.STRING);
+                                String item = field5.getStringCellValue();
+                                value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField5(value);
+                                oldValue = matchItem.get().getCustomField5();
+                            }
+                            else if (verCusColIndex == 5 && field6 != null) {
+                                field6.setCellType(CellType.STRING);
+                                String item = field6.getStringCellValue();
+                                value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField6(value);
+                                oldValue = matchItem.get().getCustomField6();
+                            }
+                            else if (verCusColIndex == 6 && field7 != null) {
+                                field7.setCellType(CellType.STRING);
+                                String item = field7.getStringCellValue();
+                                value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField7(value);
+                                oldValue = matchItem.get().getCustomField7();
+                            }
+                            //更新total,扣除掉奖金(先回退掉之前扣除的)
+                            BigDecimal bg = finance.getTotalCost();
+                            if (oldValue != null) {
+                                bg = bg.subtract(oldValue);
+                            }
+                            finance.setTotalCost(bg.add(value));
+                            total = finance.getTotalCost();
+                        } else {
+                            //常规月薪导入
+                            if (bonusCell != null) {
+                                bonusCell.setCellType(CellType.STRING);
+                                String bonusString = bonusCell.getStringCellValue();
+                                BigDecimal bonus = !StringUtil.isEmpty(bonusString) ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setBonus(bonus);
+                                if (financeConfig.getBonusCalculate()==1) total = total.add(bonus);
+                            }
+                            if (allowanceCell != null) {
+                                allowanceCell.setCellType(CellType.STRING);
+                                String item = allowanceCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setAllowance(value);
+                                if (financeConfig.getAllowanceCalculate()==1) total = total.add(value);
+                            }
+                            if (inJobCell != null) {
+                                inJobCell.setCellType(CellType.STRING);
+                                String item = inJobCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setInsuranceLosejob(value);
+                                if (financeConfig.getInsuranceLosejobCalculate()==1) total = total.add(value);
+                            }
+                            if (inMedicalCell != null) {
+                                inMedicalCell.setCellType(CellType.STRING);
+                                String item = inMedicalCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setInsuranceMedical(value);
+                                if (financeConfig.getInsuranceMedicalCalculate()==1) total = total.add(value);
+                            }
+                            if (inOldCell != null) {
+                                inOldCell.setCellType(CellType.STRING);
+                                String item = inOldCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setInsuranceOld(value);
+                                if (financeConfig.getInsuranceOldCalculate()==1) total = total.add(value);
+                            }
+                            if (injuryCell != null) {
+                                injuryCell.setCellType(CellType.STRING);
+                                String item = injuryCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setInsuranceInjury(value);
+                                if (financeConfig.getInsuranceInjuryCalculate()==1) total = total.add(value);
+                            }
+                            if (houseFundCell != null) {
+                                houseFundCell.setCellType(CellType.STRING);
+                                String item = houseFundCell.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setHouseFund(value);
+                                if (financeConfig.getHouseFundCalculate()==1) total = total.add(value);
+                            }
 
-                        if (bonusCell != null) {
-                            bonusCell.setCellType(CellType.STRING);
-                            String bonusString = bonusCell.getStringCellValue();
-                            BigDecimal bonus = !StringUtil.isEmpty(bonusString) ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setBonus(bonus);
-                            if (financeConfig.getBonusCalculate()==1) total = total.add(bonus);
-                        }
-                        if (allowanceCell != null) {
-                            allowanceCell.setCellType(CellType.STRING);
-                            String item = allowanceCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setAllowance(value);
-                            if (financeConfig.getAllowanceCalculate()==1) total = total.add(value);
-                        }
-                        if (inJobCell != null) {
-                            inJobCell.setCellType(CellType.STRING);
-                            String item = inJobCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setInsuranceLosejob(value);
-                            if (financeConfig.getInsuranceLosejobCalculate()==1) total = total.add(value);
-                        }
-                        if (inMedicalCell != null) {
-                            inMedicalCell.setCellType(CellType.STRING);
-                            String item = inMedicalCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setInsuranceMedical(value);
-                            if (financeConfig.getInsuranceMedicalCalculate()==1) total = total.add(value);
-                        }
-                        if (inOldCell != null) {
-                            inOldCell.setCellType(CellType.STRING);
-                            String item = inOldCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setInsuranceOld(value);
-                            if (financeConfig.getInsuranceOldCalculate()==1) total = total.add(value);
-                        }
-                        if (injuryCell != null) {
-                            injuryCell.setCellType(CellType.STRING);
-                            String item = injuryCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setInsuranceInjury(value);
-                            if (financeConfig.getInsuranceInjuryCalculate()==1) total = total.add(value);
-                        }
-                        if (houseFundCell != null) {
-                            houseFundCell.setCellType(CellType.STRING);
-                            String item = houseFundCell.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setHouseFund(value);
-                            if (financeConfig.getHouseFundCalculate()==1) total = total.add(value);
-                        }
-
-                        if (field1 != null) {
-                            field1.setCellType(CellType.STRING);
-                            String item = field1.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField1(value);
-                            if (financeConfig.getField1Calculate() != null && financeConfig.getField1Calculate()==1) total = total.add(value);
-                        }
-                        if (field2 != null) {
-                            field2.setCellType(CellType.STRING);
-                            String item = field2.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField2(value);
-                            if (financeConfig.getField2Calculate() != null && financeConfig.getField2Calculate()==1) total = total.add(value);
-                        }
-                        if (field3 != null) {
-                            field3.setCellType(CellType.STRING);
-                            String item = field3.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField3(value);
-                            if (financeConfig.getField3Calculate() != null && financeConfig.getField3Calculate()==1) total = total.add(value);
-                        }
-                        if (field4 != null) {
-                            field4.setCellType(CellType.STRING);
-                            String item = field4.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField4(value);
-                            if (financeConfig.getField4Calculate() != null && financeConfig.getField4Calculate()==1) total = total.add(value);
-                        }
-                        if (field5 != null) {
-                            field5.setCellType(CellType.STRING);
-                            String item = field5.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField5(value);
-                            if (financeConfig.getField5Calculate() != null && financeConfig.getField5Calculate()==1) total = total.add(value);
-                        }
-                        if (field6 != null) {
-                            field6.setCellType(CellType.STRING);
-                            String item = field6.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField6(value);
-                            if (financeConfig.getField6Calculate() != null && financeConfig.getField6Calculate()==1) total = total.add(value);
-                        }
-                        if (field7 != null) {
-                            field7.setCellType(CellType.STRING);
-                            String item = field7.getStringCellValue();
-                            BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                            finance.setCustomField7(value);
-                            if (financeConfig.getField7Calculate() != null && financeConfig.getField7Calculate()==1) total = total.add(value);
+                            if (field1 != null) {
+                                field1.setCellType(CellType.STRING);
+                                String item = field1.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField1(value);
+                                if (financeConfig.getField1Calculate() != null && financeConfig.getField1Calculate()==1) total = total.add(value);
+                            }
+                            if (field2 != null) {
+                                field2.setCellType(CellType.STRING);
+                                String item = field2.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item) ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField2(value);
+                                if (financeConfig.getField2Calculate() != null && financeConfig.getField2Calculate()==1) total = total.add(value);
+                            }
+                            if (field3 != null) {
+                                field3.setCellType(CellType.STRING);
+                                String item = field3.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField3(value);
+                                if (financeConfig.getField3Calculate() != null && financeConfig.getField3Calculate()==1) total = total.add(value);
+                            }
+                            if (field4 != null) {
+                                field4.setCellType(CellType.STRING);
+                                String item = field4.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField4(value);
+                                if (financeConfig.getField4Calculate() != null && financeConfig.getField4Calculate()==1) total = total.add(value);
+                            }
+                            if (field5 != null) {
+                                field5.setCellType(CellType.STRING);
+                                String item = field5.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField5(value);
+                                if (financeConfig.getField5Calculate() != null && financeConfig.getField5Calculate()==1) total = total.add(value);
+                            }
+                            if (field6 != null) {
+                                field6.setCellType(CellType.STRING);
+                                String item = field6.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField6(value);
+                                if (financeConfig.getField6Calculate() != null && financeConfig.getField6Calculate()==1) total = total.add(value);
+                            }
+                            if (field7 != null) {
+                                field7.setCellType(CellType.STRING);
+                                String item = field7.getStringCellValue();
+                                BigDecimal value = !StringUtil.isEmpty(item)? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
+                                finance.setCustomField7(value);
+                                if (financeConfig.getField7Calculate() != null && financeConfig.getField7Calculate()==1) total = total.add(value);
+                            }
+                            finance.setTotalCost(total);
                         }
-                        finance.setTotalCost(total);
-
                         //如果需要更新员工成本
                         if (financeImport.getRecoverMonthcost()==1 || financeImport.getRecoverReport()==1) {
                             //设置人员总成本,计算时薪
@@ -506,9 +580,9 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                                     break;
                                 }
                             }
-
                             updateUserList.add(localUser);
                         }
+
                     } else {
                         //msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
                         msg.setError(MessageUtils.message("group.userNull",name));
@@ -516,7 +590,6 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                     }
                     finance.setYmonth(yearMonth);
                     financeList.add(finance);
-
                 }
                 if (financeList.size() == 0) {
                     //msg.setError("请填写数据再上传");
@@ -539,38 +612,52 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                     userService.updateBatchById(dbUpUserList);
                 }
                 //检查是否有删除的,需要删除掉
-                List<Integer> readyForDelete = new ArrayList<>();
-                oldFinanceList.forEach(old->{
-                    boolean exists = false;
-                    if (financeList.stream().filter(f->f.getName().equals(old.getName())).findAny().isPresent()) {
-                        exists = true;
-                    }
-                    if (!exists) {
-                        readyForDelete.add(old.getId());
+                if (!oldItem.getIsVerification()) {
+                    List<Integer> readyForDelete = new ArrayList<>();
+                    oldFinanceList.forEach(old->{
+                        boolean exists = false;
+                        if (financeList.stream().filter(f->f.getName().equals(old.getName())).findAny().isPresent()) {
+                            exists = true;
+                        }
+                        if (!exists) {
+                            readyForDelete.add(old.getId());
+                        }
+                    });
+                    if (readyForDelete.size() > 0) {
+                        financeService.removeByIds(readyForDelete);
                     }
-                });
-                if (readyForDelete.size() > 0) {
-                    financeService.removeByIds(readyForDelete);
                 }
+
                 //如果有必要,更新该月份的日报相关的成本
                 if (financeImport.getRecoverReport()==1) {
                     List<Report> reportList = reportMapper.selectSimpleTime(companyId, startStr, endStr);
                     if (reportList.size() > 0) {
-                        for (Report r : reportList) {
+                        for (int i=0;i<reportList.size(); i++) {
+                            Report r = reportList.get(i);
                             Optional<User> first = updateUserList.stream().filter(u -> u.getId().equals(r.getCreatorId())).findFirst();
-                            if (!first.isPresent()) {
-                                String notFillUser = userMapper.selectById(r.getCreatorId()).getName();
-                                System.out.println("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
-                                //throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
-                                throw new UserNotFoundException(MessageUtils.message("salary.lackAndUpAgain",notFillUser));
+                            if (first.isPresent()) {
+                                BigDecimal hourCost = first.get().getCost();
+                                r.setCost(hourCost.multiply(new BigDecimal(r.getWorkingTime())));
+                                r.setCreatorId(null);
+                                r.setWorkingTime(null);
+                            } else {
+                                if (oldItem.getIsVerification()) {
+                                    //该日报的人员本次没有核销的奖金,无需处理
+                                    reportList.remove(i);
+                                    i--;
+                                } else {
+                                    //缺少薪资成本
+                                    String notFillUser = userMapper.selectById(r.getCreatorId()).getName();
+                                    System.out.println("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                                    //throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                                    throw new UserNotFoundException(MessageUtils.message("salary.lackAndUpAgain",notFillUser));
+                                }
                             }
-                            BigDecimal hourCost = first.get().getCost();
-                            r.setCost(hourCost.multiply(new BigDecimal(r.getWorkingTime())));
-                            r.setCreatorId(null);
-                            r.setWorkingTime(null);
                         }
                         //批量更新日报的成本
-                        reportService.updateBatchById(reportList);
+                        if (reportList.size() > 0) {
+                            reportService.updateBatchById(reportList);
+                        }
                     }
                 }
 

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -574,12 +574,13 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             if (syncUserCost) {
                 //重新计算时薪,保证按照标准工作时长下的时薪正确
                 List<User> dbUpUserList = new ArrayList<>();
-                BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
+//                BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
                 for (User upU : updateUserList) {
                     User user1 = new User();
                     user1.setId(upU.getId());
                     user1.setMonthCost(upU.getMonthCost());
-                    user1.setCost(upU.getMonthCost().divide(db,4, BigDecimal.ROUND_HALF_UP));
+                    //以当前上传的计算所得的时薪进行更新,方便计算其他报表的成本(泓浒定制生产制造工时成本表)
+                    user1.setCost(upU.getCost());
                     dbUpUserList.add(user1);
                 }
                 userService.updateBatchById(dbUpUserList);

+ 149 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -12116,6 +12116,155 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         return msg;
     }
 
+    @Override
+    public HttpRespMsg getProduceTimeReport(Integer companyId, Integer projectId, String startDate, String endDate) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(getProduceTime(companyId, projectId, startDate, endDate));
+        return msg;
+    }
+
+    private List<ProduceTime> getProduceTime(Integer companyId, Integer projectId, String startDate, String endDate) {
+        Integer leaveProjectId = 80333;//请假项目,排除在外
+        Integer publicProjectId = 77651;//公共项目
+        QueryWrapper<Report> wrapper = new QueryWrapper<Report>().select("id, create_date, creator_id, project_id,dept_id, working_time, group_id, extra_field4").eq("company_id", companyId).ne("project_id", leaveProjectId)
+                .eq("state", 1).between("create_date", startDate, endDate);
+        if (projectId != null) {
+            wrapper.eq("project_id", projectId);
+        }
+        List<Report> reportList = reportMapper.selectList(wrapper);
+        //查询部门列表
+        List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+        //维修部、三大中心、装配
+        List<Integer> produceDeptIdList = departmentList.stream().filter(dept->dept.getDepartmentName().equals("维修部") || dept.getDepartmentName().equals("北京中心")
+                || dept.getDepartmentName().equals("上海中心") || dept.getDepartmentName().equals("武汉中心") || dept.getDepartmentName().equals("设备一部-装配")).map(Department::getDepartmentId).collect(Collectors.toList());
+        Integer rdDeptId = departmentList.stream().filter(dept->dept.getDepartmentName().equals("研发中心")).findFirst().get().getDepartmentId();
+        Integer cuServiceDeptId = departmentList.stream().filter(dept->dept.getDepartmentName().equals("售后部")).findFirst().get().getDepartmentId();
+        List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
+        List<ProduceTime> result = new ArrayList<>();
+        if (reportList.size() > 0) {
+            //按照项目和人员进行分组统计
+            Map<Integer, List<Report>> reportMap = reportList.stream().collect(Collectors.groupingBy(Report::getProjectId));
+            List<Integer> pidList = new ArrayList<>();
+            reportMap.forEach((pid, reports)->{
+                pidList.add(pid);
+            });
+            List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", pidList));
+            //研发项目列表
+            List<Integer> rdProjectIds = projectList.stream().filter(p->!StringUtils.isEmpty(p.getProjectCode()) && p.getProjectCode().startsWith("HH-RD")).map(Project::getId).collect(Collectors.toList());
+            Map<Integer, String> departmentMap = departmentList.stream().collect(Collectors.toMap(Department::getDepartmentId, Department::getDepartmentName));
+            reportMap.forEach((pid, reports)->{
+                projectList.stream().filter(p->p.getId().equals(pid)).findFirst().ifPresent(p->{
+                    String projectName = p.getProjectName();
+
+                    //按人员再分组
+                    Map<String, List<Report>> membReportList = reports.stream().collect(Collectors.groupingBy(Report::getCreatorId));
+
+                    membReportList.forEach((membId, oneMembList )-> {
+                        User user = userList.stream().filter(u->u.getId().equals(membId)).findFirst().get();
+                        ProduceTime produceTimeItem = new ProduceTime();
+                        produceTimeItem.setProjectId(p.getId());
+                        produceTimeItem.setProjectCode(p.getProjectCode());
+                        produceTimeItem.setProjectName(projectName);
+                        String userName = user.getName();
+                        produceTimeItem.setUserName(userName);
+                        String departmentName = "";
+                        if (user.getDepartmentId() != null && user.getDepartmentId() != 0) {
+                            departmentName = departmentMap.get(user.getDepartmentId());
+                        }
+                        produceTimeItem.setDepartmentName(departmentName);
+                        //合计工时数
+                        double totalTime = oneMembList.stream().mapToDouble(Report::getWorkingTime).sum();
+                        //工单部门
+                        List<Integer> workSheetDeptIds = oneMembList.stream().filter(item->!StringUtils.isEmpty(item.getExtraField4())).map(Report::getDeptId).distinct().collect(Collectors.toList());
+                        produceTimeItem.setWorksheetDeptName(workSheetDeptIds.stream().map(deptId->departmentMap.get(deptId)).collect(Collectors.joining(",")));
+                        //计算生产工时成本,针对不同部门判断逻辑不同
+                        double produceTime = oneMembList.stream().filter(one->one.getDeptId() != null
+                                && ((produceDeptIdList.contains(one.getDeptId()) && (!StringUtils.isEmpty(one.getExtraField4()) || one.getProjectId().equals(publicProjectId)))
+                                || (one.getDeptId().equals(rdDeptId) && !StringUtils.isEmpty(one.getExtraField4())))
+                        ).mapToDouble(Report::getWorkingTime).sum();
+                        produceTimeItem.setProduceTime(produceTime);
+                        //计算制造工时费用
+                        double manufactureTime = oneMembList.stream().filter(one->one.getDeptId() != null
+                                && ((produceDeptIdList.contains(one.getDeptId()) && (StringUtils.isEmpty(one.getExtraField4()) && !one.getProjectId().equals(publicProjectId)))
+                                || (one.getDeptId().equals(rdDeptId) && !rdProjectIds.contains(one.getProjectId()) && StringUtils.isEmpty(one.getExtraField4())))
+                        ).mapToDouble(Report::getWorkingTime).sum();
+                        //计算研发工时支出
+                        double rdTime = oneMembList.stream().filter(one->one.getDeptId() != null
+                                && (one.getDeptId().equals(rdDeptId) && rdProjectIds.contains(one.getProjectId()) && StringUtils.isEmpty(one.getExtraField4()))
+                        ).mapToDouble(Report::getWorkingTime).sum();
+                        //计算销售工时费用
+                        double cusTime = oneMembList.stream().filter(one->one.getDeptId() != null
+                                && (one.getDeptId().equals(cuServiceDeptId) && StringUtils.isEmpty(one.getExtraField4()))
+                        ).mapToDouble(Report::getWorkingTime).sum();
+
+                        //计算项目工时
+                        produceTimeItem.setTotalTime(totalTime);
+                        double projectTime = totalTime - produceTime;
+                        produceTimeItem.setManufactureTime(manufactureTime);
+                        produceTimeItem.setRdTime(rdTime);
+                        produceTimeItem.setSalesTime(cusTime);
+                        produceTimeItem.setProjectTime(projectTime);
+
+                        //设置成本
+                        produceTimeItem.setProduceCost(user.getCost().multiply(new BigDecimal(produceTime)).setScale(2, RoundingMode.HALF_UP));
+                        produceTimeItem.setManufactureCost(user.getCost().multiply(new BigDecimal(manufactureTime)).setScale(2, RoundingMode.HALF_UP));
+                        produceTimeItem.setRdCost(user.getCost().multiply(new BigDecimal(rdTime)).setScale(2, RoundingMode.HALF_UP));
+                        produceTimeItem.setSalesCost(user.getCost().multiply(new BigDecimal(cusTime)).setScale(2, RoundingMode.HALF_UP));
+
+                        result.add(produceTimeItem);
+                    });
+                });
+            });
+        }
+        return result;
+    }
+
+    @Override
+    public HttpRespMsg exportProduceTimeReport(Integer companyId, Integer projectId, String startDate, String endDate) {
+        HttpRespMsg msg = new HttpRespMsg();
+        List<List<String>> dataList = new ArrayList<>();
+        List<String> headList = new ArrayList<>();
+        headList.add("项目编号");
+        headList.add("项目名称");
+        headList.add("人员");
+        headList.add("部门");
+        headList.add("工时(h)");
+        headList.add("生产工时");
+        headList.add("工单部门");
+        headList.add("生产成本-工资");
+        headList.add("项目工时");
+        headList.add("制造成本-工资");
+        headList.add("研发支出-工资");
+        headList.add("销售费用-工资");
+        dataList.add(headList);
+        List<ProduceTime> produceTimeList = getProduceTime(companyId, projectId, startDate, endDate);
+        for (ProduceTime produceTime : produceTimeList) {
+            List<String> list = new ArrayList<>();
+            list.add(produceTime.getProjectCode());
+            list.add(produceTime.getProjectName());
+            list.add(produceTime.getUserName());
+            list.add(produceTime.getDepartmentName());
+            list.add(""+produceTime.getTotalTime());
+            list.add(produceTime.getProduceTime()+"");
+            list.add(produceTime.getWorksheetDeptName());
+            list.add(produceTime.getProduceCost()+"");
+            list.add(produceTime.getProjectTime()+"");
+            list.add(produceTime.getManufactureCost().toString());
+            list.add(produceTime.getRdCost().toString());
+            list.add(produceTime.getSalesCost().toString());
+            dataList.add(list);
+        }
+        //生成excel文件导出
+        //String fileName = "人员每日工时统计_"+startDate+"至"+endDate+"_"+System.currentTimeMillis();
+        String fileName = "生产制造工时费用统计_"+ startDate+"至"+endDate+"_"+System.currentTimeMillis();
+        try {
+            return excelExportService.exportGeneralExcelByTitleAndList(null,null, fileName, dataList, path);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return msg;
+    }
+
 
     private  List<LocalDateTime> getDays(LocalDateTime start, LocalDateTime end) {
         List<LocalDateTime> result = new ArrayList();

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

@@ -18,11 +18,12 @@
         <result column="recover_report" property="recoverReport" />
         <result column="recover_monthcost" property="recoverMonthcost" />
         <result column="reject_reason" property="rejectReason" />
+        <result column="is_verification" property="isVerification" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, ymonth, file_name, server_name, indate, user_id, user_name, state, auditor_id, auditor_name, recover_report, recover_monthcost, reject_reason
+        id, company_id, ymonth, file_name, server_name, indate, user_id, user_name, state, auditor_id, auditor_name, recover_report, recover_monthcost, reject_reason, is_verification
     </sql>
 
 </mapper>

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/financeComponents/salaryDetails.vue

@@ -400,6 +400,9 @@
                     <el-checkbox :label="$t('Synchronizeemployeemonthlycosttorganizationalstructure')"
                         v-model="importParam.syncUserCost"></el-checkbox>
                 </el-form-item>
+                <el-form-item prop="isVerification">
+                    <el-checkbox label="是否为核销数据" v-model="importParam.isVerification"></el-checkbox> <span>(请确认模板中有计提奖金和奖金核销列)</span>
+                </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-link v-if="user.timeType.financeAudit == '0'" style="float:left;" type="primary" :underline="false"
@@ -1879,6 +1882,7 @@ export default {
                 let urls = ''
                 if (this.user.timeType.financeAudit == '1') {
                     urls = '/finance-import/submitImport'
+                    formData.append("isVerification", this.importParam.isVerification);
                 } else {
                     urls = '/finance/importData'
                 }

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/application.properties

@@ -10,7 +10,7 @@ mybatis-plus.configuration.map-underscore-to-camel-case=true
 mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
 
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-spring.datasource.url=jdbc:mysql://47.101.180.183:17089/big_event?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
+spring.datasource.url=jdbc:mysql://1.94.62.58:17089/big_event?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
 spring.datasource.username=root
 spring.datasource.password=P011430@Huoshi*
 spring.datasource.hikari.max-lifetime=60000

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/customerNew.html

@@ -14,7 +14,7 @@
   <link rel="stylesheet" href="./css/customerNew/customerNew.css">
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
   <script src="js/jquery1.42.min.js"></script>
   </link>
 </head>

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/dynamic.html

@@ -25,7 +25,7 @@
 
     <link rel="stylesheet" href="./css/element-uiCss.css">
     <script src="./js/vue.min.js"></script>
-    <script src="./js/element-ui.js"></script>
+<!--    <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeField copy.html

@@ -25,7 +25,7 @@
 
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/knowledgeField.html

@@ -25,7 +25,7 @@
 
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/static/moduleView/header.html

@@ -7,7 +7,7 @@
   <link rel="stylesheet" href="./css/header.css">
   <link rel="stylesheet" href="../css/element-uiCss.css">
   <script src="../js/vue.min.js"></script>
-  <script src="../js/element-ui.js"></script>
+<!--  <script src="../js/element-ui.js"></script>-->
   <script src="./js/setRem.js"></script>
 </head>
 <body>

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/customerNew.html

@@ -14,7 +14,7 @@
   <link rel="stylesheet" href="./css/customerNew/customerNew.css">
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
   <script src="js/jquery1.42.min.js"></script>
   </link>
 </head>

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/dynamic.html

@@ -25,7 +25,7 @@
 
     <link rel="stylesheet" href="./css/element-uiCss.css">
     <script src="./js/vue.min.js"></script>
-    <script src="./js/element-ui.js"></script>
+<!--    <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 0 - 266
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/homemovement.html

@@ -1,266 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
-    <title>工时管家</title>
-    <link rel="stylesheet" href="./css/homemovement/normalize.css" />
-    <!-- 先引入css文件 放到自己css文件的上面 -->
-    <link rel="stylesheet" href="./css/homemovement/swiper.min.css" />
-    <link rel="stylesheet" href="./css/homemovement/homemovement.css" />
-    <script src="js/jquery1.42.min.js"></script>
-</head>
-<body>
-    <section class="warp">
-        <!-- 头部 -->
-        <div class="header">
-            <div class="header_logo"><img src="./image/logo.jpg" alt=""></div>
-            <div class="header_qiyeweix"><a href="https://open.work.weixin.qq.com" target="_blank"><img src="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=isp&c=white&s=medium" srcset="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=isp&c=white&s=medium@2x 2x" referrerpolicy="unsafe-url" alt="企业微信"></a></div>
-            <div class="header_qw"><a href="javascript:;" id="zhuce"><img src="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=register&c=white&s=large" srcset="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=register&c=white&s=large@2x 2x" referrerpolicy="unsafe-url" alt="企业微信"></a></div>
-            <div class="header_qx"><a href="javascript:;" id="anqiye"><img src="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=install&c=white&s=large" srcset="https://open.work.weixin.qq.com/service/img?id=wwf11426cf618e1703&t=install&c=white&s=large@2x 2x" referrerpolicy="unsafe-url" alt="企业微信"></a></div>
-        </div>
-
-        <div class="homepage">
-            <div class="homepage_img">
-                <img src="./image/bannar9.gif" alt="">
-            </div>
-            <div class="homepage_gsLogo">
-                <img src="./image/gsgj.png" alt="">
-            </div>
-            <div class="homepage_title">工时管家</div>
-        </div>
-
-        <div class="reduction">
-            <div class="reduction_img">
-                <img src="./image/huajian.png" alt="">
-            </div>
-        </div>
-
-        <div class="examination">
-            <div class="examination_title">填报、审批、统计分分钟搞定</div>
-            <div class="examination_img"><img src="./image/fill.jpg" alt=""></div>
-            <div class="get_job_focus">
-              <!-- Swiper -->
-              <div class="swiper-container get_job_fo">
-                <div class="swiper-wrapper">
-                  <div class="swiper-slide">
-                    <img src="./image/yidong/xmcj.png" alt="" />
-                  </div>
-                  <div class="swiper-slide">
-                    <img src="./image/yidong/ygtb.png" alt="" />
-                  </div>
-                  <div class="swiper-slide">
-                    <img src="./image/yidong/xmjlsh.png" alt="" />
-                  </div>
-                  <div class="swiper-slide">
-                    <img src="./image/yidong/hzsj.png" alt="" />
-                  </div>
-                  <div class="swiper-slide">
-                    <img src="./image/yidong/sctjb.png" alt="" />
-                  </div>
-                </div>
-              </div>
-              <!-- Add Arrows 根据需求这个代码放到 container外面 添加左右箭头-->
-              <div class="swiper-button-next"></div>
-              <div class="swiper-button-prev"></div>
-            </div>
-        </div>
-
-        <div class="management">
-            <div class="management_title">强大的功能,轻松的管理</div>
-            <div class="management_tex">提供便捷且全面的工时填报、审核和统计功能,围绕企业成本管理提供一站式解决方案</div>
-
-            <div class="swiper-container study_fo">
-              <div class="swiper-wrapper">
-                <div class="swiper-slide">
-                  <img src="./image/gs1.jpg" alt="" />
-                  <p>工时填报</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs2.jpg" alt="" />
-                  <p>报告查看</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs3.jpg" alt="" />
-                  <p>工时审批</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs4.jpg" alt="" />
-                  <p>项目管理</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs5.jpg" alt="" />
-                  <p>成本统计</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs6.jpg" alt="" />
-                  <p>财务核算</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs7.jpg" alt="" />
-                  <p>客户管理</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs8.jpg" alt="" />
-                  <p>费用报销</p>
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/gs9.jpg" alt="" />
-                  <p>工程管理</p>
-                </div>
-                <div class="swiper-slide">
-                    <img src="./image/gs10.jpg" alt="" />
-                    <p>审批流</p>
-                </div>
-              </div>
-              <!-- Add Pagination -->
-              <div class="swiper-pagination"></div>
-            </div>
-        </div>
-
-        <div class="customer">
-            <div class="customer_title">来自客户的认可</div>
-            <div class="swiper-container customer_fo">
-              <div class="swiper-wrapper">
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg0.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg1.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg2.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg3.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg4.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg5.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg6.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg7.png" alt="" />
-                </div>
-                <div class="swiper-slide">
-                  <img src="./image/yidong/ggg8.png" alt="" />
-                </div>
-              </div>
-              <!-- Add Pagination -->
-              <div class="swiper-pagination"></div>
-            </div>
-        </div>
-
-        <div class="foots">
-            <div class="erweima">
-                <img src="./image/gzh.jpg" alt="">
-            </div>
-            <div class="erweima_text">工时管家官方客服</div>
-            <div class="erweima_haoma">Copyright©2016 南京火石闪信网络科技有限公司     苏ICP备18064522号-1</div>
-        </div>
-    </section>
-</body>
-<script src="./js/homemovement/flexible.js"></script>
-<!-- 比如引入js文件 -->
-<script src="./js/homemovement/swiper.min.js"></script>
-<script>
-    // 第一个函数里面是 就业指导轮播图
-    (function () {
-      var swiper = new Swiper(".get_job_fo", {
-        // 能够显示的 slider的个数
-        slidesPerView: 2,
-        // 每一个slide之间的距离
-        spaceBetween: 30,
-        centeredSlides: true,
-        loop: true,
-        // 添加左右箭头
-        navigation: {
-          nextEl: ".swiper-button-next",
-          prevEl: ".swiper-button-prev",
-        },
-      });
-    })();
-    // 第二个函数的轮播图
-    (function () {
-      //  如果有多个轮播图最好修改下 swiper-container
-      var swiper = new Swiper(".study_fo", {
-        // 我们可以可以看看到的是 2个半
-        slidesPerView: 1,
-        spaceBetween: 20,
-      });
-    })();
-    // 第三个函数的轮播图
-    (function () {
-      //  如果有多个轮播图最好修改下 swiper-container
-      var swiper = new Swiper(".customer_fo", {
-        // 我们可以可以看看到的是 2个半
-        slidesPerView: 2.2,
-        spaceBetween: 20,
-      });
-    })();
-  </script>
-  <script>
-    $('#anqiye').click(function() {
-        console.log('我被点击率')
-        // $.ajax({
-        //     type : "GET",
-        //     // url : "http://192.168.2.97:10010/wxcorp/getPreAuthCode",
-        //     url : "http://worktime.ttkuaiban.com/api/wxcorp/getPreAuthCode",
-        //     dataType : "jsonp",
-        //     jsonp: "jsoncallback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(默认为:callback)
-        //     jsonpCallback:"jsoncallback",//自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名
-        //     success : function(data){
-        //         console.log(data);
-        //     },
-        //     error:function(){
-        //         alert('请求失败');
-        //     }
-        // });
-        // function jsoncallback(data) {
-        //     console.log(data)
-        // }
-
-        $.ajax({
-            type : "GET",
-            url : "https://worktime.ttkuaiban.com/api/wxcorp/getPreAuthCode",
-            success : function(data){
-                let suiteId = 'ww4e237fd6abb635af'
-                let huidiao = 'https://worktime.ttkuaiban.com/api/wxcorp/installFromWebsite'
-                let url = `https://open.work.weixin.qq.com/3rdapp/install?suite_id=${suiteId}&pre_auth_code=${data.data.code}&redirect_uri=${huidiao}&state=4`
-                window.location.href = url
-            },
-            error:function(){
-                alert('请求失败');
-            }
-        });
-
-    })
-
-    $('#zhuce').click(function() {
-        $.ajax({
-            type : "GET",
-            url : "https://worktime.ttkuaiban.com/api/wxcorp/getRegisterCode",
-            success : function(data){
-                if(data.code == 'ok') {
-                    let url = `https://open.work.weixin.qq.com/3rdservice/wework/register?register_code=${data.data.code}`
-                    if(data.data.code != undefined  && data.data.code != 'undefined') {
-                        window.location.href = url
-                    }
-                } else {
-                    console.log(data)
-                    alert(data.msg)
-                }
-            },
-            error:function(){
-                alert('请求失败');
-            }
-        });
-
-    })
-</script>
-</html>

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeField copy.html

@@ -25,7 +25,7 @@
 
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 1 - 1
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/knowledgeField.html

@@ -25,7 +25,7 @@
 
   <link rel="stylesheet" href="./css/element-uiCss.css">
   <script src="./js/vue.min.js"></script>
-  <script src="./js/element-ui.js"></script>
+<!--  <script src="./js/element-ui.js"></script>-->
 </head>
 
 <body data-spy="scroll" data-target=".fixed-top">

+ 2 - 2
fhKeeper/formulahousekeeper/webttkuaiban/src/main/resources/templates/moduleView/header.html

@@ -6,8 +6,8 @@
   <link rel="stylesheet" href="./css/reset.css">
   <link rel="stylesheet" href="./css/header.css">
   <link rel="stylesheet" href="../css/element-uiCss.css">
-  <script src="../js/vue.min.js"></script>
-  <script src="../js/element-ui.js"></script>
+<!--  <script src="../js/vue.min.js"></script>-->
+<!--  <script src="../js/element-ui.js"></script>-->
   <script src="./js/setRem.js"></script>
 </head>
 <body>