Merge remote-tracking branch 'origin/master'

This commit is contained in:
liang.chao 2024-12-16 17:34:43 +08:00
commit 01247334d7
10 changed files with 54 additions and 3 deletions

View File

@ -46,6 +46,9 @@ public class TreeNode {
@ApiModelProperty(value = "实时库存") @ApiModelProperty(value = "实时库存")
private Long storageNum; private Long storageNum;
// 上架数
private Integer maCount;
private String remark; private String remark;
private List<MaTypeProperty> maTypeProperties; private List<MaTypeProperty> maTypeProperties;

View File

@ -62,6 +62,9 @@ public class TypeInfo extends BaseEntity
@ApiModelProperty(value = "父部门名称", required = true) @ApiModelProperty(value = "父部门名称", required = true)
private String parentName; private String parentName;
@ApiModelProperty(value = "上架数")
private Integer maCount;
/** 子部门 */ /** 子部门 */
@ApiModelProperty(value = "子部门", required = true) @ApiModelProperty(value = "子部门", required = true)
private List<TypeInfo> children = new ArrayList<TypeInfo>(); private List<TypeInfo> children = new ArrayList<TypeInfo>();

View File

@ -67,5 +67,7 @@ public class BookCarInfoDto {
@JSONField(format = "yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;
private String address;
private List<BookCarDetailDto> detailList; private List<BookCarDetailDto> detailList;
} }

View File

@ -224,6 +224,9 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "检测证明、检验pdf") @ApiModelProperty(value = "检测证明、检验pdf")
private List<BmFileInfo> examinationPdf = new ArrayList<>(); private List<BmFileInfo> examinationPdf = new ArrayList<>();
@ApiModelProperty(value = "唯一标识符列表")
private List<String> identifyCodes = new ArrayList<>();
@ApiModelProperty(value = "合格证、保险pdf") @ApiModelProperty(value = "合格证、保险pdf")
private List<List<BmFileInfo>> insurancePdfs = new ArrayList<>(); private List<List<BmFileInfo>> insurancePdfs = new ArrayList<>();

View File

@ -308,6 +308,7 @@ public class DevInfoServiceImpl implements DevInfoService {
devInfo.setCode(code); devInfo.setCode(code);
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
devInfo.setDeviceCount(1); devInfo.setDeviceCount(1);
devInfo.setIdentifyCode(devInfo.getIdentifyCodes().get(i));
int saveSuccessNum = devInfoMapper.insertDevInfo(devInfo); int saveSuccessNum = devInfoMapper.insertDevInfo(devInfo);
code = ""; code = "";
if (saveSuccessNum == 0) { if (saveSuccessNum == 0) {

View File

@ -21,6 +21,8 @@ public interface MaTypeInfoMapper {
*/ */
public List<TreeNode> getMaTypeInfoList(TypeInfo typeInfo) ; public List<TreeNode> getMaTypeInfoList(TypeInfo typeInfo) ;
List<TypeInfo> getMaCountByTypeId(TypeInfo typeInfo) ;
/** /**
* 热搜设备 * 热搜设备
* @param devInfoVo * @param devInfoVo

View File

@ -5,7 +5,9 @@ import com.bonus.common.biz.domain.TreeNode;
import com.bonus.common.biz.domain.TypeInfo; import com.bonus.common.biz.domain.TypeInfo;
import com.bonus.common.biz.domain.vo.AreaVo; import com.bonus.common.biz.domain.vo.AreaVo;
import com.bonus.common.core.web.domain.AjaxResult; 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.domain.vo.DevInfoVo;
import com.bonus.material.device.mapper.DevInfoMapper;
import com.bonus.material.home.mapper.MaTypeInfoMapper; import com.bonus.material.home.mapper.MaTypeInfoMapper;
import com.bonus.material.home.service.MaTypeInfoSevice; import com.bonus.material.home.service.MaTypeInfoSevice;
import com.bonus.material.ma.mapper.MaTypeMapper; import com.bonus.material.ma.mapper.MaTypeMapper;
@ -31,6 +33,9 @@ public class MaTypeInfoServiceImpl implements MaTypeInfoSevice {
@Resource @Resource
private MaTypeMapper maTypeMapper; private MaTypeMapper maTypeMapper;
@Resource
private DevInfoMapper devInfoMapper;
/** /**
* 首页查询分类树 * 首页查询分类树
* @return * @return
@ -41,6 +46,28 @@ public class MaTypeInfoServiceImpl implements MaTypeInfoSevice {
List<TreeNode> list = new ArrayList<>(); List<TreeNode> list = new ArrayList<>();
try { try {
list = maTypeInfoMapper.getMaTypeInfoList(typeInfo); 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); fillProperties(list);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {

View File

@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.bonus.material.book.mapper.BookCarMapper"> <mapper namespace="com.bonus.material.book.mapper.BookCarMapper">
<insert id="addBookCarDetail"> <insert id="addBookCarDetail">
insert into book_car_detail(ma_id, order_status, order_company, order_user, creater, create_time) insert into book_car_detail(ma_id, order_status, order_company, order_user, address, creater, create_time)
values(#{maId}, 0, #{orderCompany}, #{orderUser}, #{creater}, now()) values(#{maId}, 0, #{orderCompany}, #{orderUser}, #{address}, #{creater}, now())
</insert> </insert>
<delete id="deleteById"> <delete id="deleteById">
@ -37,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.company_id as companyId, c.company_id as companyId,
c.operate_address as operateAddress, c.operate_address as operateAddress,
d.create_time as createTime, d.create_time as createTime,
bcd.order_user as orderUser bcd.order_user as orderUser,
bcd.address as address
FROM ma_dev_info d FROM ma_dev_info d
LEFT JOIN bm_company_info c ON d.own_co = c.company_id 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 LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id

View File

@ -148,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or locate(#{keyWord},mt3.type_name) > 0 or locate(#{keyWord},mt3.type_name) > 0
or locate(#{keyWord},c.company_name) > 0 or locate(#{keyWord},c.company_name) > 0
or locate(#{keyWord},d.device_name) > 0 or locate(#{keyWord},d.device_name) > 0
or locate(#{keyWord},d.identify_code) > 0
) )
</if> </if>
and d.is_active='1' 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="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
<if test="deviceCount != null">#{deviceCount},</if> <if test="deviceCount != null">#{deviceCount},</if>
<if test="code != null and code != ''">#{code},</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="typeId != null and typeId != ''">#{typeId},</if>
<if test="maStatus != null">#{maStatus},</if> <if test="maStatus != null">#{maStatus},</if>
<if test="leaseScope != null and leaseScope != ''">#{leaseScope},</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="deviceWeight != null and deviceWeight != ''">#{deviceWeight},</if>
<if test="deviceCount != null">#{deviceCount},</if> <if test="deviceCount != null">#{deviceCount},</if>
<if test="code != null and code != ''">#{code},</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="typeId != null and typeId != ''">#{typeId},</if>
<if test="maStatus != null">#{maStatus},</if> <if test="maStatus != null">#{maStatus},</if>
<if test="leaseScope != null and leaseScope != ''">#{leaseScope},</if> <if test="leaseScope != null and leaseScope != ''">#{leaseScope},</if>

View File

@ -78,6 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where del_flag = '0' where del_flag = '0'
</select> </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="getArea" resultType="com.bonus.common.biz.domain.vo.AreaVo">
select select
id as areaId, id as areaId,