diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index f51b0baf..386981fe 100644 --- a/src/main/java/com/lz/config/ShiroConfig.java +++ b/src/main/java/com/lz/config/ShiroConfig.java @@ -65,6 +65,7 @@ public class ShiroConfig { filterMap.put("/aaa.txt", "anon"); filterMap.put("/dtlg/login", "anon"); filterMap.put("/oneCode/**", "anon"); + filterMap.put("/modules/**", "anon");//临时添加,后期去掉 filterMap.put("/dtlg/luck", "anon"); filterMap.put("/dtlg/look", "anon"); filterMap.put("/dtlg/jump", "anon"); diff --git a/src/main/java/com/lz/modules/app/controller/ReportResultController.java b/src/main/java/com/lz/modules/app/controller/ReportResultController.java index bd7b7e62..00b5eb2c 100644 --- a/src/main/java/com/lz/modules/app/controller/ReportResultController.java +++ b/src/main/java/com/lz/modules/app/controller/ReportResultController.java @@ -1,12 +1,13 @@ package com.lz.modules.app.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.google.common.collect.Maps; +import com.lz.common.utils.BigDecimalUtil; import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; -import com.lz.modules.app.dto.*; +import com.lz.modules.app.dto.CharBarDto; +import com.lz.modules.app.dto.DepartmentsDto; +import com.lz.modules.app.dto.GraphicsDto; +import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; -import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.enums.ResultRecordStatusEnum; import com.lz.modules.app.enums.ResultRecordTypeEnum; import com.lz.modules.app.resp.OwnResultResp; @@ -15,16 +16,20 @@ import com.lz.modules.app.service.DepartmentsService; import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.app.service.StaffService; import com.lz.modules.sys.controller.AbstractController; -import com.lz.modules.sys.entity.app.ResultRecord; import com.lz.modules.sys.service.app.ChartService; import com.lz.modules.sys.service.app.ResultRecordService; +import com.sun.org.apache.bcel.internal.generic.NEW; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.time.LocalDate; -import java.util.*; +import java.time.YearMonth; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; /** * @Author: djc @@ -49,36 +54,30 @@ public class ReportResultController extends AbstractController{ @RequestMapping("chart") - public R reportChart(String monthTime){ + public R reportChart(String monthTime,String departmentId){ if(StringUtil.isBlank(monthTime)){ - String time = LocalDate.now().toString(); - monthTime = time.substring(0,time.length()-3); + monthTime = YearMonth.now().toString(); } ReportChartResp data = new ReportChartResp(); //月初目标 - List start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime); + List start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime,departmentId); //月末结果 - List end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime); + List end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime,departmentId); //人员等级分布 + List allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(departmentId); + int total = staffService.countStaffByAllDeparmentIds(allDeparmentIds); List staffLevels = resultRecordService.staffDistribution(monthTime); - - List sortStaffLevels = new ArrayList<>(); - // 0人是否需要展示 - Map map = Maps.newHashMap(); + List names = new ArrayList<>(); + List datas = new ArrayList<>(); + int konwn = 0; for (GraphicsStatisticalDto staffLevel : staffLevels) { - map.put(staffLevel.getCategory(),staffLevel.getNumber()); - } - // 默认等级赋予默认值并排序 - for (String level : levels) { - GraphicsStatisticalDto dto = new GraphicsStatisticalDto(); - dto.setCategory(level); - if(!map.containsKey(level)){ - dto.setNumber(0); - }else { - dto.setNumber(map.get(level)); - } - sortStaffLevels.add(dto); + names.add(staffLevel.getCategory()); + datas.add(BigDecimalUtil.div(Double.valueOf(staffLevel.getNumber()),Double.valueOf(total),2)); + konwn = konwn + staffLevel.getNumber(); + logger.info("等级:" + staffLevel.getCategory() + " 人数:" + staffLevel.getNumber()); } + names.add("未知"); + datas.add(BigDecimalUtil.div(Double.valueOf((total - konwn)),Double.valueOf(total),2)); //部门等级占比 GraphicsDto dto = new GraphicsDto(); dto.setRows(start); @@ -86,9 +85,12 @@ public class ReportResultController extends AbstractController{ dto = new GraphicsDto(); dto.setRows(end); data.setResultDistribution(dto); - dto = new GraphicsDto(); - dto.setRows(sortStaffLevels); - data.setStaffDistribution(dto); + CharBarDto barDto= new CharBarDto(); + barDto.setNames(names); + barDto.setDatas(datas); + barDto.setTotal(total); + data.setStaffDistribution(barDto); + data.setMonthTime(YearMonth.now().toString()); return R.ok().put("data",data); } @@ -157,3 +159,25 @@ public class ReportResultController extends AbstractController{ } } + + + + + +// 0人是否需要展示 + /* List sortStaffLevels = new ArrayList<>(); + Map map = Maps.newHashMap(); + for (GraphicsStatisticalDto staffLevel : staffLevels) { + map.put(staffLevel.getCategory(),staffLevel.getNumber()); + } + // 默认等级赋予默认值并排序 + for (String level : levels) { + GraphicsStatisticalDto dto = new GraphicsStatisticalDto(); + dto.setCategory(level); + if(!map.containsKey(level)){ + dto.setNumber(0); + }else { + dto.setNumber(map.get(level)); + } + sortStaffLevels.add(dto); + }*/ \ No newline at end of file diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 5058cc95..5df40909 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -399,11 +399,10 @@ public class ResultRecordController extends AbstractController { if (!StringUtil.in(resultRecord.getStatus(),6)) { return R.error("您的提交记录中有状态不正确,请重新选择"); } - resultRecordService.reject(resultRecord); } if(batchOpt == 3 ){ for (ResultRecord resultRecord : resultRecords) { - r = resultRecordService.reject(resultRecord); + r = resultRecordService.reject(resultRecord,1); //更新驳回状态 if (!r.isSuccess()) { return r; } diff --git a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java index 398b70d2..29d3f5b3 100644 --- a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java +++ b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java @@ -80,8 +80,7 @@ public class StaffRoleController { List roles = recordRoleService.selectAll(); return R.ok().put("lzStaffRole", lzStaffRole) .put("staffs", newList) - .put("targetRoles", roles) - ; + .put("targetRoles", roles); } /** diff --git a/src/main/java/com/lz/modules/app/dto/CharBarDto.java b/src/main/java/com/lz/modules/app/dto/CharBarDto.java new file mode 100644 index 00000000..306c1a58 --- /dev/null +++ b/src/main/java/com/lz/modules/app/dto/CharBarDto.java @@ -0,0 +1,20 @@ +package com.lz.modules.app.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @Author: djc + * @Desc: + * @Date: 2020/9/21 10:21 + */ +@Data +public class CharBarDto { + + private List names; + + private List datas; + + private int total; +} diff --git a/src/main/java/com/lz/modules/app/dto/ChartDto.java b/src/main/java/com/lz/modules/app/dto/ChartDto.java deleted file mode 100644 index 06a4ce30..00000000 --- a/src/main/java/com/lz/modules/app/dto/ChartDto.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.lz.modules.app.dto; - -import lombok.Data; - -/** - * @Author: djc - * @Desc: - * @Date: 2020/9/16 16:39 - */ -@Data -public class ChartDto { - //属性名 - private String name; - //属性值 - private String value; -} diff --git a/src/main/java/com/lz/modules/app/resp/ReportChartResp.java b/src/main/java/com/lz/modules/app/resp/ReportChartResp.java index b157bbc3..b3c27fa2 100644 --- a/src/main/java/com/lz/modules/app/resp/ReportChartResp.java +++ b/src/main/java/com/lz/modules/app/resp/ReportChartResp.java @@ -1,12 +1,9 @@ package com.lz.modules.app.resp; -import com.lz.modules.app.dto.ChartDto; +import com.lz.modules.app.dto.CharBarDto; import com.lz.modules.app.dto.GraphicsDto; -import com.lz.modules.app.dto.GraphicsStatisticalDto; import lombok.Data; -import java.util.List; - /** * @Author: djc * @Desc: @@ -19,8 +16,8 @@ public class ReportChartResp { //月末结果 private GraphicsDto resultDistribution; //个人等级占比 - private GraphicsDto staffDistribution; - //部门等级占比 - private GraphicsDto departmentDistribution; + private CharBarDto staffDistribution; + //当前月份 + private String monthTime; } diff --git a/src/main/java/com/lz/modules/app/service/StaffService.java b/src/main/java/com/lz/modules/app/service/StaffService.java index 67143cc8..45946fb8 100644 --- a/src/main/java/com/lz/modules/app/service/StaffService.java +++ b/src/main/java/com/lz/modules/app/service/StaffService.java @@ -78,8 +78,10 @@ public interface StaffService extends IService { List selectBySearchName(IPage page, FindByNameModel nameModel); SysUserEntity getUser(String userName); - //查询部门下的所有人员 包括子部门下人员 - List selectAllStaffByDepartmentId(String departmentId); + //查询部门下的所有子部门 + List selectAllDeparmentIdsByDepartmentParentId(String departmentId); + //统计部门下的人数 + int countStaffByAllDeparmentIds(List deparmentIds); List selectAll(); } diff --git a/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java b/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java index a70454fe..a26c12c5 100644 --- a/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java +++ b/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java @@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; -import com.lz.common.utils.DateUtils; -import com.lz.common.utils.PageUtils; -import com.lz.common.utils.Query; -import com.lz.common.utils.R; +import com.lz.common.utils.*; import com.lz.modules.app.dao.DepartmentsDao; import com.lz.modules.app.dto.*; import com.lz.modules.app.dao.StaffDao; @@ -18,6 +15,7 @@ import com.lz.modules.app.service.*; import com.lz.modules.equipment.entity.model.FindByNameModel; import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import com.lz.modules.sys.entity.SysUserEntity; +import org.apache.commons.collections.CollectionUtils; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,6 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; @Service("staffService") @@ -50,6 +50,8 @@ public class StaffServiceImpl extends ServiceImpl impleme DepartmentsStaffRelateService departmentsStaffRelateService; @Autowired private DepartmentsDao departmentsDao; + @Autowired + private StaffService staffService; @@ -383,11 +385,42 @@ public class StaffServiceImpl extends ServiceImpl impleme @Override - public List selectAllStaffByDepartmentId(String departmentId) { - //154344269,154322459,154274609,154254673 - List parentsIds = Lists.newArrayList("154344269","154322459","154274609","154254673"); + public List selectAllDeparmentIdsByDepartmentParentId(String departmentId) { + //默认所有 + if(StringUtil.isBlank(departmentId)){ + departmentId = "1"; + } + List parentsIds = Lists.newArrayList(departmentId); List departmentsList = new ArrayList<>(); - return null; + List childs = departmentsDao.selectDepartmentIdsByparentIds(parentsIds); + if(CollectionUtils.isEmpty(childs)){ + departmentsList.addAll(parentsIds); + return departmentsList; + } + departmentsList.addAll(childs); + List allChilds = getAllChilds(departmentsList, childs); + return allChilds; + } + + + @Override + public int countStaffByAllDeparmentIds(List deparmentIds) { + if(CollectionUtils.isEmpty(deparmentIds)){ + return 0; + } + //获取所有子部门 + List list = departmentsStaffRelateService.list(new QueryWrapper() + .select("staff_id") + .eq("is_delete", 0) + .in("department_id", deparmentIds)); + if(CollectionUtils.isEmpty(list)){ + return 0; + } + //获取人员个数去重 + List staffs = list.stream().map(e -> e.getStaffId() + "").collect(Collectors.toList()); + List staffdistincts = staffs.stream().distinct().collect(Collectors.toList()); + return staffdistincts.size(); + } @Override @@ -403,12 +436,11 @@ public class StaffServiceImpl extends ServiceImpl impleme */ private List getAllChilds(List departmentsList,List parentIds){ List childs = departmentsDao.selectDepartmentIdsByparentIds(parentIds); - /* while (childs!=null){ - - }*/ - return null; - - + if(CollectionUtils.isEmpty(childs)){ + return departmentsList; + } + departmentsList.addAll(childs); + return getAllChilds(departmentsList,childs); } diff --git a/src/main/java/com/lz/modules/equipment/controller/EquipmentBrandController.java b/src/main/java/com/lz/modules/equipment/controller/EquipmentBrandController.java index 437edf22..87e385d5 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EquipmentBrandController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EquipmentBrandController.java @@ -139,11 +139,18 @@ public class EquipmentBrandController { EquipmentType type = map.get(brand.getTypeId()); if(type !=null){ resp.setTypeName(type.getType()); + }else{ + resp.setTypeName("【分类被删】"); } resps.add(resp); } + EquipmentType type = new EquipmentType(); + type.setId(null); + type.setType("全部"); + equipmentTypes.add(0, type); return R.ok().put("total", page.getTotalCount()) .put("rows", resps) + .put("types", equipmentTypes) ; } diff --git a/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java b/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java index 90ff93f3..0b728beb 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java @@ -41,6 +41,7 @@ public class EquipmentInfoController { private TCountService tCountService; + /** * 添加设备表页面 * @@ -104,13 +105,13 @@ public class EquipmentInfoController { public R equipmentInfoEdit(@RequestBody EquipmentInfoReq req) throws Exception { EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoById(req.getId()); BeanUtils.copyProperty(equipmentInfo, req, true); - Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0); + /*Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0);//20200921注释掉,后台不支持修改类型,品牌等,只能修改备注,时间,金额 EquipmentType type = equipmentTypeService.selectEquipmentTypeById(typeId); equipmentInfo.setType(type.getType()); Long brandId = NumberUtil.objToLongDefault(equipmentInfo.getBrandName(), 0); EquipmentBrand equipmentBrand = equipmentBrandService.selectEquipmentBrandById(brandId); - equipmentInfo.setBrandName(equipmentBrand.getBrand()); + equipmentInfo.setBrandName(equipmentBrand.getBrand());*/ equipmentInfoService.updateEquipmentInfoById(equipmentInfo); return R.ok("编辑成功"); } @@ -149,8 +150,17 @@ public class EquipmentInfoController { */ @RequestMapping(value = "/modules/usereq/equipmentInfoList") public R equipmentInfoList(@RequestBody EquipmentInfoReq req) throws Exception { + List types = equipmentTypeService.selectAll(); + List tcounts = tCountService.selectListLimit(10); + EquipmentType type = new EquipmentType(); + type.setId(null); + type.setType("全部"); + types.add(0, type); PageUtils page = equipmentInfoService.selectByCondition(req); return R.ok().put("total", page.getTotalCount()) - .put("rows", page.getList()); + .put("rows", page.getList()) + .put("types", types) + .put("tCounts", tcounts) + .put("curCount", req.getCount()); } } diff --git a/src/main/java/com/lz/modules/equipment/controller/EquipmentSpecsController.java b/src/main/java/com/lz/modules/equipment/controller/EquipmentSpecsController.java index eafdc2b9..0367dfe0 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EquipmentSpecsController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EquipmentSpecsController.java @@ -129,6 +129,11 @@ public class EquipmentSpecsController { @RequestMapping(value = "/modules/specs/brandList") public R brandList(@RequestBody EquipmentSpecsReq req) throws Exception { List brands = equipmentBrandService.selectByTypeId(req.getTypeId()); + EquipmentBrand band = new EquipmentBrand(); + band.setId(null); + band.setTypeId(null); + band.setBrand("全部"); + brands.add(0, band); return R.ok().put("brands",brands); } @@ -157,8 +162,22 @@ public class EquipmentSpecsController { for (EquipmentSpecs specs : specsList) { EquipmentSpecsResp resp = new EquipmentSpecsResp(); resp.setId(specs.getId()); - resp.setType(typeMap.get(specs.getTypeId()).getType()); - resp.setBrand(brandMap.get(specs.getBrandId()).getBrand()); + EquipmentType type = typeMap.get(specs.getTypeId()); + if(type == null){ + resp.setType("【分类被删】"); + }else{ + resp.setType(type.getType()); + resp.setTypeId(type.getId()); + } + + EquipmentBrand brand = brandMap.get(specs.getBrandId()); + if(brand == null){ + resp.setBrand("【品牌被删】"); + }else{ + resp.setBrand(brand.getBrand()); + resp.setBrandId(brand.getId()); + } + resp.setSpecs(specs.getSpecs()); resp.setRank(specs.getRank()); resp.setSkus(specs.getSkus()); @@ -166,7 +185,12 @@ public class EquipmentSpecsController { resp.setRemark(specs.getRemark()); resps.add(resp); } + EquipmentType type = new EquipmentType(); + type.setId(null); + type.setType("全部"); + types.add(0, type); return R.ok().put("total", page.getTotalCount()) - .put("rows", resps); + .put("rows", resps) + .put("types", types); } } diff --git a/src/main/java/com/lz/modules/equipment/controller/OneCodeController.java b/src/main/java/com/lz/modules/equipment/controller/OneCodeController.java index c055a921..8a3e0857 100644 --- a/src/main/java/com/lz/modules/equipment/controller/OneCodeController.java +++ b/src/main/java/com/lz/modules/equipment/controller/OneCodeController.java @@ -1,9 +1,11 @@ package com.lz.modules.equipment.controller; +import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; import com.lz.modules.equipment.entity.OneCode; +import com.lz.modules.equipment.entity.OneCodeReq; import com.lz.modules.equipment.service.OneCodeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; @@ -24,6 +26,17 @@ public class OneCodeController { + /** + * 获取code编码, + * */ + @RequestMapping("/get/getPrints") + public R getPrints(@RequestBody OneCodeReq req) { + + PageUtils pageUtils = oneCodeService.selectByReq(req); + + return R.ok().put("codes", pageUtils); + } + /** * 批量生成指定数量编码, * */ diff --git a/src/main/java/com/lz/modules/equipment/dao/EquipmentBrandMapper.java b/src/main/java/com/lz/modules/equipment/dao/EquipmentBrandMapper.java index 81d2643e..682facb2 100644 --- a/src/main/java/com/lz/modules/equipment/dao/EquipmentBrandMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/EquipmentBrandMapper.java @@ -38,7 +38,7 @@ public interface EquipmentBrandMapper extends BaseMapper { EquipmentBrand selectEquipmentBrandByTypeBrand(@Param("typeId") Long typeId, @Param("brand") String brand); - List selectByCondition(IPage page, EquipmentBrandReq req); + List selectByCondition(@Param("page") IPage page, @Param("req") EquipmentBrandReq req); List selectEquipmentBrandByTypeAndLikeBrand(@Param("typeId") Long typeId, @Param("brand") String brand); List selectAll(); diff --git a/src/main/java/com/lz/modules/equipment/dao/EquipmentInfoMapper.java b/src/main/java/com/lz/modules/equipment/dao/EquipmentInfoMapper.java index 95118845..95080d38 100644 --- a/src/main/java/com/lz/modules/equipment/dao/EquipmentInfoMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/EquipmentInfoMapper.java @@ -39,7 +39,7 @@ public interface EquipmentInfoMapper extends BaseMapper { EquipmentInfo selectEquipmentInfoByCode(@Param("code") String code); - List selectByCondition(IPage page, EquipmentInfoReq req); + List selectByCondition(@Param("page") IPage page, @Param("req") EquipmentInfoReq req); List selectByStaffIdOrDepId(@Param("page") IPage page, @Param("nameModel") FindEquipmentsByNameModel nameModel); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/dao/EquipmentSpecsMapper.java b/src/main/java/com/lz/modules/equipment/dao/EquipmentSpecsMapper.java index c1a9eeb6..e7d672d4 100644 --- a/src/main/java/com/lz/modules/equipment/dao/EquipmentSpecsMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/EquipmentSpecsMapper.java @@ -37,7 +37,7 @@ public interface EquipmentSpecsMapper extends BaseMapper { EquipmentSpecs selectEquipmentSpecsByTypeBrandSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs); - List selectByCondition(IPage page, EquipmentSpecsReq req); + List selectByCondition(@Param("page") IPage page, @Param("req") EquipmentSpecsReq req); List selectEquipmentSpecsByTypeBrandLikeSpecss(@Param("typeId") Long typeId, @Param("brandId") Long brandId, @Param("specs") String specs); EquipmentSpecs selectSpecs(@Param("specs") String specs); diff --git a/src/main/java/com/lz/modules/equipment/dao/EquipmentTypeMapper.java b/src/main/java/com/lz/modules/equipment/dao/EquipmentTypeMapper.java index 3ce27d1d..1ab3ddf2 100644 --- a/src/main/java/com/lz/modules/equipment/dao/EquipmentTypeMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/EquipmentTypeMapper.java @@ -41,7 +41,7 @@ public interface EquipmentTypeMapper extends BaseMapper { List selectByType(@Param("type") String type); - List selectByCondition(IPage page, EquipmentTypeReq req); + List selectByCondition(@Param("page") IPage page, @Param("req") EquipmentTypeReq req); List selectAll(); diff --git a/src/main/java/com/lz/modules/equipment/dao/OneCodeMapper.java b/src/main/java/com/lz/modules/equipment/dao/OneCodeMapper.java index 88e26a2f..910d6907 100644 --- a/src/main/java/com/lz/modules/equipment/dao/OneCodeMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/OneCodeMapper.java @@ -8,7 +8,9 @@ package com.lz.modules.equipment.dao; * @since 2020-07-29 */ import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.lz.modules.equipment.entity.OneCode; +import com.lz.modules.equipment.entity.OneCodeReq; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -40,4 +42,6 @@ public interface OneCodeMapper extends BaseMapper { OneCode selectByCode(@Param("code") String code); Long updatePrintOneCodes(List codes); + + List selectByCondition(@Param("page") IPage page, @Param("req") OneCodeReq req); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/entity/OneCodeReq.java b/src/main/java/com/lz/modules/equipment/entity/OneCodeReq.java new file mode 100644 index 00000000..2d10e6f0 --- /dev/null +++ b/src/main/java/com/lz/modules/equipment/entity/OneCodeReq.java @@ -0,0 +1,33 @@ +package com.lz.modules.equipment.entity; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** +*

+* 菜单权限表 +*

*员工表 +* @author quyixiao +* @since 2020-07-30 +*/ + + +@Data +public class OneCodeReq implements java.io.Serializable { + + private int page = 1; + private int rows = 10; + private Long id; + //是否删除0未删除,1删除 + private Integer isDelete; + //创建时间 + private Date gmtCreate; + //修改时间 + private Date gmtModified; + //编码 + private String code; + //是否打印 0未打印 1打印 + private Integer isPrint; +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/service/OneCodeService.java b/src/main/java/com/lz/modules/equipment/service/OneCodeService.java index 648d280d..a6e43581 100644 --- a/src/main/java/com/lz/modules/equipment/service/OneCodeService.java +++ b/src/main/java/com/lz/modules/equipment/service/OneCodeService.java @@ -2,7 +2,9 @@ package com.lz.modules.equipment.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.common.utils.PageUtils; import com.lz.modules.equipment.entity.OneCode; +import com.lz.modules.equipment.entity.OneCodeReq; import java.util.List; @@ -40,4 +42,6 @@ public interface OneCodeService extends IService { OneCode selectByCode(String code); Long updatePrintOneCodes(List codes); + + PageUtils selectByReq(OneCodeReq req); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java b/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java index 69db429a..5f75109e 100644 --- a/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java +++ b/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java @@ -16,6 +16,7 @@ import com.lz.modules.equipment.entity.model.FindByNameModel; import com.lz.modules.equipment.entity.model.FindEquipmentsByNameModel; import com.lz.modules.equipment.service.IEquipmentInfoService; import com.lz.modules.sys.entity.SysUserEntity; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -33,6 +34,7 @@ import java.util.List; */ @Service +@Slf4j public class EquipmentInfoServiceImpl extends ServiceImpl implements IEquipmentInfoService { @@ -98,6 +100,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl impl return oneCodeMapper.updatePrintOneCodes(codes); } + @Override + public PageUtils selectByReq(OneCodeReq req){ + PageUtils pageUtils = PageUtils.startPage(req.getPage(), req.getRows()).doSelect( + page -> oneCodeMapper.selectByCondition(page, req) + ); + return pageUtils; + } + } diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java index 140e1d6b..609bd8f9 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java @@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Maps; import com.lz.common.utils.NumberUtil; import com.lz.common.utils.PageUtils; -import com.lz.common.utils.StringUtil; import com.lz.modules.app.dao.DepartmentsDao; import com.lz.modules.app.dao.StaffDao; import com.lz.modules.app.dto.StaffRoleResp; import com.lz.modules.app.entity.DepartmentsEntity; +import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.StaffEntity; +import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.flow.dao.RecordRoleMapper; import com.lz.modules.flow.dao.StaffRoleDepartmentMapper; import com.lz.modules.flow.dao.StaffRoleMapper; @@ -18,13 +19,11 @@ import com.lz.modules.flow.entity.RecordRole; import com.lz.modules.flow.entity.StaffRole; import com.lz.modules.flow.entity.StaffRoleDepartment; import com.lz.modules.flow.service.RecordRoleService; -import com.lz.modules.flow.service.StaffRoleDepartmentService; import com.lz.modules.flow.service.StaffRoleService; import com.lz.modules.sys.entity.SysMenuEntity; import com.lz.modules.sys.entity.SysRoleEntity; import com.lz.modules.sys.service.app.ResultRecordService; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -70,6 +69,9 @@ public class StaffRoleServiceImpl extends ServiceImpl s.getDepartmentParentId().equals("1")) .collect(Collectors.toList()); - + List departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll(); + Map departmentsStaffRelateEntityMap = new HashMap<>(); + for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){ + if(new Integer(1).equals(d.getIsLeader())){ + departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d); + } + } + List staffEntities = staffDao.selectAll(); + Map staffMap = new HashMap<>(); + for(StaffEntity staffEntity : staffEntities){ + staffMap.put(staffEntity.getId(),staffEntity); + } List list = new ArrayList<>(); - for(DepartmentsEntity d:parentDepartments){ - SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(),0l),d.getDepartmentName(),0l,""); - getMenuList(tDepartments,entity,list); + for (DepartmentsEntity d : parentDepartments) { + String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId()); + SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, ""); + getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap); list.add(entity); } return list; } - public void getMenuList(List tDepartments,SysMenuEntity sysMenuEntity,List list) { + public String getSuffix(Map departmentsStaffRelateEntityMap, Map staffMap,String departmentId){ + String suffix = ""; + DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId); + if(departmentsStaffRelateEntity !=null){ + StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId()); + if(staffEntity !=null ){ + suffix = " , "+staffEntity.getName(); + } + } + return suffix; + } + + public void getMenuList(List tDepartments,SysMenuEntity sysMenuEntity,List list, + Map departmentsStaffRelateEntityMap, Map staffMap) { for(DepartmentsEntity child : tDepartments) { if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){ + String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId()); SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l), - child.getDepartmentName(),sysMenuEntity.getMenuId(),sysMenuEntity.getName()); - getMenuList(tDepartments,entity,list); + departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName()); + getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap); list.add(entity); } } diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java index f623fd50..93d475bc 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java @@ -10,7 +10,6 @@ package com.lz.modules.sys.dao.app; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.lz.modules.app.dto.ChartDto; import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.req.ResultRecordReq; import com.lz.modules.app.resp.OwnResultResp; @@ -57,8 +56,5 @@ public interface ResultRecordMapper extends BaseMapper { List staffDistribution(@Param("monthTime") String monthTime); - List departmentDistribution(@Param("monthTime") String monthTime); - - ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/ChartService.java b/src/main/java/com/lz/modules/sys/service/app/ChartService.java index 945e82ca..100252e3 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ChartService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ChartService.java @@ -1,6 +1,5 @@ package com.lz.modules.sys.service.app; -import com.lz.modules.app.dto.ChartDto; import com.lz.modules.app.dto.GraphicsStatisticalDto; import java.util.List; @@ -18,7 +17,7 @@ public interface ChartService { * @param monthTime * @return */ - List resultProgressDistribution(int type, String monthTime); + List resultProgressDistribution(int type, String monthTime,String departmentId); diff --git a/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java b/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java index d9d41e0f..1d97d8bf 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.lz.common.emun.WorkMsgTypeEnum; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; -import com.lz.modules.app.dto.ChartDto; import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.entity.DepartmentsEntity; import com.lz.modules.app.entity.StaffEntity; @@ -12,6 +11,7 @@ import com.lz.modules.app.req.ResultRecordReq; import com.lz.modules.app.resp.OwnResultResp; import com.lz.modules.app.utils.t.TwoTuple; import com.lz.modules.flow.entity.Flow; +import com.lz.modules.flow.model.StaffRoleDto; import com.lz.modules.sys.entity.SysUserEntity; import com.lz.modules.sys.entity.app.ResultRecord; @@ -81,16 +81,11 @@ public interface ResultRecordService extends IService { */ List staffDistribution(String monthTime); - /** - * 部门等级占比 - * @param monthTime - * @return - */ - List departmentDistribution(String monthTime); Map> getStringListMap(List tDepartments); ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status); - R reject( ResultRecord resultRecord); + R reject( ResultRecord resultRecord,Integer status); + StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List staffRoleDtos, Long roleId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ChartServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ChartServiceImpl.java index 8ffd7307..a306d089 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ChartServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ChartServiceImpl.java @@ -1,8 +1,6 @@ package com.lz.modules.sys.service.app.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.lz.common.utils.StringUtil; -import com.lz.modules.app.dto.ChartDto; import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.enums.ResultRecordStatusEnum; @@ -10,7 +8,6 @@ import com.lz.modules.app.service.StaffService; import com.lz.modules.sys.entity.app.ResultRecord; import com.lz.modules.sys.service.app.ChartService; import com.lz.modules.sys.service.app.ResultRecordService; -import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,15 +26,18 @@ public class ChartServiceImpl implements ChartService { @Autowired private StaffService staffService; @Override - public List resultProgressDistribution(int type, String monthTime) { + public List resultProgressDistribution(int type, String monthTime,String departmentId) { List dtos = new ArrayList<>(); - int total = staffService.count(new QueryWrapper().eq("is_delete", 0)); - + //获取所有人员总数 + List allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(departmentId); + int total = staffService.countStaffByAllDeparmentIds(allDeparmentIds); + //已提交 int commit = resultRecordService.count(new QueryWrapper() .eq("is_delete", 0) .eq("type", type) .like("month_time",monthTime) .ne("status", ResultRecordStatusEnum.CREATE.getStatus())); + //已完成 int finished = resultRecordService.count(new QueryWrapper() .eq("is_delete", 0) .eq("type", type) @@ -45,17 +45,23 @@ public class ChartServiceImpl implements ChartService { .in("status", ResultRecordStatusEnum.REFUSE.getStatus(),ResultRecordStatusEnum.AGREE.getStatus())); GraphicsStatisticalDto dto = new GraphicsStatisticalDto(); - dto.setCategory("未提交"); - dto.setNumber(total-commit); - dtos.add(dto); - dto = new GraphicsStatisticalDto(); - dto.setCategory("已完成"); - dto.setNumber(finished); - dtos.add(dto); - dto = new GraphicsStatisticalDto(); - dto.setCategory("审核中"); - dto.setNumber(commit-finished); - dtos.add(dto); + if(total-commit>0){ + dto.setCategory("未提交"); + dto.setNumber(total-commit); + dtos.add(dto); + } + if(finished>0){ + dto = new GraphicsStatisticalDto(); + dto.setCategory("已完成"); + dto.setNumber(finished); + dtos.add(dto); + } + if(commit-finished>0){ + dto = new GraphicsStatisticalDto(); + dto.setCategory("审核中"); + dto.setNumber(commit-finished); + dtos.add(dto); + } return dtos; } diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java index 1ef12c76..734b42f5 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultDetailServiceImpl.java @@ -214,49 +214,10 @@ public class ResultDetailServiceImpl extends ServiceImpl getStepList(ResultRecord resultRecord) { Long staffId = resultRecord.getStaffId(); int type = resultRecord.getType(); - String departmentId = resultRecord.getDepartmentId(); List stepList = new ArrayList<>(); - StaffEntity mySelf = staffService.selectStaffById(staffId); - TwoTuple> flowInfo = resultRecordService.getFlowInfo(staffId, type); - Long flowId = flowInfo.getFirst(); - List list = flowInfo.getSecond(); - List flowRelations = flowRelationService.selectFlowRelationAll(); - Map staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p)); - //approvalList = [ME,ONE_D,TWO_D,HR,BOSS] - List approvalList = new ArrayList<>(); - Map roleNameMap = new HashMap<>(); - approvalList.add("ME"); - roleNameMap.put("ME",mySelf.getName()); - for (FlowRelation flowRelation : flowRelations) { - FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild()); - if (flowDepartment != null || flowRelation.getCanReplace() == 0) { - approvalList.add(flowRelation.getChild()); - String departmentLevel = flowRelation.getChild(); - if(flowDepartment != null ){ - StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId()); - roleNameMap.put(departmentLevel,flowStaff.getName()); - }else{ - List staffRoles = staffRoleService.selectByRole(departmentLevel); - Long approvalStaffId = 0l; - for (StaffRole staffRole : staffRoles) { - List staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId()); - Map departmentIdMap = departmentsService.selectUserAllDepartmentIds(departmentId); - for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) { - String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId()); - if (StringUtil.isNotBlank(value)) { - approvalStaffId =staffRole.getStaffId(); - break; - } - } - } - StaffEntity flowStaff = staffService.selectStaffById(approvalStaffId); - roleNameMap.put(departmentLevel,flowStaff.getName()); - } - } - } - log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap)); - List flows = flowService.selectByFlowId(flowId); + + List flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId()); SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm"); FlowRecord lastFlowRecord = null; @@ -270,8 +231,43 @@ public class ResultDetailServiceImpl extends ServiceImpl approvalList = new ArrayList<>(); + Map roleNameMap = new HashMap<>(); + approvalList.add("ME"); + roleNameMap.put("ME",mySelf.getName()); + + TwoTuple> flowInfo = resultRecordService.getFlowInfo(staffId, type); + List list = flowInfo.getSecond(); + + List flowRelations = flowRelationService.selectFlowRelationAll(); + Map staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p)); + + + Long flowId = flowInfo.getFirst(); + List flows = flowService.selectByFlowId(flowId); + int flowIndex = lastFlowRecord != null ? lastFlowRecord.getFlowIndex() + 1 : 1; log.info("flowIndex = " + flowIndex); + for (FlowRelation flowRelation : flowRelations) { + FlowDepartment flowDepartment = staffEntityMap.get(flowRelation.getChild()); + if (flowDepartment != null || flowRelation.getCanReplace() == 0) { + approvalList.add(flowRelation.getChild()); + String departmentLevel = flowRelation.getChild(); + if(flowDepartment != null ){ + StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId()); + roleNameMap.put(departmentLevel,flowStaff.getName()); + }else{ + Long roleId = flows.get(flowIndex - 1).getRoleId(); + List staffRoleDtos = new ArrayList<>(); + StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId); + roleNameMap.put(departmentLevel,approvalStaff.getName()); + } + } + } + + log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap)); for (int i = flowIndex; i < flowIndex + 10; i++) { int index = resultRecordService.getDepartmentLevelIndex(flows, i); if (index < 0 || index >= approvalList.size()) { diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index 078545ca..e00b0008 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -7,7 +7,6 @@ import com.lz.common.emun.WorkMsgTypeEnum; import com.lz.common.utils.*; import com.lz.modules.app.dao.DepartmentsDao; import com.lz.modules.app.dao.DepartmentsStaffRelateDao; -import com.lz.modules.app.dto.ChartDto; import com.lz.modules.app.dto.EmployeesDto; import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.entity.DepartmentsEntity; @@ -466,7 +465,7 @@ public class ResultRecordServiceImpl extends ServiceImpl staffRoleDtos, Long roleId) { + @Override + public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List staffRoleDtos, Long roleId) { + StaffEntity approvalStaff = null; List staffRoles = staffRoleService.selectByRole(departmentLevel); for (StaffRole staffRole : staffRoles) { List staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId()); @@ -585,11 +586,11 @@ public class ResultRecordServiceImpl extends ServiceImpl flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(), resultRecord.getType()); if (flowRecords != null && flowRecords.size() == 2) { // 表示可以撤回 - r = reject(resultRecord); + r = reject(resultRecord,5); } else if (flowRecords != null && flowRecords.size() > 2) { return R.error("你的领导己经审批,不能撤回了"); } @@ -621,14 +622,14 @@ public class ResultRecordServiceImpl extends ServiceImpl flowRecords = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId()); StaffEntity mySelf = staffService.selectStaffById(resultRecord.getStaffId()); StaffEntity approvalStaff = mySelf; if (flowRecords.size() >= 2) { FlowRecord secondFlowRecord = flowRecords.get(flowRecords.size() - 2); resultRecord.setFlowStaffIdRole(secondFlowRecord.getFlowStaffIdRole()); - resultRecord.setStatus(5); //更新驳回状态为5 + resultRecord.setStatus(status); //更新驳回状态为5 List list = JSONObject.parseArray(resultRecord.getFlowStaffIdRole(), StaffRoleDto.class); if (CollectionUtils.isNotEmpty(list)) { StaffRoleDto staffRoleDto = list.get(0); @@ -693,9 +694,4 @@ public class ResultRecordServiceImpl extends ServiceImpl staffDistribution(String monthTime) { return resultRecordMapper.staffDistribution(monthTime); } - - @Override - public List departmentDistribution(String monthTime) { - return resultRecordMapper.departmentDistribution(monthTime); - } } diff --git a/src/main/resources/mapper/app/ResultRecordMapper.xml b/src/main/resources/mapper/app/ResultRecordMapper.xml index 244b19b8..abf97f38 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -265,12 +265,7 @@ - - - diff --git a/src/main/resources/mapper/equipment/EquipmentBrandMapper.xml b/src/main/resources/mapper/equipment/EquipmentBrandMapper.xml index b78c5728..44eec398 100644 --- a/src/main/resources/mapper/equipment/EquipmentBrandMapper.xml +++ b/src/main/resources/mapper/equipment/EquipmentBrandMapper.xml @@ -89,9 +89,9 @@ diff --git a/src/main/resources/mapper/equipment/EquipmentInfoMapper.xml b/src/main/resources/mapper/equipment/EquipmentInfoMapper.xml index f4c25a4c..8fe03d64 100644 --- a/src/main/resources/mapper/equipment/EquipmentInfoMapper.xml +++ b/src/main/resources/mapper/equipment/EquipmentInfoMapper.xml @@ -171,60 +171,60 @@ - select * from equipment_specs where is_delete = 0 - and type_id = #{typeId} - and brand_id = #{brandId} - - AND specs LIKE CONCAT('%',#{specs},'%') + and type_id = #{req.typeId} + and brand_id = #{req.brandId} + + AND specs LIKE CONCAT('%',#{req.specs},'%') order by rank desc, id desc diff --git a/src/main/resources/mapper/equipment/EquipmentTypeMapper.xml b/src/main/resources/mapper/equipment/EquipmentTypeMapper.xml index d605a5ce..df0ff4aa 100644 --- a/src/main/resources/mapper/equipment/EquipmentTypeMapper.xml +++ b/src/main/resources/mapper/equipment/EquipmentTypeMapper.xml @@ -95,8 +95,8 @@ + select * from one_code where is_delete = 0 + and isPrint = #{req.isPrint} + and code like CONCAT('%', #{req.code}, '%') + order by id desc + + diff --git a/src/main/resources/mapper/equipment/TCountMapper.xml b/src/main/resources/mapper/equipment/TCountMapper.xml index 7c805206..de55da27 100644 --- a/src/main/resources/mapper/equipment/TCountMapper.xml +++ b/src/main/resources/mapper/equipment/TCountMapper.xml @@ -66,7 +66,7 @@ - update equipment_t_count set is_delete = 1 where id=#{id} limit 1 + update equipment_t_count set is_delete = 1 where id=#{id} limit 1