From 5c31bba5313042751b000e2f3a3b5e32e6d39136 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 21 Sep 2020 17:05:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E5=93=81=E7=89=8C=E7=AD=89=E7=AE=A1=E7=90=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lz/config/ShiroConfig.java | 1 + .../controller/EquipmentBrandController.java | 7 ++ .../controller/EquipmentInfoController.java | 16 ++++- .../controller/EquipmentSpecsController.java | 30 ++++++++- .../equipment/dao/EquipmentBrandMapper.java | 2 +- .../equipment/dao/EquipmentInfoMapper.java | 2 +- .../equipment/dao/EquipmentSpecsMapper.java | 2 +- .../equipment/dao/EquipmentTypeMapper.java | 2 +- .../impl/EquipmentInfoServiceImpl.java | 3 + .../mapper/equipment/EquipmentBrandMapper.xml | 6 +- .../mapper/equipment/EquipmentInfoMapper.xml | 66 +++++++++---------- .../mapper/equipment/EquipmentSpecsMapper.xml | 10 +-- .../mapper/equipment/EquipmentTypeMapper.xml | 4 +- .../mapper/equipment/TCountMapper.xml | 14 ++-- 14 files changed, 105 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index bd108625..26e4c61d 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/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..22a1f390 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); 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/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/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 select * from equipment_brand where is_delete = 0 - and type_id = #{typeId} - - AND brand LIKE CONCAT('%',#{brand},'%') + and type_id = #{req.typeId} + + AND brand LIKE CONCAT('%',#{req.brand},'%') order by rank desc , id desc 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 t_count where id=#{id} and is_delete = 0 limit 1 + select * from equipment_t_count where id=#{id} and is_delete = 0 limit 1 - insert into t_count( + insert into equipment_t_count( num, is_delete, gmt_create, @@ -42,7 +42,7 @@ update - t_count + equipment_t_count is_delete = #{isDelete}, gmt_create = #{gmtCreate}, @@ -55,7 +55,7 @@ update - t_count + equipment_t_count set is_delete = #{isDelete}, gmt_create = #{gmtCreate}, @@ -66,14 +66,14 @@ - update t_count set is_delete = 1 where id=#{id} limit 1 + update equipment_t_count set is_delete = 1 where id=#{id} limit 1 From 3096d7f37b0270ccae137f405f68806dbc2fa7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Tue, 22 Sep 2020 11:33:30 +0800 Subject: [PATCH 2/5] fix --- .../controller/ReportResultController.java | 81 ++++++++++++------- .../com/lz/modules/app/dto/CharBarDto.java | 20 +++++ .../java/com/lz/modules/app/dto/ChartDto.java | 16 ---- .../lz/modules/app/resp/ReportChartResp.java | 11 +-- .../lz/modules/app/service/StaffService.java | 8 +- .../app/service/impl/StaffServiceImpl.java | 60 ++++++++++---- .../sys/dao/app/ResultRecordMapper.java | 6 -- .../modules/sys/service/app/ChartService.java | 3 +- .../sys/service/app/ResultRecordService.java | 8 -- .../service/app/impl/ChartServiceImpl.java | 40 +++++---- .../app/impl/ResultRecordServiceImpl.java | 6 -- .../mapper/app/ResultRecordMapper.xml | 7 +- 12 files changed, 154 insertions(+), 112 deletions(-) create mode 100644 src/main/java/com/lz/modules/app/dto/CharBarDto.java delete mode 100644 src/main/java/com/lz/modules/app/dto/ChartDto.java 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..c5792f8d 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,31 @@ 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); } ReportChartResp data = new ReportChartResp(); //月初目标 - List start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime); + List start = chartService.resultProgressDistribution(ResultRecordTypeEnum.TARGET.getType(),monthTime,""); //月末结果 - List end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime); + List end = chartService.resultProgressDistribution(ResultRecordTypeEnum.RESULT.getType(),monthTime,""); //人员等级分布 + 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 +86,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 +160,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/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 43044875..e3f96b89 100644 --- a/src/main/java/com/lz/modules/app/service/StaffService.java +++ b/src/main/java/com/lz/modules/app/service/StaffService.java @@ -75,7 +75,11 @@ public interface StaffService extends IService { SysUserEntity getUser(String userName); - //查询部门下的所有人员 包括子部门下人员 - List selectAllStaffByDepartmentId(String departmentId); + //查询部门下的所有子部门 + List selectAllDeparmentIdsByDepartmentParentId(String departmentId); + //统计部门下的人数 + int countStaffByAllDeparmentIds(List deparmentIds); + + } 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 8068cf87..4345ccef 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; @@ -17,6 +14,7 @@ import com.lz.modules.app.entity.*; import com.lz.modules.app.service.*; 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; @@ -26,6 +24,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") @@ -49,6 +49,8 @@ public class StaffServiceImpl extends ServiceImpl impleme DepartmentsStaffRelateService departmentsStaffRelateService; @Autowired private DepartmentsDao departmentsDao; + @Autowired + private StaffService staffService; @@ -378,11 +380,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(); + } /** @@ -393,12 +426,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/sys/dao/app/ResultRecordMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java index e94a9c5a..c1f30215 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,9 +56,4 @@ public interface ResultRecordMapper extends BaseMapper { List staffDistribution(@Param("monthTime") String monthTime); - List departmentDistribution(@Param("monthTime") String monthTime); - - - - } \ 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 e4b7e918..d515c88f 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.StaffEntity; import com.lz.modules.app.req.ResultRecordReq; @@ -79,11 +78,4 @@ public interface ResultRecordService extends IService { */ List staffDistribution(String monthTime); - /** - * 部门等级占比 - * @param monthTime - * @return - */ - List departmentDistribution(String monthTime); - } \ 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/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index 02345dff..01585a3c 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; @@ -622,9 +621,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 75c542fd..2e51d655 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -259,12 +259,7 @@ - - - From 36972f257f0c814782e9b98e8ecb0ce4890fe24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Tue, 22 Sep 2020 11:35:26 +0800 Subject: [PATCH 3/5] fix --- .../com/lz/modules/app/controller/ReportResultController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 c5792f8d..3fefd7bf 100644 --- a/src/main/java/com/lz/modules/app/controller/ReportResultController.java +++ b/src/main/java/com/lz/modules/app/controller/ReportResultController.java @@ -56,8 +56,7 @@ public class ReportResultController extends AbstractController{ @RequestMapping("chart") 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(); //月初目标 From c097dca61186dc9719a953eb3b33d33866910005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Tue, 22 Sep 2020 11:42:04 +0800 Subject: [PATCH 4/5] fix --- .../modules/app/controller/ReportResultController.java | 4 ++-- .../java/com/lz/modules/app/service/StaffService.java | 7 ------- .../com/lz/modules/sys/dao/app/ResultRecordMapper.java | 6 ------ .../lz/modules/sys/service/app/ResultRecordService.java | 9 --------- 4 files changed, 2 insertions(+), 24 deletions(-) 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 3fefd7bf..00b5eb2c 100644 --- a/src/main/java/com/lz/modules/app/controller/ReportResultController.java +++ b/src/main/java/com/lz/modules/app/controller/ReportResultController.java @@ -60,9 +60,9 @@ public class ReportResultController extends AbstractController{ } 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); 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 5440d60b..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,18 +78,11 @@ public interface StaffService extends IService { List selectBySearchName(IPage page, FindByNameModel nameModel); SysUserEntity getUser(String userName); -<<<<<<< HEAD //查询部门下的所有子部门 List selectAllDeparmentIdsByDepartmentParentId(String departmentId); //统计部门下的人数 int countStaffByAllDeparmentIds(List deparmentIds); - -======= - //查询部门下的所有人员 包括子部门下人员 - List selectAllStaffByDepartmentId(String departmentId); - List selectAll(); ->>>>>>> c4ca52bcf377d075780bf2f2383be4599aa3757c } 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 cea86c2b..1aa9fdb7 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 @@ -56,11 +56,5 @@ public interface ResultRecordMapper extends BaseMapper { List staffDistribution(@Param("monthTime") String monthTime); -<<<<<<< HEAD -======= - List departmentDistribution(@Param("monthTime") String monthTime); - - ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status); ->>>>>>> c4ca52bcf377d075780bf2f2383be4599aa3757c } \ No newline at end of file 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 1c850180..d0bdb858 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 @@ -80,19 +80,10 @@ public interface ResultRecordService extends IService { */ List staffDistribution(String monthTime); -<<<<<<< HEAD -======= - /** - * 部门等级占比 - * @param monthTime - * @return - */ - List departmentDistribution(String monthTime); Map> getStringListMap(List tDepartments); ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status); R reject( ResultRecord resultRecord,ResultRecordReq req, Long userId); ->>>>>>> c4ca52bcf377d075780bf2f2383be4599aa3757c } \ No newline at end of file From 0033e7a266156d9ce368185b79f5705b74b1c82e Mon Sep 17 00:00:00 2001 From: wulin Date: Tue, 22 Sep 2020 14:46:05 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=9B=B8=E5=85=B3=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EquipmentInfoController.java | 2 +- .../controller/OneCodeController.java | 13 ++++++++ .../modules/equipment/dao/OneCodeMapper.java | 4 +++ .../modules/equipment/entity/OneCodeReq.java | 33 +++++++++++++++++++ .../equipment/service/OneCodeService.java | 4 +++ .../service/impl/OneCodeServiceImpl.java | 10 ++++++ .../mapper/equipment/OneCodeMapper.xml | 7 ++++ 7 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/lz/modules/equipment/entity/OneCodeReq.java 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 22a1f390..0b728beb 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EquipmentInfoController.java @@ -105,7 +105,7 @@ 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()); 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/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/OneCodeServiceImpl.java b/src/main/java/com/lz/modules/equipment/service/impl/OneCodeServiceImpl.java index 6a6ab70a..c2399aba 100644 --- a/src/main/java/com/lz/modules/equipment/service/impl/OneCodeServiceImpl.java +++ b/src/main/java/com/lz/modules/equipment/service/impl/OneCodeServiceImpl.java @@ -1,8 +1,10 @@ package com.lz.modules.equipment.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lz.common.utils.PageUtils; import com.lz.modules.equipment.dao.OneCodeMapper; 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.stereotype.Service; @@ -80,4 +82,12 @@ public class OneCodeServiceImpl 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/resources/mapper/equipment/OneCodeMapper.xml b/src/main/resources/mapper/equipment/OneCodeMapper.xml index f3ebbea1..dd5568cd 100644 --- a/src/main/resources/mapper/equipment/OneCodeMapper.xml +++ b/src/main/resources/mapper/equipment/OneCodeMapper.xml @@ -114,5 +114,12 @@ )
+ +