Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
01247334d7
|
|
@ -46,6 +46,9 @@ public class TreeNode {
|
|||
@ApiModelProperty(value = "实时库存")
|
||||
private Long storageNum;
|
||||
|
||||
// 上架数
|
||||
private Integer maCount;
|
||||
|
||||
private String remark;
|
||||
|
||||
private List<MaTypeProperty> maTypeProperties;
|
||||
|
|
|
|||
|
|
@ -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<TypeInfo> children = new ArrayList<TypeInfo>();
|
||||
|
|
|
|||
|
|
@ -67,5 +67,7 @@ public class BookCarInfoDto {
|
|||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
private String address;
|
||||
|
||||
private List<BookCarDetailDto> detailList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@ public class DevInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "检测证明、检验pdf")
|
||||
private List<BmFileInfo> examinationPdf = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "唯一标识符列表")
|
||||
private List<String> identifyCodes = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "合格证、保险pdf")
|
||||
private List<List<BmFileInfo>> insurancePdfs = new ArrayList<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -308,6 +308,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) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ public interface MaTypeInfoMapper {
|
|||
*/
|
||||
public List<TreeNode> getMaTypeInfoList(TypeInfo typeInfo) ;
|
||||
|
||||
List<TypeInfo> getMaCountByTypeId(TypeInfo typeInfo) ;
|
||||
|
||||
/**
|
||||
* 热搜设备
|
||||
* @param devInfoVo
|
||||
|
|
|
|||
|
|
@ -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<TreeNode> list = new ArrayList<>();
|
||||
try {
|
||||
list = maTypeInfoMapper.getMaTypeInfoList(typeInfo);
|
||||
List<TypeInfo> 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<Long, List<TreeNode>> maTypeCountMap = list.stream().filter(o -> "4".equals(o.getLevel())).collect(Collectors.groupingBy(TreeNode::getParentId));
|
||||
for (TreeNode treeNode : list) {
|
||||
List<TreeNode> 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)) {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.material.book.mapper.BookCarMapper">
|
||||
|
||||
<insert id="addBookCarDetail">
|
||||
insert into book_car_detail(ma_id, order_status, order_company, order_user, 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())
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById">
|
||||
|
|
@ -37,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
c.company_id as companyId,
|
||||
c.operate_address as operateAddress,
|
||||
d.create_time as createTime,
|
||||
bcd.order_user as orderUser
|
||||
bcd.order_user as orderUser,
|
||||
bcd.address as address
|
||||
FROM ma_dev_info d
|
||||
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||
LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or locate(#{keyWord},mt3.type_name) > 0
|
||||
or locate(#{keyWord},c.company_name) > 0
|
||||
or locate(#{keyWord},d.device_name) > 0
|
||||
or locate(#{keyWord},d.identify_code) > 0
|
||||
)
|
||||
</if>
|
||||
and d.is_active='1'
|
||||
|
|
@ -316,6 +317,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
|
||||
<if test="deviceCount != null">#{deviceCount},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="identifyCode != null and identifyCode != ''">#{identifyCode},</if>
|
||||
<if test="typeId != null and typeId != ''">#{typeId},</if>
|
||||
<if test="maStatus != null">#{maStatus},</if>
|
||||
<if test="leaseScope != null and leaseScope != ''">#{leaseScope},</if>
|
||||
|
|
@ -650,6 +652,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
|
||||
<if test="deviceCount != null">#{deviceCount},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="identifyCode != null and identifyCode != ''">#{identifyCode},</if>
|
||||
<if test="typeId != null and typeId != ''">#{typeId},</if>
|
||||
<if test="maStatus != null">#{maStatus},</if>
|
||||
<if test="leaseScope != null and leaseScope != ''">#{leaseScope},</if>
|
||||
|
|
|
|||
|
|
@ -78,6 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="getMaCountByTypeId" resultType="com.bonus.common.biz.domain.TypeInfo">
|
||||
select type_id as typeId,count(1) as maCount from ma_dev_info
|
||||
where ma_status=2
|
||||
group by type_id
|
||||
</select>
|
||||
|
||||
<select id="getArea" resultType="com.bonus.common.biz.domain.vo.AreaVo">
|
||||
select
|
||||
id as areaId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue