jiangping
2023-08-18 6ad10e278e9193bd65314a2f3c954ab16e8c104f
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
@@ -11,6 +11,7 @@
import doumeemes.dao.business.*;
import doumeemes.dao.business.model.*;
import doumeemes.dao.business.vo.SalaryParamVO;
import doumeemes.dao.ext.MaterialExtMapper;
import doumeemes.dao.ext.dto.SalaryParamDTO;
import doumeemes.dao.ext.dto.SalaryParamImportDTO;
import doumeemes.dao.ext.vo.DepartmentExtListVO;
@@ -70,6 +71,7 @@
        insert.setProcedureId(salaryParam.getProcedureId());
        insert.setMaterialId(salaryParam.getMaterialId());
        insert.setDeleted((byte) Constants.ZERO);
        insert.setType(salaryParam.getType());
        if(findOne(insert) != null){
            throw  new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"同一个物料在相同工序不能重复配置哦!");
        }
@@ -235,6 +237,7 @@
            if (Objects.isNull(material)){
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品编码】有误!");
            }
<<<<<<< HEAD
            if (Objects.nonNull(material) && !Objects.equals(material.getName(),salaryParamImportDTO.getMaterialName())){
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品名称】有误!");
            }
@@ -249,6 +252,18 @@
            if (Objects.isNull(materialDistribute)){
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品编码】有误!");
            }
=======
            QueryWrapper<MaterialDistribute>  materialDistribute = new QueryWrapper<>();
            materialDistribute.lambda()
                                .eq(MaterialDistribute::getDeleted,Constants.ZERO)
                                .eq(MaterialDistribute::getMaterialId,material.getId())
                                .eq(MaterialDistribute::getRootDepartId,department.getRootId())
                                .eq(MaterialDistribute::getDepartId,department.getParentId());
            MaterialDistribute materialDistribute1 = materialDistributeMapper.selectOne(materialDistribute);
//            if (Objects.nonNull(material) && !Objects.equals(material.getName(),salaryParamImportDTO.getMaterialName())){
//                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品名称】有误!");
//            }
>>>>>>> 4d94726acad17e5cdcf828e21cab762e8b39921c
            QueryWrapper<Procedures> proceduresWrapper = new QueryWrapper<>();
            proceduresWrapper.lambda()
                    .eq(Procedures::getName,salaryParamImportDTO.getProcedureName())
@@ -263,7 +278,7 @@
            salaryParam.setRootDepartId(department.getRootId());
            salaryParam.setDepartId(department.getId());
            salaryParam.setProcedureId(procedures.getId());
            salaryParam.setMaterialId(materialDistribute.getId());
            salaryParam.setMaterialId(materialDistribute1.getId());
            salaryParam.setSalary(salaryParamImportDTO.getSalary());
            salaryParam.setNum(new BigDecimal(salaryParamImportDTO.getNum()));
            salaryParam.setTimes(getIntegerTimes(salaryParamImportDTO.getTimesName()));