111
k94314517
2023-08-16 6b656dae5760b0151757f5f82ef756c48f53124c
111
已修改9个文件
87 ■■■■■ 文件已修改
server/src/main/java/doumeemes/api/ext/PlansExtController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/config/shiro/ShiroRealm.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/vo/PlansExtListVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/WOutboundServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/PlansExtMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/WorkPlansExtMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/PlansExtController.java
@@ -223,7 +223,6 @@
        return ApiResponse.success(plansExtService.pageCount(param));
    }
    @ApiOperation("一键报工")
    @PostMapping("/autoWorkReport")
    public ApiResponse autoWorkReport (@RequestBody AutoWorkReportDTO autoWorkReportDTO) {
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java
@@ -79,7 +79,7 @@
    @ApiOperation("根据对象信息查询")
    @PostMapping("/queryOne")
    @RequiresPermissions("business:salaryparam:query")
    public ApiResponse queryOne(@RequestBody SalaryParam salaryParam) {
    public ApiResponse<SalaryParam> queryOne(@RequestBody SalaryParam salaryParam) {
        SalaryParam data = salaryParamService.findOne(salaryParam);
        return ApiResponse.success(data);
    }
server/src/main/java/doumeemes/config/shiro/ShiroRealm.java
@@ -131,9 +131,9 @@
            if(com == null){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该账户异常!");
            }
            if(Constants.equalsInteger( com.getStatus(),Constants.ZERO) ){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过禁用!");
            }
//            if(Constants.equalsInteger( com.getStatus(),Constants.ZERO) ){
//                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过禁用!");
//            }
            if(com.getOepnValidDate() != null && com.getOepnValidDate().before(new Date())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过使用有效期!");
            }
@@ -146,9 +146,9 @@
            if(cu == null){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户不存在!");
            }
            if(Constants.equalsInteger(cu.getStatus(),Constants.ONE)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户已禁用!");
            }
//            if(Constants.equalsInteger(cu.getStatus(),Constants.ONE)){
//                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户已禁用!");
//            }
            rootDepart = departmentExtService.getModelById(c.getCompanyId(),cu.getRootDepartId());
            comDepart = departmentExtService.getModelById(c.getCompanyId(),cu.getComDepartId());
            depart = departmentExtService.getModelById(c.getCompanyId(),cu.getDepartmentId());
server/src/main/java/doumeemes/dao/ext/vo/PlansExtListVO.java
@@ -189,4 +189,10 @@
    @ApiModelProperty(value = "已生产数量")
    private Integer produceNum;
    @ApiModelProperty(value = "是否有bom配置 0无 1有", example = "1")
    private Integer hasBom;
    @ApiModelProperty(value = "bom投料方式 0推式 1拉式", example = "1")
    private Integer bomType;
}
server/src/main/java/doumeemes/service/business/impl/WOutboundServiceImpl.java
@@ -2126,6 +2126,9 @@
            WOutboundInBodyBean wOutboundInBodyBean = wOutboundInBodyBeans.get(Constants.ZERO);
            //累计入库数量
            wOutboundInBodyBean.setNum(wOutboundInBodyBeans.stream().map(s -> s.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add));
            if(wOutboundInBodyBean.getNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "数量异常,请检查数量!");
            }
            WOutboundDetail wOutboundDetail = new WOutboundDetail();
            //查询物料数据
            MaterialDistribute materialDistribute = materialDistributeMapper.selectById(wOutboundInBodyBean.getMaterialId());
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
@@ -16,6 +16,7 @@
import doumeemes.core.utils.excel.EasyExcelUtil;
import doumeemes.core.utils.redis.RedisUtil;
import doumeemes.dao.business.PlansMapper;
import doumeemes.dao.business.WorkorderMapper;
import doumeemes.dao.business.dto.*;
import doumeemes.dao.business.model.*;
import doumeemes.dao.ext.*;
@@ -65,7 +66,8 @@
    private WorkorderHistoryExtMapper workorderHistoryExtMapper;
    @Autowired
    private WorkorderRecordExtMapper workorderRecordExtMapper;
    @Autowired
    private WorkorderMapper workorderMapper;
    @Autowired
    private RouteProcedureExtMapper routeProcedureExtMapper;
    @Autowired
