Commit 1d32c017e21e8c0f1ca30572e86da1c12710a4c5

Authored by youxiw2000
2 parents 7559d99e 59fcd076

Merge branch 'dev' of http://61.169.120.202:8888/youxiw20000/trash into dev

trash-admin/src/main/resources/application-dev.yml
... ... @@ -9,8 +9,9 @@ trash:
9 9 # 实例演示开关
10 10 demoEnabled: true
11 11 # 文件路径 示例( Windows配置D:/trash/uploadPath,Linux配置 /home/trash/uploadPath,存储桶 trash/uploadPath,nginx配置 /trash/upload)
  12 + profile: D:/trash/uploadPath
12 13 # profile: E:/trash/uploadPath
13   - profile: F:/work/project/Documents/uploadPath/trash
  14 +# profile: F:/work/project/Documents/uploadPath/trash
14 15 # 获取ip地址开关
15 16 addressEnabled: false
16 17 # 验证码类型 math 数组计算 char 字符验证
... ... @@ -127,4 +128,8 @@ huawei:
127 128 nginx:
128 129 enabled: false
129 130 path:
130   - url:
131 131 \ No newline at end of file
  132 + url:
  133 +
  134 +# 生成二维码 前端地址
  135 +front:
  136 + url: "http://61.169.120.202:5173/pages/order/guest/index?orderId="
132 137 \ No newline at end of file
... ...
trash-framework/src/main/java/com/trash/framework/config/SecurityConfig.java
... ... @@ -118,6 +118,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
118 118 // .antMatchers("/druid/**").anonymous()
119 119 .antMatchers("/webjars/**").anonymous()
120 120 .antMatchers("/user/login").anonymous()
  121 + .antMatchers("/order/webDetail/**").anonymous()
