Commit 86f7ad9dff4a297c5282c1f02906476ace893af3

Authored by 2c2c2c
1 parent b825e66e

装修垃圾清运 取消普通用户,只让投放点管理员登录;新增接收量字段

trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderMatchAsk.java
@@ -38,6 +38,7 @@ public class GarOrderMatchAsk implements Serializable { @@ -38,6 +38,7 @@ public class GarOrderMatchAsk implements Serializable {
38 private String garOrderHandlerTel; 38 private String garOrderHandlerTel;
39 private Double garCarryingWeight; 39 private Double garCarryingWeight;
40 40
  41 + private Double garReceptionQuantity;
41 /** 42 /**
42 * 43 *
43 */ 44 */
@@ -213,4 +214,12 @@ public class GarOrderMatchAsk implements Serializable { @@ -213,4 +214,12 @@ public class GarOrderMatchAsk implements Serializable {
213 public void setGarCarryingWeight(Double garCarryingWeight) { 214 public void setGarCarryingWeight(Double garCarryingWeight) {
214 this.garCarryingWeight = garCarryingWeight; 215 this.garCarryingWeight = garCarryingWeight;
215 } 216 }
  217 +
  218 + public Double getGarReceptionQuantity() {
  219 + return garReceptionQuantity;
  220 + }
  221 +
  222 + public void setGarReceptionQuantity(Double garReceptionQuantity) {
  223 + this.garReceptionQuantity = garReceptionQuantity;
  224 + }
216 } 225 }
217 \ No newline at end of file 226 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/AskTransportDto.java
@@ -20,6 +20,8 @@ public class AskTransportDto { @@ -20,6 +20,8 @@ public class AskTransportDto {
20 private String garOrderHandlerId; 20 private String garOrderHandlerId;
21 @NotNull(message = "车辆载重不能为空") 21 @NotNull(message = "车辆载重不能为空")
22 private Double garCarryingWeight; 22 private Double garCarryingWeight;
  23 + @NotNull(message = "接收量不能为空")
  24 + private Double garReceptionQuantity;
23 @NotBlank(message = "垃圾类型不能为空") 25 @NotBlank(message = "垃圾类型不能为空")
24 private String garOrderTrashType; 26 private String garOrderTrashType;
25 @NotBlank(message = "车牌号不能为空") 27 @NotBlank(message = "车牌号不能为空")
@@ -132,4 +134,12 @@ public class AskTransportDto { @@ -132,4 +134,12 @@ public class AskTransportDto {
132 public void setGarOrderContainerVolume(String garOrderContainerVolume) { 134 public void setGarOrderContainerVolume(String garOrderContainerVolume) {
133 this.garOrderContainerVolume = garOrderContainerVolume; 135 this.garOrderContainerVolume = garOrderContainerVolume;
134 } 136 }
  137 +
  138 + public Double getGarReceptionQuantity() {
  139 + return garReceptionQuantity;
  140 + }
  141 +
  142 + public void setGarReceptionQuantity(Double garReceptionQuantity) {
  143 + this.garReceptionQuantity = garReceptionQuantity;
  144 + }
135 } 145 }
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
@@ -18,6 +18,8 @@ import javax.crypto.spec.IvParameterSpec; @@ -18,6 +18,8 @@ import javax.crypto.spec.IvParameterSpec;
18 import javax.crypto.spec.SecretKeySpec; 18 import javax.crypto.spec.SecretKeySpec;
19 import javax.servlet.http.HttpServletRequest; 19 import javax.servlet.http.HttpServletRequest;
20 20
  21 +import com.trash.dropPointInfo.domain.DropPointInfo;
  22 +import com.trash.dropPointInfo.service.IDropPointInfoService;
21 import org.apache.commons.codec.binary.Base64; 23 import org.apache.commons.codec.binary.Base64;
22 import org.apache.commons.collections4.CollectionUtils; 24 import org.apache.commons.collections4.CollectionUtils;
23 import org.springframework.beans.factory.annotation.Autowired; 25 import org.springframework.beans.factory.annotation.Autowired;
@@ -97,6 +99,8 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> @@ -97,6 +99,8 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser>
97 @Autowired 99 @Autowired
98 private ITransportationEnterpriseService enterpriseService; 100 private ITransportationEnterpriseService enterpriseService;
99 101
  102 + @Autowired
  103 + private IDropPointInfoService dropPointInfoService;
100 104
101 @Resource 105 @Resource
102 private RedisCache redisCache; 106 private RedisCache redisCache;
@@ -134,12 +138,23 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> @@ -134,12 +138,23 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser>
134 qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel()); 138 qw.lambda().eq(GarUser::getGarUserTel, loginDto.getTel());
135 GarUser nUser = this.getOne(qw); 139 GarUser nUser = this.getOne(qw);
136 if (Objects.isNull(nUser)) { 140 if (Objects.isNull(nUser)) {
137 - // 不存在就创建用户  
138 - nUser = new GarUser();  
139 - nUser.setGarUserTel(loginDto.getTel());  
140 - nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);  
141 - nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());  
142 - this.save(nUser); 141 + // 不存在就创建用户,普通用户暂时关闭注册
  142 +// nUser = new GarUser();
  143 +// nUser.setGarUserTel(loginDto.getTel());
  144 +// nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
  145 +// nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
  146 +// this.save(nUser);
  147 + //不存在,则查询是否是投放点用户
  148 + List<DropPointInfo> list = dropPointInfoService.selectDropPointInfoListByPhone(loginDto.getTel());
  149 + if (CollectionUtil.isNotEmpty(list)) {
  150 + nUser = new GarUser();
  151 + nUser.setGarUserTel(loginDto.getTel());
  152 + nUser.setGarUserDelFlag(GlobalStatus.DEL_FLAG_NO);
  153 + nUser.setGarUserType(GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription());
  154 + this.save(nUser);
  155 + }else{
  156 + throw new UsernameNotFoundException("当前用户不存在!");
  157 + }
143 } 158 }
144 LoginUser loginUser = new LoginUser(); 159 LoginUser loginUser = new LoginUser();
145 ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>(); 160 ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>();
trash-unit/src/main/java/com/trash/dropPointInfo/mapper/DropPointInfoMapper.java
@@ -28,6 +28,13 @@ public interface DropPointInfoMapper @@ -28,6 +28,13 @@ public interface DropPointInfoMapper
28 List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo); 28 List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo);
29 29
30 /** 30 /**
  31 + * 根据管理员手机号查询投放点信息管理列表
  32 + * @param custodianPhone 管理员手机号
  33 + * @return 结果
  34 + */
  35 + List<DropPointInfo> selectDropPointInfoListByPhone(String custodianPhone);
  36 +
  37 + /**
31 * 新增投放点信息管理 38 * 新增投放点信息管理
32 * 39 *
33 * @param dropPointInfo 投放点信息管理 40 * @param dropPointInfo 投放点信息管理
trash-unit/src/main/java/com/trash/dropPointInfo/service/IDropPointInfoService.java
@@ -28,6 +28,13 @@ public interface IDropPointInfoService @@ -28,6 +28,13 @@ public interface IDropPointInfoService
28 List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo); 28 List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo);
29 29
30 /** 30 /**
  31 + * 根据管理员手机号查询投放点信息管理列表
  32 + * @param custodianPhone 管理员手机号
  33 + * @return 结果
  34 + */
  35 + List<DropPointInfo> selectDropPointInfoListByPhone(String custodianPhone);
  36 +
  37 + /**
31 * 新增投放点信息管理 38 * 新增投放点信息管理
32 * 39 *
33 * @param dropPointInfo 投放点信息管理 40 * @param dropPointInfo 投放点信息管理
trash-unit/src/main/java/com/trash/dropPointInfo/service/impl/DropPointInfoServiceImpl.java
1 package com.trash.dropPointInfo.service.impl; 1 package com.trash.dropPointInfo.service.impl;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.List;  
6 -import java.util.Map; 3 +import java.util.*;
7 4
8 import com.trash.common.utils.DateUtils; 5 import com.trash.common.utils.DateUtils;
9 import com.trash.common.utils.SecurityUtils; 6 import com.trash.common.utils.SecurityUtils;
@@ -63,6 +60,17 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService @@ -63,6 +60,17 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService
63 } 60 }
64 61
65 /** 62 /**
  63 + * 根据管理员手机号查询投放点信息管理列表
  64 + * @param custodianPhone 管理员手机号
  65 + * @return 结果
  66 + */
  67 + @Override
  68 + public List<DropPointInfo> selectDropPointInfoListByPhone(String custodianPhone) {
  69 + return dropPointInfoMapper.selectDropPointInfoListByPhone(custodianPhone);
  70 + }
  71 +
  72 +
  73 + /**
66 * 新增投放点信息管理 74 * 新增投放点信息管理
67 * 75 *
68 * @param dropPointInfo 投放点信息管理 76 * @param dropPointInfo 投放点信息管理
trash-unit/src/main/resources/mapper/unit/DropPointInfoMapper.xml
@@ -60,6 +60,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -60,6 +60,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
60 </where> 60 </where>
61 </select> 61 </select>
62 62
  63 + <select id="selectDropPointInfoListByPhone" parameterType="String"
  64 + resultMap="DropPointInfoResult">
  65 + <include refid="selectDropPointInfoVo" />
  66 + where custodian_phone = #{custodianPhone}
  67 + </select>
  68 +
63 <select id="selectDropPointInfoById" parameterType="Long" 69 <select id="selectDropPointInfoById" parameterType="Long"
64 resultMap="DropPointInfoResult"> 70 resultMap="DropPointInfoResult">
65 <include refid="selectDropPointInfoVo" /> 71 <include refid="selectDropPointInfoVo" />