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