diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeNode.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeNode.java index 37e522d..e2d268b 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeNode.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TreeNode.java @@ -46,6 +46,9 @@ public class TreeNode { @ApiModelProperty(value = "实时库存") private Long storageNum; + // 上架数 + private Integer maCount; + private String remark; private List maTypeProperties; diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TypeInfo.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TypeInfo.java index dabd7a9..397c6d3 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TypeInfo.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/TypeInfo.java @@ -62,6 +62,9 @@ public class TypeInfo extends BaseEntity @ApiModelProperty(value = "父部门名称", required = true) private String parentName; + @ApiModelProperty(value = "上架数") + private Integer maCount; + /** 子部门 */ @ApiModelProperty(value = "子部门", required = true) private List children = new ArrayList(); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java index 31fbc28..e3a4b5d 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java @@ -224,6 +224,9 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "检测证明、检验pdf") private List examinationPdf = new ArrayList<>(); + @ApiModelProperty(value = "唯一标识符列表") + private List identifyCodes = new ArrayList<>(); + @ApiModelProperty(value = "合格证、保险pdf") private List> insurancePdfs = new ArrayList<>(); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index 73ee4b9..ce60aa8 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -334,6 +334,7 @@ public class DevInfoServiceImpl implements DevInfoService { devInfo.setCode(code); devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); devInfo.setDeviceCount(1); + devInfo.setIdentifyCode(devInfo.getIdentifyCodes().get(i)); int saveSuccessNum = devInfoMapper.insertDevInfo(devInfo); code = ""; if (saveSuccessNum == 0) { diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/mapper/MaTypeInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/mapper/MaTypeInfoMapper.java index 687af6c..b2f2457 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/mapper/MaTypeInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/mapper/MaTypeInfoMapper.java @@ -21,6 +21,8 @@ public interface MaTypeInfoMapper { */ public List getMaTypeInfoList(TypeInfo typeInfo) ; + List getMaCountByTypeId(TypeInfo typeInfo) ; + /** * 热搜设备 * @param devInfoVo diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/service/impl/MaTypeInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/service/impl/MaTypeInfoServiceImpl.java index 683768e..83aa669 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/service/impl/MaTypeInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/home/service/impl/MaTypeInfoServiceImpl.java @@ -5,7 +5,9 @@ import com.bonus.common.biz.domain.TreeNode; import com.bonus.common.biz.domain.TypeInfo; import com.bonus.common.biz.domain.vo.AreaVo; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.book.domain.CompanyPersonPhoneKey; import com.bonus.material.device.domain.vo.DevInfoVo; +import com.bonus.material.device.mapper.DevInfoMapper; import com.bonus.material.home.mapper.MaTypeInfoMapper; import com.bonus.material.home.service.MaTypeInfoSevice; import com.bonus.material.ma.mapper.MaTypeMapper; @@ -31,6 +33,9 @@ public class MaTypeInfoServiceImpl implements MaTypeInfoSevice { @Resource private MaTypeMapper maTypeMapper; + @Resource + private DevInfoMapper devInfoMapper; + /** * 首页查询分类树 * @return @@ -41,6 +46,28 @@ public class MaTypeInfoServiceImpl implements MaTypeInfoSevice { List list = new ArrayList<>(); try { list = maTypeInfoMapper.getMaTypeInfoList(typeInfo); + List typeCountList = maTypeInfoMapper.getMaCountByTypeId(typeInfo); + // 计算4级菜单的上架数 + for (TreeNode treeNode : list) { + for (TypeInfo typeCount : typeCountList) { + treeNode.setMaCount(0); + if ("4".equals(treeNode.getLevel()) && treeNode.getId() == typeCount.getTypeId().longValue()) { + treeNode.setMaCount(typeCount.getMaCount()); + } + } + } + // 计算3级菜单的上架数 + Map> maTypeCountMap = list.stream().filter(o -> "4".equals(o.getLevel())).collect(Collectors.groupingBy(TreeNode::getParentId)); + for (TreeNode treeNode : list) { + List mapValues = maTypeCountMap.get(treeNode.getId()); + if (CollectionUtils.isNotEmpty(mapValues)) { + int sum = 0; + for (TreeNode node : mapValues) { + sum += node.getMaCount() == null ? 0 : node.getMaCount(); + } + treeNode.setMaCount(sum); + } + } //填充自定义属性 fillProperties(list); if (CollectionUtils.isNotEmpty(list)) { diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/bookcar/BookCarMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/bookcar/BookCarMapper.xml index 179a374..cc2d815 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/bookcar/BookCarMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/bookcar/BookCarMapper.xml @@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into book_car_detail(ma_id, order_status, order_company, order_user, address creater, create_time) - values(#{maId}, 0, #{orderCompany}, #{orderUser}, #{creater}, now()) + insert into book_car_detail(ma_id, order_status, order_company, order_user, address, creater, create_time) + values(#{maId}, 0, #{orderCompany}, #{orderUser}, #{address}, #{creater}, now()) diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/home/MaTypeInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/home/MaTypeInfoMapper.xml index 120f4b0..befc01c 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/home/MaTypeInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/home/MaTypeInfoMapper.xml @@ -78,6 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where del_flag = '0' + +