From 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期三, 06 十二月 2023 08:41:32 +0800 Subject: [PATCH] bug --- server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java | 37 ++++++++++++++----------------------- 1 files changed, 14 insertions(+), 23 deletions(-) diff --git a/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java b/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java index 355ca24..368d0ae 100644 --- a/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java +++ b/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java @@ -62,12 +62,13 @@ @Override public Integer create(SalaryParam salaryParam) { - LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); - + DepartmentExtListVO department =departmentExtService.getModelById(principal.getCompany().getId(),salaryParam.getDepartId()); + Integer comDepartId = departmentExtService.getComDepartId(department); SalaryParam insert = new SalaryParam(); insert.setRootDepartId(principal.getRootDepartment().getId()); insert.setDepartId(salaryParam.getDepartId()); +// insert.setDepartId(comDepartId); insert.setProcedureId(salaryParam.getProcedureId()); insert.setMaterialId(salaryParam.getMaterialId()); insert.setDeleted((byte) Constants.ZERO); @@ -166,7 +167,7 @@ LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); SalaryParamDTO model = pageWrap.getModel(); model.setRootDepartId(principal.getRootDepartment().getId()); -// model.setDepartId(principal.getComDepartment().getId()); +// model.setDepartId(principal.getCurComDepartment().getId()); IPage<SalaryParamVO> salaryParamVOIPage = salaryParamMapper.selectPage(page, model); if (!CollectionUtils.isEmpty(salaryParamVOIPage.getRecords())){ salaryParamVOIPage.getRecords().forEach(s->s.setSalary(s.getSalary().divide(new BigDecimal(100)))); @@ -220,16 +221,19 @@ dparam.setType(Constants.DEPART_TYPE.factory); dparam = departmentExtService.findOne(dparam); if (Objects.isNull(dparam)){ - throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "瀵煎叆鏁版嵁鍐呭銆愬叕鍙稿悕绉般�戞湁璇紒"); + throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "瀵煎叆鏁版嵁鍐呭銆愬伐鍘傜粍缁囥�戞湁璇紒"); } DepartmentExtListVO department = new DepartmentExtListVO(); - BeanUtils.copyProperties(dparam, department); + department.setId(dparam.getId()); + department.setType(dparam.getType()); + department.setParentId(dparam.getParentId()); + department.setRootId(dparam.getRootId()); + department.setCompanyId(dparam.getCompanyId()); Integer comDepartId = departmentExtService.getComDepartId(department); - QueryWrapper<Material> materialWrapper = new QueryWrapper<>(); materialWrapper.lambda() .eq(Material::getCode,salaryParamImportDTO.getMaterialCode()) - .eq(Material::getRootDepartId,department.getRootId()) + .eq(Material::getRootDepartId,dparam.getRootId()) .eq(Material::getDeleted,Constants.ZERO) .last("limit 1"); Material material = materialMapper.selectOne(materialWrapper); @@ -237,7 +241,6 @@ 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(), "瀵煎叆鏁版嵁鍐呭銆愪骇鍝佸悕绉般�戞湁璇紒"); } @@ -252,18 +255,6 @@ 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()) @@ -276,9 +267,9 @@ } SalaryParam salaryParam = new SalaryParam(); salaryParam.setRootDepartId(department.getRootId()); - salaryParam.setDepartId(department.getId()); + salaryParam.setDepartId(dparam.getId()); salaryParam.setProcedureId(procedures.getId()); - salaryParam.setMaterialId(materialDistribute1.getId()); + salaryParam.setMaterialId(materialDistribute.getId()); salaryParam.setSalary(salaryParamImportDTO.getSalary()); salaryParam.setNum(new BigDecimal(salaryParamImportDTO.getNum())); salaryParam.setTimes(getIntegerTimes(salaryParamImportDTO.getTimesName())); @@ -291,7 +282,7 @@ }).orElse(0); salaryParam.setUnqualified(unqualified); - Integer type = Optional.ofNullable(salaryParamImportDTO.getUnqualified()).map(s -> { + Integer type = Optional.ofNullable(salaryParamImportDTO.getType()).map(s -> { if ("璁′欢".equals(s)) { return 0; } else { -- Gitblit v1.9.3