Commit 6686f831e8e46fd635d14c76d505077d716b465c

Authored by 2c2c2c
2 parents 48e09191 5254a581

Merge remote-tracking branch 'origin/dev' into dev

trash-admin/src/main/java/com/trash/Application.java
... ... @@ -3,10 +3,6 @@ package com.trash;
3 3 import org.springframework.boot.SpringApplication;
4 4 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6   -import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
7   -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
8   -import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
9   -import org.springframework.context.annotation.Bean;
10 6 import org.springframework.scheduling.annotation.EnableScheduling;
11 7  
12 8 /**
... ... @@ -20,15 +16,8 @@ public class Application
20 16 {
21 17 public static void main(String[] args)
22 18 {
23   - System.setProperty("spring.devtools.restart.enabled", "true");
  19 + // System.setProperty("spring.devtools.restart.enabled", "false");
24 20 SpringApplication.run(Application.class, args);
25 21 System.out.println("Application start success");
26 22 }
27   -
28   - @Bean
29   - public ConfigurableServletWebServerFactory webServerFactory() {
30   - TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
31   - factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "|{}[]\\"));
32   - return factory;
33   - }
34 23 }
... ...
trash-admin/src/main/resources/application-dev.yml
... ... @@ -9,8 +9,8 @@ trash:
9 9 # 实例演示开关
10 10 demoEnabled: true
11 11 # 文件路径 示例( Windows配置D:/trash/uploadPath,Linux配置 /home/trash/uploadPath,存储桶 trash/uploadPath,nginx配置 /trash/upload)
12   - #profile: /home/trash/uploadPath
13   - profile: E:/trash/uploadPath
  12 + profile: /home/trash/uploadPath
  13 +# profile: E:/trash/uploadPath
14 14 # profile: F:/work/project/Documents/uploadPath/trash
15 15 # 获取ip地址开关
16 16 addressEnabled: false
... ... @@ -33,7 +33,7 @@ spring:
33 33 # 主库数据源
34 34 master:
35 35 # url: jdbc:mysql://localhost:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
36   - url: jdbc:mysql://localhost:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
  36 + url: jdbc:mysql://192.168.168.141:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
37 37 username: root
38 38 password: root
39 39 # 从库数据源
... ...
trash-admin/src/main/resources/application-local.yml
... ... @@ -85,7 +85,7 @@ spring:
85 85 # redis 配置
86 86 redis:
87 87 # 地址
88   - host: 127.0.0.1
  88 + host: 192.168.168.124
89 89 # 端口,默认为6379
90 90 port: 6379
91 91 # 密码
... ...
trash-admin/src/main/resources/static/car_2.png

50.6 KB | W: | H:

11.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
trash-admin/src/main/resources/static/car_2.png1 0 → 100644
No preview for this file type
trash-admin/src/main/resources/static/type-guide.1.png 0 → 100644

1.94 MB

trash-framework/src/main/java/com/trash/framework/web/service/SysLoginService.java
1 1 package com.trash.framework.web.service;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.HashSet;
5   -import java.util.List;
6   -import java.util.Set;
7   -
8   -import javax.annotation.Resource;
9   -
10   -import org.springframework.beans.factory.annotation.Autowired;
11   -import org.springframework.security.authentication.AuthenticationManager;
12   -import org.springframework.security.authentication.BadCredentialsException;
13   -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
14   -import org.springframework.security.core.Authentication;
15   -import org.springframework.security.core.authority.SimpleGrantedAuthority;
16   -import org.springframework.security.core.userdetails.UserDetailsService;
17   -import org.springframework.stereotype.Component;
18   -
19 3 import com.alibaba.fastjson.JSON;
20 4 import com.alibaba.fastjson.JSONArray;
21 5 import com.alibaba.fastjson.JSONObject;
... ... @@ -34,9 +18,22 @@ import com.trash.common.utils.RemoteServerUtils;
34 18 import com.trash.framework.manager.AsyncManager;
35 19 import com.trash.framework.manager.factory.AsyncFactory;
36 20 import com.trash.system.mapper.SysTempMapper;
37   -
38 21 import okhttp3.OkHttpClient;
39 22 import okhttp3.Request;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.security.authentication.AuthenticationManager;
  25 +import org.springframework.security.authentication.BadCredentialsException;
  26 +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
  27 +import org.springframework.security.core.Authentication;
  28 +import org.springframework.security.core.authority.SimpleGrantedAuthority;
  29 +import org.springframework.security.core.userdetails.UserDetailsService;
  30 +import org.springframework.stereotype.Component;
  31 +
  32 +import javax.annotation.Resource;
  33 +import java.util.ArrayList;
  34 +import java.util.HashSet;
  35 +import java.util.List;
  36 +import java.util.Set;
40 37  
41 38 /**
42 39 * 登录校验方法
... ... @@ -106,6 +103,7 @@ public class SysLoginService
106 103 throw new CustomException(e.getMessage());
107 104 }
108 105 }
  106 +
109 107 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
110 108 LoginUser loginUser = (LoginUser) authentication.getPrincipal();
111 109 // 生成token
... ...
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
... ... @@ -94,7 +94,7 @@ public class GarbageOrderController {
94 94 // 上传并返回新文件名称
95 95 fileName = FileUploadUtils.upload(filePath, file);
96 96 } catch (IOException e) {
97   -// log.error("上传图片异常",e);
  97 + log.error("上传图片异常",e);
98 98 throw new BizException(ResultCode.CODE_400, ResultCode.CODE_400.getMsg());
99 99 }
100 100 String url = serverConfig.getUrl() + fileName;
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java
... ... @@ -169,6 +169,8 @@ public class GarOrder implements Serializable {
169 169  
170 170 private Integer garTimeOutFlag;
171 171  
  172 + private String garEstimatedCost;
  173 +
172 174 /**
173 175 * 是否有用户的评价,默认值是0,默认没有
174 176 *
... ... @@ -471,4 +473,12 @@ public class GarOrder implements Serializable {
471 473 public void setHaveEvaluateOfClient(Integer haveEvaluateOfClient) {
472 474 this.haveEvaluateOfClient = haveEvaluateOfClient;
473 475 }
  476 +
  477 + public String getGarEstimatedCost() {
  478 + return garEstimatedCost;
  479 + }
  480 +
  481 + public void setGarEstimatedCost(String garEstimatedCost) {
  482 + this.garEstimatedCost = garEstimatedCost;
  483 + }
474 484 }
475 485 \ No newline at end of file
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderCar.java
... ... @@ -55,23 +55,7 @@ public class GarOrderCar implements Serializable {
55 55 @TableField(fill = FieldFill.INSERT)
56 56 private String garCreateBy;
57 57  
58   - public Integer getCarId() {
59   - return carId;
60   - }
61   -
62   - public void setCarId(Integer carId) {
63   - this.carId = carId;
64   - }
65   -
66   - public String getContainerVolume() {
67   - return containerVolume;
68   - }
69   -
70   - public void setContainerVolume(String containerVolume) {
71   - this.containerVolume = containerVolume;
72   - }
73   -
74   - /**
  58 + /**
75 59 *
76 60 */
77 61 @TableField(fill = FieldFill.INSERT_UPDATE)
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java
... ... @@ -91,6 +91,8 @@ public class OrderDto {
91 91  
92 92 private List<CarInfo> garCarInfoList;
93 93  
  94 + private String garEstimatedCost;
  95 +
94 96 @ToString
95 97 @EqualsAndHashCode
96 98 public static class CarInfo {
... ... @@ -107,8 +109,6 @@ public class OrderDto {
107 109 private String garOrderCarType;
108 110  
109 111 private String containerVolume;
110   -
111   -
112 112  
113 113 public Integer getGarOrderCarNumber() {
114 114 return garOrderCarNumber;
... ... @@ -281,6 +281,14 @@ public class OrderDto {
281 281 this.garInCarStore = garInCarStore;
282 282 }
283 283  
  284 + public String getGarEstimatedCost() {
  285 + return garEstimatedCost;
  286 + }
  287 +
  288 + public void setGarEstimatedCost(String garEstimatedCost) {
  289 + this.garEstimatedCost = garEstimatedCost;
  290 + }
  291 +
284 292 @Override
285 293 public String toString() {
286 294 return "OrderDto{" +
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/OrderDetailVo.java
... ... @@ -159,6 +159,8 @@ public class OrderDetailVo {
159 159 */
160 160 private Integer haveEvaluateOfClient = 0;
161 161  
  162 + private String garEstimatedCost;
  163 +
162 164 public OrderDetailVo() {
163 165 this.currentImages = new ArrayList<>();
164 166 this.putDownImages = new ArrayList<>();
... ... @@ -441,4 +443,12 @@ public class OrderDetailVo {
441 443 public void setHaveEvaluateOfClient(Integer haveEvaluateOfClient) {
442 444 this.haveEvaluateOfClient = haveEvaluateOfClient;
443 445 }
  446 +
  447 + public String getGarEstimatedCost() {
  448 + return garEstimatedCost;
  449 + }
  450 +
  451 + public void setGarEstimatedCost(String garEstimatedCost) {
  452 + this.garEstimatedCost = garEstimatedCost;
  453 + }
444 454 }
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
... ... @@ -96,6 +96,8 @@ public class GarOrderServiceImpl extends ServiceImpl&lt;GarOrderMapper, GarOrder&gt;
96 96 // 预估车辆等于用户选择得车辆
97 97 order.setGarRealCarCount(dto.getGarCarInfoList().stream().mapToInt(OrderDto.CarInfo::getGarOrderCarNumber).sum());
98 98 order.setGarTimeOutFlag(GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue());
  99 + order.setGarEstimatedCost(dto.getGarEstimatedCost());
  100 +
99 101 save(order);
100 102  
101 103 // 保存车辆信息
... ...
trash-unit/src/main/java/com/trash/carInfo/controller/CarInfoController.java
1 1 package com.trash.carInfo.controller;
2 2  
3   -import java.io.IOException;
4   -import java.util.List;
5   -
  3 +import com.trash.carInfo.domain.CarInfo;
6 4 import com.trash.carInfo.domain.vo.CarInfoVo;
7   -import org.springframework.security.access.prepost.PreAuthorize;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.*;
  5 +import com.trash.carInfo.service.ICarInfoService;
10 6 import com.trash.common.annotation.Log;
11 7 import com.trash.common.core.controller.BaseController;
12 8 import com.trash.common.core.domain.AjaxResult;
  9 +import com.trash.common.core.page.TableDataInfo;
13 10 import com.trash.common.enums.BusinessType;
14   -import com.trash.carInfo.domain.CarInfo;
15   -import com.trash.carInfo.service.ICarInfoService;
16 11 import com.trash.common.utils.poi.ExcelUtil;
17   -import com.trash.common.core.page.TableDataInfo;
  12 +import org.apache.commons.collections4.CollectionUtils;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.web.bind.annotation.*;
18 16 import org.springframework.web.multipart.MultipartFile;
19 17  
  18 +import java.io.IOException;
  19 +import java.util.List;
  20 +import java.util.Objects;
  21 +import java.util.stream.Collectors;
  22 +
20 23 /**
21 24 * 运输车辆管理Controller
22 25 *
... ... @@ -38,8 +41,24 @@ public class CarInfoController extends BaseController
38 41 public TableDataInfo list(CarInfoVo carInfo)
39 42 {
40 43 startPage();
41   - carInfo.setIsDel(1);
  44 + carInfo.setIsDel("1");
42 45 List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo);
  46 + if(CollectionUtils.isNotEmpty(list)){
  47 + list = list.stream().map(car->{
  48 + if(Objects.equals(car.getCarType(),"轻型货车")){
  49 + car.setCarLeft("car_1.png");
  50 + car.setRemark("箱体长2.6m,宽1.7m,高1.5m;最多可容纳约90袋装修垃圾(75cm*5cm每袋)");
  51 + }else if(Objects.equals(car.getCarType(),"中型货车")){
  52 + car.setCarLeft("car_2.png");
  53 + car.setRemark("箱体长3.2m,宽1.5m,高1.5m;最多可容纳约110袋装修垃圾(75cm*45cm每袋)");
  54 + }else if(Objects.equals(car.getCarType(),"大中型货车")){
  55 + car.setCarLeft("car_3.png");
  56 + car.setRemark("箱体长3.2m,宽1.9m,高1.9m;最多可容纳约150袋装修垃圾(75cm*45cm每袋)");
  57 + }
  58 + return car;
  59 + }).collect(Collectors.toList());
  60 + }
  61 +
43 62 return getDataTable(list);
44 63 }
45 64  
... ... @@ -51,7 +70,6 @@ public class CarInfoController extends BaseController
51 70 @GetMapping("/export")
52 71 public AjaxResult export(CarInfoVo carInfo)
53 72 {
54   - carInfo.setIsDel(1);
55 73 List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo);
56 74 ExcelUtil<CarInfoVo> util = new ExcelUtil<CarInfoVo>(CarInfoVo.class);
57 75 return util.exportExcel(list, "carInfo");
... ...
trash-unit/src/main/java/com/trash/carInfo/domain/CarInfo.java
... ... @@ -119,16 +119,6 @@ public class CarInfo extends BaseEntity
119 119 @Excel(name = "二维码")
120 120 private String qrCode;
121 121  
122   - private int isDel;
123   -
124   - public int getIsDel() {
125   - return isDel;
126   - }
127   -
128   - public void setIsDel(int isDel) {
129   - this.isDel = isDel;
130   - }
131   -
132 122 public String getLengthWidthHeight() {
133 123 return lengthWidthHeight;
134 124 }
... ...
trash-unit/src/main/java/com/trash/carInfo/domain/vo/CarInfoVo.java
... ... @@ -7,6 +7,8 @@ public class CarInfoVo extends CarInfo {
7 7  
8 8 private String driversName;
9 9  
  10 + private String isDel;
  11 +
10 12 public String getCompanyName() {
11 13 return companyName;
12 14 }
... ... @@ -22,4 +24,12 @@ public class CarInfoVo extends CarInfo {
22 24 public void setDriversName(String driversName) {
23 25 this.driversName = driversName;
24 26 }
  27 +
  28 + public String getIsDel() {
  29 + return isDel;
  30 + }
  31 +
  32 + public void setIsDel(String isDel) {
  33 + this.isDel = isDel;
  34 + }
25 35 }
... ...
trash-unit/src/main/java/com/trash/enterprise/domain/TransportationEnterprise.java
... ... @@ -117,7 +117,7 @@ public class TransportationEnterprise extends BaseEntity
117 117 private Long parentId;
118 118  
119 119 /** 公司类型(0经营单位,1运输公司) */
120   -// @Excel(name = "公司类型", readConverterExp = "0=投放点信息,1运输公司")
  120 + @Excel(name = "公司类型", readConverterExp = "0=经营单位,1运输公司")
121 121 private Integer companyType;
122 122  
123 123 /** 信用状态 */
... ...
trash-unit/src/main/resources/mapper/unit/CarInfoMapper.xml
... ... @@ -35,7 +35,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
35 35 <result property="updateBy" column="update_by" />
36 36 <result property="creditStatus" column="credit_status" />
37 37 <result property="qrCode" column="qr_code" />
38   - <result property="isDel" column="is_del" />
39 38 </resultMap>
40 39  
41 40 <resultMap type="CarInfoVo" id="CarInfoVoResult">
... ... @@ -71,10 +70,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
71 70 <result property="qrCode" column="qr_code" />
72 71 <result property="companyName" column="companyName" />
73 72 <result property="driversName" column="driversName" />
  73 + <result property="is_del" column="isDel" />
74 74 </resultMap>
75 75  
76 76 <sql id="selectCarInfoVo">
77   - select id, company_id, car_type, car_code, car_brank, emission_standard, road_transport_date, driving_license_date, enter_date, farme_number, car_identification, container_volume, car_color, car_equipment, remark, road_transport, driving_license, car_front, car_left, car_behind, car_right, drivers, status, create_time, create_by, update_time, update_by, credit_status, qr_code,is_del from car_info
  77 + select id, company_id, car_type, car_code, car_brank, emission_standard, road_transport_date, driving_license_date, enter_date, farme_number, car_identification, container_volume, car_color, car_equipment, remark, road_transport, driving_license, car_front, car_left, car_behind, car_right, drivers, status, create_time, create_by, update_time, update_by, credit_status, qr_code from car_info
78 78 </sql>
79 79  
80 80 <sql id="selectCarInfoForCompanyVo">
... ... @@ -120,7 +120,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
120 120  
121 121 <select id="selectCarInfoList" parameterType="CarInfoVo" resultMap="CarInfoVoResult">
122 122 <include refid="selectCarInfoForCompanyVo"/>
123   - <where>
  123 + <where>
124 124 <if test="companyName != null and companyName != ''"> and c.name like concat('%',#{companyName},'%')</if>
125 125 <if test="carType != null and carType != ''"> and car_type = #{carType}</if>
126 126 <if test="carCode != null and carCode != ''"> and car_code like concat('%',#{carCode},'%')</if>
... ... @@ -143,19 +143,19 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
143 143 <if test="drivers != null and drivers != ''"> and drivers = #{drivers}</if>
144 144 <if test="status != null "> and car.status = #{status}</if>
145 145 <if test="creditStatus != null and creditStatus != ''"> and car.credit_status = #{creditStatus}</if>
146   - <if test="isDel != null and isDel != ''"> and car.is_del = #{isDel}</if>
  146 + <if test="isDel != null and isDel != ''"> and car.is_del = #{isDel}</if>
147 147 </where>
148 148 </select>
149 149  
150 150 <select id="selectCarInfoById" parameterType="Long" resultMap="CarInfoResult">
151 151 <include refid="selectCarInfoVo"/>
152   - where id = #{id} and is_del = 1
  152 + where id = #{id}
153 153 </select>
154 154  
155 155  
156 156 <select id="selectByCompanyId" parameterType="Long" resultMap="CarInfoVoResult">
157 157 <include refid="selectCarInfoForCompanyVo"/>
158   - where car.company_id=#{companyId} and is_del = 1
  158 + where car.company_id=#{companyId}
159 159 </select>
160 160  
161 161  
... ... @@ -191,7 +191,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
191 191 <if test="creditStatus != null">credit_status,</if>
192 192 <if test="qrCode != null">qr_code,</if>
193 193 <if test="lengthWidthHeight != null">length_width_height,</if>
194   - <if test="isDel != null">is_del,</if>
195 194 </trim>
196 195 <trim prefix="values (" suffix=")" suffixOverrides=",">
197 196 <if test="companyId != null">#{companyId},</if>
... ... @@ -223,7 +222,6 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
223 222 <if test="creditStatus != null">#{creditStatus},</if>
224 223 <if test="qrCode != null">#{qrCode},</if>
225 224 <if test="lengthWidthHeight != null">#{lengthWidthHeight},</if>
226   - <if test="isDel != null">#{isDel},</if>
227 225 </trim>
228 226 </insert>
229 227  
... ... @@ -259,21 +257,20 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
259 257 <if test="creditStatus != null">credit_status = #{creditStatus},</if>
260 258 <if test="qrCode != null">qr_code = #{qrCode},</if>
261 259 <if test="lengthWidthHeight != null">length_width_height = #{lengthWidthHeight},</if>
262   - <if test="isDel != null">is_del = #{isDel},</if>
263 260 </trim>
264 261 where id = #{id}
265 262 </update>
266 263  
267   - <update id="deleteCarInfoById" parameterType="Long">
268   - update car_info set is_del = 0 where id = #{id}
269   - </update>
  264 + <delete id="deleteCarInfoById" parameterType="Long">
  265 + delete from car_info where id = #{id}
  266 + </delete>
270 267  
271   - <update id="deleteCarInfoByIds" parameterType="String">
272   - update car_info set is_del = 0 where id in
  268 + <delete id="deleteCarInfoByIds" parameterType="String">
  269 + delete from car_info where id in
273 270 <foreach item="id" collection="array" open="(" separator="," close=")">
274 271 #{id}
275 272 </foreach>
276   - </update>
  273 + </delete>
277 274  
278 275  
279 276 <insert id="addCarDriverRelation" parameterType="CarDriverRelation">
... ...