This commit is contained in:
skjia 2025-07-04 10:57:43 +08:00
commit 770c30e069
8 changed files with 37 additions and 10 deletions

View File

@ -35,9 +35,9 @@ public class UserServiceImpl implements UserService {
// 构建 userId moneyVo 的映射提升查找效率 // 构建 userId moneyVo 的映射提升查找效率
Map<String, UserInfoVo> moneyMap = moneyList.stream().collect(Collectors.toMap(UserInfoVo::getUserId, vo -> vo, (a, b) -> a)); Map<String, UserInfoVo> moneyMap = moneyList.stream().collect(Collectors.toMap(UserInfoVo::getUserId, vo -> vo, (a, b) -> a));
list.forEach(userInfoVo -> { list.forEach(userInfoVo -> {
if (userInfoVo.getPhone().length() > PHONE_LENGTH) { // if (userInfoVo.getPhone().length() > PHONE_LENGTH) {
userInfoVo.setPhone(SM4EncryptUtils.sm4Decrypt(userInfoVo.getPhone())); // userInfoVo.setPhone(SM4EncryptUtils.sm4Decrypt(userInfoVo.getPhone()));
} // }
UserInfoVo money = moneyMap.get(userInfoVo.getUserId()); UserInfoVo money = moneyMap.get(userInfoVo.getUserId());
if (money != null) { if (money != null) {
userInfoVo.setPersonalWalletBalance(money.getPersonalWalletBalance()); userInfoVo.setPersonalWalletBalance(money.getPersonalWalletBalance());

View File

@ -18,4 +18,5 @@ public class ApkDTO extends BaseEntity {
private String deployUser; private String deployUser;
private String type; private String type;
private String canteenType; private String canteenType;
private String deviceType;
} }

View File

@ -60,6 +60,7 @@ public class DeviceAppVersion extends BaseEntity {
/** 食堂超市类别(1食堂,2商超) */ /** 食堂超市类别(1食堂,2商超) */
private String canteenType; private String canteenType;
/** 参考设备ENUM */
private String deviceType;
} }

View File

@ -102,10 +102,10 @@ public class DeviceAppVersionServiceImpl implements IDeviceAppVersionService {
@Override @Override
public AjaxResult uploadApk(ApkDTO dto) { public AjaxResult uploadApk(ApkDTO dto) {
try { try {
ApkDTO apkDTO = deviceAppVersionMapper.getApkByType(dto.getCanteenType(), dto.getVersion()); ApkDTO apkDTO = deviceAppVersionMapper.getApkByType(dto.getDeviceType(), dto.getVersion());
if (apkDTO != null) { if (apkDTO != null) {
//检查最新的一条版本是否相同 //检查最新的一条版本是否相同
ApkDTO lastBean = deviceAppVersionMapper.getApkByType(dto.getCanteenType(), null); ApkDTO lastBean = deviceAppVersionMapper.getApkByType(dto.getDeviceType(), null);
if (lastBean != null && !lastBean.getVersion().equals(dto.getVersion())){ if (lastBean != null && !lastBean.getVersion().equals(dto.getVersion())){
return AjaxResult.error("该版本已存在"); return AjaxResult.error("该版本已存在");
} }

View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -106,4 +108,6 @@ public class KitchenWasteDeal extends BaseEntity {
private LocalDateTime endDateTime; private LocalDateTime endDateTime;
private String searchValue; private String searchValue;
private List<String> scenePictureList;
} }

View File

@ -1,11 +1,15 @@
package com.bonus.canteen.core.kitchen.service.impl; package com.bonus.canteen.core.kitchen.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.bonus.canteen.core.kitchen.domain.constants.WasteDealTypeEnum; import com.bonus.canteen.core.kitchen.domain.constants.WasteDealTypeEnum;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.bonus.canteen.core.kitchen.mapper.KitchenWasteDealMapper; import com.bonus.canteen.core.kitchen.mapper.KitchenWasteDealMapper;
@ -46,6 +50,17 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
if(CollUtil.isNotEmpty(list)) { if(CollUtil.isNotEmpty(list)) {
for(KitchenWasteDeal wasteDeal : list) { for(KitchenWasteDeal wasteDeal : list) {
wasteDeal.setDealTypeName(WasteDealTypeEnum.getDescByKey(wasteDeal.getDealType())); wasteDeal.setDealTypeName(WasteDealTypeEnum.getDescByKey(wasteDeal.getDealType()));
if(StringUtils.isNotBlank(wasteDeal.getScenePicture())) {
List<String> scenePictureList = new ArrayList<>();
String[] contractAttachmentList = StringUtils.split(wasteDeal.getScenePicture(), ",");
if(Objects.nonNull(contractAttachmentList)) {
for(String contractAttachment : contractAttachmentList) {
String finalAttachment = FileUrlUtil.getFileUrl(contractAttachment);
scenePictureList.add(finalAttachment);
}
}
wasteDeal.setScenePictureList(scenePictureList);
}
} }
} }
return list; return list;

View File

@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
deploy_time as deployTime, deploy_time as deployTime,
deploy_user as deployUser deploy_user as deployUser
from device_app_version from device_app_version
where canteen_type = #{type} and version > #{id} where device_type = #{type} and version > #{id}
</select> </select>
<select id="getParamInfo" resultType="com.bonus.canteen.core.android.vo.ParamVO"> <select id="getParamInfo" resultType="com.bonus.canteen.core.android.vo.ParamVO">
SELECT SELECT

View File

@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deployTime != null">deploy_time,</if> <if test="deployTime != null">deploy_time,</if>
<if test="deployUser != null">deploy_user,</if> <if test="deployUser != null">deploy_user,</if>
<if test="canteenType != null">canteen_type,</if> <if test="canteenType != null">canteen_type,</if>
<if test="deviceType != null">device_type,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -67,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deployTime != null">#{deployTime},</if> <if test="deployTime != null">#{deployTime},</if>
<if test="deployUser != null">#{deployUser},</if> <if test="deployUser != null">#{deployUser},</if>
<if test="canteenType != null">#{canteenType},</if> <if test="canteenType != null">#{canteenType},</if>
<if test="deviceType != null">#{deviceType},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -85,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deployTime != null">deploy_time = #{deployTime},</if> <if test="deployTime != null">deploy_time = #{deployTime},</if>
<if test="deployUser != null">deploy_user = #{deployUser},</if> <if test="deployUser != null">deploy_user = #{deployUser},</if>
<if test="canteenType != null">canteen_type = #{canteenType},</if> <if test="canteenType != null">canteen_type = #{canteenType},</if>
<if test="deviceType != null">device_type = #{deviceType},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
@ -112,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and version = #{version} and version = #{version}
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and canteen_type = #{type} and device_type = #{type}
</if> </if>
order by version desc order by version desc
limit 1 limit 1
@ -141,11 +144,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null and type != ''"> <if test="type != null and type != ''">
canteen_type = #{type}, canteen_type = #{type},
</if> </if>
<if test="deviceType != null and deviceType != ''">
device_type = #{deviceType},
</if>
</set> </set>
where version = #{version} where version = #{version}
</update> </update>
<insert id="insertApk"> <insert id="insertApk">
insert into device_app_version(version, version_name, apk_name, apk_path, update_content, deploy_user, canteen_type) insert into device_app_version(version, version_name, apk_name, apk_path, update_content, deploy_user, canteen_type,device_type)
values (#{version}, #{versionName}, #{apkName}, #{apkPath}, #{updateContent}, #{deployUser}, #{type}) values (#{version}, #{versionName}, #{apkName}, #{apkPath}, #{updateContent}, #{deployUser}, #{type}, #{deviceType})
</insert> </insert>
</mapper> </mapper>