121 122 .antMatchers("/user/send/verify").anonymous()
122 123 // .antMatchers("/user/logout").anonymous()
123 124 .antMatchers("/system/post/all").anonymous()
... ...
trash-garbage/src/main/java/com/trash/garbage/controller/GarQRController.java 0 → 100644
  1 +package com.trash.garbage.controller;
  2 +
  3 +import com.trash.garbage.global.Result;
  4 +import com.trash.garbage.service.GarQRCodeService;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.GetMapping;
  7 +import org.springframework.web.bind.annotation.PathVariable;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.servlet.http.HttpServletResponse;
  12 +
  13 +@RestController
  14 +@RequestMapping("/QRCode")
  15 +public class GarQRController {
  16 +
  17 + @Autowired
  18 + private GarQRCodeService qrCodeService;
  19 +
  20 + /**
  21 + * 生成订单详情二维码
  22 + */
  23 + @GetMapping("/create/{orderId}")
  24 + public Result<String> createQRCode(@PathVariable("orderId") String orderId, HttpServletResponse response){
  25 + return Result.OK(qrCodeService.createQRCode(orderId,response));
  26 + }
  27 +
  28 +
  29 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
... ... @@ -112,7 +112,6 @@ public class GarbageOrderController {
112 112 return Result.OK(garOrderService.queryOrderListByGarOrderPage(dto));
113 113 }
114 114  
115   -
116 115 @GetMapping("/webDetail/{id}")
117 116 public Result<OrderDetailVo> queryOrderWebDetail(@PathVariable("id") String id) {
118 117 return Result.OK(garOrderService.queryOrderWebDetail(id));
... ...
trash-garbage/src/main/java/com/trash/garbage/global/GlobalStatus.java
... ... @@ -37,7 +37,7 @@ public class GlobalStatus {
37 37 */
38 38 NORMAL_LOGIN(0, "普通登录"),
39 39 NORMAL_USER(0, "居民用户"),
40   - DRIVER_USER(1, "管理负责人");
  40 + DRIVER_USER(1, "司机");
41 41  
42 42 private Integer status;
43 43 private String description;
... ...
trash-garbage/src/main/java/com/trash/garbage/service/GarQRCodeService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import javax.servlet.http.HttpServletResponse;
  4 +
  5 +public interface GarQRCodeService {
  6 +
  7 + String createQRCode(String orderId, HttpServletResponse response);
  8 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarQRCodeServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import com.google.zxing.WriterException;
  4 +import com.trash.garbage.service.GarQRCodeService;
  5 +import com.trash.garbage.utils.QRCodeUtil;
  6 +import org.springframework.beans.factory.annotation.Value;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import javax.imageio.ImageIO;
  10 +import javax.servlet.ServletOutputStream;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import java.awt.image.BufferedImage;
  13 +import java.io.ByteArrayOutputStream;
  14 +import java.io.IOException;
  15 +import java.io.OutputStream;
  16 +import java.util.Base64;
  17 +
  18 +
  19 +@Service
  20 +public class GarQRCodeServiceImpl implements GarQRCodeService {
  21 +
  22 + @Value("${front.url}")
  23 + private String url;
  24 +
  25 + @Override
  26 + public String createQRCode(String orderId, HttpServletResponse response) {
  27 + String base64 = "";
  28 + try {
  29 + BufferedImage image = QRCodeUtil.createQRCode(url + orderId, 200);
  30 + base64 = bufferedImageToBase64(image);
  31 + } catch (WriterException e) {
  32 + throw new RuntimeException(e);
  33 + } catch (IOException e) {
  34 + throw new RuntimeException(e);
  35 + }
  36 +
  37 + return base64;
  38 + }
  39 + private String bufferedImageToBase64(BufferedImage image) throws IOException {
  40 + // 创建一个字节数组输出流
  41 + ByteArrayOutputStream baos = new ByteArrayOutputStream();
  42 +
  43 + // 将BufferedImage写入字节数组输出流
  44 + ImageIO.write(image, "jpg", baos);
  45 +
  46 + // 转换为字节数组
  47 + byte[] imageBytes = baos.toByteArray();
  48 +
  49 + // 使用Base64编码
  50 + String base64String = Base64.getEncoder().encodeToString(imageBytes);
  51 +
  52 + // 关闭字节数组输出流
  53 + baos.close();
  54 +
  55 + return "data:image/jpg;base64," + base64String;
  56 + }
  57 +
  58 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/utils/QRCodeUtil.java 0 → 100644
  1 +package com.trash.garbage.utils;
  2 +
  3 +import com.google.zxing.BarcodeFormat;
  4 +import com.google.zxing.EncodeHintType;
  5 +import com.google.zxing.WriterException;
  6 +import com.google.zxing.common.BitMatrix;
  7 +import com.google.zxing.qrcode.QRCodeWriter;
  8 +
  9 +import javax.imageio.ImageIO;
  10 +import java.awt.*;
  11 +import java.awt.image.BufferedImage;
  12 +import java.io.File;
  13 +import java.io.IOException;
  14 +import java.util.HashMap;
  15 +
  16 +public class QRCodeUtil {
  17 +
  18 + /**
  19 + * 生成指定网址大小及图片格式的二维码
  20 + *
  21 + * @param url 网址
  22 + * @param size 尺寸
  23 + */
  24 + public static BufferedImage createQRCode(String url, int size)
  25 + throws WriterException, IOException {
  26 +
  27 + HashMap<EncodeHintType, Object> hintMap = new HashMap<EncodeHintType, Object>();
  28 + hintMap.put(EncodeHintType.CHARACTER_SET, "UTF-8");
  29 +
  30 + QRCodeWriter qrCodeWriter = new QRCodeWriter();
  31 + BitMatrix bitMatrix = qrCodeWriter.encode(url, BarcodeFormat.QR_CODE, size, size, hintMap);
  32 +
  33 + int matrixWidth = bitMatrix.getWidth();
  34 + BufferedImage image = new BufferedImage(matrixWidth, matrixWidth, BufferedImage.TYPE_INT_RGB);
  35 + image.createGraphics();
  36 +
  37 + Graphics2D graphics = (Graphics2D) image.getGraphics();
  38 + graphics.setColor(Color.WHITE);
  39 + graphics.fillRect(0, 0, matrixWidth, matrixWidth);
  40 + graphics.setColor(Color.BLACK);
  41 +
  42 + for (int i = 0; i < matrixWidth; i++) {
  43 + for (int j = 0; j < matrixWidth; j++) {
  44 + if (bitMatrix.get(i, j)) {
  45 + graphics.fillRect(i, j, 1, 1);
  46 + }
  47 + }
  48 + }
  49 + return image;
  50 +// ImageIO.write(image, fileType, qrFile);
  51 + }
  52 +}
0 53 \ No newline at end of file
... ...
trash-ui/src/views/unit/enterprise/info.vue
... ... @@ -113,10 +113,8 @@
113 113 </el-form-item>
114 114 </el-col>
115 115 <el-col :span="7">
116   - <el-form-item label="经营单位" prop="parentId">
117   - <el-select v-model="form.parentId" placeholder="请选择经营单位" clearable style="width: 100%;">
118   - <el-option v-for="(item,index) in enterpriseList" :label="item.name" :value="item.id" :key="index"/>
119   - </el-select>
  116 + <el-form-item label="服务电话" prop="servicePhone">
  117 + <el-input v-model="form.servicePhone" placeholder="请输入企业服务电话" :maxlength="11" show-word-limit/>
120 118 </el-form-item>
121 119 </el-col>
122 120 <el-col :span="7">
... ... @@ -417,6 +415,14 @@ export default {
417 415 safetyPeopleName: [
418 416 {required: true, message: "请输入安全管理人员", trigger: "blur"}
419 417 ],
  418 + servicePhone: [
  419 + {required: true, message: "请输入企业服务手机号码", trigger: "blur"},
  420 + {
  421 + pattern: /^1(3|4|5|7|8|9)\d{9}$/,
  422 + message: '手机号格式错误',
  423 + trigger: 'change'
  424 + }
  425 + ],
420 426 },
421 427 areas:[],
422 428 // 企业道路运输经营许可证
... ...
trash-unit/src/main/java/com/trash/enterprise/domain/TransportationEnterprise.java
... ... @@ -85,31 +85,24 @@ public class TransportationEnterprise extends BaseEntity
85 85 private String legalRepresentativePhone;
86 86  
87 87 /** 安全管理人员 */
88   - @Excel(name = "安全管理人员")
89 88 private String safetyPeopleName;
90 89  
91 90 /** 企业道路运输经营许可证 */
92   - @Excel(name = "企业道路运输经营许可证")
93 91 private String transportPermission;
94 92  
95 93 /** 企业营业执照 */
96   - @Excel(name = "企业营业执照")
97 94 private String enterpriseBusinessLicense;
98 95  
99 96 /** 安全员考核合格证明 */
100   - @Excel(name = "安全员考核合格证明")
101 97 private String safetyOfficerQualificationCertificate;
102 98  
103 99 /** 企业负责人安全考核证 */
104   - @Excel(name = "企业负责人安全考核证")
105 100 private String safetyCertificate;
106 101  
107 102 /** 停车场全景图 */
108   - @Excel(name = "停车场全景图")
109 103 private String carParkPanorama;
110 104  
111 105 /** 经营单位 */
112   - @Excel(name = "经营单位")
113 106 private String businessUnit;
114 107  
115 108 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */
... ... @@ -117,7 +110,6 @@ public class TransportationEnterprise extends BaseEntity
117 110 private Integer status;
118 111  
119 112 /** 父公司id */
120   - @Excel(name = "父公司id")
121 113 private Long parentId;
122 114  
123 115 /** 公司类型(0经营单位,1运输公司) */
... ... @@ -125,14 +117,24 @@ public class TransportationEnterprise extends BaseEntity
125 117 private Integer companyType;
126 118  
127 119 /** 信用状态 */
128   - @Excel(name = "信用状态")
129 120 private String creditStatus;
130 121  
131 122 /** 二维码 */
132   - @Excel(name = "二维码")
133 123 private String qrCode;
134 124  
135   - public void setId(Long id)
  125 + /** 企业服务电话 */
  126 + @Excel(name = "公司类型")
  127 + private String servicePhone;
  128 +
  129 + public String getServicePhone() {
  130 + return servicePhone;
  131 + }
  132 +
  133 + public void setServicePhone(String servicePhone) {
  134 + this.servicePhone = servicePhone;
  135 + }
  136 +
  137 + public void setId(Long id)
136 138 {
137 139 this.id = id;
138 140 }
... ...
trash-unit/src/main/resources/mapper/unit/TransportationEnterpriseMapper.xml
... ... @@ -38,10 +38,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
38 38 <result property="companyType" column="company_type" />
39 39 <result property="creditStatus" column="credit_status" />
40 40 <result property="qrCode" column="qr_code" />
  41 + <result property="servicePhone" column="service_phone" />
41 42 </resultMap>
42 43  
43 44 <sql id="selectTransportationEnterpriseVo">
44   - select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, (select count(id) from car_info where company_id = te.id) car_number, safety_manager_name, safety_manager_phone, social_uniform_credit_code_number, legal_representative, legal_representative_phone, safety_people_name, remark, transport_permission, enterprise_business_license, safety_officer_qualification_certificate, safety_certificate, car_park_panorama, business_unit, status, create_time, create_by, update_time, update_by, parent_id, company_type, credit_status, qr_code from transportation_enterprise te
  45 + select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, (select count(id) from car_info where company_id = te.id) car_number, safety_manager_name, safety_manager_phone, social_uniform_credit_code_number, legal_representative, legal_representative_phone, safety_people_name, remark, transport_permission, enterprise_business_license, safety_officer_qualification_certificate, safety_certificate, car_park_panorama, business_unit, status, create_time, create_by, update_time, update_by, parent_id, company_type, credit_status, qr_code,service_phone from transportation_enterprise te
45 46 </sql>
46 47  
47 48 <select id="selectTransportationEnterpriseList" parameterType="TransportationEnterprise" resultMap="TransportationEnterpriseResult">
... ... @@ -74,6 +75,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
74 75 <if test="companyType != null "> and company_type = #{companyType}</if>
75 76 <if test="creditStatus != null and creditStatus != ''"> and credit_status = #{creditStatus}</if>
76 77 <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
  78 + <if test="servicePhone != null and servicePhone != ''"> and service_phone = #{servicePhone}</if>
77 79 </where>
78 80 </select>
79 81  
... ... @@ -117,6 +119,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
117 119 <if test="companyType != null">company_type,</if>
118 120 <if test="creditStatus != null">credit_status,</if>
119 121 <if test="qrCode != null">qr_code,</if>
  122 + <if test="servicePhone != null">service_phone,</if>
120 123 </trim>
121 124 <trim prefix="values (" suffix=")" suffixOverrides=",">
122 125 <if test="name != null">#{name},</if>
... ... @@ -151,6 +154,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
151 154 <if test="companyType != null">#{companyType},</if>
152 155 <if test="creditStatus != null">#{creditStatus},</if>
153 156 <if test="qrCode != null">#{qrCode},</if>
  157 + <if test="servicePhone != null">#{servicePhone},</if>
154 158 </trim>
155 159 </insert>
156 160  
... ... @@ -189,6 +193,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
189 193 <if test="companyType != null">company_type = #{companyType},</if>
190 194 <if test="creditStatus != null">credit_status = #{creditStatus},</if>
191 195 <if test="qrCode != null">qr_code = #{qrCode},</if>
  196 + <if test="servicePhone != null">service_phone = #{servicePhone},</if>
192 197 </trim>
193 198 where id = #{id}
194 199 </update>
... ...