jiaosong
2023-08-18 8e1a9aa9e896f24f5244f042ecfb9e49effbe6bf
Merge remote-tracking branch 'origin/master'

# Conflicts:
# server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
已修改6个文件
33 ■■■■ 文件已修改
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/dto/CreateWorkorderRecordDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/PlansExtMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java
@@ -91,6 +91,14 @@
        return ApiResponse.success(salaryParamService.findPage(pageWrap));
    }
    @ApiOperation("列表查询")
    @PostMapping("/querytList")
    @RequiresPermissions("business:salaryparam:query")
    public ApiResponse<List<SalaryParam>> querytList(@RequestBody SalaryParam salaryParam) {
        List<SalaryParam> data = salaryParamService.findList(salaryParam);
        return ApiResponse.success(data);
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:salaryparam:exportExcel")
server/src/main/java/doumeemes/dao/business/dto/CreateWorkorderRecordDTO.java
@@ -25,5 +25,7 @@
    @ApiModelProperty(value = "报工时长(秒)"  )
    private Integer duration;
    @ApiModelProperty(value = "报工类型 0计件 1计时"  )
    private Integer salaryType;
}
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
@@ -46,7 +46,6 @@
    @Autowired
    private MaterialMapper materialMapper;
    @Autowired
    private MaterialDistributeMapper materialDistributeMapper;
@@ -205,6 +204,7 @@
            wrapper.lambda()
                    .eq(Department::getName,salaryParamImportDTO.getDepartName())
                    .eq(Department::getType,Constants.DEPART_TYPE.factory)
                    .eq(Department::getDeleted,Constants.ZERO)
                    .last("limit 1");
            Department department = departmentMapper.selectOne(wrapper);
            if (Objects.isNull(department)){
@@ -215,6 +215,7 @@
            materialWrapper.lambda()
                    .eq(Material::getCode,salaryParamImportDTO.getMaterialCode())
                    .eq(Material::getRootDepartId,department.getRootId())
                    .eq(Material::getDeleted,Constants.ZERO)
                    .last("limit 1");
            Material material = materialMapper.selectOne(materialWrapper);
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
@@ -92,6 +92,8 @@
    private WorkorderRecordStandardService workorderRecordStandardService;
    @Autowired
    private UnqualifiedRecordMapper unqualifiedRecordMapper;
    @Autowired
    private CompanyUserExtMapper companyUserExtMapper;
    @Override
    public  PlansExtListVO findById(Integer id){
@@ -639,7 +641,7 @@
        List<WorkorderHistory> whList = new ArrayList<>();
        Workorder order = new Workorder();
        order.setCreateTime(DateUtil.getCurrentDate());
        order.setCreateUser(user.getId());
        order.setCreateUser(param.getCreateUser());
        order.setDeleted(Constants.ZERO);
        order.setStatus(Constants.WORKORDER_STATUS.create);
        order.setPlanId(mp.getId());
@@ -1642,7 +1644,7 @@
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据");
        }
        //工单已分配数量
        Integer produceNum = workorderList.stream().map(s -> s.getPlanNum()).reduce(Constants.ZERO, Integer::sum);
        Integer produceNum = workorderList.stream().map(s -> s.getUnqualifiedNum() + s.getQualifiedNum()).reduce(Constants.ZERO, Integer::sum);
        Integer surplusNum = plans.getNum() - produceNum;
        if(num.compareTo(BigDecimal.valueOf(surplusNum))>0){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"超出当前工序计划可报工数量");
@@ -1650,6 +1652,8 @@
        Workorder param = new Workorder();
        param.setPlanId(autoWorkReportDTO.getPlansId());
        param.setPlanDate(new Date());
//        CompanyUser companyUser= companyUserExtMapper.selectById(autoWorkReportDTO.getProUserList().get(Constants.ZERO));
        param.setCreateUser(autoWorkReportDTO.getProUserList().get(Constants.ZERO));
        param.setProGroupId(autoWorkReportDTO.getProGroupId());
        param.setProUserList(autoWorkReportDTO.getProUserList());
        param.setPlanNum(num.intValue());
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java
@@ -298,11 +298,11 @@
        wrModel.setMaterialId(wStock.getMaterialId());
        wrModel.setDepartId(mp.getDepartId());
        wrModel.setCreateTime(DateUtil.getCurrentDate());
        wrModel.setCreateUser(user.getId());
        wrModel.setCreateUser(mp.getCreateUser());
        wrModel.setMaterialBatch(mp.getBatch());
        wrModel.setType(Constants.WORKORDER_RECORD_TYPE.materail);
        wrModel.setFactoryId(mp.getFactoryId());
        wrModel.setProcedureId(mp.getProcedureId());
        wrModel.setProcedureId(wStock.getProcedureId());
        wrModel.setBatch(wStock.getBatch());
        wrModel.setUnitId(mp.getUnitId());
        wrModel.setPlanId(mp.getPlanId());
@@ -1532,8 +1532,8 @@
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到生产人员对应企业用户信息!");
            }
            workorderRecord.setCreateUser(companyUser.getUserId());
            workorderRecord.setRootDepartId(companyUser.getRootDepartId());
            workorderRecord.setDepartId(companyUser.getComDepartId());
            workorderRecord.setRootDepartId(loginUserInfo.getRootDepartment().getId());
            workorderRecord.setDepartId(loginUserInfo.getCurComDepartment().getId());
        }else{
            workorderRecord.setCreateUser(loginUserInfo.getId());
            workorderRecord.setRootDepartId(loginUserInfo.getRootDepartment().getId());
@@ -1555,7 +1555,7 @@
        workorderRecord.setQualifiedNum(createWorkorderRecordDTO.getQualifiedNum());
        //计算工资信息
        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()).last(" limit 1  "));
                .eq("DEPART_ID",workorderRecord.getFactoryId()).eq("PROCEDURE_ID",workorderRecord.getProcedureId()).eq("TYPE",workorderRecord.getSalaryType()).last(" limit 1  "));
        if(!Objects.isNull(salaryParam)&&!Objects.isNull(createWorkorderRecordDTO.getDuration())){
            workorderRecord.setSalaryPrice(salaryParam.getSalary());
            workorderRecord.setSalaryType(salaryParam.getType());
server/src/main/resources/mappers/PlansExtMapper.xml
@@ -123,7 +123,7 @@
  <select id="selectByModel" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO">
  SELECT
  `a`.*
    ,ifnull((  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status = 4 ),0) AS workorderDistributNum
    , ifnull((  SELECT sum(  b.UNQUALIFIED_NUM + QUALIFIED_NUM ) FROM  workorder b  WHERE b.deleted = 0  AND b.PLAN_ID = a.id  and b.status  = 4 ),0) AS workorderDistributNum
    from plans a
    <where>
    <if test="id != null">