111
k94314517
2023-08-18 ca27f46e204ee9772040b5b1170b0e2c1addc738
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java
@@ -1559,7 +1559,7 @@
        //计算工资信息
        SalaryParam salaryParam = salaryParamMapper.selectOne(new QueryWrapper<SalaryParam>().eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",workorderRecord.getMaterialId())
                .eq("DEPART_ID",workorderRecord.getFactoryId()).eq("PROCEDURE_ID",workorderRecord.getProcedureId()).eq("TYPE",createWorkorderRecordDTO.getType()).last(" limit 1  "));
        if(!Objects.isNull(salaryParam)&&!Objects.isNull(createWorkorderRecordDTO.getDuration())){
        if(!Objects.isNull(salaryParam)){
            workorderRecord.setSalaryPrice(salaryParam.getSalary());
            workorderRecord.setSalaryType(salaryParam.getType());
            workorderRecord.setSalaryUnqualified(salaryParam.getUnqualified());
@@ -1568,10 +1568,12 @@
                workorderRecord.setSalaryNum(salaryParam.getNum());
                workorderRecord.setSalary(salaryParam.getSalary().multiply(salaryParam.getUnqualified()==Constants.ONE?num:createWorkorderRecordDTO.getQualifiedNum()));
            }else{
                if(!Objects.isNull(createWorkorderRecordDTO.getDuration())&&Constants.formatIntegerNum(createWorkorderRecordDTO.getDuration())>Constants.ZERO){
                workorderRecord.setDuration(createWorkorderRecordDTO.getDuration());
                workorderRecord.setSalary(BigDecimal.valueOf(createWorkorderRecordDTO.getDuration()).multiply(salaryParam.getSalary()).divide(new BigDecimal(3600),BigDecimal.ROUND_HALF_UP));
            }
        }
        }
        //插入工单操作记录,并且判断是否更改为工单的状态【生产中】
        updateOrderInfo(loginUserInfo,workorder,Constants.WORKORDER_HISTORY_STATUS.produce);
        workorderRecordExtMapper.insert(workorderRecord);