@@ -140,6 +142,19 @@
//        //统计已完工数量
//        param.setStatus(Constants.WORKORDER_STATUS.done);
//        plan.setDoneNum(workorderExtMapper.sumOrderNum(param));
        QueryBomExtDTO bb = new QueryBomExtDTO();
        bb.setDepartId(plan.getDepartId());
        bb.setDeleted(Constants.ZERO);
        bb.setRootDepartId(user.getRootDepartment().getId());
        bb.setMaterialId(plan.getMaterialId());
        bb.setProcedureId(plan.getProcedureId());
        BomExtListVO versionBom = bomExtMapper.selectByModel( bb);
        if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){
            plan.setHasBom(Constants.ZERO);
        }else {
            plan.setBomType(Constants.formatIntegerNum(versionBom.getType()));
            plan.setHasBom(Constants.ONE);
        }
        return plan;
    }
@@ -601,7 +616,7 @@
        if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,计划已暂停!");
        }
        if(Constants.formatIntegerNum(mp.getDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){
        if(Constants.formatIntegerNum(mp.getWorkorderDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,累计分配数量大于计划数量!");
        }
        if(!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.publish)&&!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.distribute)){
@@ -1582,7 +1597,8 @@
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据");
        }
        //查询工序计划已分配数量
        List<Workorder> workorderList = workorderExtMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId()).notIn("STATUS",7,8));
        List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId())
                .notIn("STATUS",7,8));
        //本次产出数量
        BigDecimal num = autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum().add(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum());
        if(num.compareTo(BigDecimal.ZERO)<=Constants.ZERO){
@@ -1610,6 +1626,7 @@
            workorderRecordStandardService.createMaterialStandard(createMaterialDTO);
        }
        //工单产出记录
        autoWorkReportDTO.getCreateWorkorderRecordDTO().setWorkorderId(workorder.getId());
        workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user);
        //工单报工
        workorderRecordStandardService.comfirmDone(workorder);
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java
@@ -669,13 +669,13 @@
            if (bomDetailList == null || bomDetailList.size() == 0) {
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,该生产物料的bom配置有误,请联系管理员!");
            }
            for (BomDetailExtListVO i :bomDetailList) {
                //查询是否投料
                if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>()
                        .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工");
                }
            }
//            for (BomDetailExtListVO i :bomDetailList) {
//                //查询是否投料
//                if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>()
//                        .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){
//                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工");
//                }
//            }
        }
        WOutbound outbound = new WOutbound();
@@ -833,16 +833,16 @@
                }
                //如果是产出
                mp.setHasProduceNum(Constants.formatBigdecimal(tModel.getNum()).intValue()+Constants.formatIntegerNum(mp.getHasProduceNum()));
                if(tModel.getDoneType() == null){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!");
                }
                if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){
                    //如果不良,累计工单的不良产出
                    mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
                }else{
                    //如果是合格,累计工单的合格数量
                    mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
                }
//                if(tModel.getDoneType() == null){
//                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!");
//                }
//                if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){
//                    //如果不良,累计工单的不良产出
//                    mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
//                }else{
//                    //如果是合格,累计工单的合格数量
//                    mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
//                }
                //物料+批次+工序+质量属性去重
                WOutboundDetail detail =getWoutbondDetailByList(tModel,detailList);
server/src/main/resources/mappers/PlansExtMapper.xml
@@ -123,7 +123,7 @@
  <select id="selectByModel" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO">
  SELECT
  `a`.*
    ,(  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status !=6) AS workorderDistributNum
    ,ifnull((  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status not in (7,8) ),0) AS workorderDistributNum
    from plans a
    <where>
    <if test="id != null">
@@ -363,7 +363,7 @@
      `usermodel`.`SYSTEMID` AS USERMODEL_SYSTEMID,
      `usermodel`.`INVALID_TIME` AS USERMODEL_INVALID_TIME,
      `usermodel`.`TYPE` AS USERMODEL_TYPE
    ,(  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id  and b.status !=6) AS workorderDistributNum ,
    , ifnull((  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0  AND b.PLAN_ID = a.id  and b.status !=6),0) AS workorderDistributNum ,
    `mmodel`.name as materialName , `mmodel`.code as materialCode ,`fmodel`.name as factoryName , `pmodel`.name as produceName ,
      concat(`usermodel`.realname,' ',`usermodel`.mobile) as planUserName , `umodel`.name as unitName ,
      w.PLAN_CODE as workPlanCode , w.SALESORDER as salesOrder ,
server/src/main/resources/mappers/WorkPlansExtMapper.xml
@@ -168,7 +168,7 @@
        AND concat(#{planDateEnd},' 23:59:59') >= `a`.`PLAN_DATE`
      </if>
    </where>
        order by a.PLAN_DATE desc, a.CREATE_TIME  desc
        order by a.START_DATE desc, a.CREATE_TIME  desc
  </select>