Commit a7880dc888a9a3be400ed7c01a62916a67fa1e5b

Authored by youxiw2000
2 parents 7ef57d20 a9073a0d

m

Showing 94 changed files with 11303 additions and 507 deletions
trash-garbage/pom.xml
@@ -42,6 +42,10 @@ @@ -42,6 +42,10 @@
42 <artifactId>hutool-all</artifactId> 42 <artifactId>hutool-all</artifactId>
43 <version>5.3.8</version> 43 <version>5.3.8</version>
44 </dependency> 44 </dependency>
  45 + <dependency>
  46 + <groupId>com.trash</groupId>
  47 + <artifactId>trash-unit</artifactId>
  48 + </dependency>
45 </dependencies> 49 </dependencies>
46 <!-- 项目打包时会将java目录中的*.xml文件也进行打包 --> 50 <!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
47 <build> 51 <build>
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java 0 → 100644
  1 +package com.trash.garbage.controller;
  2 +
  3 +
  4 +import com.trash.common.config.trashConfig;
  5 +import com.trash.common.utils.file.FileUploadUtils;
  6 +import com.trash.framework.config.ServerConfig;
  7 +import com.trash.garbage.custom.BizException;
  8 +import com.trash.garbage.global.Result;
  9 +import com.trash.garbage.global.ResultCode;
  10 +import com.trash.garbage.pojo.dto.EvaluateDto;
  11 +import com.trash.garbage.pojo.dto.OrderDto;
  12 +import com.trash.garbage.pojo.dto.OrderUpdateDto;
  13 +import com.trash.garbage.pojo.dto.UploadDto;
  14 +import com.trash.garbage.pojo.vo.OrderDetailVo;
  15 +import com.trash.garbage.service.GarOrderService;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.validation.annotation.Validated;
  18 +import org.springframework.web.bind.annotation.*;
  19 +import org.springframework.web.multipart.MultipartFile;
  20 +
  21 +import java.io.IOException;
  22 +import java.util.HashMap;
  23 +import java.util.Map;
  24 +
  25 +/**
  26 + * 订单控制
  27 + *
  28 + * @author 20412
  29 + */
  30 +@RestController
  31 +@RequestMapping("/order")
  32 +public class GarbageOrderController {
  33 +
  34 + @Autowired
  35 + private GarOrderService garOrderService;
  36 + @Autowired
  37 + private ServerConfig serverConfig;
  38 +
  39 + @PostMapping("/add")
  40 + public Result<?> saveOrder(@Validated @RequestBody OrderDto dto) {
  41 + return Result.OK(garOrderService.saveOrder(dto));
  42 + }
  43 +
  44 + @RequestMapping("upload")
  45 + public Result<?> uploadFile(@RequestParam("file") MultipartFile file) {
  46 + String fileName = null;
  47 + try { // 上传文件路径
  48 + String filePath = trashConfig.getUploadPath();
  49 + // 上传并返回新文件名称
  50 + fileName = FileUploadUtils.upload(filePath, file);
  51 + } catch (IOException e) {
  52 + throw new BizException(ResultCode.CODE_400, ResultCode.CODE_400.getMsg());
  53 + }
  54 + String url = serverConfig.getUrl() + fileName;
  55 + Map<String, String> urlMap = new HashMap<>();
  56 + urlMap.put("url", url);
  57 + urlMap.put("fileName", fileName);
  58 + return Result.OK(urlMap, "图片上传成功");
  59 + }
  60 +
  61 + @GetMapping("/detail/{id}")
  62 + public Result<OrderDetailVo> queryOrderDetail(@PathVariable("id") String id) {
  63 + return Result.OK(garOrderService.queryOrderDetail(id));
  64 + }
  65 +
  66 + @PutMapping("/update")
  67 + public Result<String> uploadOrder(@RequestBody OrderUpdateDto dto) {
  68 + return Result.OK(garOrderService.uploadOrder(dto));
  69 + }
  70 +
  71 + @PostMapping("/evaluate")
  72 + public Result<String> evaluateOrder(@Validated @RequestBody EvaluateDto dto) {
  73 + return Result.OK(garOrderService.evaluateOrder(dto));
  74 + }
  75 +
  76 +
  77 + @GetMapping("/query/list")
  78 + public Result<?> queryOrderList(@RequestParam("type") Integer type, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
  79 + return Result.OK(garOrderService.queryOrderList(type, pageNo, pageSize));
  80 + }
  81 +
  82 + @PostMapping("/upload/imageUrl")
  83 + public Result<?> uploadImageUrlByType(@RequestBody UploadDto dto) {
  84 + return Result.OK(garOrderService.uploadImageUrlByType(dto));
  85 + }
  86 +
  87 +}
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageUserController.java
@@ -3,6 +3,7 @@ package com.trash.garbage.controller; @@ -3,6 +3,7 @@ package com.trash.garbage.controller;
3 3
4 import com.trash.garbage.global.Result; 4 import com.trash.garbage.global.Result;
5 import com.trash.garbage.pojo.domain.GarAddress; 5 import com.trash.garbage.pojo.domain.GarAddress;
  6 +import com.trash.garbage.pojo.domain.GarUser;
6 import com.trash.garbage.pojo.dto.AddressDto; 7 import com.trash.garbage.pojo.dto.AddressDto;
7 import com.trash.garbage.pojo.dto.LoginDto; 8 import com.trash.garbage.pojo.dto.LoginDto;
8 import com.trash.garbage.service.GarUserService; 9 import com.trash.garbage.service.GarUserService;
@@ -67,4 +68,11 @@ public class GarbageUserController { @@ -67,4 +68,11 @@ public class GarbageUserController {
67 } 68 }
68 69
69 70
  71 + @PutMapping("/update")
  72 + public Result<?> updateUser(@RequestBody GarUser user){
  73 + garUserService.updateUserInfo(user);
  74 + return Result.OK();
  75 + }
  76 +
  77 +
70 } 78 }
trash-garbage/src/main/java/com/trash/garbage/custom/BizException.java
@@ -35,10 +35,8 @@ public class BizException extends RuntimeException{ @@ -35,10 +35,8 @@ public class BizException extends RuntimeException{
35 this.code = code; 35 this.code = code;
36 } 36 }
37 37
38 -  
39 -  
40 - public BizException(ResultCode code, String msg){  
41 - this.msg = msg; 38 + public BizException(ResultCode code, String msg){
42 this.code = code; 39 this.code = code;
  40 + this.msg = msg;
43 } 41 }
44 } 42 }
trash-garbage/src/main/java/com/trash/garbage/global/GlobalStatus.java
@@ -36,13 +36,13 @@ public class GlobalStatus { @@ -36,13 +36,13 @@ public class GlobalStatus {
36 * 普通登录 36 * 普通登录
37 */ 37 */
38 NORMAL_LOGIN(0, "普通登录"), 38 NORMAL_LOGIN(0, "普通登录"),
39 - NORMAL_USER(0, "普通用户"),  
40 - DRIVER_USER(1, "驾驶员用户"); 39 + NORMAL_USER(0, "居民用户"),
  40 + DRIVER_USER(1, "管理负责人");
41 41
42 private Integer status; 42 private Integer status;
43 private String description; 43 private String description;
44 44
45 - public int getStatus() { 45 + public Integer getStatus() {
46 return this.status; 46 return this.status;
47 } 47 }
48 48
@@ -57,7 +57,7 @@ public class GlobalStatus { @@ -57,7 +57,7 @@ public class GlobalStatus {
57 } 57 }
58 58
59 /** 59 /**
60 - * 字典 60 + * 地址
61 */ 61 */
62 public enum GarAddressStatus { 62 public enum GarAddressStatus {
63 NORMAL_ADDRESS(0, "地址"), 63 NORMAL_ADDRESS(0, "地址"),
@@ -78,6 +78,38 @@ public class GlobalStatus { @@ -78,6 +78,38 @@ public class GlobalStatus {
78 public String getDescription() { 78 public String getDescription() {
79 return this.description; 79 return this.description;
80 } 80 }
  81 + }
  82 +
  83 + /**
  84 + * 订单
  85 + */
  86 + public enum GarOrderStatus {
  87 + NEW_ORDER(0, "新订单"),
  88 + ACTIVE_ORDER(1, "处理中"),
  89 + ALL_ORDER(2, "全部订单"),
  90 + SUCCESS_ORDER(3, "待支付订单"),
  91 + FAIL_ORDER(9, "订单处理失败"),
  92 + CANCEL_FLAG_NO(0, "未取消订单"),
  93 + IMAGE_TYPE_CURRENT(0, "现场图片"),
  94 + IMAGE_TYPE_PUT_ON(1, "装车图片"),
  95 + IMAGE_TYPE_PUT_DOWN(2, "卸车图片"),
  96 + EVALUATE_ORDER_NO(0,"待评价"),
  97 + EVALUATE_ORDER_YES(1,"已评价");
  98 +
  99 + GarOrderStatus(Integer status, String description) {
  100 + this.status = status;
  101 + this.description = description;
  102 + }
  103 +
  104 + private String description;
  105 + private Integer status;
81 106
  107 + public Integer getValue() {
  108 + return this.status;
  109 + }
  110 +
  111 + public String getDescription() {
  112 + return this.description;
  113 + }
82 } 114 }
83 } 115 }
trash-garbage/src/main/java/com/trash/garbage/interceptor/MyMetaObjectHandler.java
@@ -23,17 +23,12 @@ public class MyMetaObjectHandler implements MetaObjectHandler { @@ -23,17 +23,12 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
23 if (metaObject.hasGetter("garCreateTime")) { 23 if (metaObject.hasGetter("garCreateTime")) {
24 this.strictInsertFill(metaObject, "garCreateTime", Date.class, new Date()); 24 this.strictInsertFill(metaObject, "garCreateTime", Date.class, new Date());
25 } 25 }
26 -  
27 if (metaObject.hasGetter("garCreateBy")) { 26 if (metaObject.hasGetter("garCreateBy")) {
28 this.strictInsertFill(metaObject, "garCreateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId()); 27 this.strictInsertFill(metaObject, "garCreateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId());
29 } 28 }
30 -  
31 if (metaObject.hasGetter("garUpdateTime")) { 29 if (metaObject.hasGetter("garUpdateTime")) {
32 this.strictInsertFill(metaObject, "garUpdateTime", Date.class, new Date()); 30 this.strictInsertFill(metaObject, "garUpdateTime", Date.class, new Date());
33 } 31 }
34 - if (metaObject.hasGetter("garUserId")) {  
35 - this.strictInsertFill(metaObject, "garUserId", String.class, SecurityUtils.getLoginUser().getUser().getUserId());  
36 - }  
37 if (metaObject.hasGetter("garUpdateBy")) { 32 if (metaObject.hasGetter("garUpdateBy")) {
38 this.strictInsertFill(metaObject, "garUpdateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId()); 33 this.strictInsertFill(metaObject, "garUpdateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId());
39 } 34 }
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderEvaluateMapper.java 0 → 100644
  1 +package com.trash.garbage.mapper;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrderEvaluate;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Mapper
  9 +* @createDate 2023-11-29 14:19:18
  10 +* @Entity com.trash.garbage.pojo.domain.GarOrderEvaluate
  11 +*/
  12 +public interface GarOrderEvaluateMapper extends BaseMapper<GarOrderEvaluate> {
  13 +
  14 +}
  15 +
  16 +
  17 +
  18 +
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderImageMapper.java 0 → 100644
  1 +package com.trash.garbage.mapper;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrderImage;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Mapper
  9 +* @createDate 2023-11-24 16:26:19
  10 +* @Entity com.trash.garbage.pojo.domain.GarOrderImage
  11 +*/
  12 +public interface GarOrderImageMapper extends BaseMapper<GarOrderImage> {
  13 +
  14 +}
  15 +
  16 +
  17 +
  18 +
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMapper.java 0 → 100644
  1 +package com.trash.garbage.mapper;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrder;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Mapper
  9 +* @createDate 2023-11-24 16:26:19
  10 +* @Entity com.trash.garbage.pojo.domain.GarOrder
  11 +*/
  12 +public interface GarOrderMapper extends BaseMapper<GarOrder> {
  13 +
  14 +}
  15 +
  16 +
  17 +
  18 +
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarAddress.java
@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableName; @@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableName;
7 7
8 import java.io.Serializable; 8 import java.io.Serializable;
9 import java.util.Date; 9 import java.util.Date;
  10 +import java.util.Objects;
10 11
11 import com.fasterxml.jackson.annotation.JsonFormat; 12 import com.fasterxml.jackson.annotation.JsonFormat;
12 import lombok.Data; 13 import lombok.Data;
  14 +import org.springframework.format.annotation.DateTimeFormat;
13 15
14 16
15 /** 17 /**
@@ -48,6 +50,7 @@ public class GarAddress implements Serializable { @@ -48,6 +50,7 @@ public class GarAddress implements Serializable {
48 */ 50 */
49 @TableField(fill = FieldFill.INSERT, select = false) 51 @TableField(fill = FieldFill.INSERT, select = false)
50 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") 52 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  53 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
51 private Date garCreateTime; 54 private Date garCreateTime;
52 55
53 /** 56 /**
@@ -55,6 +58,7 @@ public class GarAddress implements Serializable { @@ -55,6 +58,7 @@ public class GarAddress implements Serializable {
55 */ 58 */
56 @TableField(fill = FieldFill.INSERT_UPDATE, select = false) 59 @TableField(fill = FieldFill.INSERT_UPDATE, select = false)
57 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") 60 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  61 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
58 private Date garUpdateTime; 62 private Date garUpdateTime;
59 63
60 /** 64 /**
@@ -72,6 +76,9 @@ public class GarAddress implements Serializable { @@ -72,6 +76,9 @@ public class GarAddress implements Serializable {
72 */ 76 */
73 private String garRemark; 77 private String garRemark;
74 78
  79 +
  80 +
  81 +
75 @TableField(exist = false) 82 @TableField(exist = false)
76 private static final long serialVersionUID = 1L; 83 private static final long serialVersionUID = 1L;
77 84
@@ -209,6 +216,5 @@ public class GarAddress implements Serializable { @@ -209,6 +216,5 @@ public class GarAddress implements Serializable {
209 public static long getSerialversionuid() { 216 public static long getSerialversionuid() {
210 return serialVersionUID; 217 return serialVersionUID;
211 } 218 }
212 -  
213 - 219 +
214 } 220 }
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java 0 → 100644
  1 +package com.trash.garbage.pojo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.*;
  4 +
  5 +import java.io.Serializable;
  6 +import java.util.Date;
  7 +
  8 +import com.fasterxml.jackson.annotation.JsonFormat;
  9 +import com.fasterxml.jackson.annotation.JsonIgnore;
  10 +import lombok.Data;
  11 +import org.springframework.format.annotation.DateTimeFormat;
  12 +
  13 +/**
  14 + * 建筑垃圾—订单表
  15 + * @TableName gar_order
  16 + */
  17 +@TableName(value ="gar_order")
  18 +@Data
  19 +public class GarOrder implements Serializable {
  20 + /**
  21 + * 订单id
  22 + */
  23 + @TableId
  24 + private String garOrderId;
  25 +
  26 + /**
  27 + * 用户id
  28 + */
  29 + @JsonIgnore
  30 + private String garOrderUserId;
  31 +
  32 + /**
  33 + * 负责处理人id
  34 + */
  35 + private String garOrderHandlerId;
  36 +
  37 + /**
  38 + * 订单地址
  39 + */
  40 + private String garOrderAddress;
  41 +
  42 + /**
  43 + * 订单详细地址
  44 + */
  45 + private String garOrderAddressDetails;
  46 +
  47 + /**
  48 + * 订单姓名
  49 + */
  50 + private String garOrderContactName;
  51 +
  52 + /**
  53 + * 垃圾类型
  54 + */
  55 + private String garOrderTrashType;
  56 +
  57 + /**
  58 + * 订单人电话
  59 + */
  60 + private String garOrderContactTel;
  61 +
  62 + /**
  63 + * 承接经营单位
  64 + */
  65 + private String garOrderCompanyId;
  66 +
  67 + /**
  68 + * 公司名称
  69 + */
  70 + private String garOrderCompanyName;
  71 +
  72 + /**
  73 + * 公司负责人电话
  74 + */
  75 + private String garOrderCompanyTel;
  76 +
  77 + /**
  78 + * 处理状态
  79 + */
  80 + private Integer garOrderHandlerStatus;
  81 +
  82 + /**
  83 + * 约定时间
  84 + */
  85 + private String garOrderAgreementTime;
  86 +
  87 + /**
  88 + * 订单创建时间
  89 + */
  90 + @TableField(fill = FieldFill.INSERT)
  91 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  92 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  93 + private Date garCreateTime;
  94 +
  95 + /**
  96 + * 订单修改时间
  97 + */
  98 + @TableField(fill = FieldFill.INSERT_UPDATE)
  99 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  100 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  101 + private Date garUpdateTime;
  102 +
  103 + /**
  104 + * 订单创建人
  105 + */
  106 + @TableField(fill = FieldFill.INSERT)
  107 + private String garCreateBy;
  108 +
  109 + /**
  110 + * 订单修改人
  111 + */
  112 + @TableField(fill = FieldFill.INSERT_UPDATE)
  113 + private String garUpdateBy;
  114 +
  115 + /**
  116 + * 备注
  117 + */
  118 + private String garRemark;
  119 + /**
  120 + * 取消标识
  121 + */
  122 + private Integer garCancelFlag;
  123 +
  124 + /**
  125 + * 评分标识
  126 + */
  127 + private Integer garEvaluateFlag;
  128 + /**
  129 + * 原因
  130 + */
  131 + private String garReason;
  132 +
  133 +
  134 + @TableField(exist = false)
  135 + private static final long serialVersionUID = 1L;
  136 +
  137 +}
0 \ No newline at end of file 138 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderEvaluate.java 0 → 100644
  1 +package com.trash.garbage.pojo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableField;
  4 +import com.baomidou.mybatisplus.annotation.TableId;
  5 +import com.baomidou.mybatisplus.annotation.TableName;
  6 +import java.io.Serializable;
  7 +import java.util.Date;
  8 +import lombok.Data;
  9 +
  10 +/**
  11 + * 建筑垃圾-派单评分
  12 + * @author 20412
  13 + * @TableName gar_order_evaluate
  14 + */
  15 +@TableName(value ="gar_order_evaluate")
  16 +@Data
  17 +public class GarOrderEvaluate implements Serializable {
  18 + /**
  19 + * id
  20 + */
  21 + @TableId
  22 + private String garEvaluateId;
  23 +
  24 + /**
  25 + * 订单id
  26 + */
  27 + private String garOrderId;
  28 +
  29 + /**
  30 + * 公司id
  31 + */
  32 + private String garCompanyId;
  33 +
  34 + /**
  35 + * 评价内容
  36 + */
  37 + private String garEvaluateContent;
  38 +
  39 + /**
  40 + * 评分
  41 + */
  42 + private Integer garEvaluateScore;
  43 +
  44 + /**
  45 + * 修改人
  46 + */
  47 + private String garUpdateBy;
  48 +
  49 + /**
  50 + * 创建人
  51 + */
  52 + private String garCreateBy;
  53 +
  54 + /**
  55 + * 修改时间
  56 + */
  57 + private Date garUpdateTime;
  58 +
  59 + /**
  60 + * 创建时间
  61 + */
  62 + private Date garCreateTime;
  63 +
  64 + /**
  65 + * 备注
  66 + */
  67 + private String garRemark;
  68 +
  69 + @TableField(exist = false)
  70 + private static final long serialVersionUID = 1L;
  71 +}
0 \ No newline at end of file 72 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderImage.java 0 → 100644
  1 +package com.trash.garbage.pojo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.FieldFill;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import java.io.Serializable;
  8 +import java.util.Date;
  9 +
  10 +import com.fasterxml.jackson.annotation.JsonFormat;
  11 +import lombok.Data;
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +
  14 +/**
  15 + * 装修垃圾-订单图片表
  16 + * @TableName gar_order_image
  17 + */
  18 +@TableName(value ="gar_order_image")
  19 +@Data
  20 +public class GarOrderImage implements Serializable {
  21 + /**
  22 + * 图片id
  23 + */
  24 + @TableId
  25 + private String garImageId;
  26 +
  27 + /**
  28 + * 订单表id
  29 + */
  30 + private String garOrderId;
  31 +
  32 + /**
  33 + * 图片类型
  34 + */
  35 + private Integer garOrderImageType;
  36 +
  37 + /**
  38 + * 图片路径
  39 + */
  40 + private String garOrderImageUrl;
  41 +
  42 + /**
  43 + * 创建时间
  44 + */
  45 + @TableField(fill = FieldFill.INSERT)
  46 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  47 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  48 + private Date garCreateTime;
  49 +
  50 + /**
  51 + * 修改时间
  52 + */
  53 + @TableField(fill = FieldFill.INSERT_UPDATE)
  54 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  55 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  56 + private Date garUpdateTime;
  57 +
  58 + /**
  59 + * 创建人
  60 + */
  61 + @TableField(fill = FieldFill.INSERT)
  62 + private String garCreateBy;
  63 +
  64 + /**
  65 + * 修改人
  66 + */
  67 + @TableField(fill = FieldFill.INSERT_UPDATE)
  68 + private String garUpdateBy;
  69 +
  70 + /**
  71 + * 备注
  72 + */
  73 + private String garRemark;
  74 +
  75 + @TableField(exist = false)
  76 + private static final long serialVersionUID = 1L;
  77 +
  78 +}
0 \ No newline at end of file 79 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarUser.java
@@ -9,6 +9,7 @@ import java.util.Date; @@ -9,6 +9,7 @@ import java.util.Date;
9 9
10 import com.fasterxml.jackson.annotation.JsonFormat; 10 import com.fasterxml.jackson.annotation.JsonFormat;
11 import lombok.Data; 11 import lombok.Data;
  12 +import org.springframework.format.annotation.DateTimeFormat;
12 13
13 /** 14 /**
14 * 建筑垃圾-用户表 15 * 建筑垃圾-用户表
@@ -54,6 +55,7 @@ public class GarUser implements Serializable { @@ -54,6 +55,7 @@ public class GarUser implements Serializable {
54 55
55 @TableField(fill = FieldFill.INSERT) 56 @TableField(fill = FieldFill.INSERT)
56 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") 57 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  58 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
57 private Date garCreateTime; 59 private Date garCreateTime;
58 60
59 /** 61 /**
@@ -61,6 +63,7 @@ public class GarUser implements Serializable { @@ -61,6 +63,7 @@ public class GarUser implements Serializable {
61 */ 63 */
62 @TableField(fill = FieldFill.INSERT_UPDATE) 64 @TableField(fill = FieldFill.INSERT_UPDATE)
63 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd") 65 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  66 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:dd")
64 private Date garUpdateTime; 67 private Date garUpdateTime;
65 68
66 /** 69 /**
@@ -206,6 +209,4 @@ public class GarUser implements Serializable { @@ -206,6 +209,4 @@ public class GarUser implements Serializable {
206 return serialVersionUID; 209 return serialVersionUID;
207 } 210 }
208 211
209 -  
210 -  
211 } 212 }
212 \ No newline at end of file 213 \ No newline at end of file
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/EvaluateDto.java 0 → 100644
  1 +package com.trash.garbage.pojo.dto;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import javax.validation.constraints.NotBlank;
  6 +import javax.validation.constraints.NotNull;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @author 20412
  11 + */
  12 +@Data
  13 +public class EvaluateDto {
  14 + @NotBlank(message = "订单id不能为空")
  15 + private String orderId;
  16 + private String content;
  17 + @NotNull
  18 + private Integer score;
  19 + private List<String> imageUrls;
  20 +}
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java 0 → 100644
  1 +package com.trash.garbage.pojo.dto;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableId;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotBlank;
  7 +import javax.validation.constraints.NotEmpty;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 新增订单dto
  12 + * @author 20412
  13 + */
  14 +@Data
  15 +public class OrderDto {
  16 +
  17 + /**
  18 + * 订单地址
  19 + */
  20 + @NotBlank(message = "地址不能为空")
  21 + private String garOrderAddress;
  22 + /**
  23 + * 图片列表
  24 + */
  25 + @NotEmpty(message = "必须要有现场图片")
  26 + private List<String> imageUrls;
  27 + /**
  28 + * 订单详细地址
  29 + */
  30 + private String garOrderAddressDetails;
  31 +
  32 + /**
  33 + * 订单姓名
  34 + */
  35 + private String garOrderContactName;
  36 +
  37 + /**
  38 + * 垃圾类型
  39 + */
  40 + private String garOrderTrashType;
  41 +
  42 + /**
  43 + * 订单人电话
  44 + */
  45 + @NotBlank(message = "电话不能为空")
  46 + private String garOrderContactTel;
  47 +
  48 + /**
  49 + * 承接经营单位
  50 + */
  51 + private String garOrderCompanyId;
  52 +
  53 + /**
  54 + * 公司名称
  55 + */
  56 + @NotEmpty(message = "公司名称不能为空")
  57 + private String garOrderCompanyName;
  58 +
  59 + /**
  60 + * 公司负责人电话
  61 + */
  62 + private String garOrderCompanyTel;
  63 +
  64 + /**
  65 + * 约定时间
  66 + */
  67 + @NotBlank(message = "约定时间不能为空")
  68 + private String garOrderAgreementTime;
  69 +
  70 + /**
  71 + * 备注
  72 + */
  73 + private String garRemark;
  74 +
  75 +}
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderUpdateDto.java 0 → 100644
  1 +package com.trash.garbage.pojo.dto;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author 20412
  9 + */
  10 +@Data
  11 +public class OrderUpdateDto {
  12 +
  13 + /**
  14 + * 订单id
  15 + */
  16 + private String garOrderId;
  17 +
  18 + /**
  19 + * 处理类型
  20 + */
  21 + private Integer handleType;
  22 +
  23 + /**
  24 + * 照片url
  25 + */
  26 + private List<String> imageUrls;
  27 +}
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/UploadDto.java 0 → 100644
  1 +package com.trash.garbage.pojo.dto;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author 20412
  9 + */
  10 +@Data
  11 +public class UploadDto {
  12 + private String garOrderId;
  13 + private Integer type;
  14 + private List<String> imageUrls;
  15 +}
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/OrderDetailVo.java 0 → 100644
  1 +package com.trash.garbage.pojo.vo;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotEmpty;
  7 +import java.util.ArrayList;
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * @author 20412
  13 + */
  14 +@Data
  15 +public class OrderDetailVo {
  16 +
  17 + private String garOrderHandlerId;
  18 +
  19 + private Integer garEvaluateFlag;
  20 + /**
  21 + * 订单地址
  22 + */
  23 + private String garOrderAddress;
  24 + /**
  25 + * 现场图片图片列表
  26 + */
  27 + private List<String> currentImages;
  28 + /**
  29 + * 装车图片
  30 + */
  31 + private List<String> putOnImages;
  32 + /**
  33 + * 卸车图片
  34 + */
  35 + private List<String> putDownImages;
  36 + /**
  37 + * 订单详细地址
  38 + */
  39 + private String garOrderAddressDetails;
  40 +
  41 + /**
  42 + * 订单姓名
  43 + */
  44 + private String garOrderContactName;
  45 +
  46 + /**
  47 + * 垃圾类型
  48 + */
  49 + private String garOrderTrashType;
  50 +
  51 + /**
  52 + * 订单状态
  53 + */
  54 + private Integer garOrderHandlerStatus;
  55 +
  56 + /**
  57 + * 创建时间
  58 + */
  59 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  60 + private Date garCreateTime;
  61 +
  62 + /**
  63 + * 订单人电话
  64 + */
  65 + private String garOrderContactTel;
  66 +
  67 + /**
  68 + * 承接经营单位
  69 + */
  70 + private String garOrderCompanyId;
  71 +
  72 + /**
  73 + * 公司名称
  74 + */
  75 + private String garOrderCompanyName;
  76 +
  77 + /**
  78 + * 公司负责人电话
  79 + */
  80 + private String garOrderCompanyTel;
  81 +
  82 + /**
  83 + * 约定时间
  84 + */
  85 + private String garOrderAgreementTime;
  86 +
  87 + /**
  88 + * 备注
  89 + */
  90 + private String garRemark;
  91 +
  92 + /**
  93 + * 允许处理标识
  94 + */
  95 + private Boolean handleFlag;
  96 +
  97 + public OrderDetailVo(){
  98 + this.currentImages = new ArrayList<>();
  99 + this.putDownImages = new ArrayList<>();
  100 + this.putOnImages = new ArrayList<>();
  101 + this.handleFlag = false;
  102 + }
  103 +
  104 +}
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderEvaluateService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrderEvaluate;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Service
  9 +* @createDate 2023-11-29 14:19:18
  10 +*/
  11 +public interface GarOrderEvaluateService extends IService<GarOrderEvaluate> {
  12 +
  13 +}
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderImageService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.trash.garbage.pojo.domain.GarOrderImage;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service
  9 +* @createDate 2023-11-24 16:26:19
  10 +*/
  11 +public interface GarOrderImageService extends IService<GarOrderImage> {
  12 +
  13 +}
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.github.pagehelper.PageInfo;
  5 +import com.trash.garbage.pojo.domain.GarOrder;
  6 +import com.trash.garbage.pojo.dto.EvaluateDto;
  7 +import com.trash.garbage.pojo.dto.OrderDto;
  8 +import com.trash.garbage.pojo.dto.OrderUpdateDto;
  9 +import com.trash.garbage.pojo.dto.UploadDto;
  10 +import com.trash.garbage.pojo.vo.OrderDetailVo;
  11 +
  12 +import java.util.List;
  13 +
  14 +/**
  15 +* @author 20412
  16 +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service
  17 +* @createDate 2023-11-24 16:26:19
  18 +*/
  19 +public interface GarOrderService extends IService<GarOrder> {
  20 +
  21 + /**
  22 + * 新增订单
  23 + * @param dto
  24 + * @return
  25 + */
  26 + String saveOrder(OrderDto dto);
  27 +
  28 + /**
  29 + * 根据id查询订单详情
  30 + * @param id
  31 + * @return
  32 + */
  33 + OrderDetailVo queryOrderDetail(String id);
  34 +
  35 + /**
  36 + * 根据类型查询订单
  37 + *
  38 + * @param type
  39 + * @param pageNo
  40 + * @param pageSize
  41 + * @return
  42 + */
  43 + PageInfo queryOrderList(Integer type, Integer pageNo, Integer pageSize);
  44 +
  45 + /**
  46 + * 修改订单状态
  47 + * @param dto
  48 + * @return
  49 + */
  50 + String uploadOrder(OrderUpdateDto dto);
  51 +
  52 + /**
  53 + * 上传图片url执行图片type
  54 + * @param dto
  55 + * @return
  56 + */
  57 + String uploadImageUrlByType(UploadDto dto);
  58 +
  59 + String evaluateOrder(EvaluateDto dto);
  60 +}
trash-garbage/src/main/java/com/trash/garbage/service/GarUserService.java
@@ -27,4 +27,6 @@ public interface GarUserService extends IService&lt;GarUser&gt; { @@ -27,4 +27,6 @@ public interface GarUserService extends IService&lt;GarUser&gt; {
27 String updateAddress(AddressDto dto); 27 String updateAddress(AddressDto dto);
28 28
29 String deleteAddress(String addressId); 29 String deleteAddress(String addressId);
  30 +
  31 + void updateUserInfo(GarUser user);
30 } 32 }
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderEvaluateServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.trash.garbage.pojo.domain.GarOrderEvaluate;
  5 +import com.trash.garbage.service.GarOrderEvaluateService;
  6 +import com.trash.garbage.mapper.GarOrderEvaluateMapper;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +/**
  10 +* @author 20412
  11 +* @description 针对表【gar_order_evaluate(建筑垃圾-派单评分)】的数据库操作Service实现
  12 +* @createDate 2023-11-29 14:19:18
  13 +*/
  14 +@Service
  15 +public class GarOrderEvaluateServiceImpl extends ServiceImpl<GarOrderEvaluateMapper, GarOrderEvaluate>
  16 + implements GarOrderEvaluateService{
  17 +
  18 +}
  19 +
  20 +
  21 +
  22 +
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderImageServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.trash.garbage.pojo.domain.GarOrderImage;
  5 +import com.trash.garbage.service.GarOrderImageService;
  6 +import com.trash.garbage.mapper.GarOrderImageMapper;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +/**
  10 +* @author 20412
  11 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service实现
  12 +* @createDate 2023-11-24 16:26:19
  13 +*/
  14 +@Service
  15 +public class GarOrderImageServiceImpl extends ServiceImpl<GarOrderImageMapper, GarOrderImage>
  16 + implements GarOrderImageService{
  17 +
  18 +}
  19 +
  20 +
  21 +
  22 +
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import cn.hutool.core.collection.CollectionUtil;
  4 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  5 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  6 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  7 +import com.github.pagehelper.PageHelper;
  8 +import com.github.pagehelper.PageInfo;
  9 +import com.trash.common.utils.SecurityUtils;
  10 +import com.trash.common.utils.bean.BeanUtils;
  11 +import com.trash.driver.domain.vo.DriverVo;
  12 +import com.trash.driver.service.IDriverService;
  13 +import com.trash.garbage.global.GlobalStatus;
  14 +import com.trash.garbage.pojo.domain.GarOrder;
  15 +import com.trash.garbage.pojo.domain.GarOrderEvaluate;
  16 +import com.trash.garbage.pojo.domain.GarOrderImage;
  17 +import com.trash.garbage.pojo.domain.GarUser;
  18 +import com.trash.garbage.pojo.dto.EvaluateDto;
  19 +import com.trash.garbage.pojo.dto.OrderDto;
  20 +import com.trash.garbage.pojo.dto.OrderUpdateDto;
  21 +import com.trash.garbage.pojo.dto.UploadDto;
  22 +import com.trash.garbage.pojo.vo.OrderDetailVo;
  23 +import com.trash.garbage.service.GarOrderEvaluateService;
  24 +import com.trash.garbage.service.GarOrderImageService;
  25 +import com.trash.garbage.service.GarOrderService;
  26 +import com.trash.garbage.mapper.GarOrderMapper;
  27 +import com.trash.garbage.service.GarUserService;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.stereotype.Service;
  30 +import org.springframework.transaction.annotation.Transactional;
  31 +
  32 +import java.util.ArrayList;
  33 +import java.util.List;
  34 +
  35 +/**
  36 + * @author 20412
  37 + * @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service实现
  38 + * @createDate 2023-11-24 16:26:19
  39 + */
  40 +@Service
  41 +public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder>
  42 + implements GarOrderService {
  43 +
  44 +
  45 + @Autowired
  46 + private GarOrderImageService garOrderImageService;
  47 +
  48 + @Autowired
  49 + private GarOrderEvaluateService garOrderEvaluateService;
  50 +
  51 + @Autowired
  52 + private GarUserService garUserService;
  53 +
  54 + @Autowired
  55 + private IDriverService driverService;
  56 +
  57 + @Override
  58 + @Transactional(rollbackFor = Exception.class)
  59 + public String saveOrder(OrderDto dto) {
  60 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  61 + GarOrder order = new GarOrder();
  62 + BeanUtils.copyBeanProp(order, dto);
  63 + order.setGarOrderUserId(userId);
  64 + order.setGarOrderHandlerStatus(GlobalStatus.GarOrderStatus.NEW_ORDER.getValue());
  65 + order.setGarCancelFlag(GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue());
  66 + save(order);
  67 + // 保存图片url
  68 + List<String> imageUrls = dto.getImageUrls();
  69 + List<GarOrderImage> images = new ArrayList<>(imageUrls.size());
  70 + for (String imageUrl : imageUrls) {
  71 + GarOrderImage image = new GarOrderImage();
  72 + image.setGarOrderId(order.getGarOrderId());
  73 + image.setGarOrderImageUrl(imageUrl);
  74 + image.setGarOrderImageType(GlobalStatus.GarOrderStatus.IMAGE_TYPE_CURRENT.getValue());
  75 + images.add(image);
  76 + }
  77 + garOrderImageService.saveBatch(images);
  78 + return order.getGarOrderId();
  79 + }
  80 +
  81 + @Override
  82 + public OrderDetailVo queryOrderDetail(String id) {
  83 + GarOrder order = this.getById(id);
  84 + String tel = SecurityUtils.getLoginUser().getUser().getPhonenumber();
  85 + LambdaQueryWrapper<GarOrderImage> qwi = new LambdaQueryWrapper<>();
  86 + qwi.eq(GarOrderImage::getGarOrderId, id);
  87 + OrderDetailVo vo = new OrderDetailVo();
  88 + BeanUtils.copyBeanProp(vo, order);
  89 + DriverVo driverVo = new DriverVo();
  90 + driverVo.setPhoneNo(tel);
  91 + driverVo.setCompanyId(Long.valueOf(order.getGarOrderCompanyId()));
  92 + List<DriverVo> driverVos = driverService.selectDriverList(driverVo);
  93 + if (CollectionUtil.isNotEmpty(driverVos)) {
  94 + vo.setHandleFlag(true);
  95 + }
  96 + List<GarOrderImage> imageList = garOrderImageService.list(qwi);
  97 + for (GarOrderImage image : imageList) {
  98 + if (GlobalStatus.GarOrderStatus.CANCEL_FLAG_NO.getValue().equals(image.getGarOrderImageType())) {
  99 + vo.getCurrentImages().add(image.getGarOrderImageUrl());
  100 + }
  101 + if (GlobalStatus.GarOrderStatus.IMAGE_TYPE_PUT_ON.getValue().equals(image.getGarOrderImageType())) {
  102 + vo.getPutOnImages().add(image.getGarOrderImageUrl());
  103 + }
  104 + if (GlobalStatus.GarOrderStatus.IMAGE_TYPE_PUT_DOWN.getValue().equals(image.getGarOrderImageType())) {
  105 + vo.getPutDownImages().add(image.getGarOrderImageUrl());
  106 + }
  107 + }
  108 + return vo;
  109 + }
  110 +
  111 + @Override
  112 + public PageInfo queryOrderList(Integer type, Integer pageNo, Integer pageSize) {
  113 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  114 + GarUser user = garUserService.getById(userId);
  115 + LambdaQueryWrapper<GarOrder> qw = new LambdaQueryWrapper<>();
  116 + qw.orderByAsc(GarOrder::getGarEvaluateFlag, GarOrder::getGarOrderHandlerStatus);
  117 + // 居民用户
  118 + if (user.getGarUserType().equals(GlobalStatus.UserStatusEnum.DRIVER_USER.getDescription())) {
  119 + PageHelper.startPage(pageNo, pageSize);
  120 + // 待清运 || 清运中 || 已完成 || 待支付
  121 + if (GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(type)
  122 + || GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type)
  123 + || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) {
  124 + qw.eq(GarOrder::getGarOrderUserId, userId)
  125 + .eq(GarOrder::getGarOrderHandlerStatus, type);
  126 + List<GarOrder> orderList = list(qw);
  127 + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize);
  128 + return pageInfo;
  129 + }
  130 + // 全部
  131 + if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) {
  132 + qw.eq(GarOrder::getGarOrderUserId, userId);
  133 + List<GarOrder> orderList = list(qw);
  134 + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize);
  135 + return pageInfo;
  136 + }
  137 + } else {
  138 + DriverVo driver = new DriverVo();
  139 + driver.setPhoneNo(user.getGarUserTel());
  140 + List<DriverVo> driverList = driverService.selectDriverList(driver);
  141 + DriverVo driverVo = driverList.get(0);
  142 + String companyId = String.valueOf(driverVo.getCompanyId());
  143 + PageHelper.startPage(pageNo, pageSize);
  144 + if (GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(type)) {
  145 + qw.eq(GarOrder::getGarOrderCompanyId, companyId)
  146 + .eq(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.NEW_ORDER.getValue());
  147 + List<GarOrder> orderList = list(qw);
  148 + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize);
  149 + return pageInfo;
  150 + }
  151 +
  152 + if (GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(type)
  153 + || GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(type)) {
  154 + qw.eq(GarOrder::getGarOrderCompanyId, companyId)
  155 + .eq(GarOrder::getGarOrderHandlerId, user.getGarUserId())
  156 + .eq(GarOrder::getGarOrderHandlerStatus, type);
  157 + List<GarOrder> orderList = list(qw);
  158 + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize);
  159 + return pageInfo;
  160 + }
  161 +
  162 + // 全部
  163 + if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) {
  164 + qw.eq(GarOrder::getGarOrderHandlerId, userId);
  165 + List<GarOrder> orderList = list(qw);
  166 + PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize);
  167 + return pageInfo;
  168 + }
  169 + }
  170 + return null;
  171 + }
  172 +
  173 + @Override
  174 + public String uploadOrder(OrderUpdateDto dto) {
  175 + GarOrder order = getById(dto.getGarOrderId());
  176 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  177 + GarUser user = garUserService.getById(userId);
  178 + // 运输员操作 TODO 公司所属 待清运- 》 清运中
  179 + if (GlobalStatus.UserStatusEnum.NORMAL_USER.getDescription().equals(user.getGarUserType())){
  180 + if (order.getGarOrderHandlerStatus().equals(GlobalStatus.GarOrderStatus.NEW_ORDER.getValue())
  181 + || GlobalStatus.GarOrderStatus.NEW_ORDER.getValue().equals(dto.getHandleType())) {
  182 + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>();
  183 + uw.eq(GarOrder::getGarOrderId, dto.getGarOrderId())
  184 + .set(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue())
  185 + .set(GarOrder::getGarOrderHandlerId, userId);
  186 + update(uw);
  187 + return "准备清运";
  188 + }
  189 + // 运输员操作 清运中 ==》已完成
  190 + if (GlobalStatus.GarOrderStatus.ACTIVE_ORDER.getValue().equals(order.getGarOrderHandlerStatus())
  191 + && GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(dto.getHandleType())) {
  192 + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>();
  193 + uw.eq(GarOrder::getGarOrderId, dto.getGarOrderId())
  194 + .set(GarOrder::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue())
  195 + .set(GarOrder::getGarEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue());
  196 + update(uw);
  197 + }
  198 + return "派单已完成";
  199 + }
  200 + return "什么都没发生";
  201 + }
  202 +
  203 + @Override
  204 + public String uploadImageUrlByType(UploadDto dto) {
  205 + List<GarOrderImage> garOrderImages = new ArrayList<>(dto.getImageUrls().size());
  206 + for (String imageUrl : dto.getImageUrls()) {
  207 + GarOrderImage orderImage = new GarOrderImage();
  208 + orderImage.setGarOrderId(dto.getGarOrderId());
  209 + orderImage.setGarOrderImageUrl(imageUrl);
  210 + orderImage.setGarOrderImageType(dto.getType());
  211 + garOrderImages.add(orderImage);
  212 + }
  213 + garOrderImageService.saveBatch(garOrderImages);
  214 + return "上传成功!";
  215 + }
  216 +
  217 + @Override
  218 + public String evaluateOrder(EvaluateDto dto) {
  219 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  220 + GarUser user = garUserService.getById(userId);
  221 + GarOrder order = getById(dto.getOrderId());
  222 + // TODO 用户评价
  223 + if (GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue().equals(order.getGarOrderHandlerStatus())) {
  224 + evaluate(dto, order);
  225 + }
  226 + return "已评价";
  227 + }
  228 +
  229 + private void evaluate(EvaluateDto dto, GarOrder order) {
  230 + GarOrderEvaluate evaluate = new GarOrderEvaluate();
  231 + evaluate.setGarOrderId(order.getGarOrderId());
  232 + evaluate.setGarEvaluateContent(dto.getContent());
  233 + evaluate.setGarEvaluateScore(dto.getScore());
  234 + garOrderEvaluateService.save(evaluate);
  235 + // 修改订单评价状态
  236 + LambdaUpdateWrapper<GarOrder> uw = new LambdaUpdateWrapper<>();
  237 + uw.eq(GarOrder::getGarOrderId, order.getGarOrderId())
  238 + .set(GarOrder::getGarEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_YES.getValue());
  239 + update(uw);
  240 + }
  241 +}
  242 +
  243 +
  244 +
  245 +
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
@@ -116,9 +116,6 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -116,9 +116,6 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
116 user.setRoles(roles); 116 user.setRoles(roles);
117 loginUser.setPermissions(set); 117 loginUser.setPermissions(set);
118 String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel()); 118 String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel());
119 - if (!token.contains("Bearer ")) {  
120 - token = "Bearer " + token;  
121 - }  
122 loginUser.setToken(token); 119 loginUser.setToken(token);
123 tokenService.refreshToken(loginUser); 120 tokenService.refreshToken(loginUser);
124 return token; 121 return token;
@@ -209,6 +206,17 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt; @@ -209,6 +206,17 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
209 return "删除成功!"; 206 return "删除成功!";
210 } 207 }
211 208
  209 + @Override
  210 + public void updateUserInfo(GarUser user) {
  211 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  212 + LambdaUpdateWrapper<GarUser> uw = new LambdaUpdateWrapper<>();
  213 + uw.eq(GarUser::getGarUserId, userId)
  214 + .set(GarUser::getGarUserType, user.getGarUserType())
  215 + .set(GarUser::getGarUserName, user.getGarUserName())
  216 + .set(GarUser::getGarUserCarNum, user.getGarUserCarNum());
  217 + update(uw);
  218 + }
  219 +
212 220
213 /** 221 /**
214 * 微信小程序解密 222 * 微信小程序解密
trash-garbage/src/main/resources/mapper/GarOrderEvaluateMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.garbage.mapper.GarOrderEvaluateMapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderEvaluate">
  8 + <id property="garEvaluateId" column="gar_evaluate_id" jdbcType="VARCHAR"/>
  9 + <result property="garEvaluateContent" column="gar_evaluate_content" jdbcType="VARCHAR"/>
  10 + <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
  11 + <result property="garEvaluateScore" column="gar_evaluate_score" jdbcType="TINYINT"/>
  12 + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
  13 + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
  14 + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
  15 + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
  16 + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
  17 + <result property="garCompanyId" column="gar_company_id" jdbcType="VARCHAR"/>
  18 + </resultMap>
  19 +
  20 + <sql id="Base_Column_List">
  21 + gar_evaluate_id,gar_evaluate_content,gar_evaluate_score,
  22 + gar_update_by,gar_create_by,gar_update_time,
  23 + gar_create_time,gar_remark,gar_order_id,gar_company_id
  24 + </sql>
  25 +</mapper>
trash-garbage/src/main/resources/mapper/GarOrderImageMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.garbage.mapper.GarOrderImageMapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderImage">
  8 + <id property="garImageId" column="gar_image_id" jdbcType="VARCHAR"/>
  9 + <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
  10 + <result property="garOrderImageType" column="gar_order_image_type" jdbcType="TINYINT"/>
  11 + <result property="garOrderImageUrl" column="gar_order_image_url" jdbcType="VARCHAR"/>
  12 + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
  13 + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
  14 + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
  15 + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
  16 + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
  17 + </resultMap>
  18 +
  19 + <sql id="Base_Column_List">
  20 + gar_image_id,gar_order_id,gar_order_image_type,
  21 + gar_order_image_url,gar_create_time,gar_update_time,
  22 + gar_create_by,gar_update_by,gar_remark
  23 + </sql>
  24 +</mapper>
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.garbage.mapper.GarOrderMapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrder">
  8 + <id property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
  9 + <result property="garOrderUserId" column="gar_order_user_id" jdbcType="VARCHAR"/>
  10 + <result property="garOrderHandlerId" column="gar_order_handler_id" jdbcType="VARCHAR"/>
  11 + <result property="garOrderAddress" column="gar_order_address" jdbcType="VARCHAR"/>
  12 + <result property="garOrderAddressDetails" column="gar_order_address_details" jdbcType="VARCHAR"/>
  13 + <result property="garOrderContactName" column="gar_order_contact_name" jdbcType="VARCHAR"/>
  14 + <result property="garOrderTrashType" column="gar_order_trash_type" jdbcType="VARCHAR"/>
  15 + <result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/>
  16 + <result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/>
  17 + <result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/>
  18 + <result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/>
  19 + <result property="garOrderHandlerStatus" column="gar_order_handler_status" jdbcType="INTEGER"/>
  20 + <result property="garOrderAgreementTime" column="gar_order_agreement_time" jdbcType="VARCHAR"/>
  21 + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
  22 + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
  23 + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
  24 + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
  25 + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
  26 + <result property="garReason" column="gar_reason" jdbcType="VARCHAR"/>
  27 + <result property="garCancelFlag" column="gar_cancel_flag" jdbcType="TINYINT"/>
  28 + <result property="garEvaluateFlag" column="gar_evaluate_flag" jdbcType="TINYINT"/>
  29 + </resultMap>
  30 +
  31 + <sql id="Base_Column_List">
  32 + gar_order_id
  33 + ,gar_order_user_id,gar_order_handle_id,
  34 + gar_order_address,gar_order_address_details,gar_order_contact_name,
  35 + gar_order_trash_type,gar_order_contact_tel,gar_order_company_id,
  36 + gar_order_company_name,gar_order_company_tel,gar_order_hander_status,
  37 + gar_order_agreement_time,gar_create_time,gar_update_time,
  38 + gar_create_by,gar_update_by,gar_remark,gar_reason,gar_cancel_flag,gar_evaluate_flag
  39 + </sql>
  40 +</mapper>
trash-ui/src/api/other/documentData.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询文件资料列表
  4 +export function listDocumentData(query) {
  5 + return request({
  6 + url: '/other/documentData/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询文件资料详细
  13 +export function getDocumentData(id) {
  14 + return request({
  15 + url: '/other/documentData/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增文件资料
  21 +export function addDocumentData(data) {
  22 + return request({
  23 + url: '/other/documentData',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改文件资料
  30 +export function updateDocumentData(data) {
  31 + return request({
  32 + url: '/other/documentData',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除文件资料
  39 +export function delDocumentData(id) {
  40 + return request({
  41 + url: '/other/documentData/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出文件资料
  47 +export function exportDocumentData(query) {
  48 + return request({
  49 + url: '/other/documentData/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
0 \ No newline at end of file 54 \ No newline at end of file
trash-ui/src/api/other/incorruptData.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询文件资料列表
  4 +export function listIncorruptData(tableName) {
  5 + return request({
  6 + url: '/other/incorrupt/list/'+tableName,
  7 + method: 'get'
  8 + })
  9 +}
  10 +
  11 +// 新增文件资料
  12 +export function addIncorruptData(data) {
  13 + return request({
  14 + url: '/other/incorrupt',
  15 + method: 'post',
  16 + data: data
  17 + })
  18 +}
trash-ui/src/api/unit/businessUnit.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询运输企业管理列表
  4 +export function listEnterprise(query) {
  5 + return request({
  6 + url: '/unit/enterprise/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询运输企业管理详细
  13 +export function getEnterprise(id) {
  14 + return request({
  15 + url: '/unit/enterprise/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增运输企业管理
  21 +export function addEnterprise(data) {
  22 + return request({
  23 + url: '/unit/enterprise',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改运输企业管理
  30 +export function updateEnterprise(data) {
  31 + return request({
  32 + url: '/unit/enterprise',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除运输企业管理
  39 +export function delEnterprise(id) {
  40 + return request({
  41 + url: '/unit/enterprise/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出运输企业管理
  47 +export function exportEnterprise(query) {
  48 + return request({
  49 + url: '/unit/enterprise/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
trash-ui/src/api/unit/carInfo.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询运输车辆管理列表
  4 +export function listCarInfo(query) {
  5 + return request({
  6 + url: '/unit/carInfo/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询运输车辆管理详细
  13 +export function getCarInfo(id) {
  14 + return request({
  15 + url: '/unit/carInfo/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增运输车辆管理
  21 +export function addCarInfo(data) {
  22 + return request({
  23 + url: '/unit/carInfo',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改运输车辆管理
  30 +export function updateCarInfo(data) {
  31 + return request({
  32 + url: '/unit/carInfo',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除运输车辆管理
  39 +export function delCarInfo(id) {
  40 + return request({
  41 + url: '/unit/carInfo/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出运输车辆管理
  47 +export function exportCarInfo(query) {
  48 + return request({
  49 + url: '/unit/carInfo/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
trash-ui/src/api/unit/disposalSite.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询处理场所管理列表
  4 +export function listDisposalSite(query) {
  5 + return request({
  6 + url: '/unit/disposalSite/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询处理场所管理详细
  13 +export function getDisposalSite(id) {
  14 + return request({
  15 + url: '/unit/disposalSite/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增处理场所管理
  21 +export function addDisposalSite(data) {
  22 + return request({
  23 + url: '/unit/disposalSite',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改处理场所管理
  30 +export function updateDisposalSite(data) {
  31 + return request({
  32 + url: '/unit/disposalSite',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除处理场所管理
  39 +export function delDisposalSite(id) {
  40 + return request({
  41 + url: '/unit/disposalSite/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出处理场所管理
  47 +export function exportDisposalSite(query) {
  48 + return request({
  49 + url: '/unit/disposalSite/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
trash-ui/src/api/unit/driver.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询驾驶员管理列表
  4 +export function listDriver(query) {
  5 + return request({
  6 + url: '/unit/driver/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +
  13 +// 查询驾驶员管理详细
  14 +export function listDriverByCompanyId(companyId) {
  15 + return request({
  16 + url: '/unit/driver/listDriverByCompany/' + companyId,
  17 + method: 'get'
  18 + })
  19 +}
  20 +
  21 +// 查询驾驶员管理详细
  22 +export function getDriver(id) {
  23 + return request({
  24 + url: '/unit/driver/' + id,
  25 + method: 'get'
  26 + })
  27 +}
  28 +
  29 +// 新增驾驶员管理
  30 +export function addDriver(data) {
  31 + return request({
  32 + url: '/unit/driver',
  33 + method: 'post',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 修改驾驶员管理
  39 +export function updateDriver(data) {
  40 + return request({
  41 + url: '/unit/driver',
  42 + method: 'put',
  43 + data: data
  44 + })
  45 +}
  46 +
  47 +// 删除驾驶员管理
  48 +export function delDriver(id) {
  49 + return request({
  50 + url: '/unit/driver/' + id,
  51 + method: 'delete'
  52 + })
  53 +}
  54 +
  55 +// 导出驾驶员管理
  56 +export function exportDriver(query) {
  57 + return request({
  58 + url: '/unit/driver/export',
  59 + method: 'get',
  60 + params: query
  61 + })
  62 +}
trash-ui/src/api/unit/enterprise.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询运输企业管理列表
  4 +export function listEnterprise(query) {
  5 + return request({
  6 + url: '/unit/enterprise/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询运输企业管理详细
  13 +export function getEnterprise(id) {
  14 + return request({
  15 + url: '/unit/enterprise/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增运输企业管理
  21 +export function addEnterprise(data) {
  22 + return request({
  23 + url: '/unit/enterprise',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改运输企业管理
  30 +export function updateEnterprise(data) {
  31 + return request({
  32 + url: '/unit/enterprise',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除运输企业管理
  39 +export function delEnterprise(id) {
  40 + return request({
  41 + url: '/unit/enterprise/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出运输企业管理
  47 +export function exportEnterprise(query) {
  48 + return request({
  49 + url: '/unit/enterprise/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
trash-ui/src/main.js
@@ -12,6 +12,7 @@ import &#39;@/assets/styles/trash.scss&#39; // trash css @@ -12,6 +12,7 @@ import &#39;@/assets/styles/trash.scss&#39; // trash css
12 import App from './App' 12 import App from './App'
13 import store from './store' 13 import store from './store'
14 import router from './router' 14 import router from './router'
  15 +import plugins from './plugins' // plugins
15 import permission from './directive/permission' 16 import permission from './directive/permission'
16 17
17 import './assets/icons' // icon 18 import './assets/icons' // icon
@@ -35,7 +36,11 @@ Vue.prototype.selectDictLabels = selectDictLabels @@ -35,7 +36,11 @@ Vue.prototype.selectDictLabels = selectDictLabels
35 Vue.prototype.download = download 36 Vue.prototype.download = download
36 Vue.prototype.handleTree = handleTree 37 Vue.prototype.handleTree = handleTree
37 Vue.prototype.parseStatus = parseStatus 38 Vue.prototype.parseStatus = parseStatus
38 -Vue.prototype.checkPer = checkPermi 39 +Vue.prototype.checkPer = checkPermi
  40 +
  41 +Vue.use(plugins)
  42 +Vue.prototype.$aMapKey = "902732b0ff4758e4b39f0f34f0cb1cb0";// 高德地图key
  43 +
39 44
40 Vue.prototype.remoteFrame = "http://183.66.242.6:14601" 45 Vue.prototype.remoteFrame = "http://183.66.242.6:14601"
41 // Vue.prototype.remoteFrame = "http://175.6.47.84:8008" 46 // Vue.prototype.remoteFrame = "http://175.6.47.84:8008"
@@ -67,8 +72,8 @@ Vue.use(permission) @@ -67,8 +72,8 @@ Vue.use(permission)
67 * 72 *
68 * Currently MockJs will be used in the production environment, 73 * Currently MockJs will be used in the production environment,
69 * please remove it before going online! ! ! 74 * please remove it before going online! ! !
70 - */  
71 -Element.Dialog.props.closeOnClickModal.default = false; 75 + */
  76 +Element.Dialog.props.closeOnClickModal.default = false;
72 77
73 Vue.use(Element, { 78 Vue.use(Element, {
74 size: Cookies.get('size') || 'medium' // set element-ui default size 79 size: Cookies.get('size') || 'medium' // set element-ui default size
trash-ui/src/plugins/index.js 0 → 100644
  1 +import tab from './tab'
  2 +
  3 +export default {
  4 + install(Vue) {
  5 + // 页签操作
  6 + Vue.prototype.$tab = tab
  7 + }
  8 +}
trash-ui/src/plugins/tab.js 0 → 100644
  1 +import store from '@/store'
  2 +import router from '@/router';
  3 +
  4 +export default {
  5 + // 刷新当前tab页签
  6 + refreshPage(obj) {
  7 + const { path, query, matched } = router.currentRoute;
  8 + if (obj === undefined) {
  9 + matched.forEach((m) => {
  10 + if (m.components && m.components.default && m.components.default.name) {
  11 + if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
  12 + obj = { name: m.components.default.name, path: path, query: query };
  13 + }
  14 + }
  15 + });
  16 + }
  17 + return store.dispatch('tagsView/delCachedView', obj).then(() => {
  18 + const { path, query } = obj
  19 + router.replace({
  20 + path: '/redirect' + path,
  21 + query: query
  22 + })
  23 + })
  24 + },
  25 + // 关闭当前tab页签,打开新页签
  26 + closeOpenPage(obj) {
  27 + store.dispatch("tagsView/delView", router.currentRoute);
  28 + if (obj !== undefined) {
  29 + return router.push(obj);
  30 + }
  31 + },
  32 + // 关闭指定tab页签
  33 + closePage(obj) {
  34 + if (obj === undefined) {
  35 + return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
  36 + const latestView = visitedViews.slice(-1)[0]
  37 + if (latestView) {
  38 + return router.push(latestView.fullPath)
  39 + }
  40 + return router.push('/');
  41 + });
  42 + }
  43 + return store.dispatch('tagsView/delView', obj);
  44 + },
  45 + // 关闭所有tab页签
  46 + closeAllPage() {
  47 + return store.dispatch('tagsView/delAllViews');
  48 + },
  49 + // 关闭左侧tab页签
  50 + closeLeftPage(obj) {
  51 + return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
  52 + },
  53 + // 关闭右侧tab页签
  54 + closeRightPage(obj) {
  55 + return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
  56 + },
  57 + // 关闭其他tab页签
  58 + closeOtherPage(obj) {
  59 + return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
  60 + },
  61 + // 添加tab页签
  62 + openPage(title, url, params) {
  63 + var obj = { path: url, meta: { title: title } }
  64 + store.dispatch('tagsView/addView', obj);
  65 + return router.push({ path: url, query: params });
  66 + },
  67 + // 修改tab页签
  68 + updatePage(obj) {
  69 + return store.dispatch('tagsView/updateVisitedView', obj);
  70 + }
  71 +}
trash-ui/src/router/index.js
@@ -65,6 +65,7 @@ export const constantRoutes = [ @@ -65,6 +65,7 @@ export const constantRoutes = [
65 } 65 }
66 ] 66 ]
67 }, 67 },
  68 +
68 { 69 {
69 path: '/user', 70 path: '/user',
70 component: Layout, 71 component: Layout,
@@ -115,9 +116,79 @@ export const constantRoutes = [ @@ -115,9 +116,79 @@ export const constantRoutes = [
115 component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), 116 component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
116 name: 'GenEdit', 117 name: 'GenEdit',
117 meta: { title: '修改生成配置' } 118 meta: { title: '修改生成配置' }
118 - } 119 + },
  120 + {
  121 + path: '/disposalSite/info',
  122 + component: (resolve) => require(['@/views/unit/disposalSite/info'], resolve),
  123 + name: '新增处理场所',
  124 + hidden: true,
  125 + meta: { title: '新增处理场所' }
  126 + },
  127 + {
  128 + path: '/disposalSite/infoEdit',
  129 + component: (resolve) => require(['@/views/unit/disposalSite/info'], resolve),
  130 + name: '修改处理场所',
  131 + hidden: true,
  132 + meta: { title: '修改处理场所' }
  133 + },
  134 + {
  135 + path: '/enterprise/info',
  136 + component: (resolve) => require(['@/views/unit/enterprise/info'], resolve),
  137 + name: '新增运输企业',
  138 + hidden: true,
  139 + meta: { title: '新增运输企业' }
  140 + },
  141 + {
  142 + path: '/enterprise/infoEdit',
  143 + component: (resolve) => require(['@/views/unit/enterprise/info'], resolve),
  144 + name: '修改运输企业',
  145 + hidden: true,
  146 + meta: { title: '修改运输企业' }
  147 + },
  148 + {
  149 + path: '/unit/info',
  150 + component: (resolve) => require(['@/views/unit/businessUnit/info'], resolve),
  151 + name: '新增经营单位',
  152 + hidden: true,
  153 + meta: { title: '新增经营单位' }
  154 + },
  155 + {
  156 + path: '/unit/infoEdit',
  157 + component: (resolve) => require(['@/views/unit/businessUnit/info'], resolve),
  158 + name: '修改经营单位',
  159 + hidden: true,
  160 + meta: { title: '修改经营单位' }
  161 + },
  162 + {
  163 + path: '/carInfo/info',
  164 + component: (resolve) => require(['@/views/unit/carInfo/info'], resolve),
  165 + name: '新增车辆信息',
  166 + hidden: true,
  167 + meta: { title: '新增车辆信息' }
  168 + },
  169 + {
  170 + path: '/carInfo/infoEdit',
  171 + component: (resolve) => require(['@/views/unit/carInfo/info'], resolve),
  172 + name: '修改车辆信息',
  173 + hidden: true,
  174 + meta: { title: '修改车辆信息' }
  175 + },
  176 + {
  177 + path: '/driverInfo/info',
  178 + component: (resolve) => require(['@/views/unit/driver/info'], resolve),
  179 + name: '新增驾驶员',
  180 + hidden: true,
  181 + meta: { title: '新增驾驶员' }
  182 + },
  183 + {
  184 + path: '/driverInfo/infoEdit',
  185 + component: (resolve) => require(['@/views/unit/driver/info'], resolve),
  186 + name: '修改驾驶员',
  187 + hidden: true,
  188 + meta: { title: '修改驾驶员' }
  189 + },
119 ] 190 ]
120 - }, 191 + },
121 { 192 {
122 path: '/business', 193 path: '/business',
123 component: Layout, 194 component: Layout,
@@ -128,12 +199,12 @@ export const constantRoutes = [ @@ -128,12 +199,12 @@ export const constantRoutes = [
128 component: (resolve) => require(['@/views/business/ConstructionCredit'], resolve), 199 component: (resolve) => require(['@/views/business/ConstructionCredit'], resolve),
129 name: '工地失信管理', 200 name: '工地失信管理',
130 meta: { title: '工地失信管理' } 201 meta: { title: '工地失信管理' }
131 - },  
132 - {  
133 - path: 'track',  
134 - component: (resolve) => require(['@/views/business/track'], resolve),  
135 - name: '跟踪监督',  
136 - meta: { title: '跟踪监督' } 202 + },
  203 + {
  204 + path: 'track',
  205 + component: (resolve) => require(['@/views/business/track'], resolve),
  206 + name: '跟踪监督',
  207 + meta: { title: '跟踪监督' }
137 }, 208 },
138 { 209 {
139 path: 'supervision/threestep', 210 path: 'supervision/threestep',
@@ -371,6 +442,7 @@ export const constantRoutes = [ @@ -371,6 +442,7 @@ export const constantRoutes = [
371 }, 442 },
372 ] 443 ]
373 }, 444 },
  445 +
374 // { 446 // {
375 // path: '/task/handle', 447 // path: '/task/handle',
376 // component: Layout, 448 // component: Layout,
trash-ui/src/views/other/documentData/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4 + <el-form-item label="标题" prop="title">
  5 + <el-input
  6 + v-model="queryParams.title"
  7 + placeholder="请输入标题"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item>
  14 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16 + </el-form-item>
  17 + </el-form>
  18 +
  19 + <el-row :gutter="10" class="mb8">
  20 + <el-col :span="1.5">
  21 + <el-button
  22 + type="primary"
  23 + icon="el-icon-plus"
  24 + size="mini"
  25 + @click="handleAdd"
  26 + v-hasPermi="['other:documentData:add']"
  27 + >新增
  28 + </el-button>
  29 + </el-col>
  30 + <el-col :span="1.5">
  31 + <el-button
  32 + type="success"
  33 + icon="el-icon-edit"
  34 + size="mini"
  35 + :disabled="single"
  36 + @click="handleUpdate"
  37 + v-hasPermi="['other:documentData:edit']"
  38 + >修改
  39 + </el-button>
  40 + </el-col>
  41 + <el-col :span="1.5">
  42 + <el-button
  43 + type="danger"
  44 + icon="el-icon-delete"
  45 + size="mini"
  46 + :disabled="multiple"
  47 + @click="handleDelete"
  48 + v-hasPermi="['other:documentData:remove']"
  49 + >删除
  50 + </el-button>
  51 + </el-col>
  52 + <el-col :span="1.5">
  53 + <el-button
  54 + type="warning"
  55 + icon="el-icon-download"
  56 + size="mini"
  57 + @click="handleExport"
  58 + v-hasPermi="['other:documentData:export']"
  59 + >导出
  60 + </el-button>
  61 + </el-col>
  62 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  63 + </el-row>
  64 +
  65 + <el-table v-loading="loading" :data="documentDataList" @selection-change="handleSelectionChange">
  66 + <el-table-column type="selection" width="55" align="center"/>
  67 + <el-table-column label="附件" align="center" prop="id"/>
  68 + <el-table-column label="标题" align="center" prop="title"/>
  69 + <el-table-column label="时间" align="center" prop="createTime">
  70 + <template slot-scope="scope">
  71 + <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
  72 + </template>
  73 + </el-table-column>
  74 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  75 + <template slot-scope="scope">
  76 + <el-button
  77 + size="mini"
  78 + type="text"
  79 + icon="el-icon-edit"
  80 + @click="handleUpdate(scope.row)"
  81 + v-hasPermi="['other:documentData:edit']"
  82 + >修改
  83 + </el-button>
  84 + <el-button
  85 + size="mini"
  86 + type="text"
  87 + icon="el-icon-delete"
  88 + @click="handleDelete(scope.row)"
  89 + v-hasPermi="['other:documentData:remove']"
  90 + >删除
  91 + </el-button>
  92 + </template>
  93 + </el-table-column>
  94 + </el-table>
  95 +
  96 + <pagination
  97 + v-show="total>0"
  98 + :total="total"
  99 + :page.sync="queryParams.pageNum"
  100 + :limit.sync="queryParams.pageSize"
  101 + @pagination="getList"
  102 + />
  103 +
  104 + <!-- 添加或修改文件资料对话框 -->
  105 + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  106 + <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  107 + <el-form-item label="标题" prop="title">
  108 + <el-input v-model="form.title" placeholder="请输入标题"/>
  109 + </el-form-item>
  110 + <el-form-item label="内容" prop="content">
  111 + <editor v-model="form.content" :min-height="368"/>
  112 + </el-form-item>
  113 + <el-row>
  114 + <el-col :span="12">
  115 + <el-form-item label="录入时间">
  116 + <el-input v-model="form.createTime" disabled="disabled"/>
  117 + </el-form-item>
  118 + </el-col>
  119 + <el-col :span="12">
  120 + <el-form-item label="录入人">
  121 + <el-input v-model="form.createBy" disabled="disabled"/>
  122 + </el-form-item>
  123 + </el-col>
  124 + </el-row>
  125 + <el-form-item label="附件预览">
  126 + <el-image v-for="item in fileEntityList"
  127 + v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)"
  128 + style="width: 150px; height: 100px; margin: 5px;"
  129 + :src="createUrl(item)"
  130 + :preview-src-list="[createUrl(item)]"
  131 + :z-index="999">
  132 + </el-image>
  133 + </el-form-item>
  134 + <el-form-item prop="fileEntityList" label="附件">
  135 + <el-upload
  136 + ref="upload"
  137 + action=""
  138 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  139 + :on-change="fileChange"
  140 + :auto-upload="false"
  141 + :show-file-list="false"
  142 + multiple
  143 + :file-list="fileEntityList">
  144 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  145 + </el-upload>
  146 + </el-form-item>
  147 + <el-table :data="fileEntityList">
  148 + <el-table-column property="name" label="附件名称" header-align="center" align="center"></el-table-column>
  149 + <el-table-column label="操作" class-name="small-padding fixed-width" header-align="center" align="center">
  150 + <template slot-scope="scope">
  151 + <el-button
  152 + size="small" type="success"
  153 + icon="el-icon-download"
  154 + @click="tempDownload(scope.row)"
  155 + v-hasPermi="['other:documentData:edit']"
  156 + round>下载
  157 + </el-button>
  158 + <el-button
  159 + size="small" type="danger"
  160 + icon="el-icon-delete"
  161 + @click="handleDeleteFile(scope.$index)"
  162 + v-hasPermi="['other:documentData:remove']"
  163 + round>删除
  164 + </el-button>
  165 + </template>
  166 + </el-table-column>
  167 + </el-table>
  168 + </el-form>
  169 + <div slot="footer" class="dialog-footer">
  170 + <el-button type="primary" @click="submitForm">确 定</el-button>
  171 + <el-button @click="cancel">取 消</el-button>
  172 + </div>
  173 + </el-dialog>
  174 + </div>
  175 +</template>
  176 +
  177 +<script>
  178 +import {
  179 + addDocumentData,
  180 + delDocumentData,
  181 + exportDocumentData,
  182 + getDocumentData,
  183 + listDocumentData,
  184 + updateDocumentData
  185 +} from "@/api/other/documentData";
  186 +import Editor from '@/components/ZcEditor';
  187 +import {parseTime} from "../../../utils/trash";
  188 +
  189 +export default {
  190 + name: "DocumentData",
  191 + components: {Editor},
  192 + data() {
  193 + return {
  194 + // 遮罩层
  195 + loading: true,
  196 + // 选中数组
  197 + ids: [],
  198 + // 非单个禁用
  199 + single: true,
  200 + // 非多个禁用
  201 + multiple: true,
  202 + // 显示搜索条件
  203 + showSearch: true,
  204 + // 总条数
  205 + total: 0,
  206 + // 文件资料表格数据
  207 + documentDataList: [],
  208 + // 弹出层标题
  209 + title: "",
  210 + // 是否显示弹出层
  211 + open: false,
  212 + // 查询参数
  213 + queryParams: {
  214 + pageNum: 1,
  215 + pageSize: 10,
  216 + title: null,
  217 + content: null,
  218 + files: null,
  219 + },
  220 + // 表单参数
  221 + form: {},
  222 + // 表单校验
  223 + rules: {
  224 + title: [
  225 + {required: true, message: "请输入标题", trigger: "blur"},
  226 + {min: 1, max: 100, message: "长度在 1 到 100 个字符", trigger: "blur"}
  227 + ],
  228 + content: [
  229 + {required: true, message: "请输入内容", trigger: "blur"},
  230 + {min: 1, max: 10000, message: "长度在 1 到 10000 个字符", trigger: "blur"}
  231 + ],
  232 + files: [
  233 + {required: true, message: "请上传附件", trigger: "blur"}
  234 + ]
  235 + },
  236 + fileEntityList: [],
  237 + };
  238 + },
  239 + created() {
  240 + this.getList();
  241 + },
  242 + methods: {
  243 + /** 查询文件资料列表 */
  244 + getList() {
  245 + this.loading = true;
  246 + listDocumentData(this.queryParams).then(response => {
  247 + this.documentDataList = response.rows;
  248 + this.total = response.total;
  249 + this.loading = false;
  250 + });
  251 + },
  252 + // 取消按钮
  253 + cancel() {
  254 + this.open = false;
  255 + this.reset();
  256 + },
  257 + // 表单重置
  258 + reset() {
  259 + this.form = {
  260 + id: null,
  261 + title: null,
  262 + content: null,
  263 + files: null,
  264 + createTime: null,
  265 + createBy: null,
  266 + updateTime: null,
  267 + updateBy: null
  268 + };
  269 + this.fileEntityList = [];
  270 + this.resetForm("form");
  271 + },
  272 + /** 搜索按钮操作 */
  273 + handleQuery() {
  274 + this.queryParams.pageNum = 1;
  275 + this.getList();
  276 + },
  277 + /** 重置按钮操作 */
  278 + resetQuery() {
  279 + this.resetForm("queryForm");
  280 + this.handleQuery();
  281 + },
  282 + // 多选框选中数据
  283 + handleSelectionChange(selection) {
  284 + this.ids = selection.map(item => item.id)
  285 + this.single = selection.length !== 1
  286 + this.multiple = !selection.length
  287 + },
  288 + /** 新增按钮操作 */
  289 + handleAdd() {
  290 + this.reset();
  291 + //yyyy-MM-dd HH:mm:ss
  292 + this.form.createTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
  293 + this.form.createBy = this.$store.getters.name;
  294 + this.open = true;
  295 + this.title = "添加文件资料";
  296 + },
  297 + /** 修改按钮操作 */
  298 + handleUpdate(row) {
  299 + this.reset();
  300 + const id = row.id || this.ids
  301 + getDocumentData(id).then(response => {
  302 + this.form = response.data;
  303 + //将附件转换为前端可视化数组
  304 + if (this.form.files != null && this.form.files !== "") {
  305 + let fileList = this.form.files.split(";");
  306 + fileList.map(item => {
  307 + let name = item.substring(item.lastIndexOf("/") + 1);
  308 + this.fileEntityList.push({name: name, url: item})
  309 + })
  310 + }
  311 + this.open = true;
  312 + this.title = "修改文件资料";
  313 + });
  314 + },
  315 + /** 提交按钮 */
  316 + submitForm() {
  317 + this.$refs["form"].validate(valid => {
  318 + if (valid) {
  319 + let formData = new FormData();
  320 + let form = this.form;
  321 + //去掉params属性
  322 + delete form.params;
  323 + //先清空原有的附件
  324 + form.files = null;
  325 +
  326 +
  327 + this.fileEntityList.forEach(item => {
  328 + if (item.raw != null) {
  329 + formData.append('fileList', item.raw)
  330 + } else {
  331 + //将原有的附件拼接到form中
  332 + form.files = form.files !== null ? form.files + ";" + item.url : item.url;
  333 + }
  334 + })
  335 +
  336 + for (let key in form) {
  337 + formData.append(key, form[key] == null ? "" : form[key])
  338 + }
  339 +
  340 + if (this.form.id != null) {
  341 + updateDocumentData(formData).then(response => {
  342 + this.msgSuccess("修改成功");
  343 + this.open = false;
  344 + this.getList();
  345 + });
  346 + } else {
  347 + addDocumentData(formData).then(response => {
  348 + this.msgSuccess("新增成功");
  349 + this.open = false;
  350 + this.getList();
  351 + });
  352 + }
  353 + }
  354 + });
  355 + },
  356 + /** 删除按钮操作 */
  357 + handleDelete(row) {
  358 + const ids = row.id || this.ids;
  359 + this.$confirm('是否确认删除文件资料编号为"' + ids + '"的数据项?', "警告", {
  360 + confirmButtonText: "确定",
  361 + cancelButtonText: "取消",
  362 + type: "warning"
  363 + }).then(function () {
  364 + return delDocumentData(ids);
  365 + }).then(() => {
  366 + this.getList();
  367 + this.msgSuccess("删除成功");
  368 + })
  369 + },
  370 + /** 导出按钮操作 */
  371 + handleExport() {
  372 + const queryParams = this.queryParams;
  373 + this.$confirm('是否确认导出所有文件资料数据项?', "警告", {
  374 + confirmButtonText: "确定",
  375 + cancelButtonText: "取消",
  376 + type: "warning"
  377 + }).then(function () {
  378 + return exportDocumentData(queryParams);
  379 + }).then(response => {
  380 + this.download(response.msg);
  381 + })
  382 + },
  383 + /**
  384 + * 文件改变时,限制文件上传格式和大小
  385 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  386 + * 大小不超过20M
  387 + * */
  388 + fileChange(file, fileList) {
  389 + let count = 0;
  390 + for (let i = 0; i < fileList.length; i++) {
  391 + // console.log(fileList.length)
  392 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  393 + if (fileList[i].name == file.name) {
  394 + count++;
  395 + if (count == 2) {
  396 + this.$message({
  397 + message: '已存在此文件!',
  398 + type: 'warning'
  399 + });
  400 + for (let j = fileList.length; j > 0; j--) {
  401 + //如果存在此文件,去除新选择的重复文件
  402 + if (fileList[j - 1].name == file.name) {
  403 + fileList.splice(j - 1, 1);
  404 + i--;
  405 + return false;
  406 + }
  407 + }
  408 + }
  409 + }
  410 + }
  411 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  412 + //格式符合后判断大小
  413 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  414 + let max5M = file.size / 1024 / 1024 < 100;
  415 + if (!max5M) {
  416 + this.$message({
  417 + message: '上传文件大小不得超过100M!',
  418 + type: 'warning'
  419 + });
  420 + fileList = fileList.splice(fileList.length - 1, 1);
  421 + } else {
  422 + //符合条件后进行添加
  423 + this.fileEntityList = fileList
  424 + }
  425 + } else {
  426 + this.$message({
  427 + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx格式!',
  428 + type: 'warning'
  429 + });
  430 + fileList = fileList.splice(fileList.length - 1, 1);
  431 + }
  432 + },
  433 + // 删除文件
  434 + handleDeleteFile(index) {
  435 + this.fileEntityList.splice(index, 1);
  436 + },
  437 + /** 文件下载 */
  438 + tempDownload(row) {
  439 + let name = row.name;
  440 + let url = "";
  441 + if (row.raw != null) {
  442 + url = URL.createObjectURL(row.raw);
  443 + } else {
  444 + url = process.env.VUE_APP_BASE_API + row.url;
  445 + }
  446 + const a = document.createElement('a')
  447 + a.setAttribute('download', name)
  448 + a.setAttribute('target', '_blank')
  449 + a.setAttribute('href', url);
  450 + a.click()
  451 + },
  452 + createUrl(file) {
  453 + if (file.raw != null) {
  454 + return URL.createObjectURL(file.raw);
  455 + } else {
  456 + return process.env.VUE_APP_BASE_API + file.url;
  457 + }
  458 +
  459 + },
  460 + }
  461 +};
  462 +</script>
trash-ui/src/views/other/incorruptEducation/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row :gutter="10" class="mb8">
  4 + <el-col :span="1.5">
  5 + <el-upload
  6 + ref="upload"
  7 + action=""
  8 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  9 + :on-change="fileChange"
  10 + :auto-upload="false"
  11 + :show-file-list="false"
  12 + multiple
  13 + :file-list="file">
  14 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  15 + </el-upload>
  16 + </el-col>
  17 + <el-col :span="1.5">
  18 + <el-button size="small" type="primary" @click="file=[]">删除附件</el-button>
  19 + </el-col>
  20 + <el-col :span="1.5">
  21 + <el-button size="small" type="primary" @click="submitForm">提交</el-button>
  22 + </el-col>
  23 + </el-row>
  24 + <el-image v-if="file.length!=0" style=""
  25 + :src="createUrl(file[0])"
  26 + :preview-src-list="[createUrl(file[0])]"
  27 + :z-index="999">
  28 + </el-image>
  29 + </div>
  30 +</template>
  31 +
  32 +<script>
  33 +import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData";
  34 +
  35 +export default {
  36 + name: "incorruptEducation",
  37 + data() {
  38 + return {
  39 + file: [],
  40 + };
  41 + },
  42 + created() {
  43 + this.getList();
  44 + },
  45 + methods: {
  46 + /** 查询文件资料列表 */
  47 + getList() {
  48 + this.loading = true;
  49 + listIncorruptData("education").then(response => {
  50 + this.file = [{
  51 + url:response[0].filePath,
  52 + name:response[0].fileName,
  53 + }];
  54 + });
  55 + },
  56 + delFile(){
  57 + this.file=[];
  58 + },
  59 + /** 提交按钮 */
  60 + submitForm() {
  61 +
  62 + let formData = new FormData();
  63 + let form = {
  64 + files: null,
  65 + tableName: "education",
  66 + };
  67 +
  68 + this.file.forEach(item => {
  69 + if (item.raw != null) {
  70 + formData.append('files', item.raw)
  71 + } else {
  72 + //将原有的附件拼接到form中
  73 + form.files = form.files !== null ? form.files + ";" + item.url : item.url;
  74 + }
  75 + })
  76 +
  77 + for (let key in form) {
  78 + formData.append(key, form[key] == null ? "" : form[key])
  79 + }
  80 +
  81 + addIncorruptData(formData).then(response => {
  82 + this.msgSuccess("新增成功");
  83 + this.open = false;
  84 + this.getList();
  85 + });
  86 + },
  87 + /**
  88 + * 文件改变时,限制文件上传格式和大小
  89 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  90 + * 大小不超过20M
  91 + * */
  92 + fileChange(file, fileList) {
  93 + let count = 0;
  94 + if(fileList.length>1){
  95 + this.$message({
  96 + message: '只能上传一张图片!',
  97 + type: 'warning'
  98 + });
  99 + return false;
  100 + }
  101 + for (let i = 0; i < fileList.length; i++) {
  102 + // console.log(fileList.length)
  103 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  104 + if (fileList[i].name == file.name) {
  105 + count++;
  106 + if (count == 2) {
  107 + this.$message({
  108 + message: '已存在此文件!',
  109 + type: 'warning'
  110 + });
  111 + for (let j = fileList.length; j > 0; j--) {
  112 + //如果存在此文件,去除新选择的重复文件
  113 + if (fileList[j - 1].name == file.name) {
  114 + fileList.splice(j - 1, 1);
  115 + i--;
  116 + return false;
  117 + }
  118 + }
  119 + }
  120 + }
  121 + }
  122 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  123 + //格式符合后判断大小
  124 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
  125 + let max5M = file.size / 1024 / 1024 < 100;
  126 + if (!max5M) {
  127 + this.$message({
  128 + message: '上传文件大小不得超过100M!',
  129 + type: 'warning'
  130 + });
  131 + fileList = fileList.splice(fileList.length - 1, 1);
  132 + } else {
  133 + //符合条件后进行添加
  134 + this.file = fileList
  135 + }
  136 + } else {
  137 + this.$message({
  138 + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!',
  139 + type: 'warning'
  140 + });
  141 + fileList = fileList.splice(fileList.length - 1, 1);
  142 + }
  143 + },
  144 + createUrl(file) {
  145 + if (file.raw != null) {
  146 + return URL.createObjectURL(file.raw);
  147 + } else {
  148 + return process.env.VUE_APP_BASE_API + file.url;
  149 + }
  150 +
  151 + },
  152 + }
  153 +};
  154 +</script>
trash-ui/src/views/other/incorruptGovernment/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 +
  5 + <el-row :gutter="10" class="mb8">
  6 + <el-col :span="1.5">
  7 + <el-upload
  8 + ref="upload"
  9 + action=""
  10 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  11 + :on-change="fileChange"
  12 + :auto-upload="false"
  13 + :show-file-list="false"
  14 + multiple
  15 + :file-list="file">
  16 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  17 + </el-upload>
  18 + </el-col>
  19 + <el-col :span="1.5">
  20 + <el-button size="small" type="primary" @click="file=[]">删除附件</el-button>
  21 + </el-col>
  22 + <el-col :span="1.5">
  23 + <el-button size="small" type="primary" @click="submitForm">提交</el-button>
  24 + </el-col>
  25 + </el-row>
  26 + <el-image v-if="file.length!=0" style=""
  27 + :src="createUrl(file[0])"
  28 + :preview-src-list="[createUrl(file[0])]"
  29 + :z-index="999">
  30 + </el-image>
  31 + </div>
  32 +</template>
  33 +
  34 +<script>
  35 +import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData";
  36 +
  37 +export default {
  38 + name: "incorruptGovernment",
  39 + data() {
  40 + return {
  41 + file: [],
  42 + };
  43 + },
  44 + created() {
  45 + this.getList();
  46 + },
  47 + methods: {
  48 + /** 查询文件资料列表 */
  49 + getList() {
  50 + this.loading = true;
  51 + listIncorruptData("government").then(response => {
  52 + this.file = [{
  53 + url:response[0].filePath,
  54 + name:response[0].fileName,
  55 + }];
  56 + });
  57 + },
  58 + delFile(){
  59 + this.file=[];
  60 + },
  61 + /** 提交按钮 */
  62 + submitForm() {
  63 +
  64 + let formData = new FormData();
  65 + let form = {
  66 + files: null,
  67 + tableName: "government",
  68 + };
  69 +
  70 + this.file.forEach(item => {
  71 + if (item.raw != null) {
  72 + formData.append('files', item.raw)
  73 + } else {
  74 + //将原有的附件拼接到form中
  75 + form.files = form.files !== null ? form.files + ";" + item.url : item.url;
  76 + }
  77 + })
  78 +
  79 + for (let key in form) {
  80 + formData.append(key, form[key] == null ? "" : form[key])
  81 + }
  82 +
  83 + addIncorruptData(formData).then(response => {
  84 + this.msgSuccess("新增成功");
  85 + this.open = false;
  86 + this.getList();
  87 + });
  88 + },
  89 + /**
  90 + * 文件改变时,限制文件上传格式和大小
  91 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  92 + * 大小不超过20M
  93 + * */
  94 + fileChange(file, fileList) {
  95 + let count = 0;
  96 + if(fileList.length>1){
  97 + this.$message({
  98 + message: '只能上传一张图片!',
  99 + type: 'warning'
  100 + });
  101 + return false;
  102 + }
  103 + for (let i = 0; i < fileList.length; i++) {
  104 + // console.log(fileList.length)
  105 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  106 + if (fileList[i].name == file.name) {
  107 + count++;
  108 + if (count == 2) {
  109 + this.$message({
  110 + message: '已存在此文件!',
  111 + type: 'warning'
  112 + });
  113 + for (let j = fileList.length; j > 0; j--) {
  114 + //如果存在此文件,去除新选择的重复文件
  115 + if (fileList[j - 1].name == file.name) {
  116 + fileList.splice(j - 1, 1);
  117 + i--;
  118 + return false;
  119 + }
  120 + }
  121 + }
  122 + }
  123 + }
  124 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  125 + //格式符合后判断大小
  126 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
  127 + let max5M = file.size / 1024 / 1024 < 100;
  128 + if (!max5M) {
  129 + this.$message({
  130 + message: '上传文件大小不得超过100M!',
  131 + type: 'warning'
  132 + });
  133 + fileList = fileList.splice(fileList.length - 1, 1);
  134 + } else {
  135 + //符合条件后进行添加
  136 + this.file = fileList
  137 + }
  138 + } else {
  139 + this.$message({
  140 + message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!',
  141 + type: 'warning'
  142 + });
  143 + fileList = fileList.splice(fileList.length - 1, 1);
  144 + }
  145 + },
  146 + createUrl(file) {
  147 + if (file.raw != null) {
  148 + return URL.createObjectURL(file.raw);
  149 + } else {
  150 + return process.env.VUE_APP_BASE_API + file.url;
  151 + }
  152 +
  153 + },
  154 + }
  155 +};
  156 +</script>
trash-ui/src/views/unit/businessUnit/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
  4 + <el-form-item label="企业名称" prop="name">
  5 + <el-input
  6 + v-model="queryParams.name"
  7 + placeholder="请输入企业名称"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item label="所属区域" prop="registrationArea">
  14 + <el-select v-model="queryParams.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%" clearable>
  15 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  16 + </el-select>
  17 + </el-form-item>
  18 +
  19 + <el-form-item label="法人代表" prop="legalRepresentative">
  20 + <el-input
  21 + v-model="queryParams.legalRepresentative"
  22 + placeholder="请输入法人代表"
  23 + clearable
  24 + size="small"
  25 + @keyup.enter.native="handleQuery"
  26 + />
  27 + </el-form-item>
  28 + <el-form-item label="审批状态" prop="status">
  29 + <el-select v-model="queryParams.status" placeholder="请选择审批状态" clearable size="small">
  30 + <el-option label="审批中" value="0" />
  31 + <el-option label="审批通过" value="1" />
  32 + <el-option label="被驳回" value="2" />
  33 + </el-select>
  34 + </el-form-item>
  35 + <el-form-item>
  36 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  37 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  38 + </el-form-item>
  39 + </el-form>
  40 +
  41 + <el-row :gutter="10" class="mb8">
  42 + <el-col :span="1.5">
  43 + <el-button
  44 + type="primary"
  45 + icon="el-icon-plus"
  46 + size="mini"
  47 + @click="handleAdd"
  48 + v-hasPermi="['unit:enterprise:add']"
  49 + >新增</el-button>
  50 + </el-col>
  51 + <el-col :span="1.5">
  52 + <el-button
  53 + type="success"
  54 + icon="el-icon-edit"
  55 + size="mini"
  56 + :disabled="single"
  57 + @click="handleUpdate"
  58 + v-hasPermi="['unit:enterprise:edit']"
  59 + >修改</el-button>
  60 + </el-col>
  61 + <el-col :span="1.5">
  62 + <el-button
  63 + type="danger"
  64 + icon="el-icon-delete"
  65 + size="mini"
  66 + :disabled="multiple"
  67 + @click="handleDelete"
  68 + v-hasPermi="['unit:enterprise:remove']"
  69 + >删除</el-button>
  70 + </el-col>
  71 + <el-col :span="1.5">
  72 + <el-button
  73 + type="warning"
  74 + icon="el-icon-download"
  75 + size="mini"
  76 + @click="handleExport"
  77 + v-hasPermi="['unit:enterprise:export']"
  78 + >导出</el-button>
  79 + </el-col>
  80 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  81 + </el-row>
  82 +
  83 + <el-table v-loading="loading" :data="enterpriseList" @selection-change="handleSelectionChange">
  84 + <el-table-column type="selection" width="55" align="center" />
  85 + <el-table-column type="index" width="55" align="center" label="序号"/>
  86 + <el-table-column label="企业名称" align="center" prop="name" />
  87 + <el-table-column label="简称" align="center" prop="abbreviation" />
  88 + <el-table-column label="所属区域" align="center" prop="registrationArea" />
  89 + <el-table-column label="车辆数" align="center" prop="carNumber" />
  90 + <el-table-column label="法人代表" align="center" prop="legalRepresentative" />
  91 + <el-table-column label="联系方式" align="center" prop="legalRepresentativePhone" />
  92 + <el-table-column label="审批状态" align="center" prop="status">
  93 + <template slot-scope="scope">
  94 + <span>{{ parseStatus(scope.row.status) }}</span>
  95 + </template>
  96 + </el-table-column>
  97 + <el-table-column label="信用状态" align="center" prop="creditStatus" />
  98 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  99 + <template slot-scope="scope">
  100 + <el-button
  101 + size="mini"
  102 + type="text"
  103 + icon="el-icon-edit"
  104 + @click="handleUpdate(scope.row)"
  105 + v-hasPermi="['unit:enterprise:edit']"
  106 + >修改</el-button>
  107 + <el-button
  108 + size="mini"
  109 + type="text"
  110 + icon="el-icon-delete"
  111 + @click="handleDelete(scope.row)"
  112 + v-hasPermi="['unit:enterprise:remove']"
  113 + >删除</el-button>
  114 + </template>
  115 + </el-table-column>
  116 + </el-table>
  117 +
  118 + <pagination
  119 + v-show="total>0"
  120 + :total="total"
  121 + :page.sync="queryParams.pageNum"
  122 + :limit.sync="queryParams.pageSize"
  123 + @pagination="getList"
  124 + />
  125 +
  126 + </div>
  127 +</template>
  128 +
  129 +<script>
  130 +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise";
  131 +import {getAreaList} from "@/api/casefile/remoteServer";
  132 +
  133 +export default {
  134 + name: "Enterprise",
  135 + data() {
  136 + return {
  137 + // 遮罩层
  138 + loading: true,
  139 + // 选中数组
  140 + ids: [],
  141 + // 非单个禁用
  142 + single: true,
  143 + // 非多个禁用
  144 + multiple: true,
  145 + // 显示搜索条件
  146 + showSearch: true,
  147 + // 总条数
  148 + total: 0,
  149 + // 运输企业管理表格数据
  150 + enterpriseList: [],
  151 + // 弹出层标题
  152 + title: "",
  153 + // 是否显示弹出层
  154 + open: false,
  155 + // 查询参数
  156 + queryParams: {
  157 + pageNum: 1,
  158 + pageSize: 10,
  159 + name: null,
  160 + abbreviation: null,
  161 + registrationArea: null,
  162 + transportPermissionDate: null,
  163 + enterDate: null,
  164 + businessLicenseDate: null,
  165 + officeAddress: null,
  166 + parkingLotLocation: null,
  167 + parkingArea: null,
  168 + carNumber: null,
  169 + safetyManagerName: null,
  170 + safetyManagerPhone: null,
  171 + socialUniformCreditCodeNumber: null,
  172 + legalRepresentative: null,
  173 + legalRepresentativePhone: null,
  174 + safetyPeopleName: null,
  175 + transportPermission: null,
  176 + enterpriseBusinessLicense: null,
  177 + safetyOfficerQualificationCertificate: null,
  178 + safetyCertificate: null,
  179 + carParkPanorama: null,
  180 + businessUnit: null,
  181 + status: null,
  182 + parentId: null,
  183 + companyType: null,
  184 + creditStatus: null,
  185 + qrCode: null
  186 + },
  187 + // 表单参数
  188 + form: {},
  189 + // 表单校验
  190 + rules: {
  191 + },
  192 + areas: []
  193 + };
  194 + },
  195 + created() {
  196 + getAreaList().then(res => {
  197 + this.areas = res.data;
  198 + });
  199 + this.getList();
  200 + },
  201 + watch:{
  202 + '$route.query.unitRefresh':'getList'
  203 + },
  204 + methods: {
  205 + /** 查询运输企业管理列表 */
  206 + getList() {
  207 + this.loading = true;
  208 + this.queryParams.companyType = "0";
  209 + listEnterprise(this.queryParams).then(response => {
  210 + this.enterpriseList = response.rows;
  211 + this.total = response.total;
  212 + this.loading = false;
  213 + });
  214 + },
  215 + /** 搜索按钮操作 */
  216 + handleQuery() {
  217 + this.queryParams.pageNum = 1;
  218 + this.getList();
  219 + },
  220 + /** 重置按钮操作 */
  221 + resetQuery() {
  222 + this.resetForm("queryForm");
  223 + this.handleQuery();
  224 + },
  225 + // 多选框选中数据
  226 + handleSelectionChange(selection) {
  227 + this.ids = selection.map(item => item.id)
  228 + this.single = selection.length!==1
  229 + this.multiple = !selection.length
  230 + },
  231 + /** 新增按钮操作 */
  232 + handleAdd() {
  233 + this.$tab.openPage("新增经营单位","/unit/info",{unitRefresh:0});
  234 + },
  235 + /** 修改按钮操作 */
  236 + handleUpdate(row) {
  237 + const id = row.id || this.ids
  238 + this.$tab.openPage("修改经营单位","/unit/infoEdit",{unitId: id,unitRefresh:0});
  239 + },
  240 + /** 删除按钮操作 */
  241 + handleDelete(row) {
  242 + const ids = row.id || this.ids;
  243 + this.$confirm('是否确认删除运输企业管理编号为"' + ids + '"的数据项?', "警告", {
  244 + confirmButtonText: "确定",
  245 + cancelButtonText: "取消",
  246 + type: "warning"
  247 + }).then(function() {
  248 + return delEnterprise(ids);
  249 + }).then(() => {
  250 + this.getList();
  251 + this.msgSuccess("删除成功");
  252 + })
  253 + },
  254 + /** 导出按钮操作 */
  255 + handleExport() {
  256 + const queryParams = this.queryParams;
  257 + this.$confirm('是否确认导出所有运输企业管理数据项?', "警告", {
  258 + confirmButtonText: "确定",
  259 + cancelButtonText: "取消",
  260 + type: "warning"
  261 + }).then(function() {
  262 + return exportEnterprise(queryParams);
  263 + }).then(response => {
  264 + this.download(response.msg);
  265 + })
  266 + }
  267 + }
  268 +};
  269 +</script>
trash-ui/src/views/unit/businessUnit/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 + <!-- 添加或修改处理场所管理对话框 -->
  5 + <h3>
  6 + 基础信息
  7 + </h3>
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top">
  9 + <el-row :gutter="30">
  10 + <el-col :span="7">
  11 + <el-form-item label="企业名称" prop="name">
  12 + <el-input v-model="form.name" placeholder="请输入企业名称" />
  13 + </el-form-item>
  14 + </el-col>
  15 + <el-col :span="7">
  16 + <el-form-item label="简称" prop="abbreviation">
  17 + <el-input v-model="form.abbreviation" placeholder="请输入简称" />
  18 + </el-form-item>
  19 + </el-col>
  20 + <el-col :span="7">
  21 + <el-form-item label="注册地所在区域" prop="registrationArea">
  22 + <el-select v-model="form.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%">
  23 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  24 + </el-select>
  25 + </el-form-item>
  26 + </el-col>
  27 + </el-row>
  28 + <el-row :gutter="30">
  29 + <el-col :span="7">
  30 + <el-form-item label="企业道路运输经营许可证有效期" prop="transportPermissionDate">
  31 + <el-date-picker clearable size="small" style="width: 100%;"
  32 + v-model="form.transportPermissionDate"
  33 + type="date"
  34 + value-format="yyyy-MM-dd"
  35 + placeholder="选择企业道路运输经营许可证有效期">
  36 + </el-date-picker>
  37 + </el-form-item>
  38 + </el-col>
  39 + <el-col :span="7">
  40 + <el-form-item label="企业入市时间" prop="enterDate">
  41 + <el-date-picker clearable size="small" style="width: 100%;"
  42 + v-model="form.enterDate"
  43 + type="date"
  44 + value-format="yyyy-MM-dd"
  45 + placeholder="选择企业入市时间">
  46 + </el-date-picker>
  47 + </el-form-item>
  48 + </el-col>
  49 + <el-col :span="7">
  50 + <el-form-item label="企业营业执照有效期" prop="businessLicenseDate">
  51 + <el-date-picker clearable size="small" style="width: 100%;"
  52 + v-model="form.businessLicenseDate"
  53 + type="date"
  54 + value-format="yyyy-MM-dd"
  55 + placeholder="选择企业营业执照有效期">
  56 + </el-date-picker>
  57 + </el-form-item>
  58 + </el-col>
  59 + </el-row>
  60 + <el-row :gutter="30">
  61 + <el-col :span="7">
  62 + <el-form-item label="办公地址" prop="officeAddress">
  63 + <el-input v-model="form.officeAddress" placeholder="请输入内容" />
  64 + </el-form-item>
  65 + </el-col>
  66 + <el-col :span="7">
  67 + <el-form-item label="停车场位置" prop="parkingLotLocation">
  68 + <el-input v-model="form.parkingLotLocation" placeholder="请输入内容" />
  69 + </el-form-item>
  70 + </el-col>
  71 + <el-col :span="7">
  72 + <el-form-item label="停车场面积(m²)" prop="parkingArea">
  73 + <el-input v-model="form.parkingArea" placeholder="请输入停车场面积" />
  74 + </el-form-item>
  75 + </el-col>
  76 + </el-row>
  77 + <el-row :gutter="30">
  78 + <el-col :span="7">
  79 + <el-form-item label="企业安全负责人姓名及联系方式" prop="safetyManagerName">
  80 + <el-row>
  81 + <el-col :span="6">
  82 + <el-input v-model="form.safetyManagerName" placeholder="姓名" />
  83 + </el-col>
  84 + <el-col :span="18">
  85 + <el-input v-model="form.safetyManagerPhone" placeholder="联系方式" :maxlength="11" show-word-limit/>
  86 + </el-col>
  87 + </el-row>
  88 + </el-form-item>
  89 + </el-col>
  90 + <el-col :span="7">
  91 + <el-form-item label="社会统一信用代码编号" prop="socialUniformCreditCodeNumber">
  92 + <el-input v-model="form.socialUniformCreditCodeNumber" placeholder="请输入社会统一信用代码编号" />
  93 + </el-form-item>
  94 + </el-col>
  95 + <el-col :span="7">
  96 + <el-form-item label="法人代表及联系方式" prop="legalRepresentative">
  97 + <el-row>
  98 + <el-col :span="6">
  99 + <el-input v-model="form.legalRepresentative" placeholder="姓名" />
  100 + </el-col>
  101 + <el-col :span="18">
  102 + <el-input v-model="form.legalRepresentativePhone" placeholder="联系方式" :maxlength="11" show-word-limit/>
  103 + </el-col>
  104 + </el-row>
  105 + </el-form-item>
  106 + </el-col>
  107 + </el-row>
  108 +
  109 + <el-row :gutter="30">
  110 + <el-col :span="7">
  111 + <el-form-item label="安全管理人员" prop="safetyPeopleName">
  112 + <el-input v-model="form.safetyPeopleName" placeholder="请输入安全管理人员" />
  113 + </el-form-item>
  114 + </el-col>
  115 + <el-col :span="14">
  116 + <el-form-item label="备注" prop="remark">
  117 + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  118 + </el-form-item>
  119 + </el-col>
  120 + </el-row>
  121 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  122 + <el-col :span="3">
  123 + <div class="upload_lable">
  124 + 企业道路运输经营许可证
  125 + <el-upload
  126 + ref="upload"
  127 + action=""
  128 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  129 + :on-change="fileChange"
  130 + :auto-upload="false"
  131 + :show-file-list="false"
  132 + multiple
  133 + :file-list="transportPermission">
  134 +
  135 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  136 + </el-upload>
  137 + </div>
  138 + </el-col>
  139 + <el-col :span="21">
  140 + <div class="upload_btn">
  141 + <div v-for="(item,index) in transportPermission">
  142 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  143 + <div class="upload_close" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  144 + <el-image
  145 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  146 + :src="createUrl(item)"
  147 + :preview-src-list="[createUrl(item)]"
  148 + :z-index="999">
  149 + </el-image>
  150 + </div>
  151 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  152 + <div class="upload_close_file" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  153 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  154 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  155 + </div>
  156 + </div>
  157 + </div>
  158 + </el-col>
  159 + </el-row>
  160 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  161 + <el-col :span="3">
  162 + <div class="upload_lable">
  163 + 企业营业执照
  164 + <el-upload
  165 + ref="upload"
  166 + action=""
  167 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  168 + :on-change="fileChange1"
  169 + :auto-upload="false"
  170 + :show-file-list="false"
  171 + multiple
  172 + :file-list="enterpriseBusinessLicense">
  173 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  174 + </el-upload>
  175 + </div>
  176 + </el-col>
  177 + <el-col :span="21">
  178 + <div class="upload_btn">
  179 + <div v-for="(item,index) in enterpriseBusinessLicense">
  180 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  181 + <div class="upload_close" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  182 + <el-image
  183 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  184 + :src="createUrl(item)"
  185 + :preview-src-list="[createUrl(item)]"
  186 + :z-index="999">
  187 + </el-image>
  188 + </div>
  189 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  190 + <div class="upload_close_file" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  191 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  192 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  193 + </div>
  194 + </div>
  195 + </div>
  196 + </el-col>
  197 + </el-row>
  198 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  199 + <el-col :span="3">
  200 + <div class="upload_lable">
  201 + 安全员考核合格证明
  202 + <el-upload
  203 + ref="upload"
  204 + action=""
  205 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  206 + :on-change="fileChange2"
  207 + :auto-upload="false"
  208 + :show-file-list="false"
  209 + multiple
  210 + :file-list="safetyOfficerQualificationCertificate">
  211 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  212 + </el-upload>
  213 + </div>
  214 + </el-col>
  215 + <el-col :span="21">
  216 + <div class="upload_btn">
  217 + <div v-for="(item,index) in safetyOfficerQualificationCertificate">
  218 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  219 + <div class="upload_close" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  220 + <el-image
  221 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  222 + :src="createUrl(item)"
  223 + :preview-src-list="[createUrl(item)]"
  224 + :z-index="999">
  225 + </el-image>
  226 + </div>
  227 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  228 + <div class="upload_close_file" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  229 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  230 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  231 + </div>
  232 + </div>
  233 + </div>
  234 + </el-col>
  235 + </el-row>
  236 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  237 + <el-col :span="3">
  238 + <div class="upload_lable">
  239 + 企业负责人安全考核证
  240 + <el-upload
  241 + ref="upload"
  242 + action=""
  243 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  244 + :on-change="fileChange3"
  245 + :auto-upload="false"
  246 + :show-file-list="false"
  247 + multiple
  248 + :file-list="safetyCertificate">
  249 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  250 + </el-upload>
  251 + </div>
  252 + </el-col>
  253 + <el-col :span="21">
  254 + <div class="upload_btn">
  255 + <div v-for="(item,index) in safetyCertificate">
  256 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  257 + <div class="upload_close" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  258 + <el-image
  259 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  260 + :src="createUrl(item)"
  261 + :preview-src-list="[createUrl(item)]"
  262 + :z-index="999">
  263 + </el-image>
  264 + </div>
  265 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  266 + <div class="upload_close_file" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  267 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  268 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  269 + </div>
  270 + </div>
  271 + </div>
  272 + </el-col>
  273 + </el-row>
  274 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  275 + <el-col :span="3">
  276 + <div class="upload_lable">
  277 + 停车场全景图
  278 + <el-upload
  279 + ref="upload"
  280 + action=""
  281 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  282 + :on-change="fileChange4"
  283 + :auto-upload="false"
  284 + :show-file-list="false"
  285 + multiple
  286 + :file-list="carParkPanorama">
  287 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  288 + </el-upload>
  289 + </div>
  290 + </el-col>
  291 + <el-col :span="21">
  292 + <div class="upload_btn">
  293 + <div v-for="(item,index) in carParkPanorama">
  294 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  295 + <div class="upload_close" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  296 + <el-image
  297 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  298 + :src="createUrl(item)"
  299 + :preview-src-list="[createUrl(item)]"
  300 + :z-index="999">
  301 + </el-image>
  302 + </div>
  303 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  304 + <div class="upload_close_file" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  305 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  306 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  307 + </div>
  308 + </div>
  309 + </div>
  310 + </el-col>
  311 + </el-row>
  312 + <!-- <el-form-item label="" prop="environmentalApproval">-->
  313 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  314 + <!-- </el-form-item>-->
  315 + <!-- <el-form-item label="" prop="authorization">-->
  316 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  317 + <!-- </el-form-item>-->
  318 + <!-- <el-form-item label="" prop="otherInformation">-->
  319 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  320 + <!-- </el-form-item>-->
  321 + <!-- <el-form-item label="运输企业" prop="companyIds">-->
  322 + <!-- <el-input v-model="form.companyIds" placeholder="请输入运输企业" />-->
  323 + <!-- </el-form-item>-->
  324 + <!-- <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">-->
  325 + <!-- <el-radio-group v-model="form.status">-->
  326 + <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  327 + <!-- </el-radio-group>-->
  328 + <!-- </el-form-item>-->
  329 + <!-- <el-form-item label="二维码" prop="qrCode">-->
  330 + <!-- <el-input v-model="form.qrCode" placeholder="请输入二维码" />-->
  331 + <!-- </el-form-item>-->
  332 + </el-form>
  333 + <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  334 + <el-button type="primary" @click="submitForm">确 定</el-button>
  335 + <el-button @click="cancel">取 消</el-button>
  336 + </div>
  337 + </div>
  338 +</template>
  339 +
  340 +<script>
  341 +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise";
  342 +import Treeselect from "@riophae/vue-treeselect";
  343 +import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  344 +import {getAreaList} from "@/api/casefile/remoteServer";
  345 +
  346 +export default {
  347 + name: "DisposalSite",
  348 + components: {Treeselect},
  349 + data() {
  350 + return {
  351 + // 遮罩层
  352 + loading: true,
  353 + // 选中数组
  354 + ids: [],
  355 + // 非单个禁用
  356 + single: true,
  357 + // 非多个禁用
  358 + multiple: true,
  359 + // 显示搜索条件
  360 + showSearch: true,
  361 + // 总条数
  362 + total: 0,
  363 + // 处理场所管理表格数据
  364 + disposalSiteList: [],
  365 + // 弹出层标题
  366 + title: "",
  367 + // 是否显示弹出层
  368 + open: false,
  369 + // 表单参数
  370 + form: {},
  371 + // 表单校验
  372 + rules: {
  373 + name: [
  374 + {required: true, message: "请输入企业名称", trigger: "blur"}
  375 + ],
  376 + abbreviation: [
  377 + {required: true, message: "请输入简称", trigger: "blur"}
  378 + ],
  379 + registrationArea: [
  380 + {required: true, message: "请输入注册地所在区域", trigger: "blur"}
  381 + ],
  382 + transportPermissionDate: [
  383 + {required: true, message: "请选择企业道路运输经营许可证有效期", trigger: "blur"}
  384 + ],
  385 + enterDate: [
  386 + {required: true, message: "请选择企业入市时间", trigger: "blur"}
  387 + ],
  388 + businessLicenseDate: [
  389 + {required: true, message: "请选择企业营业执照有效期", trigger: "blur"}
  390 + ],
  391 + officeAddress: [
  392 + {required: true, message: "请输入办公地址", trigger: "blur"}
  393 + ],
  394 + parkingLotLocation: [
  395 + {required: true, message: "请输入停车场位置", trigger: "blur"}
  396 + ],
  397 + parkingArea: [
  398 + {required: true, message: "请输入停车场面积", trigger: "blur"},
  399 + {pattern: /^\d+(\.\d+)?$/, message: "只能输入正数和小数", trigger: "blur"}
  400 + ],
  401 + safetyManagerName: [
  402 + {required: true, message: "请输入企业安全负责人姓名", trigger: "blur"}
  403 + ],
  404 + socialUniformCreditCodeNumber: [
  405 + {required: true, message: "请输入社会统一信用代码编号", trigger: "blur"}
  406 + ],
  407 + legalRepresentative: [
  408 + {required: true, message: "请输入法人代表", trigger: "blur"}
  409 + ],
  410 + safetyPeopleName: [
  411 + {required: true, message: "请输入安全管理人员", trigger: "blur"}
  412 + ],
  413 + },
  414 + areas:[],
  415 + // 企业道路运输经营许可证
  416 + transportPermission:[],
  417 + // 企业营业执照
  418 + enterpriseBusinessLicense:[],
  419 + // 安全员考核合格证明
  420 + safetyOfficerQualificationCertificate:[],
  421 + // 企业负责人安全考核证
  422 + safetyCertificate:[],
  423 + // 停车场全景图
  424 + carParkPanorama:[],
  425 + };
  426 + },
  427 + created() {
  428 + getAreaList().then(res => {
  429 + this.areas = res.data;
  430 + });
  431 + this.initData();
  432 + },
  433 + watch: {
  434 + '$route.query.unitId': 'initData'
  435 + },
  436 + methods: {
  437 + reset(){
  438 + this.form = {};
  439 + this.transportPermission = [];
  440 + this.enterpriseBusinessLicense = [];
  441 + this.safetyOfficerQualificationCertificate = [];
  442 + this.safetyCertificate = [];
  443 + this.carParkPanorama = [];
  444 + },
  445 + initData(){
  446 + this.reset();
  447 + let id = this.$route.query.unitId;
  448 + if(id!=null){
  449 + getEnterprise(id).then(response => {
  450 + this.form = response.data;
  451 + //将附件转换为前端可视化数组
  452 + if(this.form.transportPermission!=null&&this.form.transportPermission!==""){
  453 + let approvalDocument = this.form.transportPermission.split(";");
  454 + approvalDocument.map(item=>{
  455 + let name = item.substring(item.lastIndexOf("/")+1);
  456 + this.transportPermission.push({name:name,url:item})
  457 + })
  458 + }
  459 + if(this.form.enterpriseBusinessLicense!=null&&this.form.enterpriseBusinessLicense!==""){
  460 + let approvalData = this.form.enterpriseBusinessLicense.split(";");
  461 + approvalData.map(item=>{
  462 + let name = item.substring(item.lastIndexOf("/")+1);
  463 + this.enterpriseBusinessLicense.push({name:name,url:item})
  464 + })
  465 + }
  466 + if(this.form.safetyOfficerQualificationCertificate!=null&&this.form.safetyOfficerQualificationCertificate!==""){
  467 + let scenePhoto = this.form.safetyOfficerQualificationCertificate.split(";");
  468 + scenePhoto.map(item=>{
  469 + let name = item.substring(item.lastIndexOf("/")+1);
  470 + this.safetyOfficerQualificationCertificate.push({name:name,url:item})
  471 + })
  472 + }
  473 + if(this.form.safetyCertificate!=null&&this.form.safetyCertificate!==""){
  474 + let carWashingFacilitiesImage = this.form.safetyCertificate.split(";");
  475 + carWashingFacilitiesImage.map(item=>{
  476 + let name = item.substring(item.lastIndexOf("/")+1);
  477 + this.safetyCertificate.push({name:name,url:item})
  478 + })
  479 + }
  480 + if(this.form.carParkPanorama!=null&&this.form.carParkPanorama!==""){
  481 + let safetyAssessmentReport = this.form.carParkPanorama.split(";");
  482 + safetyAssessmentReport.map(item=>{
  483 + let name = item.substring(item.lastIndexOf("/")+1);
  484 + this.carParkPanorama.push({name:name,url:item})
  485 + })
  486 + }
  487 + });
  488 + }
  489 + },
  490 + createUrl(file){
  491 + if(file.raw!=null){
  492 + return URL.createObjectURL(file.raw);
  493 + }else{
  494 + return process.env.VUE_APP_BASE_API + file.url;
  495 + }
  496 +
  497 + },
  498 + tempDownload(row){
  499 + let name = row.name;
  500 + let url = "";
  501 + if(row.raw!=null){
  502 + url = URL.createObjectURL(row.raw);
  503 + }else{
  504 + url = process.env.VUE_APP_BASE_API + row.url;
  505 + }
  506 + const a = document.createElement('a')
  507 + a.setAttribute('download', name)
  508 + a.setAttribute('target', '_blank')
  509 + a.setAttribute('href', url);
  510 + a.click()
  511 + },
  512 + // 取消按钮
  513 + cancel() {
  514 + this.$tab.closePage({path:"/unit/info"}).then(() => {
  515 + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1})
  516 + })
  517 + },
  518 + /** 提交按钮 */
  519 + submitForm() {
  520 + this.$refs["form"].validate(valid => {
  521 + if (valid) {
  522 + let phoneTest = /^1[3456789]\d{9}$/;
  523 + if(phoneTest.test(this.form.safetyManagerPhone)===false){
  524 + this.msgError("请输入正确的企业安全负责人联系方式");
  525 + return false;
  526 + }
  527 + if(phoneTest.test(this.form.legalRepresentativePhone)===false){
  528 + this.msgError("请输入正确的法人代表联系方式");
  529 + return false;
  530 + }
  531 + let formData = new FormData();
  532 + let form = this.form;
  533 + //去掉params属性
  534 + delete form.params;
  535 +
  536 + //先清空原有的附件
  537 + form.transportPermission = null;
  538 + form.enterpriseBusinessLicense = null;
  539 + form.safetyOfficerQualificationCertificate = null;
  540 + form.safetyCertificate = null;
  541 + form.carParkPanorama = null;
  542 + form.companyType = "0";
  543 +
  544 + this.transportPermission.forEach(item => {
  545 + if (item.raw != null) {
  546 + formData.append('transportPermissionFiles', item.raw)
  547 + }else{
  548 + //将原有的附件拼接到form中
  549 + form.transportPermission = form.transportPermission!==null?form.transportPermission+";"+item.url:item.url;
  550 + }
  551 + })
  552 +
  553 + this.enterpriseBusinessLicense.forEach(item => {
  554 + if (item.raw != null) {
  555 + formData.append('enterpriseBusinessLicenseFiles', item.raw)
  556 + }else{
  557 + //将原有的附件拼接到form中
  558 + form.enterpriseBusinessLicense = form.enterpriseBusinessLicense!==null?form.enterpriseBusinessLicense+";"+item.url:item.url;
  559 + }
  560 + })
  561 + this.safetyOfficerQualificationCertificate.forEach(item => {
  562 + if (item.raw != null) {
  563 + formData.append('safetyOfficerQualificationCertificateFiles', item.raw)
  564 + }else{
  565 + //将原有的附件拼接到form中
  566 + form.safetyOfficerQualificationCertificate = form.safetyOfficerQualificationCertificate!==null?form.safetyOfficerQualificationCertificate+";"+item.url:item.url;
  567 + }
  568 + })
  569 + this.safetyCertificate.forEach(item => {
  570 + if (item.raw != null) {
  571 + formData.append('safetyCertificateFiles', item.raw)
  572 + }else{
  573 + //将原有的附件拼接到form中
  574 + form.safetyCertificate = form.safetyCertificate!==null?form.safetyCertificate+";"+item.url:item.url;
  575 + }
  576 + })
  577 + this.carParkPanorama.forEach(item => {
  578 + if (item.raw != null) {
  579 + formData.append('carParkPanoramaFiles', item.raw)
  580 + }else{
  581 + //将原有的附件拼接到form中
  582 + form.carParkPanorama = form.carParkPanorama!==null?form.carParkPanorama+";"+item.url:item.url;
  583 + }
  584 + })
  585 + for (let key in form) {
  586 + formData.append(key, form[key] == null ? "" : form[key])
  587 + }
  588 + if (this.form.id != null) {
  589 + updateEnterprise(formData).then(response => {
  590 + this.msgSuccess("修改成功");
  591 + this.$tab.closePage({path:"/unit/infoEdit"}).then(() => {
  592 + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1})
  593 + })
  594 + });
  595 + } else {
  596 + addEnterprise(formData).then(response => {
  597 + this.msgSuccess("新增成功");
  598 + this.$tab.closePage({path:"/unit/info"}).then(() => {
  599 + this.$tab.openPage("经营单位管理", "/tool/unit",{unitRefresh:1})
  600 + })
  601 + });
  602 + }
  603 + }
  604 + });
  605 + },
  606 + /**
  607 + * 文件改变时,限制文件上传格式和大小
  608 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  609 + * 大小不超过20M
  610 + * */
  611 + fileChange(file, fileList) {
  612 + let count = 0;
  613 + for (let i = 0; i < fileList.length; i++) {
  614 + // console.log(fileList.length)
  615 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  616 + if (fileList[i].name == file.name) {
  617 + count++;
  618 + if (count == 2) {
  619 + this.$message({
  620 + message: '已存在此文件!',
  621 + type: 'warning'
  622 + });
  623 + for (let j = fileList.length; j > 0; j--) {
  624 + //如果存在此文件,去除新选择的重复文件
  625 + if (fileList[j - 1].name == file.name) {
  626 + fileList.splice(j - 1, 1);
  627 + i--;
  628 + return false;
  629 + }
  630 + }
  631 + }
  632 + }
  633 + }
  634 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  635 + //格式符合后判断大小
  636 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  637 + let max5M = file.size / 1024 / 1024 < 100;
  638 + if (!max5M) {
  639 + this.$message({
  640 + message: '上传文件大小不得超过100M!',
  641 + type: 'warning'
  642 + });
  643 + fileList = fileList.splice(fileList.length - 1, 1);
  644 + } else {
  645 + //符合条件后进行添加
  646 + this.transportPermission = fileList
  647 + }
  648 + } else {
  649 + this.$message({
  650 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  651 + type: 'warning'
  652 + });
  653 + fileList = fileList.splice(fileList.length - 1, 1);
  654 + }
  655 + },
  656 + fileChange1(file, fileList) {
  657 + let count = 0;
  658 + for (let i = 0; i < fileList.length; i++) {
  659 + // console.log(fileList.length)
  660 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  661 + if (fileList[i].name == file.name) {
  662 + count++;
  663 + if (count == 2) {
  664 + this.$message({
  665 + message: '已存在此文件!',
  666 + type: 'warning'
  667 + });
  668 + for (let j = fileList.length; j > 0; j--) {
  669 + //如果存在此文件,去除新选择的重复文件
  670 + if (fileList[j - 1].name == file.name) {
  671 + fileList.splice(j - 1, 1);
  672 + i--;
  673 + return false;
  674 + }
  675 + }
  676 + }
  677 + }
  678 + }
  679 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  680 + //格式符合后判断大小
  681 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  682 + let max5M = file.size / 1024 / 1024 < 100;
  683 + if (!max5M) {
  684 + this.$message({
  685 + message: '上传文件大小不得超过100M!',
  686 + type: 'warning'
  687 + });
  688 + fileList = fileList.splice(fileList.length - 1, 1);
  689 + } else {
  690 + //符合条件后进行添加
  691 + this.enterpriseBusinessLicense = fileList
  692 + }
  693 + } else {
  694 + this.$message({
  695 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  696 + type: 'warning'
  697 + });
  698 + fileList = fileList.splice(fileList.length - 1, 1);
  699 + }
  700 + },
  701 + fileChange2(file, fileList) {
  702 + let count = 0;
  703 + for (let i = 0; i < fileList.length; i++) {
  704 + // console.log(fileList.length)
  705 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  706 + if (fileList[i].name == file.name) {
  707 + count++;
  708 + if (count == 2) {
  709 + this.$message({
  710 + message: '已存在此文件!',
  711 + type: 'warning'
  712 + });
  713 + for (let j = fileList.length; j > 0; j--) {
  714 + //如果存在此文件,去除新选择的重复文件
  715 + if (fileList[j - 1].name == file.name) {
  716 + fileList.splice(j - 1, 1);
  717 + i--;
  718 + return false;
  719 + }
  720 + }
  721 + }
  722 + }
  723 + }
  724 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  725 + //格式符合后判断大小
  726 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  727 + let max5M = file.size / 1024 / 1024 < 100;
  728 + if (!max5M) {
  729 + this.$message({
  730 + message: '上传文件大小不得超过100M!',
  731 + type: 'warning'
  732 + });
  733 + fileList = fileList.splice(fileList.length - 1, 1);
  734 + } else {
  735 + //符合条件后进行添加
  736 + this.safetyOfficerQualificationCertificate = fileList
  737 + }
  738 + } else {
  739 + this.$message({
  740 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  741 + type: 'warning'
  742 + });
  743 + fileList = fileList.splice(fileList.length - 1, 1);
  744 + }
  745 + },
  746 + fileChange3(file, fileList) {
  747 + let count = 0;
  748 + for (let i = 0; i < fileList.length; i++) {
  749 + // console.log(fileList.length)
  750 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  751 + if (fileList[i].name == file.name) {
  752 + count++;
  753 + if (count == 2) {
  754 + this.$message({
  755 + message: '已存在此文件!',
  756 + type: 'warning'
  757 + });
  758 + for (let j = fileList.length; j > 0; j--) {
  759 + //如果存在此文件,去除新选择的重复文件
  760 + if (fileList[j - 1].name == file.name) {
  761 + fileList.splice(j - 1, 1);
  762 + i--;
  763 + return false;
  764 + }
  765 + }
  766 + }
  767 + }
  768 + }
  769 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  770 + //格式符合后判断大小
  771 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  772 + let max5M = file.size / 1024 / 1024 < 100;
  773 + if (!max5M) {
  774 + this.$message({
  775 + message: '上传文件大小不得超过100M!',
  776 + type: 'warning'
  777 + });
  778 + fileList = fileList.splice(fileList.length - 1, 1);
  779 + } else {
  780 + //符合条件后进行添加
  781 + this.safetyCertificate = fileList
  782 + }
  783 + } else {
  784 + this.$message({
  785 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  786 + type: 'warning'
  787 + });
  788 + fileList = fileList.splice(fileList.length - 1, 1);
  789 + }
  790 + },
  791 + fileChange4(file, fileList) {
  792 + let count = 0;
  793 + for (let i = 0; i < fileList.length; i++) {
  794 + // console.log(fileList.length)
  795 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  796 + if (fileList[i].name == file.name) {
  797 + count++;
  798 + if (count == 2) {
  799 + this.$message({
  800 + message: '已存在此文件!',
  801 + type: 'warning'
  802 + });
  803 + for (let j = fileList.length; j > 0; j--) {
  804 + //如果存在此文件,去除新选择的重复文件
  805 + if (fileList[j - 1].name == file.name) {
  806 + fileList.splice(j - 1, 1);
  807 + i--;
  808 + return false;
  809 + }
  810 + }
  811 + }
  812 + }
  813 + }
  814 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  815 + //格式符合后判断大小
  816 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  817 + let max5M = file.size / 1024 / 1024 < 100;
  818 + if (!max5M) {
  819 + this.$message({
  820 + message: '上传文件大小不得超过100M!',
  821 + type: 'warning'
  822 + });
  823 + fileList = fileList.splice(fileList.length - 1, 1);
  824 + } else {
  825 + //符合条件后进行添加
  826 + this.carParkPanorama = fileList
  827 + }
  828 + } else {
  829 + this.$message({
  830 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  831 + type: 'warning'
  832 + });
  833 + fileList = fileList.splice(fileList.length - 1, 1);
  834 + }
  835 + },
  836 + }
  837 +};
  838 +</script>
  839 +<style lang="scss" scoped>
  840 +.upload_lable{
  841 + border-right: 1px solid #dcdfe6;
  842 + padding: 27px 30px;
  843 + background: #fafafa;
  844 + text-align: center;
  845 +}
  846 +.upload_btn{
  847 + max-height: 106px;
  848 +}
  849 +.upload_close{
  850 + position: absolute;
  851 + left: 105px;
  852 + z-index:99;
  853 + top:-1px;
  854 + font-size:18px;
  855 + color:red;
  856 +}
  857 +.upload_close_file{
  858 + position: absolute;
  859 + left: 80px;
  860 + z-index:99;
  861 + top:-1px;
  862 + font-size:18px;
  863 + color:red;
  864 +}
  865 +.upload_div_image{
  866 + display: inline-block;
  867 + width: 110px;
  868 + height: 95px;
  869 + position: relative;
  870 + float: left;
  871 + margin-left: 5px;
  872 +}
  873 +.upload_div_file{
  874 + display: inline-block;
  875 + width: 110px;
  876 + height: 95px;
  877 + text-align: center;
  878 + float:left;
  879 + margin: 5px;
  880 + position: relative;
  881 +}
  882 +.serach_map{
  883 + position: absolute;
  884 + top: 100px;
  885 + left: 25px;
  886 + z-index: 999;
  887 + background: #fff;
  888 + padding: 10px;
  889 + border-radius: 5px;
  890 + box-shadow: 0 0 10px rgba(0,0,0,.2);
  891 +}
  892 +</style>
trash-ui/src/views/unit/carInfo/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4 + <el-form-item label="所属公司" prop="companyName">
  5 + <el-input
  6 + v-model="queryParams.companyName"
  7 + placeholder="请输入所属公司"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item label="车辆类型" prop="carType">
  14 + <el-select v-model="queryParams.carType" placeholder="请选择车辆类型" clearable style="width: 100%;" size="small">
  15 + <el-option label="燃油渣土车" value="燃油渣土车" />
  16 + <el-option label="电动渣土车" value="电动渣土车" />
  17 + <el-option label="其它" value="其它" />
  18 + </el-select>
  19 + </el-form-item>
  20 + <el-form-item label="车牌号" prop="carCode">
  21 + <el-input
  22 + v-model="queryParams.carCode"
  23 + placeholder="请输入车牌号"
  24 + clearable
  25 + size="small"
  26 + @keyup.enter.native="handleQuery"
  27 + />
  28 + </el-form-item>
  29 + <el-form-item label="车辆品牌" prop="carBrank">
  30 + <el-input
  31 + v-model="queryParams.carBrank"
  32 + placeholder="请输入车辆品牌"
  33 + clearable
  34 + size="small"
  35 + @keyup.enter.native="handleQuery"
  36 + />
  37 + </el-form-item>
  38 + <el-form-item>
  39 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  40 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  41 + </el-form-item>
  42 + </el-form>
  43 +
  44 + <el-row :gutter="10" class="mb8">
  45 + <el-col :span="1.5">
  46 + <el-button
  47 + type="primary"
  48 + icon="el-icon-plus"
  49 + size="mini"
  50 + @click="handleAdd"
  51 + v-hasPermi="['unit:carInfo:add']"
  52 + >新增</el-button>
  53 + </el-col>
  54 + <el-col :span="1.5">
  55 + <el-button
  56 + type="success"
  57 + icon="el-icon-edit"
  58 + size="mini"
  59 + :disabled="single"
  60 + @click="handleUpdate"
  61 + v-hasPermi="['unit:carInfo:edit']"
  62 + >修改</el-button>
  63 + </el-col>
  64 + <el-col :span="1.5">
  65 + <el-button
  66 + type="danger"
  67 + icon="el-icon-delete"
  68 + size="mini"
  69 + :disabled="multiple"
  70 + @click="handleDelete"
  71 + v-hasPermi="['unit:carInfo:remove']"
  72 + >删除</el-button>
  73 + </el-col>
  74 + <el-col :span="1.5">
  75 + <el-button
  76 + type="warning"
  77 + icon="el-icon-download"
  78 + size="mini"
  79 + @click="handleExport"
  80 + v-hasPermi="['unit:carInfo:export']"
  81 + >导出</el-button>
  82 + </el-col>
  83 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  84 + </el-row>
  85 +
  86 + <el-table v-loading="loading" :data="carInfoList" @selection-change="handleSelectionChange">
  87 + <el-table-column type="selection" width="55" align="center" />
  88 + <el-table-column type="index" width="55" align="center" label="序号"/>
  89 + <el-table-column label="车牌号" align="center" prop="carCode" />
  90 + <el-table-column label="车辆标识牌" align="center" prop="carIdentification" />
  91 + <el-table-column label="所属公司" align="center" prop="companyName" />
  92 + <el-table-column label="驾驶员" align="center" prop="driversName" />
  93 + <el-table-column label="车辆品牌" align="center" prop="carBrank" />
  94 + <el-table-column label="所属区域" align="center" prop="emissionStandard" />
  95 + <el-table-column label="车辆类型" align="center" prop="carType" />
  96 + <el-table-column label="SIM卡号" align="center" prop="farmeNumber" />
  97 + <el-table-column label="审批状态" align="center" prop="status" >
  98 + <template slot-scope="scope">
  99 + {{ parseStatus(scope.row.status)}}
  100 + </template>
  101 + </el-table-column>
  102 + <el-table-column label="信用状态" align="center" prop="creditStatus" />
  103 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  104 + <template slot-scope="scope">
  105 + <el-button
  106 + size="mini"
  107 + type="text"
  108 + icon="el-icon-edit"
  109 + @click="handleUpdate(scope.row)"
  110 + v-hasPermi="['unit:carInfo:edit']"
  111 + >修改</el-button>
  112 + <el-button
  113 + size="mini"
  114 + type="text"
  115 + icon="el-icon-delete"
  116 + @click="handleDelete(scope.row)"
  117 + v-hasPermi="['unit:carInfo:remove']"
  118 + >删除</el-button>
  119 + </template>
  120 + </el-table-column>
  121 + </el-table>
  122 +
  123 + <pagination
  124 + v-show="total>0"
  125 + :total="total"
  126 + :page.sync="queryParams.pageNum"
  127 + :limit.sync="queryParams.pageSize"
  128 + @pagination="getList"
  129 + />
  130 +
  131 + </div>
  132 +</template>
  133 +
  134 +<script>
  135 +import { listCarInfo, getCarInfo, delCarInfo, addCarInfo, updateCarInfo, exportCarInfo } from "@/api/unit/carInfo";
  136 +import {parseStatus} from "../../../utils/trash";
  137 +
  138 +export default {
  139 + name: "CarInfo",
  140 + data() {
  141 + return {
  142 + // 遮罩层
  143 + loading: true,
  144 + // 选中数组
  145 + ids: [],
  146 + // 非单个禁用
  147 + single: true,
  148 + // 非多个禁用
  149 + multiple: true,
  150 + // 显示搜索条件
  151 + showSearch: true,
  152 + // 总条数
  153 + total: 0,
  154 + // 运输车辆管理表格数据
  155 + carInfoList: [],
  156 + // 弹出层标题
  157 + title: "",
  158 + // 是否显示弹出层
  159 + open: false,
  160 + // 查询参数
  161 + queryParams: {
  162 + pageNum: 1,
  163 + pageSize: 10,
  164 + companyId: null,
  165 + carType: null,
  166 + carCode: null,
  167 + carBrank: null,
  168 + emissionStandard: null,
  169 + roadTransportDate: null,
  170 + drivingLicenseDate: null,
  171 + enterDate: null,
  172 + farmeNumber: null,
  173 + carIdentification: null,
  174 + containerVolume: null,
  175 + carColor: null,
  176 + carEquipment: null,
  177 + roadTransport: null,
  178 + drivingLicense: null,
  179 + carFront: null,
  180 + carLeft: null,
  181 + carBehind: null,
  182 + carRight: null,
  183 + drivers: null,
  184 + status: null,
  185 + creditStatus: null,
  186 + qrCode: null
  187 + },
  188 + // 表单参数
  189 + form: {},
  190 + // 表单校验
  191 + rules: {
  192 + }
  193 + };
  194 + },
  195 + created() {
  196 + this.getList();
  197 + },
  198 + watch:{
  199 + '$route.query.carInfoRefresh':'getList'
  200 + },
  201 + methods: {
  202 + /** 查询运输车辆管理列表 */
  203 + getList() {
  204 + this.loading = true;
  205 + listCarInfo(this.queryParams).then(response => {
  206 + this.carInfoList = response.rows;
  207 + this.total = response.total;
  208 + this.loading = false;
  209 + });
  210 + },
  211 + /** 搜索按钮操作 */
  212 + handleQuery() {
  213 + this.queryParams.pageNum = 1;
  214 + this.getList();
  215 + },
  216 + /** 重置按钮操作 */
  217 + resetQuery() {
  218 + this.resetForm("queryForm");
  219 + this.handleQuery();
  220 + },
  221 + // 多选框选中数据
  222 + handleSelectionChange(selection) {
  223 + this.ids = selection.map(item => item.id)
  224 + this.single = selection.length!==1
  225 + this.multiple = !selection.length
  226 + },
  227 + /** 新增按钮操作 */
  228 + handleAdd() {
  229 + this.$tab.openPage("新增车辆信息","/carInfo/info",{carInfoRefresh:0});
  230 + },
  231 + /** 修改按钮操作 */
  232 + handleUpdate(row) {
  233 + const id = row.id || this.ids
  234 + this.$tab.openPage("修改运输企业","/carInfo/infoEdit",{carInfoId: id,carInfoRefresh:0});
  235 + },
  236 + /** 提交按钮 */
  237 + submitForm() {
  238 + this.$refs["form"].validate(valid => {
  239 + if (valid) {
  240 + if (this.form.id != null) {
  241 + updateCarInfo(this.form).then(response => {
  242 + this.msgSuccess("修改成功");
  243 + this.open = false;
  244 + this.getList();
  245 + });
  246 + } else {
  247 + addCarInfo(this.form).then(response => {
  248 + this.msgSuccess("新增成功");
  249 + this.open = false;
  250 + this.getList();
  251 + });
  252 + }
  253 + }
  254 + });
  255 + },
  256 + /** 删除按钮操作 */
  257 + handleDelete(row) {
  258 + const ids = row.id || this.ids;
  259 + this.$confirm('是否确认删除运输车辆管理编号为"' + ids + '"的数据项?', "警告", {
  260 + confirmButtonText: "确定",
  261 + cancelButtonText: "取消",
  262 + type: "warning"
  263 + }).then(function() {
  264 + return delCarInfo(ids);
  265 + }).then(() => {
  266 + this.getList();
  267 + this.msgSuccess("删除成功");
  268 + })
  269 + },
  270 + /** 导出按钮操作 */
  271 + handleExport() {
  272 + const queryParams = this.queryParams;
  273 + this.$confirm('是否确认导出所有运输车辆管理数据项?', "警告", {
  274 + confirmButtonText: "确定",
  275 + cancelButtonText: "取消",
  276 + type: "warning"
  277 + }).then(function() {
  278 + return exportCarInfo(queryParams);
  279 + }).then(response => {
  280 + this.download(response.msg);
  281 + })
  282 + }
  283 + }
  284 +};
  285 +</script>
trash-ui/src/views/unit/carInfo/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 + <!-- 添加或修改处理场所管理对话框 -->
  5 + <h3>
  6 + 基础信息
  7 + </h3>
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top">
  9 + <el-row :gutter="30">
  10 + <el-col :span="7">
  11 + <el-form-item label="所属公司" prop="companyId">
  12 + <el-select v-model="form.companyId" placeholder="请选择所属公司" clearable style="width: 100%;" @change="listDriverByCompany">
  13 + <el-option v-for="(item,index) in enterpriseList" :label="item.name" :value="item.id" :key="index"/>
  14 + </el-select>
  15 + </el-form-item>
  16 + </el-col>
  17 + <el-col :span="7">
  18 + <el-form-item label="车辆类型" prop="carType">
  19 + <el-select v-model="form.carType" placeholder="请选择车辆类型" clearable style="width: 100%;">
  20 + <el-option label="燃油渣土车" value="燃油渣土车" />
  21 + <el-option label="电动渣土车" value="电动渣土车" />
  22 + <el-option label="其它" value="其它" />
  23 + </el-select>
  24 + </el-form-item>
  25 + </el-col>
  26 + <el-col :span="7">
  27 + <el-form-item label="车牌号" prop="carCode">
  28 + <el-input v-model="form.carCode" placeholder="请输入车牌号" />
  29 + </el-form-item>
  30 + </el-col>
  31 + </el-row>
  32 + <el-row :gutter="30">
  33 + <el-col :span="7">
  34 + <el-form-item label="车辆品牌" prop="carBrank">
  35 + <el-input v-model="form.carBrank" placeholder="请输入车辆品牌" />
  36 + </el-form-item>
  37 + </el-col>
  38 + <el-col :span="7">
  39 + <el-form-item label="排放标准" prop="emissionStandard">
  40 + <el-select v-model="form.emissionStandard" placeholder="请选择排放标准" clearable style="width: 100%;">
  41 + <el-option label="国四" value="国四" />
  42 + <el-option label="国五" value="国五" />
  43 + <el-option label="国六" value="国六" />
  44 + <el-option label="纯电动" value="纯电动" />
  45 + </el-select>
  46 + </el-form-item>
  47 + </el-col>
  48 + <el-col :span="7">
  49 + <el-form-item label="驾驶员" prop="drivers">
  50 + <treeselect v-model="drivers" :multiple="true" :options="options" placeholder="请选择"/>
  51 + </el-form-item>
  52 + </el-col>
  53 + </el-row>
  54 + <el-row :gutter="30">
  55 + <el-col :span="7">
  56 + <el-form-item label="道路运输证有效期" prop="roadTransportDate">
  57 + <el-date-picker clearable size="small" style="width: 100%"
  58 + v-model="form.roadTransportDate"
  59 + type="date"
  60 + value-format="yyyy-MM-dd"
  61 + placeholder="选择道路运输证有效期">
  62 + </el-date-picker>
  63 + </el-form-item>
  64 +
  65 + </el-col>
  66 + <el-col :span="7">
  67 + <el-form-item label="行驶证有效期" prop="drivingLicenseDate">
  68 + <el-date-picker clearable size="small" style="width: 100%"
  69 + v-model="form.drivingLicenseDate"
  70 + type="date"
  71 + value-format="yyyy-MM-dd"
  72 + placeholder="选择行驶证有效期">
  73 + </el-date-picker>
  74 + </el-form-item>
  75 +
  76 + </el-col>
  77 + <el-col :span="7">
  78 + <el-form-item label="录入日期" prop="enterDate">
  79 + <el-date-picker clearable size="small" style="width: 100%"
  80 + v-model="form.enterDate"
  81 + type="date"
  82 + value-format="yyyy-MM-dd"
  83 + placeholder="选择录入日期">
  84 + </el-date-picker>
  85 + </el-form-item>
  86 +
  87 + </el-col>
  88 + </el-row>
  89 + <el-row :gutter="30">
  90 + <el-col :span="7">
  91 + <el-form-item label="车架号" prop="farmeNumber">
  92 + <el-input v-model="form.farmeNumber" placeholder="请输入车架号" />
  93 + </el-form-item>
  94 +
  95 + </el-col>
  96 + <el-col :span="7">
  97 + <el-form-item label="车辆标识牌" prop="carIdentification">
  98 + <el-input v-model="form.carIdentification" placeholder="请输入车辆标识牌" />
  99 + </el-form-item>
  100 +
  101 + </el-col>
  102 + <el-col :span="7">
  103 + <el-form-item label="箱货体积" prop="containerVolume">
  104 + <el-row>
  105 + <el-col :span="5">
  106 + <el-select v-model="volumeOrLWH" placeholder="请选择排放标准" style="width: 100%;">
  107 + <el-option label="体积" value="体积"/>
  108 + <el-option label="长宽高" value="长宽高" />
  109 + </el-select>
  110 + </el-col>
  111 + <el-col :span="19" v-if="volumeOrLWH==='体积'">
  112 + <el-input v-model="form.containerVolume" placeholder="请输入车辆体积" />
  113 + </el-col>
  114 + <el-col :span="19" v-if="volumeOrLWH==='长宽高'">
  115 + <el-row>
  116 + <el-col :span="8">
  117 + <el-input v-model="form.length" placeholder="长" />
  118 + </el-col>
  119 + <el-col :span="8">
  120 + <el-input v-model="form.width" placeholder="宽" />
  121 + </el-col>
  122 + <el-col :span="8">
  123 + <el-input v-model="form.height" placeholder="高" />
  124 + </el-col>
  125 + </el-row>
  126 + </el-col>
  127 + </el-row>
  128 +
  129 + </el-form-item>
  130 +
  131 + </el-col>
  132 + </el-row>
  133 +
  134 + <el-row :gutter="30">
  135 + <el-col :span="7">
  136 + <el-form-item label="车辆颜色" prop="carColor">
  137 + <el-select v-model="form.carColor" placeholder="请选择车辆颜色" clearable style="width: 100%;">
  138 + <el-option label="黄色" value="黄色"/>
  139 + <el-option label="蓝色" value="蓝色" />
  140 + <el-option label="黄绿色" value="黄绿色" />
  141 + <el-option label="黑色" value="黑色" />
  142 + <el-option label="白色" value="白色" />
  143 + <el-option label="未上牌" value="未上牌" />
  144 + <el-option label="其它" value="其它" />
  145 + </el-select>
  146 + </el-form-item>
  147 +
  148 + </el-col>
  149 + <el-col :span="7">
  150 + <el-form-item label="车辆设备" prop="carEquipment">
  151 + <el-input v-model="form.carEquipment" placeholder="请输入车辆设备" />
  152 + </el-form-item>
  153 + </el-col>
  154 + <el-col :span="7">
  155 + <el-form-item label="备注" prop="remark">
  156 + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  157 + </el-form-item>
  158 + </el-col>
  159 + </el-row>
  160 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  161 + <el-col :span="3">
  162 + <div class="upload_lable">
  163 + 道路运输证
  164 + <el-upload
  165 + ref="upload"
  166 + action=""
  167 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  168 + :on-change="fileChange"
  169 + :auto-upload="false"
  170 + :show-file-list="false"
  171 + multiple
  172 + :file-list="roadTransport">
  173 +
  174 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  175 + </el-upload>
  176 + </div>
  177 + </el-col>
  178 + <el-col :span="21">
  179 + <div class="upload_btn">
  180 + <div v-for="(item,index) in roadTransport">
  181 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  182 + <div class="upload_close" @click="roadTransport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  183 + <el-image
  184 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  185 + :src="createUrl(item)"
  186 + :preview-src-list="[createUrl(item)]"
  187 + :z-index="999">
  188 + </el-image>
  189 + </div>
  190 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  191 + <div class="upload_close_file" @click="roadTransport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  192 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  193 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  194 + </div>
  195 + </div>
  196 + </div>
  197 + </el-col>
  198 + </el-row>
  199 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  200 + <el-col :span="3">
  201 + <div class="upload_lable">
  202 + 行驶证
  203 + <el-upload
  204 + ref="upload"
  205 + action=""
  206 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  207 + :on-change="fileChange1"
  208 + :auto-upload="false"
  209 + :show-file-list="false"
  210 + multiple
  211 + :file-list="drivingLicense">
  212 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  213 + </el-upload>
  214 + </div>
  215 + </el-col>
  216 + <el-col :span="21">
  217 + <div class="upload_btn">
  218 + <div v-for="(item,index) in drivingLicense">
  219 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  220 + <div class="upload_close" @click="drivingLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  221 + <el-image
  222 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  223 + :src="createUrl(item)"
  224 + :preview-src-list="[createUrl(item)]"
  225 + :z-index="999">
  226 + </el-image>
  227 + </div>
  228 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  229 + <div class="upload_close_file" @click="drivingLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  230 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  231 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  232 + </div>
  233 + </div>
  234 + </div>
  235 + </el-col>
  236 + </el-row>
  237 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  238 + <el-col :span="3">
  239 + <div class="upload_lable">
  240 + 车辆正面照片
  241 + <el-upload
  242 + ref="upload"
  243 + action=""
  244 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  245 + :on-change="fileChange2"
  246 + :auto-upload="false"
  247 + :show-file-list="false"
  248 + multiple
  249 + :file-list="carFront">
  250 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  251 + </el-upload>
  252 + </div>
  253 + </el-col>
  254 + <el-col :span="21">
  255 + <div class="upload_btn">
  256 + <div v-for="(item,index) in carFront">
  257 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  258 + <div class="upload_close" @click="carFront.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  259 + <el-image
  260 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  261 + :src="createUrl(item)"
  262 + :preview-src-list="[createUrl(item)]"
  263 + :z-index="999">
  264 + </el-image>
  265 + </div>
  266 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  267 + <div class="upload_close_file" @click="carFront.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  268 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  269 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  270 + </div>
  271 + </div>
  272 + </div>
  273 + </el-col>
  274 + </el-row>
  275 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  276 + <el-col :span="3">
  277 + <div class="upload_lable">
  278 + 车辆左侧照片
  279 + <el-upload
  280 + ref="upload"
  281 + action=""
  282 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  283 + :on-change="fileChange3"
  284 + :auto-upload="false"
  285 + :show-file-list="false"
  286 + multiple
  287 + :file-list="carLeft">
  288 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  289 + </el-upload>
  290 + </div>
  291 + </el-col>
  292 + <el-col :span="21">
  293 + <div class="upload_btn">
  294 + <div v-for="(item,index) in carLeft">
  295 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  296 + <div class="upload_close" @click="carLeft.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  297 + <el-image
  298 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  299 + :src="createUrl(item)"
  300 + :preview-src-list="[createUrl(item)]"
  301 + :z-index="999">
  302 + </el-image>
  303 + </div>
  304 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  305 + <div class="upload_close_file" @click="carLeft.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  306 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  307 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  308 + </div>
  309 + </div>
  310 + </div>
  311 + </el-col>
  312 + </el-row>
  313 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  314 + <el-col :span="3">
  315 + <div class="upload_lable">
  316 + 车辆尾部照片
  317 + <el-upload
  318 + ref="upload"
  319 + action=""
  320 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  321 + :on-change="fileChange4"
  322 + :auto-upload="false"
  323 + :show-file-list="false"
  324 + multiple
  325 + :file-list="carBehind">
  326 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  327 + </el-upload>
  328 + </div>
  329 + </el-col>
  330 + <el-col :span="21">
  331 + <div class="upload_btn">
  332 + <div v-for="(item,index) in carBehind">
  333 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  334 + <div class="upload_close" @click="carBehind.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  335 + <el-image
  336 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  337 + :src="createUrl(item)"
  338 + :preview-src-list="[createUrl(item)]"
  339 + :z-index="999">
  340 + </el-image>
  341 + </div>
  342 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  343 + <div class="upload_close_file" @click="carBehind.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  344 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  345 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  346 + </div>
  347 + </div>
  348 + </div>
  349 + </el-col>
  350 + </el-row>
  351 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  352 + <el-col :span="3">
  353 + <div class="upload_lable">
  354 + 车辆右侧照片
  355 + <el-upload
  356 + ref="upload"
  357 + action=""
  358 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
  359 + :on-change="fileChange5"
  360 + :auto-upload="false"
  361 + :show-file-list="false"
  362 + multiple
  363 + :file-list="carRight">
  364 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  365 + </el-upload>
  366 + </div>
  367 + </el-col>
  368 + <el-col :span="21">
  369 + <div class="upload_btn">
  370 + <div v-for="(item,index) in carRight">
  371 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  372 + <div class="upload_close" @click="carRight.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  373 + <el-image
  374 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  375 + :src="createUrl(item)"
  376 + :preview-src-list="[createUrl(item)]"
  377 + :z-index="999">
  378 + </el-image>
  379 + </div>
  380 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  381 + <div class="upload_close_file" @click="carRight.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  382 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  383 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  384 + </div>
  385 + </div>
  386 + </div>
  387 + </el-col>
  388 + </el-row>
  389 + <!-- <el-form-item label="" prop="environmentalApproval">-->
  390 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  391 + <!-- </el-form-item>-->
  392 + <!-- <el-form-item label="" prop="authorization">-->
  393 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  394 + <!-- </el-form-item>-->
  395 + <!-- <el-form-item label="" prop="otherInformation">-->
  396 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  397 + <!-- </el-form-item>-->
  398 + <!-- <el-form-item label="运输企业" prop="companyIds">-->
  399 + <!-- <el-input v-model="form.companyIds" placeholder="请输入运输企业" />-->
  400 + <!-- </el-form-item>-->
  401 + <!-- <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">-->
  402 + <!-- <el-radio-group v-model="form.status">-->
  403 + <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  404 + <!-- </el-radio-group>-->
  405 + <!-- </el-form-item>-->
  406 + <!-- <el-form-item label="二维码" prop="qrCode">-->
  407 + <!-- <el-input v-model="form.qrCode" placeholder="请输入二维码" />-->
  408 + <!-- </el-form-item>-->
  409 + </el-form>
  410 + <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  411 + <el-button type="primary" @click="submitForm">确 定</el-button>
  412 + <el-button @click="cancel">取 消</el-button>
  413 + </div>
  414 + </div>
  415 +</template>
  416 +
  417 +<script>
  418 +import {getCarInfo, addCarInfo, updateCarInfo } from "@/api/unit/carInfo";
  419 +import { listEnterprise} from "@/api/unit/enterprise";
  420 +import Treeselect from "@riophae/vue-treeselect";
  421 +import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  422 +import {getAreaList} from "@/api/casefile/remoteServer";
  423 +import { listDriverByCompanyId } from "@/api/unit/driver";
  424 +
  425 +export default {
  426 + name: "DisposalSite",
  427 + components: {Treeselect},
  428 + data() {
  429 + return {
  430 + // 遮罩层
  431 + loading: true,
  432 + // 选中数组
  433 + ids: [],
  434 + // 非单个禁用
  435 + single: true,
  436 + // 非多个禁用
  437 + multiple: true,
  438 + // 显示搜索条件
  439 + showSearch: true,
  440 + // 总条数
  441 + total: 0,
  442 + // 处理场所管理表格数据
  443 + disposalSiteList: [],
  444 + // 弹出层标题
  445 + title: "",
  446 + // 是否显示弹出层
  447 + open: false,
  448 + // 表单参数
  449 + form: {},
  450 + // 表单校验
  451 + rules: {
  452 + companyId: [
  453 + {required: true, message: "请选择所属公司", trigger: "blur"}
  454 + ],
  455 + carType: [
  456 + {required: true, message: "请选择车辆类型", trigger: "blur"}
  457 + ],
  458 + carCode: [
  459 + {required: true, message: "请输入车牌号", trigger: "blur"}
  460 + ],
  461 + carBrank: [
  462 + {required: true, message: "请输入车辆品牌", trigger: "blur"}
  463 + ],
  464 + emissionStandard: [
  465 + {required: true, message: "请选择排放标准", trigger: "blur"}
  466 + ],
  467 + roadTransportDate: [
  468 + {required: true, message: "请选择道路运输证有效期", trigger: "blur"}
  469 + ],
  470 + drivingLicenseDate: [
  471 + {required: true, message: "请选择行驶证有效期", trigger: "blur"}
  472 + ],
  473 + enterDate: [
  474 + {required: true, message: "请选择录入日期", trigger: "blur"}
  475 + ],
  476 + farmeNumber: [
  477 + {required: true, message: "请输入车架号", trigger: "blur"}
  478 + ],
  479 + carIdentification: [
  480 + {required: true, message: "请输入车辆标识牌", trigger: "blur"}
  481 + ],
  482 +
  483 + },
  484 + areas:[],
  485 + // 附件
  486 + roadTransport: [],
  487 + drivingLicense: [],
  488 + carFront: [],
  489 + carLeft: [],
  490 + carBehind: [],
  491 + carRight: [],
  492 + enterpriseList:[],
  493 + driverList:[],
  494 + options:[],
  495 + volumeOrLWH:"体积",
  496 + drivers:[]
  497 + };
  498 + },
  499 + created() {
  500 + getAreaList().then(res => {
  501 + this.areas = res.data;
  502 + });
  503 + this.queryParams = {
  504 + companyType:"1"
  505 + }
  506 + listEnterprise(this.queryParams).then(response => {
  507 + this.enterpriseList = response.rows;
  508 + });
  509 + this.initData();
  510 + },
  511 + watch: {
  512 + '$route.query.carInfoId': 'initData'
  513 + },
  514 + methods: {
  515 + listDriverByCompany(value){
  516 + listDriverByCompanyId(value).then(response => {
  517 + this.drivers = [];
  518 + this.options = response;
  519 + });
  520 + },
  521 + reset(){
  522 + this.form = {
  523 + id: null,
  524 + companyId: null,
  525 + carType: null,
  526 + carCode: null,
  527 + carBrank: null,
  528 + emissionStandard: null,
  529 + roadTransportDate: null,
  530 + drivingLicenseDate: null,
  531 + enterDate: null,
  532 + farmeNumber: null,
  533 + carIdentification: null,
  534 + containerVolume: null,
  535 + carColor: null,
  536 + carEquipment: null,
  537 + remark: null,
  538 + roadTransport: null,
  539 + drivingLicense: null,
  540 + carFront: null,
  541 + carLeft: null,
  542 + carBehind: null,
  543 + carRight: null,
  544 + drivers: null,
  545 + status: 0,
  546 + createTime: null,
  547 + createBy: null,
  548 + updateTime: null,
  549 + updateBy: null,
  550 + creditStatus: "0",
  551 + qrCode: null
  552 + };
  553 + this.roadTransport = [];
  554 + this.drivingLicense = [];
  555 + this.carFront = [];
  556 + this.carLeft = [];
  557 + this.carBehind = [];
  558 + this.carRight = [];
  559 + this.drivers = [];
  560 + },
  561 + initData(){
  562 + this.reset();
  563 + let id = this.$route.query.carInfoId;
  564 + if(id!=null){
  565 + getCarInfo(id).then(response => {
  566 + this.form = response.data;
  567 +
  568 + listDriverByCompanyId(this.form.companyId).then(response => {
  569 + this.drivers = this.form.drivers.split(",").map(value => parseInt(value));
  570 + this.options = response;
  571 + });
  572 +
  573 + //将附件转换为前端可视化数组
  574 + if(this.form.roadTransport!=null&&this.form.roadTransport!==""){
  575 + let roadTransport = this.form.roadTransport.split(";");
  576 + roadTransport.map(item=>{
  577 + let name = item.substring(item.lastIndexOf("/")+1);
  578 + this.roadTransport.push({name:name,url:item})
  579 + })
  580 + }
  581 + if(this.form.drivingLicense!=null&&this.form.drivingLicense!==""){
  582 + let drivingLicense = this.form.drivingLicense.split(";");
  583 + drivingLicense.map(item=>{
  584 + let name = item.substring(item.lastIndexOf("/")+1);
  585 + this.drivingLicense.push({name:name,url:item})
  586 + })
  587 + }
  588 + if(this.form.carFront!=null&&this.form.carFront!==""){
  589 + let carFront = this.form.carFront.split(";");
  590 + carFront.map(item=>{
  591 + let name = item.substring(item.lastIndexOf("/")+1);
  592 + this.carFront.push({name:name,url:item})
  593 + })
  594 + }
  595 + if(this.form.carLeft!=null&&this.form.carLeft!==""){
  596 + let carLeft = this.form.carLeft.split(";");
  597 + carLeft.map(item=>{
  598 + let name = item.substring(item.lastIndexOf("/")+1);
  599 + this.carLeft.push({name:name,url:item})
  600 + })
  601 + }
  602 + if(this.form.carBehind!=null&&this.form.carBehind!==""){
  603 + let carBehind = this.form.carBehind.split(";");
  604 + carBehind.map(item=>{
  605 + let name = item.substring(item.lastIndexOf("/")+1);
  606 + this.carBehind.push({name:name,url:item})
  607 + })
  608 + }
  609 + if(this.form.carRight!=null&&this.form.carRight!==""){
  610 + let carRight = this.form.carRight.split(";");
  611 + carRight.map(item=>{
  612 + let name = item.substring(item.lastIndexOf("/")+1);
  613 + this.carRight.push({name:name,url:item})
  614 + })
  615 + }
  616 + });
  617 + }
  618 + },
  619 + createUrl(file){
  620 + if(file.raw!=null){
  621 + return URL.createObjectURL(file.raw);
  622 + }else{
  623 + return process.env.VUE_APP_BASE_API + file.url;
  624 + }
  625 +
  626 + },
  627 + tempDownload(row){
  628 + let name = row.name;
  629 + let url = "";
  630 + if(row.raw!=null){
  631 + url = URL.createObjectURL(row.raw);
  632 + }else{
  633 + url = process.env.VUE_APP_BASE_API + row.url;
  634 + }
  635 + const a = document.createElement('a')
  636 + a.setAttribute('download', name)
  637 + a.setAttribute('target', '_blank')
  638 + a.setAttribute('href', url);
  639 + a.click()
  640 + },
  641 + // 取消按钮
  642 + cancel() {
  643 + this.$tab.closePage({path:"/carInfo/info"}).then(() => {
  644 + this.$tab.openPage("车辆信息", "/tool/carInfo",{carInfoRefresh:1})
  645 + })
  646 + },
  647 + /** 提交按钮 */
  648 + submitForm() {
  649 + this.$refs["form"].validate(valid => {
  650 + if (valid) {
  651 + let formData = new FormData();
  652 + let form = this.form;
  653 + //去掉params属性
  654 + delete form.params;
  655 +
  656 + //先清空原有的附件
  657 + form.roadTransport = null;
  658 + form.drivingLicense = null;
  659 + form.carFront = null;
  660 + form.carLeft = null;
  661 + form.carBehind = null;
  662 + form.carRight = null;
  663 +
  664 + if(this.volumeOrLWH==="长宽高"){
  665 + form.lengthWidthHeight = form.length+";"+form.width+";"+form.height;
  666 + }
  667 + this.form.drivers = this.drivers.join(",");
  668 + this.roadTransport.forEach(item => {
  669 + if (item.raw != null) {
  670 + formData.append('roadTransportFiles', item.raw)
  671 + }else{
  672 + //将原有的附件拼接到form中
  673 + form.roadTransport = form.roadTransport!==null?form.roadTransport+";"+item.url:item.url;
  674 + }
  675 + })
  676 + this.drivingLicense.forEach(item => {
  677 + if (item.raw != null) {
  678 + formData.append('drivingLicenseFiles', item.raw)
  679 + }else{
  680 + //将原有的附件拼接到form中
  681 + form.drivingLicense = form.drivingLicense!==null?form.drivingLicense+";"+item.url:item.url;
  682 + }
  683 + })
  684 + this.carFront.forEach(item => {
  685 + if (item.raw != null) {
  686 + formData.append('carFrontFiles', item.raw)
  687 + }else{
  688 + //将原有的附件拼接到form中
  689 + form.carFront = form.carFront!==null?form.carFront+";"+item.url:item.url;
  690 + }
  691 + })
  692 + this.carLeft.forEach(item => {
  693 + if (item.raw != null) {
  694 + formData.append('carLeftFiles', item.raw)
  695 + }else{
  696 + //将原有的附件拼接到form中
  697 + form.carLeft = form.carLeft!==null?form.carLeft+";"+item.url:item.url;
  698 + }
  699 + })
  700 + this.carBehind.forEach(item => {
  701 + if (item.raw != null) {
  702 + formData.append('carBehindFiles', item.raw)
  703 + }else{
  704 + //将原有的附件拼接到form中
  705 + form.carBehind = form.carBehind!==null?form.carBehind+";"+item.url:item.url;
  706 + }
  707 + })
  708 + this.carRight.forEach(item => {
  709 + if (item.raw != null) {
  710 + formData.append('carRightFiles', item.raw)
  711 + }else{
  712 + //将原有的附件拼接到form中
  713 + form.carRight = form.carRight!==null?form.carRight+";"+item.url:item.url;
  714 + }
  715 + })
  716 + for (let key in form) {
  717 + formData.append(key, form[key] == null ? "" : form[key])
  718 + }
  719 + if (this.form.id != null) {
  720 + updateCarInfo(formData).then(response => {
  721 + this.msgSuccess("修改成功");
  722 + this.$tab.closePage({path:"/carInfo/infoEdit"}).then(() => {
  723 + this.$tab.openPage("车辆信息管理", "/tool/carInfo",{carInfoRefresh:1})
  724 + })
  725 + });
  726 + } else {
  727 + addCarInfo(formData).then(response => {
  728 + this.msgSuccess("新增成功");
  729 + this.$tab.closePage({path:"/carInfo/info"}).then(() => {
  730 + this.$tab.openPage("车辆信息管理", "/tool/carInfo",{carInfoRefresh:1})
  731 + })
  732 + });
  733 + }
  734 + }
  735 + });
  736 + },
  737 + /**
  738 + * 文件改变时,限制文件上传格式和大小
  739 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  740 + * 大小不超过20M
  741 + * */
  742 + fileChange(file, fileList) {
  743 + let count = 0;
  744 + for (let i = 0; i < fileList.length; i++) {
  745 + // console.log(fileList.length)
  746 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  747 + if (fileList[i].name == file.name) {
  748 + count++;
  749 + if (count == 2) {
  750 + this.$message({
  751 + message: '已存在此文件!',
  752 + type: 'warning'
  753 + });
  754 + for (let j = fileList.length; j > 0; j--) {
  755 + //如果存在此文件,去除新选择的重复文件
  756 + if (fileList[j - 1].name == file.name) {
  757 + fileList.splice(j - 1, 1);
  758 + i--;
  759 + return false;
  760 + }
  761 + }
  762 + }
  763 + }
  764 + }
  765 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  766 + //格式符合后判断大小
  767 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  768 + let max5M = file.size / 1024 / 1024 < 100;
  769 + if (!max5M) {
  770 + this.$message({
  771 + message: '上传文件大小不得超过100M!',
  772 + type: 'warning'
  773 + });
  774 + fileList = fileList.splice(fileList.length - 1, 1);
  775 + } else {
  776 + //符合条件后进行添加
  777 + this.roadTransport = fileList
  778 + }
  779 + } else {
  780 + this.$message({
  781 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  782 + type: 'warning'
  783 + });
  784 + fileList = fileList.splice(fileList.length - 1, 1);
  785 + }
  786 + },
  787 + fileChange1(file, fileList) {
  788 + let count = 0;
  789 + for (let i = 0; i < fileList.length; i++) {
  790 + // console.log(fileList.length)
  791 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  792 + if (fileList[i].name == file.name) {
  793 + count++;
  794 + if (count == 2) {
  795 + this.$message({
  796 + message: '已存在此文件!',
  797 + type: 'warning'
  798 + });
  799 + for (let j = fileList.length; j > 0; j--) {
  800 + //如果存在此文件,去除新选择的重复文件
  801 + if (fileList[j - 1].name == file.name) {
  802 + fileList.splice(j - 1, 1);
  803 + i--;
  804 + return false;
  805 + }
  806 + }
  807 + }
  808 + }
  809 + }
  810 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  811 + //格式符合后判断大小
  812 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  813 + let max5M = file.size / 1024 / 1024 < 100;
  814 + if (!max5M) {
  815 + this.$message({
  816 + message: '上传文件大小不得超过100M!',
  817 + type: 'warning'
  818 + });
  819 + fileList = fileList.splice(fileList.length - 1, 1);
  820 + } else {
  821 + //符合条件后进行添加
  822 + this.drivingLicense = fileList
  823 + }
  824 + } else {
  825 + this.$message({
  826 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  827 + type: 'warning'
  828 + });
  829 + fileList = fileList.splice(fileList.length - 1, 1);
  830 + }
  831 + },
  832 + fileChange2(file, fileList) {
  833 + let count = 0;
  834 + for (let i = 0; i < fileList.length; i++) {
  835 + // console.log(fileList.length)
  836 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  837 + if (fileList[i].name == file.name) {
  838 + count++;
  839 + if (count == 2) {
  840 + this.$message({
  841 + message: '已存在此文件!',
  842 + type: 'warning'
  843 + });
  844 + for (let j = fileList.length; j > 0; j--) {
  845 + //如果存在此文件,去除新选择的重复文件
  846 + if (fileList[j - 1].name == file.name) {
  847 + fileList.splice(j - 1, 1);
  848 + i--;
  849 + return false;
  850 + }
  851 + }
  852 + }
  853 + }
  854 + }
  855 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  856 + //格式符合后判断大小
  857 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
  858 + let max5M = file.size / 1024 / 1024 < 100;
  859 + if (!max5M) {
  860 + this.$message({
  861 + message: '上传文件大小不得超过100M!',
  862 + type: 'warning'
  863 + });
  864 + fileList = fileList.splice(fileList.length - 1, 1);
  865 + } else {
  866 + //符合条件后进行添加
  867 + this.carFront = fileList
  868 + }
  869 + } else {
  870 + this.$message({
  871 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp格式!',
  872 + type: 'warning'
  873 + });
  874 + fileList = fileList.splice(fileList.length - 1, 1);
  875 + }
  876 + },
  877 + fileChange3(file, fileList) {
  878 + let count = 0;
  879 + for (let i = 0; i < fileList.length; i++) {
  880 + // console.log(fileList.length)
  881 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  882 + if (fileList[i].name == file.name) {
  883 + count++;
  884 + if (count == 2) {
  885 + this.$message({
  886 + message: '已存在此文件!',
  887 + type: 'warning'
  888 + });
  889 + for (let j = fileList.length; j > 0; j--) {
  890 + //如果存在此文件,去除新选择的重复文件
  891 + if (fileList[j - 1].name == file.name) {
  892 + fileList.splice(j - 1, 1);
  893 + i--;
  894 + return false;
  895 + }
  896 + }
  897 + }
  898 + }
  899 + }
  900 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  901 + //格式符合后判断大小
  902 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf".indexOf(fileType) != -1) {
  903 + let max5M = file.size / 1024 / 1024 < 100;
  904 + if (!max5M) {
  905 + this.$message({
  906 + message: '上传文件大小不得超过100M!',
  907 + type: 'warning'
  908 + });
  909 + fileList = fileList.splice(fileList.length - 1, 1);
  910 + } else {
  911 + //符合条件后进行添加
  912 + this.carLeft = fileList
  913 + }
  914 + } else {
  915 + this.$message({
  916 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp格式!',
  917 + type: 'warning'
  918 + });
  919 + fileList = fileList.splice(fileList.length - 1, 1);
  920 + }
  921 + },
  922 + fileChange4(file, fileList) {
  923 + let count = 0;
  924 + for (let i = 0; i < fileList.length; i++) {
  925 + // console.log(fileList.length)
  926 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  927 + if (fileList[i].name == file.name) {
  928 + count++;
  929 + if (count == 2) {
  930 + this.$message({
  931 + message: '已存在此文件!',
  932 + type: 'warning'
  933 + });
  934 + for (let j = fileList.length; j > 0; j--) {
  935 + //如果存在此文件,去除新选择的重复文件
  936 + if (fileList[j - 1].name == file.name) {
  937 + fileList.splice(j - 1, 1);
  938 + i--;
  939 + return false;
  940 + }
  941 + }
  942 + }
  943 + }
  944 + }
  945 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  946 + //格式符合后判断大小
  947 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
  948 + let max5M = file.size / 1024 / 1024 < 100;
  949 + if (!max5M) {
  950 + this.$message({
  951 + message: '上传文件大小不得超过100M!',
  952 + type: 'warning'
  953 + });
  954 + fileList = fileList.splice(fileList.length - 1, 1);
  955 + } else {
  956 + //符合条件后进行添加
  957 + this.carBehind = fileList
  958 + }
  959 + } else {
  960 + this.$message({
  961 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp格式!',
  962 + type: 'warning'
  963 + });
  964 + fileList = fileList.splice(fileList.length - 1, 1);
  965 + }
  966 + },
  967 + fileChange5(file, fileList) {
  968 + let count = 0;
  969 + for (let i = 0; i < fileList.length; i++) {
  970 + // console.log(fileList.length)
  971 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  972 + if (fileList[i].name == file.name) {
  973 + count++;
  974 + if (count == 2) {
  975 + this.$message({
  976 + message: '已存在此文件!',
  977 + type: 'warning'
  978 + });
  979 + for (let j = fileList.length; j > 0; j--) {
  980 + //如果存在此文件,去除新选择的重复文件
  981 + if (fileList[j - 1].name == file.name) {
  982 + fileList.splice(j - 1, 1);
  983 + i--;
  984 + return false;
  985 + }
  986 + }
  987 + }
  988 + }
  989 + }
  990 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  991 + //格式符合后判断大小
  992 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
  993 + let max5M = file.size / 1024 / 1024 < 100;
  994 + if (!max5M) {
  995 + this.$message({
  996 + message: '上传文件大小不得超过100M!',
  997 + type: 'warning'
  998 + });
  999 + fileList = fileList.splice(fileList.length - 1, 1);
  1000 + } else {
  1001 + //符合条件后进行添加
  1002 + this.carRight = fileList
  1003 + }
  1004 + } else {
  1005 + this.$message({
  1006 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp格式!',
  1007 + type: 'warning'
  1008 + });
  1009 + fileList = fileList.splice(fileList.length - 1, 1);
  1010 + }
  1011 + },
  1012 + }
  1013 +};
  1014 +</script>
  1015 +<style lang="scss" scoped>
  1016 +.upload_lable{
  1017 + border-right: 1px solid #dcdfe6;
  1018 + padding: 27px 30px;
  1019 + background: #fafafa;
  1020 + text-align: center;
  1021 +}
  1022 +.upload_btn{
  1023 + max-height: 106px;
  1024 +}
  1025 +.upload_close{
  1026 + position: absolute;
  1027 + left: 105px;
  1028 + z-index:99;
  1029 + top:-1px;
  1030 + font-size:18px;
  1031 + color:red;
  1032 +}
  1033 +.upload_close_file{
  1034 + position: absolute;
  1035 + left: 80px;
  1036 + z-index:99;
  1037 + top:-1px;
  1038 + font-size:18px;
  1039 + color:red;
  1040 +}
  1041 +.upload_div_image{
  1042 + display: inline-block;
  1043 + width: 110px;
  1044 + height: 95px;
  1045 + position: relative;
  1046 + float: left;
  1047 + margin-left: 5px;
  1048 +}
  1049 +.upload_div_file{
  1050 + display: inline-block;
  1051 + width: 110px;
  1052 + height: 95px;
  1053 + text-align: center;
  1054 + float:left;
  1055 + margin: 5px;
  1056 + position: relative;
  1057 +}
  1058 +.serach_map{
  1059 + position: absolute;
  1060 + top: 100px;
  1061 + left: 25px;
  1062 + z-index: 999;
  1063 + background: #fff;
  1064 + padding: 10px;
  1065 + border-radius: 5px;
  1066 + box-shadow: 0 0 10px rgba(0,0,0,.2);
  1067 +}
  1068 +</style>
trash-ui/src/views/unit/disposalSite/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="158px">
  4 + <el-form-item label="处理场所名称" prop="name">
  5 + <el-input
  6 + v-model="queryParams.name"
  7 + placeholder="请输入处理场所名称"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item label="建筑垃圾处理场所类型" prop="siteType">
  14 + <el-select v-model="queryParams.siteType" placeholder="请选择建筑垃圾处理场所类型" clearable size="small">
  15 + <el-option label="消纳(回填)场所" value="消纳(回填)场所" />
  16 + <el-option label="建筑垃圾资源化处置场" value="建筑垃圾资源化处置场" />
  17 + <el-option label="盾构土环保处置场" value="盾构土环保处置场" />
  18 + </el-select>
  19 + </el-form-item>
  20 + <el-form-item label="所在区域" prop="localArea">
  21 + <el-select v-model="queryParams.localArea" placeholder="请选择所在区域" style="width: 100%" clearable>
  22 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  23 + </el-select>
  24 + </el-form-item>
  25 + <el-form-item label="审核情况" prop="auditStatus">
  26 + <el-select v-model="queryParams.auditStatus" placeholder="审核情况" clearable size="small">
  27 + <el-option label="新增审核中" value="新增审核中" />
  28 + <el-option label="审核通过" value="审核通过" />
  29 + <el-option label="新增审核驳回" value="新增审核驳回" />
  30 + <el-option label="变更审核中" value="变更审核中" />
  31 + <el-option label="变更审核驳回" value="变更审核驳回" />
  32 + </el-select>
  33 + </el-form-item>
  34 + <el-form-item label="信用状态" prop="creditStatus">
  35 + <el-select v-model="queryParams.creditStatus" placeholder="请选择信用状态" clearable size="small">
  36 + <el-option label="正常" value="正常" />
  37 + <el-option label="失信" value="失信" />
  38 + </el-select>
  39 + </el-form-item>
  40 + <el-form-item label="期限范围" prop="termRange">
  41 + <el-select v-model="queryParams.termRange" placeholder="请选择期限范围" clearable size="small">
  42 + <el-option label="已超期" value="已超期" />
  43 + <el-option label="未超期" value="未超期" />
  44 + </el-select>
  45 + </el-form-item>
  46 + <el-form-item>
  47 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  48 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  49 + </el-form-item>
  50 + </el-form>
  51 +
  52 + <el-row :gutter="10" class="mb8">
  53 + <el-col :span="1.5">
  54 + <el-button
  55 + type="primary"
  56 + icon="el-icon-plus"
  57 + size="mini"
  58 + @click="handleAdd"
  59 + v-hasPermi="['unit:disposalSite:add']"
  60 + >新增</el-button>
  61 + </el-col>
  62 + <el-col :span="1.5">
  63 + <el-button
  64 + type="success"
  65 + icon="el-icon-edit"
  66 + size="mini"
  67 + :disabled="single"
  68 + @click="handleUpdate"
  69 + v-hasPermi="['unit:disposalSite:edit']"
  70 + >修改</el-button>
  71 + </el-col>
  72 + <el-col :span="1.5">
  73 + <el-button
  74 + type="danger"
  75 + icon="el-icon-delete"
  76 + size="mini"
  77 + :disabled="multiple"
  78 + @click="handleDelete"
  79 + v-hasPermi="['unit:disposalSite:remove']"
  80 + >删除</el-button>
  81 + </el-col>
  82 + <el-col :span="1.5">
  83 + <el-button
  84 + type="warning"
  85 + icon="el-icon-download"
  86 + size="mini"
  87 + @click="handleExport"
  88 + v-hasPermi="['unit:disposalSite:export']"
  89 + >导出</el-button>
  90 + </el-col>
  91 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  92 + </el-row>
  93 +
  94 + <el-table v-loading="loading" :data="disposalSiteList" @selection-change="handleSelectionChange">
  95 + <el-table-column type="selection" width="55" align="center" />
  96 + <el-table-column type="index" width="55" align="center" label="序号"/>
  97 + <el-table-column label="处理场所名称" align="center" prop="name" />
  98 + <el-table-column label="建筑垃圾处理场所类型" align="center" prop="siteType" />
  99 + <el-table-column label="所在区域" align="center" prop="localArea" />
  100 + <el-table-column label="审批方量(m³)" align="center" prop="squareMeasure" />
  101 + <el-table-column label="剩余方量(m³)" align="center" prop="surplusSquareMeasure" />
  102 + <el-table-column label="有限期开始时间" align="center" prop="validityBeginDate" width="180">
  103 + <template slot-scope="scope">
  104 + <span>{{ parseTime(scope.row.validityBeginDate, '{y}-{m}-{d}') }}</span>
  105 + </template>
  106 + </el-table-column>
  107 + <el-table-column label="有限期结束时间" align="center" prop="validityEndDate" width="180">
  108 + <template slot-scope="scope">
  109 + <span>{{ parseTime(scope.row.validityEndDate, '{y}-{m}-{d}') }}</span>
  110 + </template>
  111 + </el-table-column>
  112 + <el-table-column label="消纳来源" align="center" prop="absorbSource" />
  113 + <el-table-column label="审核情况" align="center" prop="auditStatus" />
  114 + <el-table-column label="信用状态" align="center" prop="creditStatus" />
  115 + <el-table-column label="期限范围" align="center" prop="termRange" />
  116 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  117 + <template slot-scope="scope">
  118 + <el-button
  119 + size="mini"
  120 + type="text"
  121 + icon="el-icon-edit"
  122 + @click="handleUpdate(scope.row)"
  123 + v-hasPermi="['unit:disposalSite:edit']"
  124 + >修改</el-button>
  125 + <el-button
  126 + size="mini"
  127 + type="text"
  128 + icon="el-icon-delete"
  129 + @click="handleDelete(scope.row)"
  130 + v-hasPermi="['unit:disposalSite:remove']"
  131 + >删除</el-button>
  132 + </template>
  133 + </el-table-column>
  134 + </el-table>
  135 +
  136 + <pagination
  137 + v-show="total>0"
  138 + :total="total"
  139 + :page.sync="queryParams.pageNum"
  140 + :limit.sync="queryParams.pageSize"
  141 + @pagination="getList"
  142 + />
  143 + </div>
  144 +</template>
  145 +
  146 +<script>
  147 +import { listDisposalSite, getDisposalSite, delDisposalSite, addDisposalSite, updateDisposalSite, exportDisposalSite } from "@/api/unit/disposalSite";
  148 +import {getAreaList} from "@/api/casefile/remoteServer";
  149 +
  150 +export default {
  151 + name: "DisposalSite",
  152 + data() {
  153 + return {
  154 + // 遮罩层
  155 + loading: true,
  156 + // 选中数组
  157 + ids: [],
  158 + // 非单个禁用
  159 + single: true,
  160 + // 非多个禁用
  161 + multiple: true,
  162 + // 显示搜索条件
  163 + showSearch: true,
  164 + // 总条数
  165 + total: 0,
  166 + // 处理场所管理表格数据
  167 + disposalSiteList: [],
  168 + // 弹出层标题
  169 + title: "",
  170 + // 是否显示弹出层
  171 + open: false,
  172 + // 查询参数
  173 + queryParams: {
  174 + pageNum: 1,
  175 + pageSize: 10,
  176 + name: null,
  177 + certificateNumber: null,
  178 + address: null,
  179 + engineeringProperty: null,
  180 + siteType: null,
  181 + localArea: null,
  182 + operatingArea: null,
  183 + trashType: null,
  184 + constructionUnit: null,
  185 + constructionUnitPerson: null,
  186 + constructionUnitPersonPhone: null,
  187 + validityBeginDate: null,
  188 + validityEndDate: null,
  189 + squareMeasure: null,
  190 + surplusSquareMeasure: null,
  191 + carWashingFacilities: null,
  192 + exitRoadCondition: null,
  193 + lightingFacility: null,
  194 + videoSurveillanceFacility: null,
  195 + preparer: null,
  196 + handlingAdvice: null,
  197 + absorbSource: null,
  198 + electronicFence: null,
  199 + creditStatus: null,
  200 + approvalDocument: null,
  201 + approvalData: null,
  202 + scenePhoto: null,
  203 + carWashingFacilitiesImage: null,
  204 + termRange: null,
  205 + safetyAssessmentReport: null,
  206 + environmentalApproval: null,
  207 + authorization: null,
  208 + otherInformation: null,
  209 + companyIds: null,
  210 + status: null,
  211 + qrCode: null
  212 + },
  213 + // 表单参数
  214 + form: {},
  215 + // 表单校验
  216 + rules: {
  217 + },
  218 + areas: []
  219 + };
  220 + },
  221 + created() {
  222 + getAreaList().then(res => {
  223 + this.areas = res.data;
  224 + });
  225 +
  226 + this.getList();
  227 + },
  228 + watch:{
  229 + '$route.query.disposalSiteRefresh':'getList'
  230 + },
  231 + methods: {
  232 + /** 查询处理场所管理列表 */
  233 + getList() {
  234 + this.loading = true;
  235 + listDisposalSite(this.queryParams).then(response => {
  236 + this.disposalSiteList = response.rows;
  237 + this.total = response.total;
  238 + this.loading = false;
  239 + });
  240 + },
  241 + /** 搜索按钮操作 */
  242 + handleQuery() {
  243 + this.queryParams.pageNum = 1;
  244 + this.getList();
  245 + },
  246 + /** 重置按钮操作 */
  247 + resetQuery() {
  248 + this.handleQuery();
  249 + },
  250 + // 多选框选中数据
  251 + handleSelectionChange(selection) {
  252 + this.ids = selection.map(item => item.id)
  253 + this.single = selection.length!==1
  254 + this.multiple = !selection.length
  255 + },
  256 + /** 新增按钮操作 */
  257 + handleAdd() {
  258 + this.$tab.openPage("新增处理场所管理","/disposalSite/info",{disposalSiteRefresh:0});
  259 + },
  260 + /** 修改按钮操作 */
  261 + handleUpdate(row) {
  262 + const id = row.id || this.ids
  263 + this.$tab.openPage("修改处理场所","/disposalSite/infoEdit",{disposalSiteId: id,disposalSiteRefresh:0});
  264 + },
  265 + /** 删除按钮操作 */
  266 + handleDelete(row) {
  267 + const ids = row.id || this.ids;
  268 + this.$confirm('是否确认删除处理场所管理编号为"' + ids + '"的数据项?', "警告", {
  269 + confirmButtonText: "确定",
  270 + cancelButtonText: "取消",
  271 + type: "warning"
  272 + }).then(function() {
  273 + return delDisposalSite(ids);
  274 + }).then(() => {
  275 + this.getList();
  276 + this.msgSuccess("删除成功");
  277 + })
  278 + },
  279 + /** 导出按钮操作 */
  280 + handleExport() {
  281 + const queryParams = this.queryParams;
  282 + this.$confirm('是否确认导出所有处理场所管理数据项?', "警告", {
  283 + confirmButtonText: "确定",
  284 + cancelButtonText: "取消",
  285 + type: "warning"
  286 + }).then(function() {
  287 + return exportDisposalSite(queryParams);
  288 + }).then(response => {
  289 + this.download(response.msg);
  290 + })
  291 + }
  292 + }
  293 +};
  294 +</script>
trash-ui/src/views/unit/disposalSite/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 + <!-- 添加或修改处理场所管理对话框 -->
  5 + <h3>
  6 + 基础信息
  7 + </h3>
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top">
  9 + <el-row :gutter="30">
  10 + <el-col :span="6">
  11 + <el-form-item label="建筑垃圾处理场所名称" prop="name">
  12 + <el-input v-model="form.name" placeholder="请输入建筑垃圾处理场所名称" />
  13 + </el-form-item>
  14 + </el-col>
  15 + <el-col :span="6">
  16 + <el-form-item label="证书编号" prop="certificateNumber">
  17 + <el-input v-model="form.certificateNumber" placeholder="请输入证书编号" />
  18 + </el-form-item>
  19 + </el-col>
  20 + <el-col :span="6">
  21 + <el-form-item label="所在地址" prop="address">
  22 + <el-input v-model="form.address" placeholder="请输入所在地址" />
  23 + </el-form-item>
  24 + </el-col>
  25 + </el-row>
  26 + <el-row :gutter="30">
  27 + <el-col :span="6">
  28 + <el-form-item label="所在区域" prop="localArea">
  29 + <el-select v-model="form.localArea" placeholder="请选择所在区域" style="width: 100%">
  30 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  31 + </el-select>
  32 + </el-form-item>
  33 + </el-col>
  34 + <el-col :span="6">
  35 + <el-form-item label="建筑垃圾处理场所类型" prop="siteType">
  36 + <el-select v-model="form.siteType" placeholder="请选择建筑垃圾处理场所类型" style="width: 100%">
  37 + <el-option label="消纳(回填)场所" value="消纳(回填)场所" />
  38 + <el-option label="建筑垃圾资源化处置场" value="建筑垃圾资源化处置场" />
  39 + <el-option label="盾构土环保处置场" value="盾构土环保处置场" />
  40 + </el-select>
  41 + </el-form-item>
  42 + </el-col>
  43 + <el-col :span="6">
  44 + <el-form-item label="消纳(回填)场所工程性质" prop="engineeringProperty">
  45 + <el-select v-model="form.engineeringProperty" placeholder="请选择消纳(回填)场所工程性质" style="width: 100%">
  46 + <el-option label="消纳(回填)场" value="消纳(回填)场" />
  47 + <el-option label="房建市政工程" value="房建市政工程" />
  48 + <el-option label="交通工程" value="交通工程" />
  49 + <el-option label="水利工程" value="水利工程" />
  50 + <el-option label="国有土地整理" value="国有土地整理" />
  51 + <el-option label="平场工程" value="平场工程" />
  52 + <el-option label="生态修复" value="生态修复" />
  53 + <el-option label="覆绿造景工程" value="覆绿造景工程" />
  54 + </el-select>
  55 + </el-form-item>
  56 + </el-col>
  57 + </el-row>
  58 + <el-row :gutter="30">
  59 + <el-col :span="6">
  60 + <el-form-item label="作业区域" prop="operatingArea">
  61 + <el-select v-model="form.operatingArea" placeholder="请选择作业区域" style="width: 100%">
  62 + <el-option label="核心区域" value="核心区域" />
  63 + <el-option label="中心区域" value="中心区域" />
  64 + <el-option label="外环区域" value="外环区域" />
  65 + </el-select>
  66 + </el-form-item>
  67 + </el-col>
  68 + <el-col :span="6">
  69 + <el-form-item label="可受纳建筑垃圾类型" prop="trashType">
  70 + <treeselect v-model="form.trashType" :multiple="true" :options="options" placeholder="请选择"/>
  71 + </el-form-item>
  72 + </el-col>
  73 + <el-col :span="6">
  74 + <el-form-item label="建设(施工)单位名称" prop="constructionUnit">
  75 + <el-input v-model="form.constructionUnit" placeholder="请输入建设(施工)单位名称" />
  76 + </el-form-item>
  77 + </el-col>
  78 + </el-row>
  79 + <el-row :gutter="30">
  80 + <el-col :span="6">
  81 + <el-form-item label="建设(施工)单位责任人" prop="constructionUnitPerson">
  82 + <el-input v-model="form.constructionUnitPerson" placeholder="请输入建设(施工)单位责任人" />
  83 + </el-form-item>
  84 + </el-col>
  85 + <el-col :span="6">
  86 + <el-form-item label="责任人联系电话" prop="constructionUnitPersonPhone">
  87 + <el-input v-model="form.constructionUnitPersonPhone" placeholder="请输入责任人联系电话" :maxlength="11" show-word-limit/>
  88 + </el-form-item>
  89 + </el-col>
  90 + <el-col :span="6">
  91 + </el-col>
  92 + </el-row>
  93 +
  94 + <el-row :gutter="30">
  95 + <el-col :span="6">
  96 + <el-form-item label="有限期开始时间" prop="validityBeginDate">
  97 + <el-date-picker clearable size="small" style="width: 100%"
  98 + v-model="form.validityBeginDate"
  99 + type="date"
  100 + value-format="yyyy-MM-dd"
  101 + placeholder="选择有限期开始时间">
  102 + </el-date-picker>
  103 + </el-form-item>
  104 +
  105 + </el-col>
  106 + <el-col :span="6">
  107 + <el-form-item label="有限期结束时间" prop="validityEndDate">
  108 + <el-date-picker clearable size="small" style="width: 100%"
  109 + v-model="form.validityEndDate"
  110 + type="date"
  111 + value-format="yyyy-MM-dd"
  112 + placeholder="选择有限期结束时间">
  113 + </el-date-picker>
  114 + </el-form-item>
  115 + </el-col>
  116 + <el-col :span="6">
  117 + <el-form-item label="审批方量(m³)" prop="squareMeasure">
  118 + <el-input v-model="form.squareMeasure" placeholder="请输入审批方量(m³)" />
  119 + </el-form-item>
  120 + </el-col>
  121 + </el-row>
  122 + <!-- <el-form-item label="剩余方量" prop="surplusSquareMeasure">-->
  123 + <!-- <el-input v-model="form.surplusSquareMeasure" placeholder="请输入剩余方量" />-->
  124 + <!-- </el-form-item>-->
  125 + <el-row :gutter="30">
  126 + <el-col :span="6">
  127 + <el-form-item label="洗车作业设施" prop="carWashingFacilities">
  128 + <el-select v-model="form.carWashingFacilities" placeholder="请选择洗车作业设施" style="width: 100%">
  129 + <el-option label="钢架洗车平台" value="钢架洗车平台" />
  130 + <el-option label="钢架洗车平台、过水槽" value="钢架洗车平台、过水槽" />
  131 + <el-option label="全自动洗车平台、过水槽" value="全自动洗车平台、过水槽" />
  132 + <el-option label="特殊事项" value="特殊事项" />
  133 + </el-select>
  134 + </el-form-item>
  135 + </el-col>
  136 + <el-col :span="6">
  137 + <el-form-item label="出口道路状况" prop="exitRoadCondition">
  138 + <el-select v-model="form.exitRoadCondition" placeholder="请选择出口道路状况" style="width: 100%">
  139 + <el-option label="硬化" value="硬化" />
  140 + <el-option label="未硬化" value="未硬化" />
  141 + </el-select>
  142 + </el-form-item>
  143 + </el-col>
  144 + </el-row>
  145 + <el-row :gutter="30">
  146 + <el-col :span="6">
  147 + <el-form-item label="照明设施" prop="lightingFacility">
  148 + <el-select v-model="form.lightingFacility" placeholder="请选择照明设施" style="width: 100%">
  149 + <el-option label="有" value="有" />
  150 + <el-option label="无" value="无" />
  151 + <el-option label="不适用" value="不适用" />
  152 + </el-select>
  153 + </el-form-item>
  154 + </el-col>
  155 + <el-col :span="6">
  156 + <el-form-item label="视频监控设施" prop="videoSurveillanceFacility">
  157 + <el-select v-model="form.videoSurveillanceFacility" placeholder="请选择视频监控设施" style="width: 100%">
  158 + <el-option label="有" value="有" />
  159 + <el-option label="无" value="无" />
  160 + <el-option label="不适用" value="不适用" />
  161 + </el-select>
  162 + </el-form-item>
  163 + </el-col>
  164 + </el-row>
  165 + <el-row :gutter="30">
  166 + <el-col :span="6">
  167 + <el-form-item label="填表人" prop="preparer">
  168 + <el-input v-model="form.preparer" placeholder="请输入填表人" />
  169 + </el-form-item>
  170 + </el-col>
  171 + <el-col :span="6">
  172 + <el-form-item label="办理意见" prop="handlingAdvice">
  173 + <el-input v-model="form.handlingAdvice" placeholder="请输入内容" />
  174 + </el-form-item>
  175 + </el-col>
  176 + </el-row>
  177 +
  178 +
  179 +
  180 +
  181 + <!-- <el-form-item label="消纳来源" prop="absorbSource">-->
  182 + <!-- <el-input v-model="form.absorbSource" placeholder="请输入消纳来源" />-->
  183 + <!-- </el-form-item>-->
  184 + <el-form-item label="电子围栏" prop="electronicFence">
  185 + <template v-slot:label>
  186 + <el-tooltip class="item" placement="right" style="float:left;">
  187 + <div slot="content">
  188 + 请保证经度在前,维度在后,中间用,隔开。多个坐标点之间用“;”隔开,示例:118.121,110.112;118.111,110.112
  189 + </div>
  190 + <div class="tips">
  191 + <span class="tipsSpan">
  192 + 电子围栏
  193 + </span>
  194 + <i class="el-icon-question"></i>
  195 + </div>
  196 + </el-tooltip>
  197 + <el-button @click="draw" type="text" style="float: left;margin-left: 10px">绘制围栏</el-button>
  198 + </template>
  199 +
  200 + <el-input v-model="form.electronicFence" type="textarea" placeholder="请输入内容" style="width: 49%"/>
  201 + </el-form-item>
  202 + <!-- <el-form-item label="信用状态">-->
  203 + <!-- <el-radio-group v-model="form.creditStatus">-->
  204 + <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  205 + <!-- </el-radio-group>-->
  206 + <!-- </el-form-item>-->
  207 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  208 + <el-col :span="3">
  209 + <div class="upload_lable">
  210 + 批准文件
  211 + <el-upload
  212 + ref="upload"
  213 + action=""
  214 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  215 + :on-change="fileChange"
  216 + :auto-upload="false"
  217 + :show-file-list="false"
  218 + multiple
  219 + :file-list="approvalDocument">
  220 +
  221 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  222 + </el-upload>
  223 + </div>
  224 + </el-col>
  225 + <el-col :span="21">
  226 + <div class="upload_btn">
  227 + <div v-for="(item,index) in approvalDocument">
  228 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  229 + <div class="upload_close" @click="approvalDocument.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  230 + <el-image
  231 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  232 + :src="createUrl(item)"
  233 + :preview-src-list="[createUrl(item)]"
  234 + :z-index="999">
  235 + </el-image>
  236 + </div>
  237 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  238 + <div class="upload_close_file" @click="approvalDocument.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  239 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  240 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  241 + </div>
  242 + </div>
  243 + </div>
  244 + </el-col>
  245 + </el-row>
  246 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  247 + <el-col :span="3">
  248 + <div class="upload_lable">
  249 + 审批资料
  250 + <el-upload
  251 + ref="upload"
  252 + action=""
  253 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  254 + :on-change="fileChange1"
  255 + :auto-upload="false"
  256 + :show-file-list="false"
  257 + multiple
  258 + :file-list="approvalData">
  259 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  260 + </el-upload>
  261 + </div>
  262 + </el-col>
  263 + <el-col :span="21">
  264 + <div class="upload_btn">
  265 + <div v-for="(item,index) in approvalData">
  266 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  267 + <div class="upload_close" @click="approvalData.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  268 + <el-image
  269 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  270 + :src="createUrl(item)"
  271 + :preview-src-list="[createUrl(item)]"
  272 + :z-index="999">
  273 + </el-image>
  274 + </div>
  275 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  276 + <div class="upload_close_file" @click="approvalData.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  277 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  278 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  279 + </div>
  280 + </div>
  281 + </div>
  282 + </el-col>
  283 + </el-row>
  284 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  285 + <el-col :span="3">
  286 + <div class="upload_lable">
  287 + 现场照片
  288 + <el-upload
  289 + ref="upload"
  290 + action=""
  291 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  292 + :on-change="fileChange2"
  293 + :auto-upload="false"
  294 + :show-file-list="false"
  295 + multiple
  296 + :file-list="scenePhoto">
  297 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  298 + </el-upload>
  299 + </div>
  300 + </el-col>
  301 + <el-col :span="21">
  302 + <div class="upload_btn">
  303 + <div v-for="(item,index) in scenePhoto">
  304 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  305 + <div class="upload_close" @click="scenePhoto.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  306 + <el-image
  307 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  308 + :src="createUrl(item)"
  309 + :preview-src-list="[createUrl(item)]"
  310 + :z-index="999">
  311 + </el-image>
  312 + </div>
  313 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  314 + <div class="upload_close_file" @click="scenePhoto.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  315 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  316 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  317 + </div>
  318 + </div>
  319 + </div>
  320 + </el-col>
  321 + </el-row>
  322 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  323 + <el-col :span="3">
  324 + <div class="upload_lable">
  325 + 洗车设施照片
  326 + <el-upload
  327 + ref="upload"
  328 + action=""
  329 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  330 + :on-change="fileChange3"
  331 + :auto-upload="false"
  332 + :show-file-list="false"
  333 + multiple
  334 + :file-list="carWashingFacilitiesImage">
  335 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  336 + </el-upload>
  337 + </div>
  338 + </el-col>
  339 + <el-col :span="21">
  340 + <div class="upload_btn">
  341 + <div v-for="(item,index) in carWashingFacilitiesImage">
  342 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  343 + <div class="upload_close" @click="carWashingFacilitiesImage.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  344 + <el-image
  345 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  346 + :src="createUrl(item)"
  347 + :preview-src-list="[createUrl(item)]"
  348 + :z-index="999">
  349 + </el-image>
  350 + </div>
  351 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  352 + <div class="upload_close_file" @click="carWashingFacilitiesImage.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  353 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  354 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  355 + </div>
  356 + </div>
  357 + </div>
  358 + </el-col>
  359 + </el-row>
  360 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  361 + <el-col :span="3">
  362 + <div class="upload_lable">
  363 + 安全评估报告
  364 + <el-upload
  365 + ref="upload"
  366 + action=""
  367 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  368 + :on-change="fileChange4"
  369 + :auto-upload="false"
  370 + :show-file-list="false"
  371 + multiple
  372 + :file-list="safetyAssessmentReport">
  373 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  374 + </el-upload>
  375 + </div>
  376 + </el-col>
  377 + <el-col :span="21">
  378 + <div class="upload_btn">
  379 + <div v-for="(item,index) in safetyAssessmentReport">
  380 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  381 + <div class="upload_close" @click="safetyAssessmentReport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  382 + <el-image
  383 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  384 + :src="createUrl(item)"
  385 + :preview-src-list="[createUrl(item)]"
  386 + :z-index="999">
  387 + </el-image>
  388 + </div>
  389 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  390 + <div class="upload_close_file" @click="safetyAssessmentReport.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  391 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  392 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  393 + </div>
  394 + </div>
  395 + </div>
  396 + </el-col>
  397 + </el-row>
  398 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  399 + <el-col :span="3">
  400 + <div class="upload_lable">
  401 + 环评报告及环保部门批复
  402 + <el-upload
  403 + ref="upload"
  404 + action=""
  405 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  406 + :on-change="fileChange5"
  407 + :auto-upload="false"
  408 + :show-file-list="false"
  409 + multiple
  410 + :file-list="environmentalApproval">
  411 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  412 + </el-upload>
  413 + </div>
  414 + </el-col>
  415 + <el-col :span="21">
  416 + <div class="upload_btn">
  417 + <div v-for="(item,index) in environmentalApproval">
  418 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  419 + <div class="upload_close" @click="environmentalApproval.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  420 + <el-image
  421 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  422 + :src="createUrl(item)"
  423 + :preview-src-list="[createUrl(item)]"
  424 + :z-index="999">
  425 + </el-image>
  426 + </div>
  427 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  428 + <div class="upload_close_file" @click="environmentalApproval.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  429 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  430 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  431 + </div>
  432 + </div>
  433 + </div>
  434 + </el-col>
  435 + </el-row>
  436 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  437 + <el-col :span="3">
  438 + <div class="upload_lable">
  439 + 签署消纳合同授权委托书
  440 + <el-upload
  441 + ref="upload"
  442 + action=""
  443 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  444 + :on-change="fileChange6"
  445 + :auto-upload="false"
  446 + :show-file-list="false"
  447 + multiple
  448 + :file-list="authorization">
  449 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  450 + </el-upload>
  451 + </div>
  452 + </el-col>
  453 + <el-col :span="21">
  454 + <div class="upload_btn">
  455 + <div v-for="(item,index) in authorization">
  456 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  457 + <div class="upload_close" @click="authorization.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  458 + <el-image
  459 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  460 + :src="createUrl(item)"
  461 + :preview-src-list="[createUrl(item)]"
  462 + :z-index="999">
  463 + </el-image>
  464 + </div>
  465 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  466 + <div class="upload_close_file" @click="authorization.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  467 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  468 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  469 + </div>
  470 + </div>
  471 + </div>
  472 + </el-col>
  473 + </el-row>
  474 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  475 + <el-col :span="3">
  476 + <div class="upload_lable">
  477 + 其他资料
  478 + <el-upload
  479 + ref="upload"
  480 + action=""
  481 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  482 + :on-change="fileChange7"
  483 + :auto-upload="false"
  484 + :show-file-list="false"
  485 + multiple
  486 + :file-list="otherInformation">
  487 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  488 + </el-upload>
  489 + </div>
  490 + </el-col>
  491 + <el-col :span="21">
  492 + <div class="upload_btn">
  493 + <div v-for="(item,index) in otherInformation">
  494 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  495 + <div class="upload_close" @click="otherInformation.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  496 + <el-image
  497 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  498 + :src="createUrl(item)"
  499 + :preview-src-list="[createUrl(item)]"
  500 + :z-index="999">
  501 + </el-image>
  502 + </div>
  503 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  504 + <div class="upload_close_file" @click="otherInformation.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  505 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  506 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  507 + </div>
  508 + </div>
  509 + </div>
  510 + </el-col>
  511 + </el-row>
  512 + <!-- <el-form-item label="" prop="environmentalApproval">-->
  513 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  514 + <!-- </el-form-item>-->
  515 + <!-- <el-form-item label="" prop="authorization">-->
  516 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  517 + <!-- </el-form-item>-->
  518 + <!-- <el-form-item label="" prop="otherInformation">-->
  519 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  520 + <!-- </el-form-item>-->
  521 + <!-- <el-form-item label="运输企业" prop="companyIds">-->
  522 + <!-- <el-input v-model="form.companyIds" placeholder="请输入运输企业" />-->
  523 + <!-- </el-form-item>-->
  524 + <!-- <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">-->
  525 + <!-- <el-radio-group v-model="form.status">-->
  526 + <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  527 + <!-- </el-radio-group>-->
  528 + <!-- </el-form-item>-->
  529 + <!-- <el-form-item label="二维码" prop="qrCode">-->
  530 + <!-- <el-input v-model="form.qrCode" placeholder="请输入二维码" />-->
  531 + <!-- </el-form-item>-->
  532 + </el-form>
  533 + <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  534 + <el-button type="primary" @click="submitForm">确 定</el-button>
  535 + <el-button @click="cancel">取 消</el-button>
  536 + </div>
  537 + <el-dialog title="高德地图" :visible.sync="openMap" width="1600px" height="750px" append-to-body>
  538 + <div class="serach_map">
  539 + 搜索:
  540 + <el-select
  541 + v-model="keywords"
  542 + filterable
  543 + remote
  544 + placeholder="请输入关键词"
  545 + :remote-method="remoteMethod"
  546 + :loading="loading"
  547 + :clearable="true"
  548 + size="mini"
  549 + @change="currentSelect"
  550 + style="width: 250px"
  551 + >
  552 + <el-option
  553 + v-for="item in mapOptions"
  554 + :key="item.id"
  555 + :label="item.name"
  556 + :value="item"
  557 + class="one-text"
  558 + >
  559 + <span style="float: left">{{ item.name }}</span>
  560 + <span style="float: right; color: #8492a6; font-size: 13px">{{
  561 + item.district
  562 + }}</span>
  563 + </el-option>
  564 + </el-select>
  565 + </div>
  566 + <div v-loading="loading" id="zcContainer" class="am-map" style="width:100%;height: 700px;"></div>
  567 + <div slot="footer" class="dialog-footer">
  568 + <el-button @click="clearPolyEditor">清 空</el-button>
  569 + <el-button @click="closeMap">取 消</el-button>
  570 + <el-button type="primary" @click="openMap = false">确 定</el-button>
  571 + </div>
  572 + </el-dialog>
  573 +
  574 + </div>
  575 +</template>
  576 +
  577 +<script>
  578 +import { listDisposalSite, getDisposalSite, delDisposalSite, addDisposalSite, updateDisposalSite, exportDisposalSite } from "@/api/unit/disposalSite";
  579 +import Treeselect from "@riophae/vue-treeselect";
  580 +import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  581 +import {getAreaList} from "@/api/casefile/remoteServer";
  582 +import AMapLoader from '@amap/amap-jsapi-loader';
  583 +
  584 +// 设置安全密钥
  585 +window._AMapSecurityConfig = {
  586 + securityJsCode: 'aa1db7d8f534f3da3f6d8a6a71382802',
  587 +}
  588 +export default {
  589 + name: "DisposalSite",
  590 + components: {Treeselect,AMapLoader},
  591 + data() {
  592 + return {
  593 + // 遮罩层
  594 + loading: true,
  595 + // 选中数组
  596 + ids: [],
  597 + // 非单个禁用
  598 + single: true,
  599 + // 非多个禁用
  600 + multiple: true,
  601 + // 显示搜索条件
  602 + showSearch: true,
  603 + // 总条数
  604 + total: 0,
  605 + // 处理场所管理表格数据
  606 + disposalSiteList: [],
  607 + // 弹出层标题
  608 + title: "",
  609 + // 是否显示弹出层
  610 + open: false,
  611 + // 表单参数
  612 + form: {},
  613 + // 表单校验
  614 + rules: {
  615 + name: [
  616 + { required: true, message: "请输入处置场所名称", trigger: "blur" },
  617 + ],
  618 + address: [
  619 + { required: true, message: "请输入处置场所地址", trigger: "blur" },
  620 + ],
  621 + localArea: [
  622 + { required: true, message: "请选择所属区域", trigger: "blur" },
  623 + ],
  624 + siteType: [
  625 + { required: true, message: "请选择处置场所类型", trigger: "blur" },
  626 + ],
  627 + operatingArea: [
  628 + { required: true, message: "请选择锁业区域", trigger: "blur" },
  629 + ],
  630 + trashType: [
  631 + { required: true, message: "请选择可受纳建筑垃圾类型", trigger: "blur" },
  632 + ],
  633 + constructionUnit: [
  634 + { required: true, message: "请输入建设(施工)单位", trigger: "blur" },
  635 + ],
  636 + constructionUnitPerson: [
  637 + { required: true, message: "请输入建设(施工)单位责任人", trigger: "blur" },
  638 + ],
  639 + constructionUnitPersonPhone: [
  640 + { required: true, message: "请输入责任人联系电话", trigger: "blur" },
  641 + {
  642 + pattern: /^1(3|4|5|7|8|9)\d{9}$/,
  643 + message: '手机号格式错误',
  644 + trigger: 'change'
  645 + }
  646 + ],
  647 + validityBeginDate: [
  648 + { required: true, message: "请选择有限期开始时间", trigger: "blur" },
  649 + ],
  650 + validityEndDate: [
  651 + { required: true, message: "请选择有限期结束时间", trigger: "blur" },
  652 + ],
  653 + electronicFence: [
  654 + { required: true, message: "请输入电子围栏", trigger: "blur" },
  655 + ],
  656 + squareMeasure: [
  657 + { required: true, message: "请输入审批方量", trigger: "blur" },
  658 + ],
  659 + carWashingFacilities: [
  660 + { required: true, message: "请选择洗车作业设施", trigger: "blur" },
  661 + ],
  662 + exitRoadCondition: [
  663 + { required: true, message: "请选择出口道路状况", trigger: "blur" },
  664 + ],
  665 + lightingFacility: [
  666 + { required: true, message: "请选择照明设施", trigger: "blur" },
  667 + ],
  668 + videoSurveillanceFacility: [
  669 + { required: true, message: "请选择视频监控设施", trigger: "blur" },
  670 + ],
  671 + preparer: [
  672 + { required: true, message: "请输入填表人", trigger: "blur" },
  673 + ],
  674 + handlingAdvice: [
  675 + { required: true, message: "请输入办理意见", trigger: "blur" },
  676 + ],
  677 +
  678 + },
  679 + areas:[],
  680 + options:[{id:1,label:"工程渣土"},{id:2,label:"工程淤泥"},{id:3,label:"盾构渣土"},{id:4,label:"拆除垃圾"},{id:5,label:"其他建筑垃圾"}],
  681 + approvalDocument:[],
  682 + approvalDocumentSlide:[],
  683 + approvalData:[],
  684 + approvalDataSlide:[],
  685 + scenePhoto:[],
  686 + scenePhotoSlide:[],
  687 + carWashingFacilitiesImage:[],
  688 + carWashingFacilitiesImageSlide:[],
  689 + safetyAssessmentReport:[],
  690 + safetyAssessmentReportSlide:[],
  691 + environmentalApproval:[],
  692 + environmentalApprovalSlide:[],
  693 + authorization:[],
  694 + authorizationSlide:[],
  695 + otherInformation:[],
  696 + otherInformationSlide:[],
  697 + openMap:false,
  698 + // 地图
  699 + map: null,
  700 + // 编辑工具
  701 + polyEditor: null,
  702 + // 电子围栏数据集
  703 + polygonArr: [],
  704 + // 当前电子围栏
  705 + nowPolygon: null,
  706 + keywords: "",
  707 + mapOptions: [],
  708 + AutoComplete: null,
  709 + searchMarker: null,
  710 + };
  711 + },
  712 + created() {
  713 + getAreaList().then(res => {
  714 + this.areas = res.data;
  715 + });
  716 + this.initData();
  717 + },
  718 + watch: {
  719 + '$route.query.disposalSiteId': 'initData'
  720 + },
  721 + methods: {
  722 + reset(){
  723 + this.form = {};
  724 + this.approvalDocument = [];
  725 + this.approvalData = [];
  726 + this.scenePhoto = [];
  727 + this.carWashingFacilitiesImage = [];
  728 + this.safetyAssessmentReport = [];
  729 + this.environmentalApproval = [];
  730 + this.authorization = [];
  731 + this.otherInformation = [];
  732 + },
  733 + initData(){
  734 + this.reset();
  735 + let id = this.$route.query.disposalSiteId;
  736 + if(id!=null){
  737 + getDisposalSite(id).then(response => {
  738 + this.form = response.data;
  739 + //将字符串转换为int数组
  740 + let trashTypeArr = this.form.trashType.split(",").map(str => parseInt(str, 10));
  741 + this.form.trashType = trashTypeArr;
  742 + //将附件转换为前端可视化数组
  743 + if(this.form.approvalDocument!=null&&this.form.approvalDocument!==""){
  744 + let approvalDocument = this.form.approvalDocument.split(";");
  745 + approvalDocument.map(item=>{
  746 + let name = item.substring(item.lastIndexOf("/")+1);
  747 + this.approvalDocument.push({name:name,url:item})
  748 + })
  749 + }
  750 + if(this.form.approvalData!=null&&this.form.approvalData!==""){
  751 + let approvalData = this.form.approvalData.split(";");
  752 + approvalData.map(item=>{
  753 + let name = item.substring(item.lastIndexOf("/")+1);
  754 + this.approvalData.push({name:name,url:item})
  755 + })
  756 + }
  757 + if(this.form.scenePhoto!=null&&this.form.scenePhoto!==""){
  758 + let scenePhoto = this.form.scenePhoto.split(";");
  759 + scenePhoto.map(item=>{
  760 + let name = item.substring(item.lastIndexOf("/")+1);
  761 + this.scenePhoto.push({name:name,url:item})
  762 + })
  763 + }
  764 + if(this.form.carWashingFacilitiesImage!=null&&this.form.carWashingFacilitiesImage!==""){
  765 + let carWashingFacilitiesImage = this.form.carWashingFacilitiesImage.split(";");
  766 + carWashingFacilitiesImage.map(item=>{
  767 + let name = item.substring(item.lastIndexOf("/")+1);
  768 + this.carWashingFacilitiesImage.push({name:name,url:item})
  769 + })
  770 + }
  771 + if(this.form.safetyAssessmentReport!=null&&this.form.safetyAssessmentReport!==""){
  772 + let safetyAssessmentReport = this.form.safetyAssessmentReport.split(";");
  773 + safetyAssessmentReport.map(item=>{
  774 + let name = item.substring(item.lastIndexOf("/")+1);
  775 + this.safetyAssessmentReport.push({name:name,url:item})
  776 + })
  777 + }
  778 + if(this.form.environmentalApproval!=null&&this.form.environmentalApproval!==""){
  779 + let environmentalApproval = this.form.environmentalApproval.split(";");
  780 + environmentalApproval.map(item=>{
  781 + let name = item.substring(item.lastIndexOf("/")+1);
  782 + this.environmentalApproval.push({name:name,url:item})
  783 + })
  784 + }
  785 + if(this.form.authorization!=null&&this.form.authorization!==""){
  786 + let authorization = this.form.authorization.split(";");
  787 + authorization.map(item=>{
  788 + let name = item.substring(item.lastIndexOf("/")+1);
  789 + this.authorization.push({name:name,url:item})
  790 + })
  791 + }
  792 + if(this.form.otherInformation!=null&&this.form.otherInformation!==""){
  793 + let otherInformation = this.form.otherInformation.split(";");
  794 + otherInformation.map(item=>{
  795 + let name = item.substring(item.lastIndexOf("/")+1);
  796 + this.otherInformation.push({name:name,url:item})
  797 + })
  798 + }
  799 + });
  800 + }
  801 + },
  802 + closeMap(){
  803 + this.openMap = false;
  804 + this.form.electronicFence = null;
  805 + //清空地图图层
  806 + this.map.remove(this.nowPolygon);
  807 + },
  808 + // 选中提示
  809 + currentSelect(val) {
  810 + // 清空时不执行后面代码
  811 + if (!val) {
  812 + return ;
  813 + }
  814 + // 自动适应显示想显示的范围区域
  815 + this.map.setFitView();
  816 + //清除marker
  817 + if (this.searchMarker){
  818 + this.map.remove(this.searchMarker)
  819 + }
  820 + //设置marker
  821 + this.searchMarker = new AMap.Marker({
  822 + map: this.map,
  823 + position: [val.location.lng, val.location.lat],
  824 + });
  825 +
  826 + this.keywords = val.name
  827 + //定位
  828 + this.map.setCenter([val.location.lng, val.location.lat])
  829 + },
  830 + // 搜索地址
  831 + remoteMethod(query) {
  832 + if (query !== "") {
  833 + this.loading = true;
  834 + setTimeout(() => {
  835 + this.loading = false;
  836 + this.AutoComplete.search(query, (status, result) => {
  837 + this.mapOptions = result.tips;
  838 + });
  839 + }, 200);
  840 + } else {
  841 + this.mapOptions = [];
  842 + }
  843 + },
  844 + initAMap() {
  845 + const _this = this
  846 + // 加载高德地图
  847 + AMapLoader.load({
  848 + key: _this.$aMapKey, //设置高德地图申请的key
  849 + version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
  850 + plugins: ['AMap.ToolBar', 'AMap.PolygonEditor','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Marker'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
  851 + AMapUI: {
  852 + version: "1.1",
  853 + plugins: []
  854 + },
  855 + Loca: {
  856 + version: "2.0"
  857 + },
  858 + }).then(async (AMap) => {
  859 + _this.map = await new AMap.Map("zcContainer", { //设置地图容器id
  860 + viewMode: "2D", // 默认使用 2D 模式
  861 + center: [113.01814545605467, 28.201039299894283], // 初始化地图中心点位置
  862 + zoom: 11, //初始化地图层级
  863 + resizeEnable: true,
  864 + willreadoften: true
  865 + });
  866 +
  867 + _this.AutoComplete = await new AMap.AutoComplete({city:'全国'});
  868 +
  869 + // 图层样式切换控件(卫星图)
  870 + AMapUI.loadUI(['control/BasicControl'], function(BasicControl) {
  871 +
  872 + //图层切换控件
  873 + _this.map.addControl(new BasicControl.LayerSwitcher({
  874 + position: 'rb' // 右下角
  875 + }));
  876 +
  877 + });
  878 + _this.polyEditor = new AMap.PolygonEditor(_this.map);
  879 + if(_this.form.electronicFence!=null){
  880 + // 电子围栏经纬度
  881 + let path = _this.form.electronicFence.split(";");
  882 + path.map(item=>{
  883 + let arr = item.split(",");
  884 + //将电子围栏经纬度转换为double类型数组
  885 + _this.polygonArr.push([parseFloat(arr[0]),parseFloat(arr[1])]);
  886 + });
  887 + _this.nowPolygon = new AMap.Polygon({
  888 + path: _this.polygonArr
  889 + })
  890 + _this.map.add([_this.nowPolygon]);
  891 + _this.map.setFitView();
  892 + _this.polyEditor.addAdsorbPolygons([_this.nowPolygon]);
  893 + _this.nowPolygon.on('dblclick', () => {
  894 + _this.polyEditor.setTarget(_this.nowPolygon);
  895 + _this.polyEditor.open();
  896 + })
  897 + }
  898 + _this.polyEditor.on('add', function (data) {
  899 + _this.nowPolygon = data.target;
  900 + _this.polyEditor.addAdsorbPolygons(_this.nowPolygon);
  901 + _this.nowPolygon.on('dblclick', () => {
  902 + _this.polyEditor.setTarget(_this.nowPolygon);
  903 + _this.polyEditor.open();
  904 + })
  905 +
  906 + // 加个右击监听 双击图层进行编辑
  907 + _this.map.on("rightclick",function (e){
  908 + if (_this.polyEditor) {
  909 + const arr = _this.nowPolygon.getPath()
  910 + let pathArr = []
  911 + // 将获取的停车场坐标点转换格式后存入数组
  912 + for (let item of arr) {
  913 + const list = [item.lng, item.lat]
  914 + pathArr.push(list)
  915 + }
  916 +
  917 + var maxDistance = 0; // 最大距离
  918 + var maxPointIndex = []; // 记录最大距离对应的点索引
  919 +
  920 + // 计算所有点对之间的距离
  921 + for (var i = 0; i < pathArr.length; i++) {
  922 + for (var j = i + 1; j < pathArr.length; j++) {
  923 + var distance = AMap.GeometryUtil.distance(pathArr[i], pathArr[j]);
  924 + if (distance > maxDistance) {
  925 + maxDistance = distance;
  926 + maxPointIndex = [i, j];
  927 + }
  928 + }
  929 + }
  930 +
  931 + if(_this.nowPolygon!=null){
  932 + // 通过最大距离的点索引获取对应的点坐标
  933 + let mybounds = new AMap.Bounds(pathArr[maxPointIndex[0]],pathArr[maxPointIndex[1]]);
  934 + // 设置地图显示范围
  935 + _this.map.setBounds(mybounds);
  936 + }
  937 + //将经纬度存到form中
  938 + _this.form.electronicFence = pathArr.join(";");
  939 + _this.polyEditor.close();
  940 + }
  941 + });
  942 + })
  943 +
  944 + if(_this.nowPolygon===null){
  945 + _this.polyEditor.close();
  946 + _this.polyEditor.setTarget();
  947 + _this.polyEditor.open();
  948 + }
  949 +
  950 +
  951 + }).catch(e => {
  952 + console.log(e);
  953 + });
  954 + this.loading = false;
  955 + // this.openMap = false;
  956 + },
  957 + clearPolyEditor(){
  958 + this.form.electronicFence = null;
  959 + this.map.remove(this.nowPolygon);
  960 + // 关闭一下编辑器,防止出bug
  961 + this.polyEditor.close();
  962 + // 置空编辑区即为新增
  963 + this.polyEditor.setTarget();
  964 + // 打开编辑器即可开始绘制
  965 + this.polyEditor.open();
  966 + },
  967 + draw(){
  968 + if(this.polyEditor!=null){
  969 + if(this.form.electronicFence==null){
  970 + // 关闭一下编辑器,防止出bug
  971 + this.polyEditor.close();
  972 + // 置空编辑区即为新增
  973 + this.polyEditor.setTarget();
  974 + // 打开编辑器即可开始绘制
  975 + this.polyEditor.open();
  976 + }
  977 + }else{
  978 + this.initAMap();
  979 + }
  980 + this.openMap = true;
  981 + this.$alert('左键单击地图添加点,左键双击编辑,右键双击地图结束绘制', '温馨提示', {
  982 + confirmButtonText: '确定',
  983 + callback: action => {
  984 + let path = this.form.electronicFence.split(";");
  985 + path.map(item=>{
  986 + let arr = item.split(",");
  987 + this.polygonArr.push([arr[0],arr[1]]);
  988 + });
  989 + }
  990 + });
  991 + },
  992 + createUrl(file){
  993 + if(file.raw!=null){
  994 + return URL.createObjectURL(file.raw);
  995 + }else{
  996 + return process.env.VUE_APP_BASE_API + file.url;
  997 + }
  998 +
  999 + },
  1000 + tempDownload(row){
  1001 + let name = row.name;
  1002 + let url = "";
  1003 + if(row.raw!=null){
  1004 + url = URL.createObjectURL(row.raw);
  1005 + }else{
  1006 + url = process.env.VUE_APP_BASE_API + row.url;
  1007 + }
  1008 + console.log(url)
  1009 + const a = document.createElement('a')
  1010 + a.setAttribute('download', name)
  1011 + a.setAttribute('target', '_blank')
  1012 + a.setAttribute('href', url);
  1013 + a.click()
  1014 + },
  1015 + // 取消按钮
  1016 + cancel() {
  1017 + this.$tab.closePage({path:"/disposalSite/info"}).then(() => {
  1018 + this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
  1019 + })
  1020 + },
  1021 + /** 提交按钮 */
  1022 + submitForm() {
  1023 + this.$refs["form"].validate(valid => {
  1024 + if (valid) {
  1025 + let formData = new FormData();
  1026 + let form = this.form;
  1027 + //去掉params属性
  1028 + delete form.params;
  1029 + // formData.append('approvalDocument', null);
  1030 + // formData.append('approvalData', null);
  1031 + // formData.append('scenePhoto', null);
  1032 + // formData.append('carWashingFacilitiesImage', null);
  1033 + // formData.append('authorization', null);
  1034 + // formData.append('safetyAssessmentReport', null);
  1035 + // formData.append('environmentalApproval', null);
  1036 + // formData.append('otherInformation', null);
  1037 + //将新增的文件放入formData
  1038 +
  1039 + //先清空原有的附件
  1040 + form.approvalDocument = null;
  1041 + form.approvalData = null;
  1042 + form.scenePhoto = null;
  1043 + form.carWashingFacilitiesImage = null;
  1044 + form.authorization = null;
  1045 + form.safetyAssessmentReport = null;
  1046 + form.environmentalApproval = null;
  1047 + form.otherInformation = null;
  1048 + form.trashType = this.form.trashType.join(",");
  1049 +
  1050 + this.approvalDocument.forEach(item => {
  1051 + if (item.raw != null) {
  1052 + formData.append('approvalDocumentFiles', item.raw)
  1053 + }else{
  1054 + //将原有的附件拼接到form中
  1055 + form.approvalDocument = form.approvalDocument!==null?form.approvalDocument+";"+item.url:item.url;
  1056 + }
  1057 + })
  1058 +
  1059 + this.approvalData.forEach(item => {
  1060 + if (item.raw != null) {
  1061 + formData.append('approvalDataFiles', item.raw)
  1062 + }else{
  1063 + //将原有的附件拼接到form中
  1064 + form.approvalData = form.approvalData!==null?form.approvalData+";"+item.url:item.url;
  1065 + }
  1066 + })
  1067 + this.scenePhoto.forEach(item => {
  1068 + if (item.raw != null) {
  1069 + formData.append('scenePhotoFiles', item.raw)
  1070 + }else{
  1071 + //将原有的附件拼接到form中
  1072 + form.scenePhoto = form.scenePhoto!==null?form.scenePhoto+";"+item.url:item.url;
  1073 + }
  1074 + })
  1075 + this.carWashingFacilitiesImage.forEach(item => {
  1076 + if (item.raw != null) {
  1077 + formData.append('carWashingFacilitiesImageFiles', item.raw)
  1078 + }else{
  1079 + //将原有的附件拼接到form中
  1080 + form.carWashingFacilitiesImage = form.carWashingFacilitiesImage!==null?form.carWashingFacilitiesImage+";"+item.url:item.url;
  1081 + }
  1082 + })
  1083 + this.safetyAssessmentReport.forEach(item => {
  1084 + if (item.raw != null) {
  1085 + formData.append('safetyAssessmentReportFiles', item.raw)
  1086 + }else{
  1087 + //将原有的附件拼接到form中
  1088 + form.safetyAssessmentReport = form.safetyAssessmentReport!==null?form.safetyAssessmentReport+";"+item.url:item.url;
  1089 + }
  1090 + })
  1091 + this.environmentalApproval.forEach(item => {
  1092 + if (item.raw != null) {
  1093 + formData.append('environmentalApprovalFiles', item.raw)
  1094 + }else{
  1095 + //将原有的附件拼接到form中
  1096 + form.environmentalApproval = form.environmentalApproval!==null?form.environmentalApproval+";"+item.url:item.url;
  1097 + }
  1098 + })
  1099 + this.authorization.forEach(item => {
  1100 + if (item.raw != null) {
  1101 + formData.append('authorizationFiles', item.raw)
  1102 + }else{
  1103 + //将原有的附件拼接到form中
  1104 + form.authorization = form.authorization!==null?form.authorization+";"+item.url:item.url;
  1105 + }
  1106 + })
  1107 + this.otherInformation.forEach(item => {
  1108 + if (item.raw != null) {
  1109 + formData.append('otherInformationFiles', item.raw)
  1110 + }else{
  1111 + //将原有的附件拼接到form中
  1112 + form.otherInformation = form.otherInformation!==null?form.otherInformation+";"+item.url:item.url;
  1113 + }
  1114 + })
  1115 + for (let key in form) {
  1116 + formData.append(key, form[key] == null ? "" : form[key])
  1117 + }
  1118 + if (this.form.id != null) {
  1119 + updateDisposalSite(formData).then(response => {
  1120 + this.msgSuccess("修改成功");
  1121 + this.$tab.closePage({path:"/disposalSite/infoEdit"}).then(() => {
  1122 + this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
  1123 + })
  1124 + });
  1125 + } else {
  1126 + addDisposalSite(formData).then(response => {
  1127 + this.msgSuccess("新增成功");
  1128 + this.$tab.closePage({path:"/disposalSite/info"}).then(() => {
  1129 + this.$tab.openPage("处理场所管理", "/tool/disposalSite",{disposalSiteRefresh:1})
  1130 + })
  1131 + });
  1132 + }
  1133 + }
  1134 + });
  1135 + },
  1136 + /**
  1137 + * 文件改变时,限制文件上传格式和大小
  1138 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  1139 + * 大小不超过20M
  1140 + * */
  1141 + fileChange(file, fileList) {
  1142 + let count = 0;
  1143 + for (let i = 0; i < fileList.length; i++) {
  1144 + // console.log(fileList.length)
  1145 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1146 + if (fileList[i].name == file.name) {
  1147 + count++;
  1148 + if (count == 2) {
  1149 + this.$message({
  1150 + message: '已存在此文件!',
  1151 + type: 'warning'
  1152 + });
  1153 + for (let j = fileList.length; j > 0; j--) {
  1154 + //如果存在此文件,去除新选择的重复文件
  1155 + if (fileList[j - 1].name == file.name) {
  1156 + fileList.splice(j - 1, 1);
  1157 + i--;
  1158 + return false;
  1159 + }
  1160 + }
  1161 + }
  1162 + }
  1163 + }
  1164 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1165 + //格式符合后判断大小
  1166 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1167 + let max5M = file.size / 1024 / 1024 < 100;
  1168 + if (!max5M) {
  1169 + this.$message({
  1170 + message: '上传文件大小不得超过100M!',
  1171 + type: 'warning'
  1172 + });
  1173 + fileList = fileList.splice(fileList.length - 1, 1);
  1174 + } else {
  1175 + //符合条件后进行添加
  1176 + this.approvalDocument = fileList
  1177 + }
  1178 + } else {
  1179 + this.$message({
  1180 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1181 + type: 'warning'
  1182 + });
  1183 + fileList = fileList.splice(fileList.length - 1, 1);
  1184 + }
  1185 + },
  1186 + fileChange1(file, fileList) {
  1187 + let count = 0;
  1188 + for (let i = 0; i < fileList.length; i++) {
  1189 + // console.log(fileList.length)
  1190 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1191 + if (fileList[i].name == file.name) {
  1192 + count++;
  1193 + if (count == 2) {
  1194 + this.$message({
  1195 + message: '已存在此文件!',
  1196 + type: 'warning'
  1197 + });
  1198 + for (let j = fileList.length; j > 0; j--) {
  1199 + //如果存在此文件,去除新选择的重复文件
  1200 + if (fileList[j - 1].name == file.name) {
  1201 + fileList.splice(j - 1, 1);
  1202 + i--;
  1203 + return false;
  1204 + }
  1205 + }
  1206 + }
  1207 + }
  1208 + }
  1209 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1210 + //格式符合后判断大小
  1211 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1212 + let max5M = file.size / 1024 / 1024 < 100;
  1213 + if (!max5M) {
  1214 + this.$message({
  1215 + message: '上传文件大小不得超过100M!',
  1216 + type: 'warning'
  1217 + });
  1218 + fileList = fileList.splice(fileList.length - 1, 1);
  1219 + } else {
  1220 + //符合条件后进行添加
  1221 + this.approvalData = fileList
  1222 + }
  1223 + } else {
  1224 + this.$message({
  1225 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1226 + type: 'warning'
  1227 + });
  1228 + fileList = fileList.splice(fileList.length - 1, 1);
  1229 + }
  1230 + },
  1231 + fileChange2(file, fileList) {
  1232 + let count = 0;
  1233 + for (let i = 0; i < fileList.length; i++) {
  1234 + // console.log(fileList.length)
  1235 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1236 + if (fileList[i].name == file.name) {
  1237 + count++;
  1238 + if (count == 2) {
  1239 + this.$message({
  1240 + message: '已存在此文件!',
  1241 + type: 'warning'
  1242 + });
  1243 + for (let j = fileList.length; j > 0; j--) {
  1244 + //如果存在此文件,去除新选择的重复文件
  1245 + if (fileList[j - 1].name == file.name) {
  1246 + fileList.splice(j - 1, 1);
  1247 + i--;
  1248 + return false;
  1249 + }
  1250 + }
  1251 + }
  1252 + }
  1253 + }
  1254 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1255 + //格式符合后判断大小
  1256 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1257 + let max5M = file.size / 1024 / 1024 < 100;
  1258 + if (!max5M) {
  1259 + this.$message({
  1260 + message: '上传文件大小不得超过100M!',
  1261 + type: 'warning'
  1262 + });
  1263 + fileList = fileList.splice(fileList.length - 1, 1);
  1264 + } else {
  1265 + //符合条件后进行添加
  1266 + this.scenePhoto = fileList
  1267 + }
  1268 + } else {
  1269 + this.$message({
  1270 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1271 + type: 'warning'
  1272 + });
  1273 + fileList = fileList.splice(fileList.length - 1, 1);
  1274 + }
  1275 + },
  1276 + fileChange3(file, fileList) {
  1277 + let count = 0;
  1278 + for (let i = 0; i < fileList.length; i++) {
  1279 + // console.log(fileList.length)
  1280 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1281 + if (fileList[i].name == file.name) {
  1282 + count++;
  1283 + if (count == 2) {
  1284 + this.$message({
  1285 + message: '已存在此文件!',
  1286 + type: 'warning'
  1287 + });
  1288 + for (let j = fileList.length; j > 0; j--) {
  1289 + //如果存在此文件,去除新选择的重复文件
  1290 + if (fileList[j - 1].name == file.name) {
  1291 + fileList.splice(j - 1, 1);
  1292 + i--;
  1293 + return false;
  1294 + }
  1295 + }
  1296 + }
  1297 + }
  1298 + }
  1299 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1300 + //格式符合后判断大小
  1301 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1302 + let max5M = file.size / 1024 / 1024 < 100;
  1303 + if (!max5M) {
  1304 + this.$message({
  1305 + message: '上传文件大小不得超过100M!',
  1306 + type: 'warning'
  1307 + });
  1308 + fileList = fileList.splice(fileList.length - 1, 1);
  1309 + } else {
  1310 + //符合条件后进行添加
  1311 + this.carWashingFacilitiesImage = fileList
  1312 + }
  1313 + } else {
  1314 + this.$message({
  1315 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1316 + type: 'warning'
  1317 + });
  1318 + fileList = fileList.splice(fileList.length - 1, 1);
  1319 + }
  1320 + },
  1321 + fileChange4(file, fileList) {
  1322 + let count = 0;
  1323 + for (let i = 0; i < fileList.length; i++) {
  1324 + // console.log(fileList.length)
  1325 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1326 + if (fileList[i].name == file.name) {
  1327 + count++;
  1328 + if (count == 2) {
  1329 + this.$message({
  1330 + message: '已存在此文件!',
  1331 + type: 'warning'
  1332 + });
  1333 + for (let j = fileList.length; j > 0; j--) {
  1334 + //如果存在此文件,去除新选择的重复文件
  1335 + if (fileList[j - 1].name == file.name) {
  1336 + fileList.splice(j - 1, 1);
  1337 + i--;
  1338 + return false;
  1339 + }
  1340 + }
  1341 + }
  1342 + }
  1343 + }
  1344 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1345 + //格式符合后判断大小
  1346 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1347 + let max5M = file.size / 1024 / 1024 < 100;
  1348 + if (!max5M) {
  1349 + this.$message({
  1350 + message: '上传文件大小不得超过100M!',
  1351 + type: 'warning'
  1352 + });
  1353 + fileList = fileList.splice(fileList.length - 1, 1);
  1354 + } else {
  1355 + //符合条件后进行添加
  1356 + this.safetyAssessmentReport = fileList
  1357 + }
  1358 + } else {
  1359 + this.$message({
  1360 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1361 + type: 'warning'
  1362 + });
  1363 + fileList = fileList.splice(fileList.length - 1, 1);
  1364 + }
  1365 + },
  1366 + fileChange5(file, fileList) {
  1367 + let count = 0;
  1368 + for (let i = 0; i < fileList.length; i++) {
  1369 + // console.log(fileList.length)
  1370 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1371 + if (fileList[i].name == file.name) {
  1372 + count++;
  1373 + if (count == 2) {
  1374 + this.$message({
  1375 + message: '已存在此文件!',
  1376 + type: 'warning'
  1377 + });
  1378 + for (let j = fileList.length; j > 0; j--) {
  1379 + //如果存在此文件,去除新选择的重复文件
  1380 + if (fileList[j - 1].name == file.name) {
  1381 + fileList.splice(j - 1, 1);
  1382 + i--;
  1383 + return false;
  1384 + }
  1385 + }
  1386 + }
  1387 + }
  1388 + }
  1389 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1390 + //格式符合后判断大小
  1391 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1392 + let max5M = file.size / 1024 / 1024 < 100;
  1393 + if (!max5M) {
  1394 + this.$message({
  1395 + message: '上传文件大小不得超过100M!',
  1396 + type: 'warning'
  1397 + });
  1398 + fileList = fileList.splice(fileList.length - 1, 1);
  1399 + } else {
  1400 + //符合条件后进行添加
  1401 + this.environmentalApproval = fileList
  1402 + }
  1403 + } else {
  1404 + this.$message({
  1405 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1406 + type: 'warning'
  1407 + });
  1408 + fileList = fileList.splice(fileList.length - 1, 1);
  1409 + }
  1410 + },
  1411 + fileChange6(file, fileList) {
  1412 + let count = 0;
  1413 + for (let i = 0; i < fileList.length; i++) {
  1414 + // console.log(fileList.length)
  1415 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1416 + if (fileList[i].name == file.name) {
  1417 + count++;
  1418 + if (count == 2) {
  1419 + this.$message({
  1420 + message: '已存在此文件!',
  1421 + type: 'warning'
  1422 + });
  1423 + for (let j = fileList.length; j > 0; j--) {
  1424 + //如果存在此文件,去除新选择的重复文件
  1425 + if (fileList[j - 1].name == file.name) {
  1426 + fileList.splice(j - 1, 1);
  1427 + i--;
  1428 + return false;
  1429 + }
  1430 + }
  1431 + }
  1432 + }
  1433 + }
  1434 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1435 + //格式符合后判断大小
  1436 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1437 + let max5M = file.size / 1024 / 1024 < 100;
  1438 + if (!max5M) {
  1439 + this.$message({
  1440 + message: '上传文件大小不得超过100M!',
  1441 + type: 'warning'
  1442 + });
  1443 + fileList = fileList.splice(fileList.length - 1, 1);
  1444 + } else {
  1445 + //符合条件后进行添加
  1446 + this.authorization = fileList
  1447 + }
  1448 + } else {
  1449 + this.$message({
  1450 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1451 + type: 'warning'
  1452 + });
  1453 + fileList = fileList.splice(fileList.length - 1, 1);
  1454 + }
  1455 + },
  1456 + fileChange7(file, fileList) {
  1457 + let count = 0;
  1458 + for (let i = 0; i < fileList.length; i++) {
  1459 + // console.log(fileList.length)
  1460 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  1461 + if (fileList[i].name == file.name) {
  1462 + count++;
  1463 + if (count == 2) {
  1464 + this.$message({
  1465 + message: '已存在此文件!',
  1466 + type: 'warning'
  1467 + });
  1468 + for (let j = fileList.length; j > 0; j--) {
  1469 + //如果存在此文件,去除新选择的重复文件
  1470 + if (fileList[j - 1].name == file.name) {
  1471 + fileList.splice(j - 1, 1);
  1472 + i--;
  1473 + return false;
  1474 + }
  1475 + }
  1476 + }
  1477 + }
  1478 + }
  1479 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  1480 + //格式符合后判断大小
  1481 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  1482 + let max5M = file.size / 1024 / 1024 < 100;
  1483 + if (!max5M) {
  1484 + this.$message({
  1485 + message: '上传文件大小不得超过100M!',
  1486 + type: 'warning'
  1487 + });
  1488 + fileList = fileList.splice(fileList.length - 1, 1);
  1489 + } else {
  1490 + //符合条件后进行添加
  1491 + this.otherInformation = fileList
  1492 + }
  1493 + } else {
  1494 + this.$message({
  1495 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  1496 + type: 'warning'
  1497 + });
  1498 + fileList = fileList.splice(fileList.length - 1, 1);
  1499 + }
  1500 + },
  1501 + }
  1502 +};
  1503 +</script>
  1504 +<style lang="scss" scoped>
  1505 +.upload_lable{
  1506 + border-right: 1px solid #dcdfe6;
  1507 + padding: 27px 30px;
  1508 + background: #fafafa;
  1509 + text-align: center;
  1510 +}
  1511 +.upload_btn{
  1512 + max-height: 106px;
  1513 +}
  1514 +.upload_close{
  1515 + position: absolute;
  1516 + left: 105px;
  1517 + z-index:99;
  1518 + top:-1px;
  1519 + font-size:18px;
  1520 + color:red;
  1521 +}
  1522 +.upload_close_file{
  1523 + position: absolute;
  1524 + left: 80px;
  1525 + z-index:99;
  1526 + top:-1px;
  1527 + font-size:18px;
  1528 + color:red;
  1529 +}
  1530 +.upload_div_image{
  1531 + display: inline-block;
  1532 + width: 110px;
  1533 + height: 95px;
  1534 + position: relative;
  1535 + float: left;
  1536 + margin-left: 5px;
  1537 +}
  1538 +.upload_div_file{
  1539 + display: inline-block;
  1540 + width: 110px;
  1541 + height: 95px;
  1542 + text-align: center;
  1543 + float:left;
  1544 + margin: 5px;
  1545 + position: relative;
  1546 +}
  1547 +.serach_map{
  1548 + position: absolute;
  1549 + top: 100px;
  1550 + left: 25px;
  1551 + z-index: 999;
  1552 + background: #fff;
  1553 + padding: 10px;
  1554 + border-radius: 5px;
  1555 + box-shadow: 0 0 10px rgba(0,0,0,.2);
  1556 +}
  1557 +</style>
trash-ui/src/views/unit/driver/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="108px">
  4 + <el-form-item label="驾驶员名称" prop="name">
  5 + <el-input
  6 + v-model="queryParams.name"
  7 + placeholder="请输入驾驶员名称"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item label="所属公司" prop="companyName">
  14 + <el-input
  15 + v-model="queryParams.companyName"
  16 + placeholder="请输入所属公司"
  17 + clearable
  18 + size="small"
  19 + @keyup.enter.native="handleQuery"
  20 + />
  21 + </el-form-item>
  22 +
  23 + <el-form-item label="审批状态" prop="status">
  24 + <el-select v-model="queryParams.status" placeholder="请选择审批状态" clearable size="small">
  25 + <el-option label="审批中" value="0" />
  26 + <el-option label="审批通过" value="1" />
  27 + <el-option label="被驳回" value="2" />
  28 + </el-select>
  29 + </el-form-item>
  30 + <el-form-item>
  31 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  32 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  33 + </el-form-item>
  34 + </el-form>
  35 +
  36 + <el-row :gutter="10" class="mb8">
  37 + <el-col :span="1.5">
  38 + <el-button
  39 + type="primary"
  40 + icon="el-icon-plus"
  41 + size="mini"
  42 + @click="handleAdd"
  43 + v-hasPermi="['unit:driver:add']"
  44 + >新增</el-button>
  45 + </el-col>
  46 + <el-col :span="1.5">
  47 + <el-button
  48 + type="success"
  49 + icon="el-icon-edit"
  50 + size="mini"
  51 + :disabled="single"
  52 + @click="handleUpdate"
  53 + v-hasPermi="['unit:driver:edit']"
  54 + >修改</el-button>
  55 + </el-col>
  56 + <el-col :span="1.5">
  57 + <el-button
  58 + type="danger"
  59 + icon="el-icon-delete"
  60 + size="mini"
  61 + :disabled="multiple"
  62 + @click="handleDelete"
  63 + v-hasPermi="['unit:driver:remove']"
  64 + >删除</el-button>
  65 + </el-col>
  66 + <el-col :span="1.5">
  67 + <el-button
  68 + type="warning"
  69 + icon="el-icon-download"
  70 + size="mini"
  71 + @click="handleExport"
  72 + v-hasPermi="['unit:driver:export']"
  73 + >导出</el-button>
  74 + </el-col>
  75 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  76 + </el-row>
  77 +
  78 + <el-table v-loading="loading" :data="driverList" @selection-change="handleSelectionChange">
  79 + <el-table-column type="selection" width="55" align="center" />
  80 + <el-table-column type="index" width="55" align="center" label="序号"/>
  81 + <el-table-column label="姓名" align="center" prop="name" />
  82 + <el-table-column label="身份证" align="center" prop="identityCard" />
  83 + <el-table-column label="所属公司" align="center" prop="companyName" />
  84 + <el-table-column label="从业资格证有效期" align="center" prop="professionalQualificationBeginDate" width="200">
  85 + <template slot-scope="scope">
  86 + <span>{{ parseTime(scope.row.professionalQualificationBeginDate, '{y}-{m}-{d}') +' ~ '+ parseTime(scope.row.professionalQualificationEndDate, '{y}-{m}-{d}') }}</span>
  87 + </template>
  88 + </el-table-column>
  89 +<!-- <el-table-column label="从业资格证有效期终" align="center" prop="professionalQualificationEndDate" width="180">-->
  90 +<!-- <template slot-scope="scope">-->
  91 +<!-- <span>{{ parseTime(scope.row.professionalQualificationEndDate, '{y}-{m}-{d}') }}</span>-->
  92 +<!-- </template>-->
  93 +<!-- </el-table-column>-->
  94 + <el-table-column label="驾驶证有效期" align="center" prop="drivingLicenceBeginDate" width="200">
  95 + <template slot-scope="scope">
  96 + <span>{{ parseTime(scope.row.drivingLicenceBeginDate, '{y}-{m}-{d}')+' ~ '+parseTime(scope.row.drivingLicenceEndDate, '{y}-{m}-{d}') }}</span>
  97 + </template>
  98 + </el-table-column>
  99 +<!-- <el-table-column label="驾驶证有效期终" align="center" prop="drivingLicenceEndDate" width="180">-->
  100 +<!-- <template slot-scope="scope">-->
  101 +<!-- <span>{{ parseTime(scope.row.drivingLicenceEndDate, '{y}-{m}-{d}') }}</span>-->
  102 +<!-- </template>-->
  103 +<!-- </el-table-column>-->
  104 + <el-table-column label="审批状态" align="center" prop="status" >
  105 + <template slot-scope="scope">
  106 + {{ parseStatus(scope.row.status)}}
  107 + </template>
  108 + </el-table-column>
  109 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  110 + <template slot-scope="scope">
  111 + <el-button
  112 + size="mini"
  113 + type="text"
  114 + icon="el-icon-edit"
  115 + @click="handleUpdate(scope.row)"
  116 + v-hasPermi="['unit:driver:edit']"
  117 + >修改</el-button>
  118 + <el-button
  119 + size="mini"
  120 + type="text"
  121 + icon="el-icon-delete"
  122 + @click="handleDelete(scope.row)"
  123 + v-hasPermi="['unit:driver:remove']"
  124 + >删除</el-button>
  125 + </template>
  126 + </el-table-column>
  127 + </el-table>
  128 +
  129 + <pagination
  130 + v-show="total>0"
  131 + :total="total"
  132 + :page.sync="queryParams.pageNum"
  133 + :limit.sync="queryParams.pageSize"
  134 + @pagination="getList"
  135 + />
  136 + </div>
  137 +</template>
  138 +
  139 +<script>
  140 +import { listDriver, getDriver, delDriver, addDriver, updateDriver, exportDriver } from "@/api/unit/driver";
  141 +import Editor from '@/components/Editor';
  142 +
  143 +export default {
  144 + name: "Driver",
  145 + components: { Editor },
  146 + data() {
  147 + return {
  148 + // 遮罩层
  149 + loading: true,
  150 + // 选中数组
  151 + ids: [],
  152 + // 非单个禁用
  153 + single: true,
  154 + // 非多个禁用
  155 + multiple: true,
  156 + // 显示搜索条件
  157 + showSearch: true,
  158 + // 总条数
  159 + total: 0,
  160 + // 驾驶员管理表格数据
  161 + driverList: [],
  162 + // 弹出层标题
  163 + title: "",
  164 + // 是否显示弹出层
  165 + open: false,
  166 + // 查询参数
  167 + queryParams: {
  168 + pageNum: 1,
  169 + pageSize: 10,
  170 + name: null,
  171 + identityCard: null,
  172 + companyId: null,
  173 + professionalQualificationBeginDate: null,
  174 + professionalQualificationEndDate: null,
  175 + drivingLicenceBeginDate: null,
  176 + drivingLicenceEndDate: null,
  177 + safetyTrainingDate: null,
  178 + safetyTrainingContent: null,
  179 + drivingLicence: null,
  180 + professionalQualification: null,
  181 + safetyTraining: null,
  182 + status: null,
  183 + photographOne: null,
  184 + photographTwo: null
  185 + },
  186 + // 表单参数
  187 + form: {},
  188 + // 表单校验
  189 + rules: {
  190 + }
  191 + };
  192 + },
  193 + created() {
  194 + this.getList();
  195 + },
  196 + methods: {
  197 + /** 查询驾驶员管理列表 */
  198 + getList() {
  199 + this.loading = true;
  200 + listDriver(this.queryParams).then(response => {
  201 + this.driverList = response.rows;
  202 + this.total = response.total;
  203 + this.loading = false;
  204 + });
  205 + },
  206 +
  207 + /** 搜索按钮操作 */
  208 + handleQuery() {
  209 + this.queryParams.pageNum = 1;
  210 + this.getList();
  211 + },
  212 + /** 重置按钮操作 */
  213 + resetQuery() {
  214 + this.resetForm("queryForm");
  215 + this.handleQuery();
  216 + },
  217 + // 多选框选中数据
  218 + handleSelectionChange(selection) {
  219 + this.ids = selection.map(item => item.id)
  220 + this.single = selection.length!==1
  221 + this.multiple = !selection.length
  222 + },
  223 + /** 新增按钮操作 */
  224 + handleAdd() {
  225 + this.$tab.openPage("新增驾驶员","/driverInfo/info",{driverInfoRefresh:0});
  226 + },
  227 + /** 修改按钮操作 */
  228 + handleUpdate(row) {
  229 + const id = row.id || this.ids
  230 + this.$tab.openPage("修改驾驶员","/driverInfo/infoEdit",{driverInfoId: id,driverInfoRefresh:0});
  231 + },
  232 + /** 删除按钮操作 */
  233 + handleDelete(row) {
  234 + const ids = row.id || this.ids;
  235 + this.$confirm('是否确认删除驾驶员管理编号为"' + ids + '"的数据项?', "警告", {
  236 + confirmButtonText: "确定",
  237 + cancelButtonText: "取消",
  238 + type: "warning"
  239 + }).then(function() {
  240 + return delDriver(ids);
  241 + }).then(() => {
  242 + this.getList();
  243 + this.msgSuccess("删除成功");
  244 + })
  245 + },
  246 + /** 导出按钮操作 */
  247 + handleExport() {
  248 + const queryParams = this.queryParams;
  249 + this.$confirm('是否确认导出所有驾驶员管理数据项?', "警告", {
  250 + confirmButtonText: "确定",
  251 + cancelButtonText: "取消",
  252 + type: "warning"
  253 + }).then(function() {
  254 + return exportDriver(queryParams);
  255 + }).then(response => {
  256 + this.download(response.msg);
  257 + })
  258 + }
  259 + }
  260 +};
  261 +</script>
trash-ui/src/views/unit/driver/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 + <!-- 添加或修改处理场所管理对话框 -->
  5 + <h3>
  6 + 基础信息
  7 + </h3>
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top">
  9 + <el-row :gutter="30">
  10 + <el-col :span="7">
  11 + <el-form-item label="姓名" prop="name">
  12 + <el-input v-model="form.name" placeholder="请输入姓名" />
  13 + </el-form-item>
  14 + </el-col>
  15 + <el-col :span="7">
  16 + <el-form-item label="身份证号码" prop="identityCard">
  17 + <el-input v-model="form.identityCard" placeholder="请输入身份证" />
  18 + </el-form-item>
  19 + </el-col>
  20 + <el-col :span="7">
  21 + <el-form-item label="手机号码" prop="phoneNo">
  22 + <el-input v-model="form.phoneNo" placeholder="请输入手机号码" :maxlength="11" show-word-limit/>
  23 + </el-form-item>
  24 + </el-col>
  25 + </el-row>
  26 + <el-row :gutter="30">
  27 +
  28 +
  29 + <el-col :span="7">
  30 + <el-form-item label="从业资格证有效期起" prop="professionalQualificationBeginDate">
  31 + <el-date-picker clearable size="small" style="width: 100%"
  32 + v-model="form.professionalQualificationBeginDate"
  33 + type="date"
  34 + value-format="yyyy-MM-dd"
  35 + placeholder="选择从业资格证有效期起">
  36 + </el-date-picker>
  37 + </el-form-item>
  38 + </el-col>
  39 + <el-col :span="7">
  40 + <el-form-item label="从业资格证有效期终" prop="professionalQualificationEndDate">
  41 + <el-date-picker clearable size="small" style="width: 100%"
  42 + v-model="form.professionalQualificationEndDate"
  43 + type="date"
  44 + value-format="yyyy-MM-dd"
  45 + placeholder="选择从业资格证有效期终">
  46 + </el-date-picker>
  47 + </el-form-item>
  48 + </el-col>
  49 + <el-col :span="7">
  50 + <el-form-item label="所属公司" prop="companyId">
  51 + <el-select v-model="form.companyId" placeholder="请选择所属公司" clearable style="width: 100%;">
  52 + <el-option v-for="(item,index) in enterpriseList" :label="item.name" :value="item.id" :key="index"/>
  53 + </el-select>
  54 + </el-form-item>
  55 + </el-col>
  56 + </el-row>
  57 + <el-row :gutter="30">
  58 + <el-col :span="7">
  59 + <el-form-item label="驾驶证有效期起" prop="drivingLicenceBeginDate">
  60 + <el-date-picker clearable size="small" style="width: 100%"
  61 + v-model="form.drivingLicenceBeginDate"
  62 + type="date"
  63 + value-format="yyyy-MM-dd"
  64 + placeholder="选择驾驶证有效期起">
  65 + </el-date-picker>
  66 + </el-form-item>
  67 +
  68 +
  69 + </el-col>
  70 + <el-col :span="7">
  71 + <el-form-item label="驾驶证有效期终" prop="drivingLicenceEndDate">
  72 + <el-date-picker clearable size="small" style="width: 100%"
  73 + v-model="form.drivingLicenceEndDate"
  74 + type="date"
  75 + value-format="yyyy-MM-dd"
  76 + placeholder="选择驾驶证有效期终">
  77 + </el-date-picker>
  78 + </el-form-item>
  79 +
  80 + </el-col>
  81 + <el-col :span="7">
  82 + <el-row>
  83 + <el-col :span="8">
  84 + <el-form-item label="安全教育培训日期" prop="safetyTrainingDate">
  85 + <el-date-picker clearable size="small" style="width: 100%"
  86 + v-model="form.safetyTrainingDate"
  87 + type="date"
  88 + value-format="yyyy-MM-dd"
  89 + placeholder="选择日期">
  90 + </el-date-picker>
  91 + </el-form-item>
  92 + </el-col>
  93 + <el-col :span="16">
  94 + <el-form-item label="安全教育培训内容">
  95 + <el-input v-model="form.safetyTrainingContent" placeholder="请输入内容"/>
  96 + </el-form-item>
  97 + </el-col>
  98 + </el-row>
  99 + </el-col>
  100 + </el-row>
  101 +
  102 + <el-row :gutter="30">
  103 + <el-col :span="14">
  104 + <el-form-item label="备注" prop="remark">
  105 + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  106 + </el-form-item>
  107 + </el-col>
  108 + </el-row>
  109 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  110 + <el-col :span="3">
  111 + <div class="upload_lable">
  112 + <span style="color:red;">*</span>驾驶证
  113 + <el-upload
  114 + ref="upload"
  115 + action=""
  116 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  117 + :on-change="fileChange"
  118 + :auto-upload="false"
  119 + :show-file-list="false"
  120 + multiple
  121 + :file-list="drivingLicence">
  122 +
  123 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  124 + </el-upload>
  125 + </div>
  126 + </el-col>
  127 + <el-col :span="21">
  128 + <div class="upload_btn">
  129 + <div v-for="(item,index) in drivingLicence">
  130 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  131 + <div class="upload_close" @click="drivingLicence.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  132 + <el-image
  133 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  134 + :src="createUrl(item)"
  135 + :preview-src-list="[createUrl(item)]"
  136 + :z-index="999">
  137 + </el-image>
  138 + </div>
  139 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  140 + <div class="upload_close_file" @click="drivingLicence.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  141 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  142 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  143 + </div>
  144 + </div>
  145 + </div>
  146 + </el-col>
  147 + </el-row>
  148 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  149 + <el-col :span="3">
  150 + <div class="upload_lable">
  151 + <span style="color:red;">*</span>从业资格证
  152 + <el-upload
  153 + ref="upload"
  154 + action=""
  155 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  156 + :on-change="fileChange1"
  157 + :auto-upload="false"
  158 + :show-file-list="false"
  159 + multiple
  160 + :file-list="professionalQualification">
  161 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  162 + </el-upload>
  163 + </div>
  164 + </el-col>
  165 + <el-col :span="21">
  166 + <div class="upload_btn">
  167 + <div v-for="(item,index) in professionalQualification">
  168 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  169 + <div class="upload_close" @click="professionalQualification.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  170 + <el-image
  171 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  172 + :src="createUrl(item)"
  173 + :preview-src-list="[createUrl(item)]"
  174 + :z-index="999">
  175 + </el-image>
  176 + </div>
  177 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  178 + <div class="upload_close_file" @click="professionalQualification.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  179 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  180 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  181 + </div>
  182 + </div>
  183 + </div>
  184 + </el-col>
  185 + </el-row>
  186 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  187 + <el-col :span="3">
  188 + <div class="upload_lable">
  189 + <span style="color:red;">*</span>安全教育培训结业证明
  190 + <el-upload
  191 + ref="upload"
  192 + action=""
  193 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  194 + :on-change="fileChange2"
  195 + :auto-upload="false"
  196 + :show-file-list="false"
  197 + multiple
  198 + :file-list="safetyTraining">
  199 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  200 + </el-upload>
  201 + </div>
  202 + </el-col>
  203 + <el-col :span="21">
  204 + <div class="upload_btn">
  205 + <div v-for="(item,index) in safetyTraining">
  206 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  207 + <div class="upload_close" @click="safetyTraining.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  208 + <el-image
  209 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  210 + :src="createUrl(item)"
  211 + :preview-src-list="[createUrl(item)]"
  212 + :z-index="999">
  213 + </el-image>
  214 + </div>
  215 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  216 + <div class="upload_close_file" @click="safetyTraining.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  217 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  218 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  219 + </div>
  220 + </div>
  221 + </div>
  222 + </el-col>
  223 + </el-row>
  224 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  225 + <el-col :span="3">
  226 + <div class="upload_lable">
  227 + <span style="color:red;">*</span>一寸免冠照片1
  228 + <el-upload
  229 + ref="upload"
  230 + action=""
  231 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  232 + :on-change="fileChange3"
  233 + :auto-upload="false"
  234 + :show-file-list="false"
  235 + multiple
  236 + :file-list="photographOne">
  237 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  238 + </el-upload>
  239 + </div>
  240 + </el-col>
  241 + <el-col :span="21">
  242 + <div class="upload_btn">
  243 + <div v-for="(item,index) in photographOne">
  244 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  245 + <div class="upload_close" @click="photographOne.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  246 + <el-image
  247 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  248 + :src="createUrl(item)"
  249 + :preview-src-list="[createUrl(item)]"
  250 + :z-index="999">
  251 + </el-image>
  252 + </div>
  253 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  254 + <div class="upload_close_file" @click="photographOne.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  255 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  256 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  257 + </div>
  258 + </div>
  259 + </div>
  260 + </el-col>
  261 + </el-row>
  262 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  263 + <el-col :span="3">
  264 + <div class="upload_lable">
  265 + <span style="color:red;">*</span>一寸免冠照片2
  266 + <el-upload
  267 + ref="upload"
  268 + action=""
  269 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  270 + :on-change="fileChange4"
  271 + :auto-upload="false"
  272 + :show-file-list="false"
  273 + multiple
  274 + :file-list="photographTwo">
  275 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  276 + </el-upload>
  277 + </div>
  278 + </el-col>
  279 + <el-col :span="21">
  280 + <div class="upload_btn">
  281 + <div v-for="(item,index) in photographTwo">
  282 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  283 + <div class="upload_close" @click="photographTwo.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  284 + <el-image
  285 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  286 + :src="createUrl(item)"
  287 + :preview-src-list="[createUrl(item)]"
  288 + :z-index="999">
  289 + </el-image>
  290 + </div>
  291 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  292 + <div class="upload_close_file" @click="photographTwo.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  293 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  294 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  295 + </div>
  296 + </div>
  297 + </div>
  298 + </el-col>
  299 + </el-row>
  300 + </el-form>
  301 + <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  302 + <el-button type="primary" @click="submitForm">确 定</el-button>
  303 + <el-button @click="cancel">取 消</el-button>
  304 + </div>
  305 + </div>
  306 +</template>
  307 +
  308 +<script>
  309 +import { listDriver, getDriver, delDriver, addDriver, updateDriver, exportDriver } from "@/api/unit/driver";
  310 +import { listEnterprise} from "@/api/unit/enterprise";
  311 +import Treeselect from "@riophae/vue-treeselect";
  312 +import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  313 +import {getAreaList} from "@/api/casefile/remoteServer";
  314 +import Editor from "@/components/Editor/index.vue";
  315 +
  316 +export default {
  317 + name: "DisposalSite",
  318 + components: {Editor, Treeselect},
  319 + data() {
  320 + return {
  321 + // 遮罩层
  322 + loading: true,
  323 + // 选中数组
  324 + ids: [],
  325 + // 非单个禁用
  326 + single: true,
  327 + // 非多个禁用
  328 + multiple: true,
  329 + // 显示搜索条件
  330 + showSearch: true,
  331 + // 总条数
  332 + total: 0,
  333 + // 处理场所管理表格数据
  334 + disposalSiteList: [],
  335 + // 弹出层标题
  336 + title: "",
  337 + // 是否显示弹出层
  338 + open: false,
  339 + // 表单参数
  340 + form: {},
  341 + // 表单校验
  342 + rules: {
  343 + name: [
  344 + {required: true, message: "请输入姓名", trigger: "blur"}
  345 + ],
  346 + identityCard: [
  347 + {required: true, message: "请输入身份证号码", trigger: "blur"}
  348 + ],
  349 + companyId: [
  350 + {required: true, message: "请选择所属公司", trigger: "blur"}
  351 + ],
  352 + drivingLicenceBeginDate: [
  353 + {required: true, message: "请选择驾驶证有效期起", trigger: "blur"}
  354 + ],
  355 + drivingLicenceEndDate: [
  356 + {required: true, message: "请选择驾驶证有效期终", trigger: "blur"}
  357 + ],
  358 + professionalQualificationBeginDate: [
  359 + {required: true, message: "请选择从业资格证有效期起", trigger: "blur"}
  360 + ],
  361 + professionalQualificationEndDate: [
  362 + {required: true, message: "请选择从业资格证有效期终", trigger: "blur"}
  363 + ],
  364 + safetyTrainingDate: [
  365 + {required: true, message: "请选择安全教育培训日期", trigger: "blur"}
  366 + ],
  367 + safetyTrainingContent: [
  368 + {required: true, message: "请输入安全教育培训内容", trigger: "blur"}
  369 + ],
  370 + phoneNo: [
  371 + {required: true, message: "请输入手机号码", trigger: "blur"},
  372 + {
  373 + pattern: /^1(3|4|5|7|8|9)\d{9}$/,
  374 + message: '手机号格式错误',
  375 + trigger: 'change'
  376 + }
  377 + ],
  378 + },
  379 + areas:[],
  380 + drivingLicence:[],
  381 + professionalQualification:[],
  382 + safetyTraining:[],
  383 + photographOne:[],
  384 + photographTwo:[],
  385 + enterpriseList:[]
  386 + };
  387 + },
  388 + created() {
  389 + getAreaList().then(res => {
  390 + this.areas = res.data;
  391 + });
  392 + this.queryParams = {
  393 + companyType:"1"
  394 + }
  395 + listEnterprise(this.queryParams).then(response => {
  396 + this.enterpriseList = response.rows;
  397 + });
  398 + this.initData();
  399 + },
  400 + watch: {
  401 + '$route.query.driverInfoId': 'initData'
  402 + },
  403 + methods: {
  404 + reset(){
  405 + this.form = {};
  406 + this.drivingLicence = [];
  407 + this.professionalQualification = [];
  408 + this.safetyTraining = [];
  409 + this.photographOne = [];
  410 + this.photographTwo = [];
  411 + },
  412 + initData(){
  413 + this.reset();
  414 + let id = this.$route.query.driverInfoId;
  415 + console.log(id)
  416 + if(id!=null){
  417 + getDriver(id).then(response => {
  418 + this.form = response.data;
  419 + //将附件转换为前端可视化数组
  420 + if(this.form.drivingLicence!=null&&this.form.drivingLicence!==""){
  421 + let roadTransport = this.form.drivingLicence.split(";");
  422 + roadTransport.map(item=>{
  423 + let name = item.substring(item.lastIndexOf("/")+1);
  424 + this.drivingLicence.push({name:name,url:item})
  425 + })
  426 + }
  427 + if(this.form.professionalQualification!=null&&this.form.professionalQualification!==""){
  428 + let drivingLicense = this.form.professionalQualification.split(";");
  429 + drivingLicense.map(item=>{
  430 + let name = item.substring(item.lastIndexOf("/")+1);
  431 + this.professionalQualification.push({name:name,url:item})
  432 + })
  433 + }
  434 + if(this.form.safetyTraining!=null&&this.form.safetyTraining!==""){
  435 + let carFront = this.form.safetyTraining.split(";");
  436 + carFront.map(item=>{
  437 + let name = item.substring(item.lastIndexOf("/")+1);
  438 + this.safetyTraining.push({name:name,url:item})
  439 + })
  440 + }
  441 + if(this.form.photographOne!=null&&this.form.photographOne!==""){
  442 + let carLeft = this.form.photographOne.split(";");
  443 + carLeft.map(item=>{
  444 + let name = item.substring(item.lastIndexOf("/")+1);
  445 + this.photographOne.push({name:name,url:item})
  446 + })
  447 + }
  448 + if(this.form.photographTwo!=null&&this.form.photographTwo!==""){
  449 + let carBehind = this.form.photographTwo.split(";");
  450 + carBehind.map(item=>{
  451 + let name = item.substring(item.lastIndexOf("/")+1);
  452 + this.photographTwo.push({name:name,url:item})
  453 + })
  454 + }
  455 + });
  456 + }
  457 + },
  458 + createUrl(file){
  459 + if(file.raw!=null){
  460 + return URL.createObjectURL(file.raw);
  461 + }else{
  462 + return process.env.VUE_APP_BASE_API + file.url;
  463 + }
  464 +
  465 + },
  466 + tempDownload(row){
  467 + let name = row.name;
  468 + let url = "";
  469 + if(row.raw!=null){
  470 + url = URL.createObjectURL(row.raw);
  471 + }else{
  472 + url = process.env.VUE_APP_BASE_API + row.url;
  473 + }
  474 + const a = document.createElement('a')
  475 + a.setAttribute('download', name)
  476 + a.setAttribute('target', '_blank')
  477 + a.setAttribute('href', url);
  478 + a.click()
  479 + },
  480 + // 取消按钮
  481 + cancel() {
  482 + this.$tab.closePage({path:"/driverInfo/info"}).then(() => {
  483 + this.$tab.openPage("驾驶员管理", "/tool/driver",{driverInfoRefresh:1})
  484 + })
  485 + },
  486 + /** 提交按钮 */
  487 + submitForm() {
  488 + this.$refs["form"].validate(valid => {
  489 + if(this.drivingLicence.length===0){
  490 + this.$message({
  491 + message: '请上传驾驶证!',
  492 + type: 'warning'
  493 + });
  494 + return false;
  495 + }
  496 + if(this.professionalQualification.length===0){
  497 + this.$message({
  498 + message: '请上传从业资格证!',
  499 + type: 'warning'
  500 + });
  501 + return false;
  502 + }
  503 + if(this.safetyTraining.length===0){
  504 + this.$message({
  505 + message: '请上传安全教育培训结业证明!',
  506 + type: 'warning'
  507 + });
  508 + return false;
  509 + }
  510 + if(this.photographOne.length===0){
  511 + this.$message({
  512 + message: '请上传一寸免冠照片1!',
  513 + type: 'warning'
  514 + });
  515 + return false;
  516 + }
  517 + if(this.photographTwo.length===0){
  518 + this.$message({
  519 + message: '请上传一寸免冠照片2!',
  520 + type: 'warning'
  521 + });
  522 + return false;
  523 + }
  524 + if (valid) {
  525 + let formData = new FormData();
  526 + let form = this.form;
  527 + //去掉params属性
  528 + delete form.params;
  529 +
  530 + //先清空原有的附件
  531 + form.drivingLicence = null;
  532 + form.professionalQualification = null;
  533 + form.safetyTraining = null;
  534 + form.photographOne = null;
  535 + form.photographTwo = null;
  536 + //将附件拼接到form中
  537 + this.drivingLicence.forEach(item => {
  538 + if (item.raw != null) {
  539 + formData.append('drivingLicenceFiles', item.raw)
  540 + }else{
  541 + //将原有的附件拼接到form中
  542 + form.drivingLicence = form.drivingLicence!==null?form.drivingLicence+";"+item.url:item.url;
  543 + }
  544 + })
  545 + this.professionalQualification.forEach(item => {
  546 + if (item.raw != null) {
  547 + formData.append('professionalQualificationFiles', item.raw)
  548 + }else{
  549 + //将原有的附件拼接到form中
  550 + form.professionalQualification = form.professionalQualification!==null?form.professionalQualification+";"+item.url:item.url;
  551 + }
  552 + })
  553 + this.safetyTraining.forEach(item => {
  554 + if (item.raw != null) {
  555 + formData.append('safetyTrainingFiles', item.raw)
  556 + }else{
  557 + //将原有的附件拼接到form中
  558 + form.safetyTraining = form.safetyTraining!==null?form.safetyTraining+";"+item.url:item.url;
  559 + }
  560 + })
  561 + this.photographOne.forEach(item => {
  562 + if (item.raw != null) {
  563 + formData.append('photographOneFiles', item.raw)
  564 + }else{
  565 + //将原有的附件拼接到form中
  566 + form.photographOne = form.photographOne!==null?form.photographOne+";"+item.url:item.url;
  567 + }
  568 + })
  569 + this.photographTwo.forEach(item => {
  570 + if (item.raw != null) {
  571 + formData.append('photographTwoFiles', item.raw)
  572 + }else{
  573 + //将原有的附件拼接到form中
  574 + form.photographTwo = form.photographTwo!==null?form.photographTwo+";"+item.url:item.url;
  575 + }
  576 + })
  577 +
  578 + for (let key in form) {
  579 + formData.append(key, form[key] == null ? "" : form[key])
  580 + }
  581 + if (this.form.id != null) {
  582 + updateDriver(formData).then(response => {
  583 + this.msgSuccess("修改成功");
  584 + this.$tab.closePage({path:"/driverInfo/infoEdit"}).then(() => {
  585 + this.$tab.openPage("驾驶员管理", "/tool/driver",{driverInfoRefresh:1})
  586 + })
  587 + });
  588 + } else {
  589 + addDriver(formData).then(response => {
  590 + this.msgSuccess("新增成功");
  591 + this.$tab.closePage({path:"/driverInfo/info"}).then(() => {
  592 + this.$tab.openPage("驾驶员管理", "/tool/driver",{driverInfoRefresh:1})
  593 + })
  594 + });
  595 + }
  596 + }
  597 + });
  598 + },
  599 + /**
  600 + * 文件改变时,限制文件上传格式和大小
  601 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  602 + * 大小不超过20M
  603 + * */
  604 + fileChange(file, fileList) {
  605 + let count = 0;
  606 + for (let i = 0; i < fileList.length; i++) {
  607 + // console.log(fileList.length)
  608 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  609 + if (fileList[i].name == file.name) {
  610 + count++;
  611 + if (count == 2) {
  612 + this.$message({
  613 + message: '已存在此文件!',
  614 + type: 'warning'
  615 + });
  616 + for (let j = fileList.length; j > 0; j--) {
  617 + //如果存在此文件,去除新选择的重复文件
  618 + if (fileList[j - 1].name == file.name) {
  619 + fileList.splice(j - 1, 1);
  620 + i--;
  621 + return false;
  622 + }
  623 + }
  624 + }
  625 + }
  626 + }
  627 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  628 + //格式符合后判断大小
  629 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  630 + let max5M = file.size / 1024 / 1024 < 100;
  631 + if (!max5M) {
  632 + this.$message({
  633 + message: '上传文件大小不得超过100M!',
  634 + type: 'warning'
  635 + });
  636 + fileList = fileList.splice(fileList.length - 1, 1);
  637 + } else {
  638 + //符合条件后进行添加
  639 + this.drivingLicence = fileList
  640 + }
  641 + } else {
  642 + this.$message({
  643 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  644 + type: 'warning'
  645 + });
  646 + fileList = fileList.splice(fileList.length - 1, 1);
  647 + }
  648 + },
  649 + fileChange1(file, fileList) {
  650 + let count = 0;
  651 + for (let i = 0; i < fileList.length; i++) {
  652 + // console.log(fileList.length)
  653 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  654 + if (fileList[i].name == file.name) {
  655 + count++;
  656 + if (count == 2) {
  657 + this.$message({
  658 + message: '已存在此文件!',
  659 + type: 'warning'
  660 + });
  661 + for (let j = fileList.length; j > 0; j--) {
  662 + //如果存在此文件,去除新选择的重复文件
  663 + if (fileList[j - 1].name == file.name) {
  664 + fileList.splice(j - 1, 1);
  665 + i--;
  666 + return false;
  667 + }
  668 + }
  669 + }
  670 + }
  671 + }
  672 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  673 + //格式符合后判断大小
  674 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  675 + let max5M = file.size / 1024 / 1024 < 100;
  676 + if (!max5M) {
  677 + this.$message({
  678 + message: '上传文件大小不得超过100M!',
  679 + type: 'warning'
  680 + });
  681 + fileList = fileList.splice(fileList.length - 1, 1);
  682 + } else {
  683 + //符合条件后进行添加
  684 + this.professionalQualification = fileList
  685 + }
  686 + } else {
  687 + this.$message({
  688 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  689 + type: 'warning'
  690 + });
  691 + fileList = fileList.splice(fileList.length - 1, 1);
  692 + }
  693 + },
  694 + fileChange2(file, fileList) {
  695 + let count = 0;
  696 + for (let i = 0; i < fileList.length; i++) {
  697 + // console.log(fileList.length)
  698 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  699 + if (fileList[i].name == file.name) {
  700 + count++;
  701 + if (count == 2) {
  702 + this.$message({
  703 + message: '已存在此文件!',
  704 + type: 'warning'
  705 + });
  706 + for (let j = fileList.length; j > 0; j--) {
  707 + //如果存在此文件,去除新选择的重复文件
  708 + if (fileList[j - 1].name == file.name) {
  709 + fileList.splice(j - 1, 1);
  710 + i--;
  711 + return false;
  712 + }
  713 + }
  714 + }
  715 + }
  716 + }
  717 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  718 + //格式符合后判断大小
  719 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  720 + let max5M = file.size / 1024 / 1024 < 100;
  721 + if (!max5M) {
  722 + this.$message({
  723 + message: '上传文件大小不得超过100M!',
  724 + type: 'warning'
  725 + });
  726 + fileList = fileList.splice(fileList.length - 1, 1);
  727 + } else {
  728 + //符合条件后进行添加
  729 + this.safetyTraining = fileList
  730 + }
  731 + } else {
  732 + this.$message({
  733 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  734 + type: 'warning'
  735 + });
  736 + fileList = fileList.splice(fileList.length - 1, 1);
  737 + }
  738 + },
  739 + fileChange3(file, fileList) {
  740 + let count = 0;
  741 + for (let i = 0; i < fileList.length; i++) {
  742 + // console.log(fileList.length)
  743 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  744 + if (fileList[i].name == file.name) {
  745 + count++;
  746 + if (count == 2) {
  747 + this.$message({
  748 + message: '已存在此文件!',
  749 + type: 'warning'
  750 + });
  751 + for (let j = fileList.length; j > 0; j--) {
  752 + //如果存在此文件,去除新选择的重复文件
  753 + if (fileList[j - 1].name == file.name) {
  754 + fileList.splice(j - 1, 1);
  755 + i--;
  756 + return false;
  757 + }
  758 + }
  759 + }
  760 + }
  761 + }
  762 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  763 + //格式符合后判断大小
  764 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  765 + let max5M = file.size / 1024 / 1024 < 100;
  766 + if (!max5M) {
  767 + this.$message({
  768 + message: '上传文件大小不得超过100M!',
  769 + type: 'warning'
  770 + });
  771 + fileList = fileList.splice(fileList.length - 1, 1);
  772 + } else {
  773 + //符合条件后进行添加
  774 + this.photographOne = fileList
  775 + }
  776 + } else {
  777 + this.$message({
  778 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  779 + type: 'warning'
  780 + });
  781 + fileList = fileList.splice(fileList.length - 1, 1);
  782 + }
  783 + },
  784 + fileChange4(file, fileList) {
  785 + let count = 0;
  786 + for (let i = 0; i < fileList.length; i++) {
  787 + // console.log(fileList.length)
  788 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  789 + if (fileList[i].name == file.name) {
  790 + count++;
  791 + if (count == 2) {
  792 + this.$message({
  793 + message: '已存在此文件!',
  794 + type: 'warning'
  795 + });
  796 + for (let j = fileList.length; j > 0; j--) {
  797 + //如果存在此文件,去除新选择的重复文件
  798 + if (fileList[j - 1].name == file.name) {
  799 + fileList.splice(j - 1, 1);
  800 + i--;
  801 + return false;
  802 + }
  803 + }
  804 + }
  805 + }
  806 + }
  807 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  808 + //格式符合后判断大小
  809 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  810 + let max5M = file.size / 1024 / 1024 < 100;
  811 + if (!max5M) {
  812 + this.$message({
  813 + message: '上传文件大小不得超过100M!',
  814 + type: 'warning'
  815 + });
  816 + fileList = fileList.splice(fileList.length - 1, 1);
  817 + } else {
  818 + //符合条件后进行添加
  819 + this.photographTwo = fileList
  820 + }
  821 + } else {
  822 + this.$message({
  823 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  824 + type: 'warning'
  825 + });
  826 + fileList = fileList.splice(fileList.length - 1, 1);
  827 + }
  828 + },
  829 + }
  830 +};
  831 +</script>
  832 +<style lang="scss" scoped>
  833 +.upload_lable{
  834 + border-right: 1px solid #dcdfe6;
  835 + padding: 27px 30px;
  836 + background: #fafafa;
  837 + text-align: center;
  838 +}
  839 +.upload_btn{
  840 + max-height: 106px;
  841 +}
  842 +.upload_close{
  843 + position: absolute;
  844 + left: 105px;
  845 + z-index:99;
  846 + top:-1px;
  847 + font-size:18px;
  848 + color:red;
  849 +}
  850 +.upload_close_file{
  851 + position: absolute;
  852 + left: 80px;
  853 + z-index:99;
  854 + top:-1px;
  855 + font-size:18px;
  856 + color:red;
  857 +}
  858 +.upload_div_image{
  859 + display: inline-block;
  860 + width: 110px;
  861 + height: 95px;
  862 + position: relative;
  863 + float: left;
  864 + margin-left: 5px;
  865 +}
  866 +.upload_div_file{
  867 + display: inline-block;
  868 + width: 110px;
  869 + height: 95px;
  870 + text-align: center;
  871 + float:left;
  872 + margin: 5px;
  873 + position: relative;
  874 +}
  875 +.serach_map{
  876 + position: absolute;
  877 + top: 100px;
  878 + left: 25px;
  879 + z-index: 999;
  880 + background: #fff;
  881 + padding: 10px;
  882 + border-radius: 5px;
  883 + box-shadow: 0 0 10px rgba(0,0,0,.2);
  884 +}
  885 +</style>
trash-ui/src/views/unit/enterprise/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
  4 + <el-form-item label="企业名称" prop="name">
  5 + <el-input
  6 + v-model="queryParams.name"
  7 + placeholder="请输入企业名称"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item label="所属区域" prop="registrationArea">
  14 + <el-select v-model="queryParams.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%" clearable>
  15 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  16 + </el-select>
  17 + </el-form-item>
  18 +
  19 + <el-form-item label="法人代表" prop="legalRepresentative">
  20 + <el-input
  21 + v-model="queryParams.legalRepresentative"
  22 + placeholder="请输入法人代表"
  23 + clearable
  24 + size="small"
  25 + @keyup.enter.native="handleQuery"
  26 + />
  27 + </el-form-item>
  28 + <el-form-item label="审批状态" prop="status">
  29 + <el-select v-model="queryParams.status" placeholder="请选择审批状态" clearable size="small">
  30 + <el-option label="审批中" value="0" />
  31 + <el-option label="审批通过" value="1" />
  32 + <el-option label="被驳回" value="2" />
  33 + </el-select>
  34 + </el-form-item>
  35 + <el-form-item>
  36 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  37 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  38 + </el-form-item>
  39 + </el-form>
  40 +
  41 + <el-row :gutter="10" class="mb8">
  42 + <el-col :span="1.5">
  43 + <el-button
  44 + type="primary"
  45 + icon="el-icon-plus"
  46 + size="mini"
  47 + @click="handleAdd"
  48 + v-hasPermi="['unit:enterprise:add']"
  49 + >新增</el-button>
  50 + </el-col>
  51 + <el-col :span="1.5">
  52 + <el-button
  53 + type="success"
  54 + icon="el-icon-edit"
  55 + size="mini"
  56 + :disabled="single"
  57 + @click="handleUpdate"
  58 + v-hasPermi="['unit:enterprise:edit']"
  59 + >修改</el-button>
  60 + </el-col>
  61 + <el-col :span="1.5">
  62 + <el-button
  63 + type="danger"
  64 + icon="el-icon-delete"
  65 + size="mini"
  66 + :disabled="multiple"
  67 + @click="handleDelete"
  68 + v-hasPermi="['unit:enterprise:remove']"
  69 + >删除</el-button>
  70 + </el-col>
  71 + <el-col :span="1.5">
  72 + <el-button
  73 + type="warning"
  74 + icon="el-icon-download"
  75 + size="mini"
  76 + @click="handleExport"
  77 + v-hasPermi="['unit:enterprise:export']"
  78 + >导出</el-button>
  79 + </el-col>
  80 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  81 + </el-row>
  82 +
  83 + <el-table v-loading="loading" :data="enterpriseList" @selection-change="handleSelectionChange">
  84 + <el-table-column type="selection" width="55" align="center" />
  85 + <el-table-column type="index" width="55" align="center" label="序号"/>
  86 + <el-table-column label="企业名称" align="center" prop="name" />
  87 + <el-table-column label="简称" align="center" prop="abbreviation" />
  88 + <el-table-column label="所属区域" align="center" prop="registrationArea" />
  89 + <el-table-column label="车辆数" align="center" prop="carNumber" />
  90 + <el-table-column label="法人代表" align="center" prop="legalRepresentative" />
  91 + <el-table-column label="联系方式" align="center" prop="legalRepresentativePhone" />
  92 + <el-table-column label="审批状态" align="center" prop="status">
  93 + <template slot-scope="scope">
  94 + <span>{{ parseStatus(scope.row.status) }}</span>
  95 + </template>
  96 + </el-table-column>
  97 + <el-table-column label="信用状态" align="center" prop="creditStatus" />
  98 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  99 + <template slot-scope="scope">
  100 + <el-button
  101 + size="mini"
  102 + type="text"
  103 + icon="el-icon-edit"
  104 + @click="handleUpdate(scope.row)"
  105 + v-hasPermi="['unit:enterprise:edit']"
  106 + >修改</el-button>
  107 + <el-button
  108 + size="mini"
  109 + type="text"
  110 + icon="el-icon-delete"
  111 + @click="handleDelete(scope.row)"
  112 + v-hasPermi="['unit:enterprise:remove']"
  113 + >删除</el-button>
  114 + </template>
  115 + </el-table-column>
  116 + </el-table>
  117 +
  118 + <pagination
  119 + v-show="total>0"
  120 + :total="total"
  121 + :page.sync="queryParams.pageNum"
  122 + :limit.sync="queryParams.pageSize"
  123 + @pagination="getList"
  124 + />
  125 +
  126 + </div>
  127 +</template>
  128 +
  129 +<script>
  130 +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise";
  131 +import {getAreaList} from "@/api/casefile/remoteServer";
  132 +
  133 +export default {
  134 + name: "Enterprise",
  135 + data() {
  136 + return {
  137 + // 遮罩层
  138 + loading: true,
  139 + // 选中数组
  140 + ids: [],
  141 + // 非单个禁用
  142 + single: true,
  143 + // 非多个禁用
  144 + multiple: true,
  145 + // 显示搜索条件
  146 + showSearch: true,
  147 + // 总条数
  148 + total: 0,
  149 + // 运输企业管理表格数据
  150 + enterpriseList: [],
  151 + // 弹出层标题
  152 + title: "",
  153 + // 是否显示弹出层
  154 + open: false,
  155 + // 查询参数
  156 + queryParams: {
  157 + pageNum: 1,
  158 + pageSize: 10,
  159 + name: null,
  160 + abbreviation: null,
  161 + registrationArea: null,
  162 + transportPermissionDate: null,
  163 + enterDate: null,
  164 + businessLicenseDate: null,
  165 + officeAddress: null,
  166 + parkingLotLocation: null,
  167 + parkingArea: null,
  168 + carNumber: null,
  169 + safetyManagerName: null,
  170 + safetyManagerPhone: null,
  171 + socialUniformCreditCodeNumber: null,
  172 + legalRepresentative: null,
  173 + legalRepresentativePhone: null,
  174 + safetyPeopleName: null,
  175 + transportPermission: null,
  176 + enterpriseBusinessLicense: null,
  177 + safetyOfficerQualificationCertificate: null,
  178 + safetyCertificate: null,
  179 + carParkPanorama: null,
  180 + businessUnit: null,
  181 + status: null,
  182 + parentId: null,
  183 + companyType: null,
  184 + creditStatus: null,
  185 + qrCode: null
  186 + },
  187 + // 表单参数
  188 + form: {},
  189 + // 表单校验
  190 + rules: {
  191 + },
  192 + areas: []
  193 + };
  194 + },
  195 + created() {
  196 + getAreaList().then(res => {
  197 + this.areas = res.data;
  198 + });
  199 + this.getList();
  200 + },
  201 + watch:{
  202 + '$route.query.enterpriseRefresh':'getList'
  203 + },
  204 + methods: {
  205 + /** 查询运输企业管理列表 */
  206 + getList() {
  207 + this.loading = true;
  208 + this.queryParams.companyType = "1";
  209 + listEnterprise(this.queryParams).then(response => {
  210 + this.enterpriseList = response.rows;
  211 + this.total = response.total;
  212 + this.loading = false;
  213 + });
  214 + },
  215 + /** 搜索按钮操作 */
  216 + handleQuery() {
  217 + this.queryParams.pageNum = 1;
  218 + this.getList();
  219 + },
  220 + /** 重置按钮操作 */
  221 + resetQuery() {
  222 + this.resetForm("queryForm");
  223 + this.handleQuery();
  224 + },
  225 + // 多选框选中数据
  226 + handleSelectionChange(selection) {
  227 + this.ids = selection.map(item => item.id)
  228 + this.single = selection.length!==1
  229 + this.multiple = !selection.length
  230 + },
  231 + /** 新增按钮操作 */
  232 + handleAdd() {
  233 + this.$tab.openPage("新增运输企业","/enterprise/info",{enterpriseRefresh:0});
  234 + },
  235 + /** 修改按钮操作 */
  236 + handleUpdate(row) {
  237 + const id = row.id || this.ids
  238 + this.$tab.openPage("修改运输企业","/enterprise/infoEdit",{enterpriseId: id,enterpriseRefresh:0});
  239 + },
  240 + /** 删除按钮操作 */
  241 + handleDelete(row) {
  242 + const ids = row.id || this.ids;
  243 + this.$confirm('是否确认删除运输企业管理编号为"' + ids + '"的数据项?', "警告", {
  244 + confirmButtonText: "确定",
  245 + cancelButtonText: "取消",
  246 + type: "warning"
  247 + }).then(function() {
  248 + return delEnterprise(ids);
  249 + }).then(() => {
  250 + this.getList();
  251 + this.msgSuccess("删除成功");
  252 + })
  253 + },
  254 + /** 导出按钮操作 */
  255 + handleExport() {
  256 + const queryParams = this.queryParams;
  257 + this.$confirm('是否确认导出所有运输企业管理数据项?', "警告", {
  258 + confirmButtonText: "确定",
  259 + cancelButtonText: "取消",
  260 + type: "warning"
  261 + }).then(function() {
  262 + return exportEnterprise(queryParams);
  263 + }).then(response => {
  264 + this.download(response.msg);
  265 + })
  266 + }
  267 + }
  268 +};
  269 +</script>
trash-ui/src/views/unit/enterprise/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 +
  4 + <!-- 添加或修改处理场所管理对话框 -->
  5 + <h3>
  6 + 基础信息
  7 + </h3>
  8 + <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="top">
  9 + <el-row :gutter="30">
  10 + <el-col :span="7">
  11 + <el-form-item label="企业名称" prop="name">
  12 + <el-input v-model="form.name" placeholder="请输入企业名称" />
  13 + </el-form-item>
  14 + </el-col>
  15 + <el-col :span="7">
  16 + <el-form-item label="简称" prop="abbreviation">
  17 + <el-input v-model="form.abbreviation" placeholder="请输入简称" />
  18 + </el-form-item>
  19 + </el-col>
  20 + <el-col :span="7">
  21 + <el-form-item label="注册地所在区域" prop="registrationArea">
  22 + <el-select v-model="form.registrationArea" placeholder="请输入注册地所在区域" style="width: 100%">
  23 + <el-option v-for="(area,index) in areas" :label="area.name" :value="area.name" :key="index"/>
  24 + </el-select>
  25 + </el-form-item>
  26 + </el-col>
  27 + </el-row>
  28 + <el-row :gutter="30">
  29 + <el-col :span="7">
  30 + <el-form-item label="企业道路运输经营许可证有效期" prop="transportPermissionDate">
  31 + <el-date-picker clearable size="small" style="width: 100%;"
  32 + v-model="form.transportPermissionDate"
  33 + type="date"
  34 + value-format="yyyy-MM-dd"
  35 + placeholder="选择企业道路运输经营许可证有效期">
  36 + </el-date-picker>
  37 + </el-form-item>
  38 + </el-col>
  39 + <el-col :span="7">
  40 + <el-form-item label="企业入市时间" prop="enterDate">
  41 + <el-date-picker clearable size="small" style="width: 100%;"
  42 + v-model="form.enterDate"
  43 + type="date"
  44 + value-format="yyyy-MM-dd"
  45 + placeholder="选择企业入市时间">
  46 + </el-date-picker>
  47 + </el-form-item>
  48 + </el-col>
  49 + <el-col :span="7">
  50 + <el-form-item label="企业营业执照有效期" prop="businessLicenseDate">
  51 + <el-date-picker clearable size="small" style="width: 100%;"
  52 + v-model="form.businessLicenseDate"
  53 + type="date"
  54 + value-format="yyyy-MM-dd"
  55 + placeholder="选择企业营业执照有效期">
  56 + </el-date-picker>
  57 + </el-form-item>
  58 + </el-col>
  59 + </el-row>
  60 + <el-row :gutter="30">
  61 + <el-col :span="7">
  62 + <el-form-item label="办公地址" prop="officeAddress">
  63 + <el-input v-model="form.officeAddress" placeholder="请输入内容" />
  64 + </el-form-item>
  65 + </el-col>
  66 + <el-col :span="7">
  67 + <el-form-item label="停车场位置" prop="parkingLotLocation">
  68 + <el-input v-model="form.parkingLotLocation" placeholder="请输入内容" />
  69 + </el-form-item>
  70 + </el-col>
  71 + <el-col :span="7">
  72 + <el-form-item label="停车场面积(m²)" prop="parkingArea">
  73 + <el-input v-model="form.parkingArea" placeholder="请输入停车场面积" />
  74 + </el-form-item>
  75 + </el-col>
  76 + </el-row>
  77 + <el-row :gutter="30">
  78 + <el-col :span="7">
  79 + <el-form-item label="企业安全负责人姓名及联系方式" prop="safetyManagerName">
  80 + <el-row>
  81 + <el-col :span="6">
  82 + <el-input v-model="form.safetyManagerName" placeholder="姓名" />
  83 + </el-col>
  84 + <el-col :span="18">
  85 + <el-input v-model="form.safetyManagerPhone" placeholder="联系方式" :maxlength="11" show-word-limit/>
  86 + </el-col>
  87 + </el-row>
  88 + </el-form-item>
  89 + </el-col>
  90 + <el-col :span="7">
  91 + <el-form-item label="社会统一信用代码编号" prop="socialUniformCreditCodeNumber">
  92 + <el-input v-model="form.socialUniformCreditCodeNumber" placeholder="请输入社会统一信用代码编号" />
  93 + </el-form-item>
  94 + </el-col>
  95 + <el-col :span="7">
  96 + <el-form-item label="法人代表及联系方式" prop="legalRepresentative">
  97 + <el-row>
  98 + <el-col :span="6">
  99 + <el-input v-model="form.legalRepresentative" placeholder="姓名" />
  100 + </el-col>
  101 + <el-col :span="18">
  102 + <el-input v-model="form.legalRepresentativePhone" placeholder="联系方式" :maxlength="11" show-word-limit/>
  103 + </el-col>
  104 + </el-row>
  105 + </el-form-item>
  106 + </el-col>
  107 + </el-row>
  108 +
  109 + <el-row :gutter="30">
  110 + <el-col :span="7">
  111 + <el-form-item label="安全管理人员" prop="safetyPeopleName">
  112 + <el-input v-model="form.safetyPeopleName" placeholder="请输入安全管理人员" />
  113 + </el-form-item>
  114 + </el-col>
  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>
  120 + </el-form-item>
  121 + </el-col>
  122 + <el-col :span="7">
  123 + <el-form-item label="备注" prop="remark">
  124 + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  125 + </el-form-item>
  126 + </el-col>
  127 + </el-row>
  128 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  129 + <el-col :span="3">
  130 + <div class="upload_lable">
  131 + 企业道路运输经营许可证
  132 + <el-upload
  133 + ref="upload"
  134 + action=""
  135 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  136 + :on-change="fileChange"
  137 + :auto-upload="false"
  138 + :show-file-list="false"
  139 + multiple
  140 + :file-list="transportPermission">
  141 +
  142 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  143 + </el-upload>
  144 + </div>
  145 + </el-col>
  146 + <el-col :span="21">
  147 + <div class="upload_btn">
  148 + <div v-for="(item,index) in transportPermission">
  149 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  150 + <div class="upload_close" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  151 + <el-image
  152 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  153 + :src="createUrl(item)"
  154 + :preview-src-list="[createUrl(item)]"
  155 + :z-index="999">
  156 + </el-image>
  157 + </div>
  158 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  159 + <div class="upload_close_file" @click="transportPermission.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  160 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  161 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  162 + </div>
  163 + </div>
  164 + </div>
  165 + </el-col>
  166 + </el-row>
  167 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  168 + <el-col :span="3">
  169 + <div class="upload_lable">
  170 + 企业营业执照
  171 + <el-upload
  172 + ref="upload"
  173 + action=""
  174 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  175 + :on-change="fileChange1"
  176 + :auto-upload="false"
  177 + :show-file-list="false"
  178 + multiple
  179 + :file-list="enterpriseBusinessLicense">
  180 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  181 + </el-upload>
  182 + </div>
  183 + </el-col>
  184 + <el-col :span="21">
  185 + <div class="upload_btn">
  186 + <div v-for="(item,index) in enterpriseBusinessLicense">
  187 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  188 + <div class="upload_close" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  189 + <el-image
  190 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  191 + :src="createUrl(item)"
  192 + :preview-src-list="[createUrl(item)]"
  193 + :z-index="999">
  194 + </el-image>
  195 + </div>
  196 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  197 + <div class="upload_close_file" @click="enterpriseBusinessLicense.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  198 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  199 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  200 + </div>
  201 + </div>
  202 + </div>
  203 + </el-col>
  204 + </el-row>
  205 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  206 + <el-col :span="3">
  207 + <div class="upload_lable">
  208 + 安全员考核合格证明
  209 + <el-upload
  210 + ref="upload"
  211 + action=""
  212 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  213 + :on-change="fileChange2"
  214 + :auto-upload="false"
  215 + :show-file-list="false"
  216 + multiple
  217 + :file-list="safetyOfficerQualificationCertificate">
  218 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  219 + </el-upload>
  220 + </div>
  221 + </el-col>
  222 + <el-col :span="21">
  223 + <div class="upload_btn">
  224 + <div v-for="(item,index) in safetyOfficerQualificationCertificate">
  225 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  226 + <div class="upload_close" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  227 + <el-image
  228 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  229 + :src="createUrl(item)"
  230 + :preview-src-list="[createUrl(item)]"
  231 + :z-index="999">
  232 + </el-image>
  233 + </div>
  234 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  235 + <div class="upload_close_file" @click="safetyOfficerQualificationCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  236 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  237 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  238 + </div>
  239 + </div>
  240 + </div>
  241 + </el-col>
  242 + </el-row>
  243 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  244 + <el-col :span="3">
  245 + <div class="upload_lable">
  246 + 企业负责人安全考核证
  247 + <el-upload
  248 + ref="upload"
  249 + action=""
  250 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  251 + :on-change="fileChange3"
  252 + :auto-upload="false"
  253 + :show-file-list="false"
  254 + multiple
  255 + :file-list="safetyCertificate">
  256 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  257 + </el-upload>
  258 + </div>
  259 + </el-col>
  260 + <el-col :span="21">
  261 + <div class="upload_btn">
  262 + <div v-for="(item,index) in safetyCertificate">
  263 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  264 + <div class="upload_close" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  265 + <el-image
  266 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  267 + :src="createUrl(item)"
  268 + :preview-src-list="[createUrl(item)]"
  269 + :z-index="999">
  270 + </el-image>
  271 + </div>
  272 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  273 + <div class="upload_close_file" @click="safetyCertificate.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  274 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  275 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  276 + </div>
  277 + </div>
  278 + </div>
  279 + </el-col>
  280 + </el-row>
  281 + <el-row style="border: 1px solid #dcdfe6;border-radius: 2px;">
  282 + <el-col :span="3">
  283 + <div class="upload_lable">
  284 + 停车场全景图
  285 + <el-upload
  286 + ref="upload"
  287 + action=""
  288 + accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx"
  289 + :on-change="fileChange4"
  290 + :auto-upload="false"
  291 + :show-file-list="false"
  292 + multiple
  293 + :file-list="carParkPanorama">
  294 + <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
  295 + </el-upload>
  296 + </div>
  297 + </el-col>
  298 + <el-col :span="21">
  299 + <div class="upload_btn">
  300 + <div v-for="(item,index) in carParkPanorama">
  301 + <div v-if="!/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_image">
  302 + <div class="upload_close" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  303 + <el-image
  304 + style="width: 110px; height: 95px; margin: 5px;float:left;"
  305 + :src="createUrl(item)"
  306 + :preview-src-list="[createUrl(item)]"
  307 + :z-index="999">
  308 + </el-image>
  309 + </div>
  310 + <div v-if="/\.(pjp|pdf|doc|docx|xls|xlsx)$/.test(item.name)" class="upload_div_file">
  311 + <div class="upload_close_file" @click="carParkPanorama.splice(index,1);"><el-icon class="el-icon-error"></el-icon></div>
  312 + <span @click="tempDownload(item)"><el-icon class="el-icon-document-add" style="font-size:70px;"></el-icon></span>
  313 + <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="tempDownload(item)">{{ item.name }}</div>
  314 + </div>
  315 + </div>
  316 + </div>
  317 + </el-col>
  318 + </el-row>
  319 + <!-- <el-form-item label="" prop="environmentalApproval">-->
  320 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  321 + <!-- </el-form-item>-->
  322 + <!-- <el-form-item label="" prop="authorization">-->
  323 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  324 + <!-- </el-form-item>-->
  325 + <!-- <el-form-item label="" prop="otherInformation">-->
  326 + <!-- <el-input v-model="form." type="textarea" placeholder="请输入内容" />-->
  327 + <!-- </el-form-item>-->
  328 + <!-- <el-form-item label="运输企业" prop="companyIds">-->
  329 + <!-- <el-input v-model="form.companyIds" placeholder="请输入运输企业" />-->
  330 + <!-- </el-form-item>-->
  331 + <!-- <el-form-item label="审批状态,0=审批中,1=审批通过,2=被驳回">-->
  332 + <!-- <el-radio-group v-model="form.status">-->
  333 + <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  334 + <!-- </el-radio-group>-->
  335 + <!-- </el-form-item>-->
  336 + <!-- <el-form-item label="二维码" prop="qrCode">-->
  337 + <!-- <el-input v-model="form.qrCode" placeholder="请输入二维码" />-->
  338 + <!-- </el-form-item>-->
  339 + </el-form>
  340 + <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  341 + <el-button type="primary" @click="submitForm">确 定</el-button>
  342 + <el-button @click="cancel">取 消</el-button>
  343 + </div>
  344 + </div>
  345 +</template>
  346 +
  347 +<script>
  348 +import { listEnterprise, getEnterprise, delEnterprise, addEnterprise, updateEnterprise, exportEnterprise } from "@/api/unit/enterprise";
  349 +import Treeselect from "@riophae/vue-treeselect";
  350 +import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  351 +import {getAreaList} from "@/api/casefile/remoteServer";
  352 +
  353 +export default {
  354 + name: "DisposalSite",
  355 + components: {Treeselect},
  356 + data() {
  357 + return {
  358 + // 遮罩层
  359 + loading: true,
  360 + // 选中数组
  361 + ids: [],
  362 + // 非单个禁用
  363 + single: true,
  364 + // 非多个禁用
  365 + multiple: true,
  366 + // 显示搜索条件
  367 + showSearch: true,
  368 + // 总条数
  369 + total: 0,
  370 + // 处理场所管理表格数据
  371 + disposalSiteList: [],
  372 + // 弹出层标题
  373 + title: "",
  374 + // 是否显示弹出层
  375 + open: false,
  376 + // 表单参数
  377 + form: {},
  378 + // 表单校验
  379 + rules: {
  380 + name: [
  381 + {required: true, message: "请输入企业名称", trigger: "blur"}
  382 + ],
  383 + abbreviation: [
  384 + {required: true, message: "请输入简称", trigger: "blur"}
  385 + ],
  386 + registrationArea: [
  387 + {required: true, message: "请输入注册地所在区域", trigger: "blur"}
  388 + ],
  389 + transportPermissionDate: [
  390 + {required: true, message: "请选择企业道路运输经营许可证有效期", trigger: "blur"}
  391 + ],
  392 + enterDate: [
  393 + {required: true, message: "请选择企业入市时间", trigger: "blur"}
  394 + ],
  395 + businessLicenseDate: [
  396 + {required: true, message: "请选择企业营业执照有效期", trigger: "blur"}
  397 + ],
  398 + officeAddress: [
  399 + {required: true, message: "请输入办公地址", trigger: "blur"}
  400 + ],
  401 + parkingLotLocation: [
  402 + {required: true, message: "请输入停车场位置", trigger: "blur"}
  403 + ],
  404 + parkingArea: [
  405 + {required: true, message: "请输入停车场面积", trigger: "blur"},
  406 + {pattern: /^\d+(\.\d+)?$/, message: "只能输入正数和小数", trigger: "blur"}
  407 + ],
  408 + safetyManagerName: [
  409 + {required: true, message: "请输入企业安全负责人姓名", trigger: "blur"}
  410 + ],
  411 + socialUniformCreditCodeNumber: [
  412 + {required: true, message: "请输入社会统一信用代码编号", trigger: "blur"}
  413 + ],
  414 + legalRepresentative: [
  415 + {required: true, message: "请输入法人代表", trigger: "blur"}
  416 + ],
  417 + safetyPeopleName: [
  418 + {required: true, message: "请输入安全管理人员", trigger: "blur"}
  419 + ],
  420 + },
  421 + areas:[],
  422 + // 企业道路运输经营许可证
  423 + transportPermission:[],
  424 + // 企业营业执照
  425 + enterpriseBusinessLicense:[],
  426 + // 安全员考核合格证明
  427 + safetyOfficerQualificationCertificate:[],
  428 + // 企业负责人安全考核证
  429 + safetyCertificate:[],
  430 + // 停车场全景图
  431 + carParkPanorama:[],
  432 + enterpriseList:[]
  433 + };
  434 + },
  435 + created() {
  436 + getAreaList().then(res => {
  437 + this.areas = res.data;
  438 + });
  439 + this.queryParams = {
  440 + companyType:"0"
  441 + }
  442 + listEnterprise(this.queryParams).then(response => {
  443 + this.enterpriseList = response.rows;
  444 + });
  445 + this.initData();
  446 + },
  447 + watch: {
  448 + '$route.query.enterpriseId': 'initData'
  449 + },
  450 + methods: {
  451 + reset(){
  452 + this.form = {};
  453 + this.transportPermission = [];
  454 + this.enterpriseBusinessLicense = [];
  455 + this.safetyOfficerQualificationCertificate = [];
  456 + this.safetyCertificate = [];
  457 + this.carParkPanorama = [];
  458 + },
  459 + initData(){
  460 + this.reset();
  461 + let id = this.$route.query.enterpriseId;
  462 + if(id!=null){
  463 + getEnterprise(id).then(response => {
  464 + this.form = response.data;
  465 + //将附件转换为前端可视化数组
  466 + if(this.form.transportPermission!=null&&this.form.transportPermission!==""){
  467 + let approvalDocument = this.form.transportPermission.split(";");
  468 + approvalDocument.map(item=>{
  469 + let name = item.substring(item.lastIndexOf("/")+1);
  470 + this.transportPermission.push({name:name,url:item})
  471 + })
  472 + }
  473 + if(this.form.enterpriseBusinessLicense!=null&&this.form.enterpriseBusinessLicense!==""){
  474 + let approvalData = this.form.enterpriseBusinessLicense.split(";");
  475 + approvalData.map(item=>{
  476 + let name = item.substring(item.lastIndexOf("/")+1);
  477 + this.enterpriseBusinessLicense.push({name:name,url:item})
  478 + })
  479 + }
  480 + if(this.form.safetyOfficerQualificationCertificate!=null&&this.form.safetyOfficerQualificationCertificate!==""){
  481 + let scenePhoto = this.form.safetyOfficerQualificationCertificate.split(";");
  482 + scenePhoto.map(item=>{
  483 + let name = item.substring(item.lastIndexOf("/")+1);
  484 + this.safetyOfficerQualificationCertificate.push({name:name,url:item})
  485 + })
  486 + }
  487 + if(this.form.safetyCertificate!=null&&this.form.safetyCertificate!==""){
  488 + let carWashingFacilitiesImage = this.form.safetyCertificate.split(";");
  489 + carWashingFacilitiesImage.map(item=>{
  490 + let name = item.substring(item.lastIndexOf("/")+1);
  491 + this.safetyCertificate.push({name:name,url:item})
  492 + })
  493 + }
  494 + if(this.form.carParkPanorama!=null&&this.form.carParkPanorama!==""){
  495 + let safetyAssessmentReport = this.form.carParkPanorama.split(";");
  496 + safetyAssessmentReport.map(item=>{
  497 + let name = item.substring(item.lastIndexOf("/")+1);
  498 + this.carParkPanorama.push({name:name,url:item})
  499 + })
  500 + }
  501 + });
  502 + }
  503 + },
  504 + createUrl(file){
  505 + if(file.raw!=null){
  506 + return URL.createObjectURL(file.raw);
  507 + }else{
  508 + return process.env.VUE_APP_BASE_API + file.url;
  509 + }
  510 +
  511 + },
  512 + tempDownload(row){
  513 + let name = row.name;
  514 + let url = "";
  515 + if(row.raw!=null){
  516 + url = URL.createObjectURL(row.raw);
  517 + }else{
  518 + url = process.env.VUE_APP_BASE_API + row.url;
  519 + }
  520 + const a = document.createElement('a')
  521 + a.setAttribute('download', name)
  522 + a.setAttribute('target', '_blank')
  523 + a.setAttribute('href', url);
  524 + a.click()
  525 + },
  526 + // 取消按钮
  527 + cancel() {
  528 + this.$tab.closePage({path:"/enterprise/info"}).then(() => {
  529 + this.$tab.openPage("处理场所管理", "/tool/enterprise",{enterpriseRefresh:1})
  530 + })
  531 + },
  532 + /** 提交按钮 */
  533 + submitForm() {
  534 + this.$refs["form"].validate(valid => {
  535 + if (valid) {
  536 + let phoneTest = /^1[3456789]\d{9}$/;
  537 + if(phoneTest.test(this.form.safetyManagerPhone)===false){
  538 + this.msgError("请输入正确的企业安全负责人联系方式");
  539 + return false;
  540 + }
  541 + if(phoneTest.test(this.form.legalRepresentativePhone)===false){
  542 + this.msgError("请输入正确的法人代表联系方式");
  543 + return false;
  544 + }
  545 + let formData = new FormData();
  546 + let form = this.form;
  547 + //去掉params属性
  548 + delete form.params;
  549 +
  550 + //先清空原有的附件
  551 + form.transportPermission = null;
  552 + form.enterpriseBusinessLicense = null;
  553 + form.safetyOfficerQualificationCertificate = null;
  554 + form.safetyCertificate = null;
  555 + form.carParkPanorama = null;
  556 + form.companyType = "1";
  557 +
  558 + this.transportPermission.forEach(item => {
  559 + if (item.raw != null) {
  560 + formData.append('transportPermissionFiles', item.raw)
  561 + }else{
  562 + //将原有的附件拼接到form中
  563 + form.transportPermission = form.transportPermission!==null?form.transportPermission+";"+item.url:item.url;
  564 + }
  565 + })
  566 +
  567 + this.enterpriseBusinessLicense.forEach(item => {
  568 + if (item.raw != null) {
  569 + formData.append('enterpriseBusinessLicenseFiles', item.raw)
  570 + }else{
  571 + //将原有的附件拼接到form中
  572 + form.enterpriseBusinessLicense = form.enterpriseBusinessLicense!==null?form.enterpriseBusinessLicense+";"+item.url:item.url;
  573 + }
  574 + })
  575 + this.safetyOfficerQualificationCertificate.forEach(item => {
  576 + if (item.raw != null) {
  577 + formData.append('safetyOfficerQualificationCertificateFiles', item.raw)
  578 + }else{
  579 + //将原有的附件拼接到form中
  580 + form.safetyOfficerQualificationCertificate = form.safetyOfficerQualificationCertificate!==null?form.safetyOfficerQualificationCertificate+";"+item.url:item.url;
  581 + }
  582 + })
  583 + this.safetyCertificate.forEach(item => {
  584 + if (item.raw != null) {
  585 + formData.append('safetyCertificateFiles', item.raw)
  586 + }else{
  587 + //将原有的附件拼接到form中
  588 + form.safetyCertificate = form.safetyCertificate!==null?form.safetyCertificate+";"+item.url:item.url;
  589 + }
  590 + })
  591 + this.carParkPanorama.forEach(item => {
  592 + if (item.raw != null) {
  593 + formData.append('carParkPanoramaFiles', item.raw)
  594 + }else{
  595 + //将原有的附件拼接到form中
  596 + form.carParkPanorama = form.carParkPanorama!==null?form.carParkPanorama+";"+item.url:item.url;
  597 + }
  598 + })
  599 + for (let key in form) {
  600 + formData.append(key, form[key] == null ? "" : form[key])
  601 + }
  602 + if (this.form.id != null) {
  603 + updateEnterprise(formData).then(response => {
  604 + this.msgSuccess("修改成功");
  605 + this.$tab.closePage({path:"/enterprise/infoEdit"}).then(() => {
  606 + this.$tab.openPage("运输企业管理", "/tool/enterprise",{enterpriseRefresh:1})
  607 + })
  608 + });
  609 + } else {
  610 + addEnterprise(formData).then(response => {
  611 + this.msgSuccess("新增成功");
  612 + this.$tab.closePage({path:"/enterprise/info"}).then(() => {
  613 + this.$tab.openPage("运输企业管理", "/tool/enterprise",{enterpriseRefresh:1})
  614 + })
  615 + });
  616 + }
  617 + }
  618 + });
  619 + },
  620 + /**
  621 + * 文件改变时,限制文件上传格式和大小
  622 + * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
  623 + * 大小不超过20M
  624 + * */
  625 + fileChange(file, fileList) {
  626 + let count = 0;
  627 + for (let i = 0; i < fileList.length; i++) {
  628 + // console.log(fileList.length)
  629 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  630 + if (fileList[i].name == file.name) {
  631 + count++;
  632 + if (count == 2) {
  633 + this.$message({
  634 + message: '已存在此文件!',
  635 + type: 'warning'
  636 + });
  637 + for (let j = fileList.length; j > 0; j--) {
  638 + //如果存在此文件,去除新选择的重复文件
  639 + if (fileList[j - 1].name == file.name) {
  640 + fileList.splice(j - 1, 1);
  641 + i--;
  642 + return false;
  643 + }
  644 + }
  645 + }
  646 + }
  647 + }
  648 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  649 + //格式符合后判断大小
  650 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  651 + let max5M = file.size / 1024 / 1024 < 100;
  652 + if (!max5M) {
  653 + this.$message({
  654 + message: '上传文件大小不得超过100M!',
  655 + type: 'warning'
  656 + });
  657 + fileList = fileList.splice(fileList.length - 1, 1);
  658 + } else {
  659 + //符合条件后进行添加
  660 + this.transportPermission = fileList
  661 + }
  662 + } else {
  663 + this.$message({
  664 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  665 + type: 'warning'
  666 + });
  667 + fileList = fileList.splice(fileList.length - 1, 1);
  668 + }
  669 + },
  670 + fileChange1(file, fileList) {
  671 + let count = 0;
  672 + for (let i = 0; i < fileList.length; i++) {
  673 + // console.log(fileList.length)
  674 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  675 + if (fileList[i].name == file.name) {
  676 + count++;
  677 + if (count == 2) {
  678 + this.$message({
  679 + message: '已存在此文件!',
  680 + type: 'warning'
  681 + });
  682 + for (let j = fileList.length; j > 0; j--) {
  683 + //如果存在此文件,去除新选择的重复文件
  684 + if (fileList[j - 1].name == file.name) {
  685 + fileList.splice(j - 1, 1);
  686 + i--;
  687 + return false;
  688 + }
  689 + }
  690 + }
  691 + }
  692 + }
  693 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  694 + //格式符合后判断大小
  695 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  696 + let max5M = file.size / 1024 / 1024 < 100;
  697 + if (!max5M) {
  698 + this.$message({
  699 + message: '上传文件大小不得超过100M!',
  700 + type: 'warning'
  701 + });
  702 + fileList = fileList.splice(fileList.length - 1, 1);
  703 + } else {
  704 + //符合条件后进行添加
  705 + this.enterpriseBusinessLicense = fileList
  706 + }
  707 + } else {
  708 + this.$message({
  709 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  710 + type: 'warning'
  711 + });
  712 + fileList = fileList.splice(fileList.length - 1, 1);
  713 + }
  714 + },
  715 + fileChange2(file, fileList) {
  716 + let count = 0;
  717 + for (let i = 0; i < fileList.length; i++) {
  718 + // console.log(fileList.length)
  719 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  720 + if (fileList[i].name == file.name) {
  721 + count++;
  722 + if (count == 2) {
  723 + this.$message({
  724 + message: '已存在此文件!',
  725 + type: 'warning'
  726 + });
  727 + for (let j = fileList.length; j > 0; j--) {
  728 + //如果存在此文件,去除新选择的重复文件
  729 + if (fileList[j - 1].name == file.name) {
  730 + fileList.splice(j - 1, 1);
  731 + i--;
  732 + return false;
  733 + }
  734 + }
  735 + }
  736 + }
  737 + }
  738 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  739 + //格式符合后判断大小
  740 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  741 + let max5M = file.size / 1024 / 1024 < 100;
  742 + if (!max5M) {
  743 + this.$message({
  744 + message: '上传文件大小不得超过100M!',
  745 + type: 'warning'
  746 + });
  747 + fileList = fileList.splice(fileList.length - 1, 1);
  748 + } else {
  749 + //符合条件后进行添加
  750 + this.safetyOfficerQualificationCertificate = fileList
  751 + }
  752 + } else {
  753 + this.$message({
  754 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  755 + type: 'warning'
  756 + });
  757 + fileList = fileList.splice(fileList.length - 1, 1);
  758 + }
  759 + },
  760 + fileChange3(file, fileList) {
  761 + let count = 0;
  762 + for (let i = 0; i < fileList.length; i++) {
  763 + // console.log(fileList.length)
  764 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  765 + if (fileList[i].name == file.name) {
  766 + count++;
  767 + if (count == 2) {
  768 + this.$message({
  769 + message: '已存在此文件!',
  770 + type: 'warning'
  771 + });
  772 + for (let j = fileList.length; j > 0; j--) {
  773 + //如果存在此文件,去除新选择的重复文件
  774 + if (fileList[j - 1].name == file.name) {
  775 + fileList.splice(j - 1, 1);
  776 + i--;
  777 + return false;
  778 + }
  779 + }
  780 + }
  781 + }
  782 + }
  783 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  784 + //格式符合后判断大小
  785 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  786 + let max5M = file.size / 1024 / 1024 < 100;
  787 + if (!max5M) {
  788 + this.$message({
  789 + message: '上传文件大小不得超过100M!',
  790 + type: 'warning'
  791 + });
  792 + fileList = fileList.splice(fileList.length - 1, 1);
  793 + } else {
  794 + //符合条件后进行添加
  795 + this.safetyCertificate = fileList
  796 + }
  797 + } else {
  798 + this.$message({
  799 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  800 + type: 'warning'
  801 + });
  802 + fileList = fileList.splice(fileList.length - 1, 1);
  803 + }
  804 + },
  805 + fileChange4(file, fileList) {
  806 + let count = 0;
  807 + for (let i = 0; i < fileList.length; i++) {
  808 + // console.log(fileList.length)
  809 + // console.log(this.fileEntityList[i].name+"111"+file.name)
  810 + if (fileList[i].name == file.name) {
  811 + count++;
  812 + if (count == 2) {
  813 + this.$message({
  814 + message: '已存在此文件!',
  815 + type: 'warning'
  816 + });
  817 + for (let j = fileList.length; j > 0; j--) {
  818 + //如果存在此文件,去除新选择的重复文件
  819 + if (fileList[j - 1].name == file.name) {
  820 + fileList.splice(j - 1, 1);
  821 + i--;
  822 + return false;
  823 + }
  824 + }
  825 + }
  826 + }
  827 + }
  828 + let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
  829 + //格式符合后判断大小
  830 + if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp,pdf,doc,docx,xls,xlsx".indexOf(fileType) != -1) {
  831 + let max5M = file.size / 1024 / 1024 < 100;
  832 + if (!max5M) {
  833 + this.$message({
  834 + message: '上传文件大小不得超过100M!',
  835 + type: 'warning'
  836 + });
  837 + fileList = fileList.splice(fileList.length - 1, 1);
  838 + } else {
  839 + //符合条件后进行添加
  840 + this.carParkPanorama = fileList
  841 + }
  842 + } else {
  843 + this.$message({
  844 + message: '上传文件只能是.jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp,.pdf,.doc,.docx,.xls,.xlsx格式!',
  845 + type: 'warning'
  846 + });
  847 + fileList = fileList.splice(fileList.length - 1, 1);
  848 + }
  849 + },
  850 + }
  851 +};
  852 +</script>
  853 +<style lang="scss" scoped>
  854 +.upload_lable{
  855 + border-right: 1px solid #dcdfe6;
  856 + padding: 27px 30px;
  857 + background: #fafafa;
  858 + text-align: center;
  859 +}
  860 +.upload_btn{
  861 + max-height: 106px;
  862 +}
  863 +.upload_close{
  864 + position: absolute;
  865 + left: 105px;
  866 + z-index:99;
  867 + top:-1px;
  868 + font-size:18px;
  869 + color:red;
  870 +}
  871 +.upload_close_file{
  872 + position: absolute;
  873 + left: 80px;
  874 + z-index:99;
  875 + top:-1px;
  876 + font-size:18px;
  877 + color:red;
  878 +}
  879 +.upload_div_image{
  880 + display: inline-block;
  881 + width: 110px;
  882 + height: 95px;
  883 + position: relative;
  884 + float: left;
  885 + margin-left: 5px;
  886 +}
  887 +.upload_div_file{
  888 + display: inline-block;
  889 + width: 110px;
  890 + height: 95px;
  891 + text-align: center;
  892 + float:left;
  893 + margin: 5px;
  894 + position: relative;
  895 +}
  896 +.serach_map{
  897 + position: absolute;
  898 + top: 100px;
  899 + left: 25px;
  900 + z-index: 999;
  901 + background: #fff;
  902 + padding: 10px;
  903 + border-radius: 5px;
  904 + box-shadow: 0 0 10px rgba(0,0,0,.2);
  905 +}
  906 +</style>
trash-unit/src/main/java/com/trash/carInfo/controller/CarInfoController.java
1 package com.trash.carInfo.controller; 1 package com.trash.carInfo.controller;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +
  6 +import com.trash.carInfo.domain.vo.CarInfoVo;
4 import org.springframework.security.access.prepost.PreAuthorize; 7 import org.springframework.security.access.prepost.PreAuthorize;
5 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
6 -import org.springframework.web.bind.annotation.GetMapping;  
7 -import org.springframework.web.bind.annotation.PostMapping;  
8 -import org.springframework.web.bind.annotation.PutMapping;  
9 -import org.springframework.web.bind.annotation.DeleteMapping;  
10 -import org.springframework.web.bind.annotation.PathVariable;  
11 -import org.springframework.web.bind.annotation.RequestBody;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RestController; 9 +import org.springframework.web.bind.annotation.*;
14 import com.trash.common.annotation.Log; 10 import com.trash.common.annotation.Log;
15 import com.trash.common.core.controller.BaseController; 11 import com.trash.common.core.controller.BaseController;
16 import com.trash.common.core.domain.AjaxResult; 12 import com.trash.common.core.domain.AjaxResult;
@@ -19,15 +15,16 @@ import com.trash.carInfo.domain.CarInfo; @@ -19,15 +15,16 @@ import com.trash.carInfo.domain.CarInfo;
19 import com.trash.carInfo.service.ICarInfoService; 15 import com.trash.carInfo.service.ICarInfoService;
20 import com.trash.common.utils.poi.ExcelUtil; 16 import com.trash.common.utils.poi.ExcelUtil;
21 import com.trash.common.core.page.TableDataInfo; 17 import com.trash.common.core.page.TableDataInfo;
  18 +import org.springframework.web.multipart.MultipartFile;
22 19
23 /** 20 /**
24 * 运输车辆管理Controller 21 * 运输车辆管理Controller
25 * 22 *
26 * @author trash 23 * @author trash
27 - * @date 2023-11-15 24 + * @date 2023-11-21
28 */ 25 */
29 @RestController 26 @RestController
30 -@RequestMapping("/carInfo") 27 +@RequestMapping("/unit/carInfo")
31 public class CarInfoController extends BaseController 28 public class CarInfoController extends BaseController
32 { 29 {
33 @Autowired 30 @Autowired
@@ -36,32 +33,32 @@ public class CarInfoController extends BaseController @@ -36,32 +33,32 @@ public class CarInfoController extends BaseController
36 /** 33 /**
37 * 查询运输车辆管理列表 34 * 查询运输车辆管理列表
38 */ 35 */
39 -// @PreAuthorize("@ss.hasPermi('carInfo:carInfo:list')") 36 + @PreAuthorize("@ss.hasPermi('unit:carInfo:list')")
40 @GetMapping("/list") 37 @GetMapping("/list")
41 - public TableDataInfo list(CarInfo carInfo) 38 + public TableDataInfo list(CarInfoVo carInfo)
42 { 39 {
43 startPage(); 40 startPage();
44 - List<CarInfo> list = carInfoService.selectCarInfoList(carInfo); 41 + List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo);
45 return getDataTable(list); 42 return getDataTable(list);
46 } 43 }
47 44
48 /** 45 /**
49 * 导出运输车辆管理列表 46 * 导出运输车辆管理列表
50 */ 47 */
51 - @PreAuthorize("@ss.hasPermi('carInfo:carInfo:export')") 48 + @PreAuthorize("@ss.hasPermi('unit:carInfo:export')")
52 @Log(title = "运输车辆管理", businessType = BusinessType.EXPORT) 49 @Log(title = "运输车辆管理", businessType = BusinessType.EXPORT)
53 @GetMapping("/export") 50 @GetMapping("/export")
54 - public AjaxResult export(CarInfo carInfo) 51 + public AjaxResult export(CarInfoVo carInfo)
55 { 52 {
56 - List<CarInfo> list = carInfoService.selectCarInfoList(carInfo);  
57 - ExcelUtil<CarInfo> util = new ExcelUtil<CarInfo>(CarInfo.class); 53 + List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo);
  54 + ExcelUtil<CarInfoVo> util = new ExcelUtil<CarInfoVo>(CarInfoVo.class);
58 return util.exportExcel(list, "carInfo"); 55 return util.exportExcel(list, "carInfo");
59 } 56 }
60 57
61 /** 58 /**
62 * 获取运输车辆管理详细信息 59 * 获取运输车辆管理详细信息
63 */ 60 */
64 - @PreAuthorize("@ss.hasPermi('carInfo:carInfo:query')") 61 + @PreAuthorize("@ss.hasPermi('unit:carInfo:query')")
65 @GetMapping(value = "/{id}") 62 @GetMapping(value = "/{id}")
66 public AjaxResult getInfo(@PathVariable("id") Long id) 63 public AjaxResult getInfo(@PathVariable("id") Long id)
67 { 64 {
@@ -71,29 +68,39 @@ public class CarInfoController extends BaseController @@ -71,29 +68,39 @@ public class CarInfoController extends BaseController
71 /** 68 /**
72 * 新增运输车辆管理 69 * 新增运输车辆管理
73 */ 70 */
74 - @PreAuthorize("@ss.hasPermi('carInfo:carInfo:add')") 71 + @PreAuthorize("@ss.hasPermi('unit:carInfo:add')")
75 @Log(title = "运输车辆管理", businessType = BusinessType.INSERT) 72 @Log(title = "运输车辆管理", businessType = BusinessType.INSERT)
76 @PostMapping 73 @PostMapping
77 - public AjaxResult add(@RequestBody CarInfo carInfo)  
78 - {  
79 - return toAjax(carInfoService.insertCarInfo(carInfo)); 74 + public AjaxResult add(@RequestParam(value = "roadTransportFiles") MultipartFile[] roadTransportFiles,
  75 + @RequestParam(value = "drivingLicenseFiles") MultipartFile[] drivingLicenseFiles,
  76 + @RequestParam(value = "carFrontFiles") MultipartFile[] carFrontFiles,
  77 + @RequestParam(value = "carLeftFiles") MultipartFile[] carLeftFiles,
  78 + @RequestParam(value = "carBehindFiles") MultipartFile[] carBehindFiles,
  79 + @RequestParam(value = "carRightFiles") MultipartFile[] carRightFiles,
  80 + CarInfo carInfo) throws IOException {
  81 + return toAjax(carInfoService.insertCarInfo(roadTransportFiles, drivingLicenseFiles, carFrontFiles, carLeftFiles, carBehindFiles, carRightFiles, carInfo));
80 } 82 }
81 83
82 /** 84 /**
83 * 修改运输车辆管理 85 * 修改运输车辆管理
84 */ 86 */
85 - @PreAuthorize("@ss.hasPermi('carInfo:carInfo:edit')") 87 + @PreAuthorize("@ss.hasPermi('unit:carInfo:edit')")
86 @Log(title = "运输车辆管理", businessType = BusinessType.UPDATE) 88 @Log(title = "运输车辆管理", businessType = BusinessType.UPDATE)
87 @PutMapping 89 @PutMapping
88 - public AjaxResult edit(@RequestBody CarInfo carInfo)  
89 - {  
90 - return toAjax(carInfoService.updateCarInfo(carInfo)); 90 + public AjaxResult edit(@RequestParam(value = "roadTransportFiles") MultipartFile[] roadTransportFiles,
  91 + @RequestParam(value = "drivingLicenseFiles") MultipartFile[] drivingLicenseFiles,
  92 + @RequestParam(value = "carFrontFiles") MultipartFile[] carFrontFiles,
  93 + @RequestParam(value = "carLeftFiles") MultipartFile[] carLeftFiles,
  94 + @RequestParam(value = "carBehindFiles") MultipartFile[] carBehindFiles,
  95 + @RequestParam(value = "carRightFiles") MultipartFile[] carRightFiles,
  96 + CarInfo carInfo) throws IOException {
  97 + return toAjax(carInfoService.updateCarInfo(roadTransportFiles, drivingLicenseFiles, carFrontFiles, carLeftFiles, carBehindFiles, carRightFiles, carInfo));
91 } 98 }
92 99
93 /** 100 /**
94 * 删除运输车辆管理 101 * 删除运输车辆管理
95 */ 102 */
96 - @PreAuthorize("@ss.hasPermi('carInfo:carInfo:remove')") 103 + @PreAuthorize("@ss.hasPermi('unit:carInfo:remove')")
97 @Log(title = "运输车辆管理", businessType = BusinessType.DELETE) 104 @Log(title = "运输车辆管理", businessType = BusinessType.DELETE)
98 @DeleteMapping("/{ids}") 105 @DeleteMapping("/{ids}")
99 public AjaxResult remove(@PathVariable Long[] ids) 106 public AjaxResult remove(@PathVariable Long[] ids)
trash-unit/src/main/java/com/trash/carInfo/domain/CarDriverRelation.java 0 → 100644
  1 +package com.trash.carInfo.domain;
  2 +
  3 +public class CarDriverRelation {
  4 +
  5 + private Long id;
  6 +
  7 + private Long carId;
  8 +
  9 +
  10 + private Long driverId;
  11 +
  12 + public Long getId() {
  13 + return id;
  14 + }
  15 +
  16 + public void setId(Long id) {
  17 + this.id = id;
  18 + }
  19 +
  20 + public Long getCarId() {
  21 + return carId;
  22 + }
  23 +
  24 + public void setCarId(Long carId) {
  25 + this.carId = carId;
  26 + }
  27 +
  28 + public Long getDriverId() {
  29 + return driverId;
  30 + }
  31 +
  32 + public void setDriverId(Long driverId) {
  33 + this.driverId = driverId;
  34 + }
  35 +}
trash-unit/src/main/java/com/trash/carInfo/domain/CarInfo.java
@@ -11,7 +11,7 @@ import com.trash.common.core.domain.BaseEntity; @@ -11,7 +11,7 @@ import com.trash.common.core.domain.BaseEntity;
11 * 运输车辆管理对象 car_info 11 * 运输车辆管理对象 car_info
12 * 12 *
13 * @author trash 13 * @author trash
14 - * @date 2023-11-15 14 + * @date 2023-11-21
15 */ 15 */
16 public class CarInfo extends BaseEntity 16 public class CarInfo extends BaseEntity
17 { 17 {
@@ -63,10 +63,14 @@ public class CarInfo extends BaseEntity @@ -63,10 +63,14 @@ public class CarInfo extends BaseEntity
63 @Excel(name = "车辆标识牌") 63 @Excel(name = "车辆标识牌")
64 private String carIdentification; 64 private String carIdentification;
65 65
66 - /** 车辆体积 */  
67 - @Excel(name = "车辆体积") 66 + /** 货箱体积 */
  67 + @Excel(name = "货箱体积")
68 private String containerVolume; 68 private String containerVolume;
69 69
  70 + /** 货箱长宽高 */
  71 + @Excel(name = "货箱长宽高")
  72 + private String lengthWidthHeight;
  73 +
70 /** 车辆颜色 */ 74 /** 车辆颜色 */
71 @Excel(name = "车辆颜色") 75 @Excel(name = "车辆颜色")
72 private String carColor; 76 private String carColor;
@@ -104,10 +108,26 @@ public class CarInfo extends BaseEntity @@ -104,10 +108,26 @@ public class CarInfo extends BaseEntity
104 private String drivers; 108 private String drivers;
105 109
106 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */ 110 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */
107 - @Excel(name = "审批状态,0=审批中,1=审批通过,2=被驳回") 111 + @Excel(name = "审批状态",readConverterExp = "0=审批中,1=审批通过,2=被驳回")
108 private Integer status; 112 private Integer status;
109 113
110 - public void setId(Long id) 114 + /** 信用状态 */
  115 + @Excel(name = "信用状态")
  116 + private String creditStatus;
  117 +
  118 + /** 二维码 */
  119 + @Excel(name = "二维码")
  120 + private String qrCode;
  121 +
  122 + public String getLengthWidthHeight() {
  123 + return lengthWidthHeight;
  124 + }
  125 +
  126 + public void setLengthWidthHeight(String lengthWidthHeight) {
  127 + this.lengthWidthHeight = lengthWidthHeight;
  128 + }
  129 +
  130 + public void setId(Long id)
111 { 131 {
112 this.id = id; 132 this.id = id;
113 } 133 }
@@ -305,6 +325,24 @@ public class CarInfo extends BaseEntity @@ -305,6 +325,24 @@ public class CarInfo extends BaseEntity
305 { 325 {
306 return status; 326 return status;
307 } 327 }
  328 + public void setCreditStatus(String creditStatus)
  329 + {
  330 + this.creditStatus = creditStatus;
  331 + }
  332 +
  333 + public String getCreditStatus()
  334 + {
  335 + return creditStatus;
  336 + }
  337 + public void setQrCode(String qrCode)
  338 + {
  339 + this.qrCode = qrCode;
  340 + }
  341 +
  342 + public String getQrCode()
  343 + {
  344 + return qrCode;
  345 + }
308 346
309 @Override 347 @Override
310 public String toString() { 348 public String toString() {
@@ -336,6 +374,8 @@ public class CarInfo extends BaseEntity @@ -336,6 +374,8 @@ public class CarInfo extends BaseEntity
336 .append("createBy", getCreateBy()) 374 .append("createBy", getCreateBy())
337 .append("updateTime", getUpdateTime()) 375 .append("updateTime", getUpdateTime())
338 .append("updateBy", getUpdateBy()) 376 .append("updateBy", getUpdateBy())
  377 + .append("creditStatus", getCreditStatus())
  378 + .append("qrCode", getQrCode())
339 .toString(); 379 .toString();
340 } 380 }
341 } 381 }
trash-unit/src/main/java/com/trash/carInfo/domain/vo/CarInfoVo.java 0 → 100644
  1 +package com.trash.carInfo.domain.vo;
  2 +
  3 +import com.trash.carInfo.domain.CarInfo;
  4 +
  5 +public class CarInfoVo extends CarInfo {
  6 + private String companyName;
  7 +
  8 + private String driversName;
  9 +
  10 + public String getCompanyName() {
  11 + return companyName;
  12 + }
  13 +
  14 + public void setCompanyName(String companyName) {
  15 + this.companyName = companyName;
  16 + }
  17 +
  18 + public String getDriversName() {
  19 + return driversName;
  20 + }
  21 +
  22 + public void setDriversName(String driversName) {
  23 + this.driversName = driversName;
  24 + }
  25 +}
trash-unit/src/main/java/com/trash/carInfo/mapper/CarInfoMapper.java
1 package com.trash.carInfo.mapper; 1 package com.trash.carInfo.mapper;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +
  5 +import com.trash.carInfo.domain.CarDriverRelation;
4 import com.trash.carInfo.domain.CarInfo; 6 import com.trash.carInfo.domain.CarInfo;
  7 +import com.trash.carInfo.domain.vo.CarInfoVo;
5 8
6 /** 9 /**
7 * 运输车辆管理Mapper接口 10 * 运输车辆管理Mapper接口
8 * 11 *
9 * @author trash 12 * @author trash
10 - * @date 2023-11-15 13 + * @date 2023-11-21
11 */ 14 */
12 public interface CarInfoMapper 15 public interface CarInfoMapper
13 { 16 {
@@ -25,7 +28,7 @@ public interface CarInfoMapper @@ -25,7 +28,7 @@ public interface CarInfoMapper
25 * @param carInfo 运输车辆管理 28 * @param carInfo 运输车辆管理
26 * @return 运输车辆管理集合 29 * @return 运输车辆管理集合
27 */ 30 */
28 - List<CarInfo> selectCarInfoList(CarInfo carInfo); 31 + List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo);
29 32
30 /** 33 /**
31 * 新增运输车辆管理 34 * 新增运输车辆管理
@@ -58,4 +61,19 @@ public interface CarInfoMapper @@ -58,4 +61,19 @@ public interface CarInfoMapper
58 * @return 结果 61 * @return 结果
59 */ 62 */
60 int deleteCarInfoByIds(Long[] ids); 63 int deleteCarInfoByIds(Long[] ids);
  64 +
  65 + /**
  66 + * 新增车辆驾驶员关系
  67 + * @return 结果
  68 + */
  69 + int addCarDriverRelation(CarDriverRelation carDriverRelation);
  70 +
  71 + /**
  72 + * 删除车辆驾驶员关系
  73 + * @param carId 车辆id
  74 + * @return 结果
  75 + */
  76 + int deleteCarDriverRelationByCarId(Long carId);
  77 +
  78 +
61 } 79 }
trash-unit/src/main/java/com/trash/carInfo/service/ICarInfoService.java
1 package com.trash.carInfo.service; 1 package com.trash.carInfo.service;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
4 import com.trash.carInfo.domain.CarInfo; 5 import com.trash.carInfo.domain.CarInfo;
  6 +import com.trash.carInfo.domain.vo.CarInfoVo;
  7 +import org.springframework.web.multipart.MultipartFile;
5 8
6 /** 9 /**
7 * 运输车辆管理Service接口 10 * 运输车辆管理Service接口
8 * 11 *
9 * @author trash 12 * @author trash
10 - * @date 2023-11-15 13 + * @date 2023-11-21
11 */ 14 */
12 public interface ICarInfoService 15 public interface ICarInfoService
13 { 16 {
@@ -21,27 +24,51 @@ public interface ICarInfoService @@ -21,27 +24,51 @@ public interface ICarInfoService
21 24
22 /** 25 /**
23 * 查询运输车辆管理列表 26 * 查询运输车辆管理列表
24 - * 27 + *
25 * @param carInfo 运输车辆管理 28 * @param carInfo 运输车辆管理
26 * @return 运输车辆管理集合 29 * @return 运输车辆管理集合
27 */ 30 */
28 - List<CarInfo> selectCarInfoList(CarInfo carInfo); 31 + List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo);
29 32
30 /** 33 /**
31 * 新增运输车辆管理 34 * 新增运输车辆管理
32 - *  
33 - * @param carInfo 运输车辆管理 35 + *
  36 + * @param roadTransportFiles
  37 + * @param drivingLicenseFiles
  38 + * @param carFrontFiles
  39 + * @param carLeftFiles
  40 + * @param carBehindFiles
  41 + * @param carRightFiles
  42 + * @param carInfo 运输车辆管理
34 * @return 结果 43 * @return 结果
35 */ 44 */
36 - int insertCarInfo(CarInfo carInfo); 45 + int insertCarInfo(MultipartFile[] roadTransportFiles,
  46 + MultipartFile[] drivingLicenseFiles,
  47 + MultipartFile[] carFrontFiles,
  48 + MultipartFile[] carLeftFiles,
  49 + MultipartFile[] carBehindFiles,
  50 + MultipartFile[] carRightFiles,
  51 + CarInfo carInfo) throws IOException;
37 52
38 /** 53 /**
39 * 修改运输车辆管理 54 * 修改运输车辆管理
40 - *  
41 - * @param carInfo 运输车辆管理 55 + *
  56 + * @param roadTransportFiles
  57 + * @param drivingLicenseFiles
  58 + * @param carFrontFiles
  59 + * @param carLeftFiles
  60 + * @param carBehindFiles
  61 + * @param carRightFiles
  62 + * @param carInfo 运输车辆管理
42 * @return 结果 63 * @return 结果
43 */ 64 */
44 - int updateCarInfo(CarInfo carInfo); 65 + int updateCarInfo(MultipartFile[] roadTransportFiles,
  66 + MultipartFile[] drivingLicenseFiles,
  67 + MultipartFile[] carFrontFiles,
  68 + MultipartFile[] carLeftFiles,
  69 + MultipartFile[] carBehindFiles,
  70 + MultipartFile[] carRightFiles,
  71 + CarInfo carInfo) throws IOException;
45 72
46 /** 73 /**
47 * 批量删除运输车辆管理 74 * 批量删除运输车辆管理
trash-unit/src/main/java/com/trash/carInfo/service/impl/CarInfoServiceImpl.java
1 package com.trash.carInfo.service.impl; 1 package com.trash.carInfo.service.impl;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +
  6 +import com.trash.carInfo.domain.CarDriverRelation;
  7 +import com.trash.carInfo.domain.vo.CarInfoVo;
  8 +import com.trash.common.config.trashConfig;
4 import com.trash.common.utils.DateUtils; 9 import com.trash.common.utils.DateUtils;
  10 +import com.trash.common.utils.SecurityUtils;
  11 +import com.trash.enterprise.domain.TransportationEnterprise;
  12 +import com.trash.enterprise.mapper.TransportationEnterpriseMapper;
5 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 14 import org.springframework.stereotype.Service;
7 import com.trash.carInfo.mapper.CarInfoMapper; 15 import com.trash.carInfo.mapper.CarInfoMapper;
8 import com.trash.carInfo.domain.CarInfo; 16 import com.trash.carInfo.domain.CarInfo;
9 import com.trash.carInfo.service.ICarInfoService; 17 import com.trash.carInfo.service.ICarInfoService;
  18 +import org.springframework.transaction.annotation.Transactional;
  19 +import org.springframework.web.multipart.MultipartFile;
  20 +
  21 +import static com.trash.common.utils.file.FileUploadUtils.upload;
10 22
11 /** 23 /**
12 * 运输车辆管理Service业务层处理 24 * 运输车辆管理Service业务层处理
13 * 25 *
14 * @author trash 26 * @author trash
15 - * @date 2023-11-15 27 + * @date 2023-11-21
16 */ 28 */
17 @Service 29 @Service
18 public class CarInfoServiceImpl implements ICarInfoService 30 public class CarInfoServiceImpl implements ICarInfoService
@@ -20,6 +32,9 @@ public class CarInfoServiceImpl implements ICarInfoService @@ -20,6 +32,9 @@ public class CarInfoServiceImpl implements ICarInfoService
20 @Autowired 32 @Autowired
21 private CarInfoMapper carInfoMapper; 33 private CarInfoMapper carInfoMapper;
22 34
  35 + @Autowired
  36 + private TransportationEnterpriseMapper transportationEnterpriseMapper;
  37 +
23 /** 38 /**
24 * 查询运输车辆管理 39 * 查询运输车辆管理
25 * 40 *
@@ -34,39 +49,124 @@ public class CarInfoServiceImpl implements ICarInfoService @@ -34,39 +49,124 @@ public class CarInfoServiceImpl implements ICarInfoService
34 49
35 /** 50 /**
36 * 查询运输车辆管理列表 51 * 查询运输车辆管理列表
37 - * 52 + *
38 * @param carInfo 运输车辆管理 53 * @param carInfo 运输车辆管理
39 * @return 运输车辆管理 54 * @return 运输车辆管理
40 */ 55 */
41 @Override 56 @Override
42 - public List<CarInfo> selectCarInfoList(CarInfo carInfo) 57 + public List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo)
43 { 58 {
44 return carInfoMapper.selectCarInfoList(carInfo); 59 return carInfoMapper.selectCarInfoList(carInfo);
45 } 60 }
46 61
47 /** 62 /**
48 * 新增运输车辆管理 63 * 新增运输车辆管理
49 - *  
50 - * @param carInfo 运输车辆管理 64 + *
  65 + * @param roadTransportFiles
  66 + * @param drivingLicenseFiles
  67 + * @param carFrontFiles
  68 + * @param carLeftFiles
  69 + * @param carBehindFiles
  70 + * @param carRightFiles
  71 + * @param carInfo 运输车辆管理
51 * @return 结果 72 * @return 结果
52 */ 73 */
53 @Override 74 @Override
54 - public int insertCarInfo(CarInfo carInfo)  
55 - { 75 + @Transactional
  76 + public int insertCarInfo(MultipartFile[] roadTransportFiles, MultipartFile[] drivingLicenseFiles, MultipartFile[] carFrontFiles, MultipartFile[] carLeftFiles, MultipartFile[] carBehindFiles, MultipartFile[] carRightFiles, CarInfo carInfo) throws IOException {
56 carInfo.setCreateTime(DateUtils.getNowDate()); 77 carInfo.setCreateTime(DateUtils.getNowDate());
57 - return carInfoMapper.insertCarInfo(carInfo); 78 + carInfo.setCreateBy(SecurityUtils.getUsername());
  79 + carInfo.setCreditStatus("正常");
  80 + carInfo.setStatus(0);
  81 + for (MultipartFile file : roadTransportFiles) {
  82 + carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file));
  83 + }
  84 + for (MultipartFile file : drivingLicenseFiles) {
  85 + carInfo.setDrivingLicense(carInfo.getDrivingLicense()!=null?carInfo.getDrivingLicense()+";"+uploadFile(file):uploadFile(file));
  86 + }
  87 + for (MultipartFile file : carFrontFiles) {
  88 + carInfo.setCarFront(carInfo.getCarFront()!=null?carInfo.getCarFront()+";"+uploadFile(file):uploadFile(file));
  89 + }
  90 + for (MultipartFile file : carLeftFiles) {
  91 + carInfo.setCarLeft(carInfo.getCarLeft()!=null?carInfo.getCarLeft()+";"+uploadFile(file):uploadFile(file));
  92 + }
  93 + for (MultipartFile file : carBehindFiles) {
  94 + carInfo.setCarBehind(carInfo.getCarBehind()!=null?carInfo.getCarBehind()+";"+uploadFile(file):uploadFile(file));
  95 + }
  96 + for (MultipartFile file : carRightFiles) {
  97 + carInfo.setCarRight(carInfo.getCarRight()!=null?carInfo.getCarRight()+";"+uploadFile(file):uploadFile(file));
  98 + }
  99 + carInfo.setRoadTransport(removeSemicolon(carInfo.getRoadTransport()));
  100 + carInfo.setDrivingLicense(removeSemicolon(carInfo.getDrivingLicense()));
  101 + carInfo.setCarFront(removeSemicolon(carInfo.getCarFront()));
  102 + carInfo.setCarLeft(removeSemicolon(carInfo.getCarLeft()));
  103 + carInfo.setCarBehind(removeSemicolon(carInfo.getCarBehind()));
  104 + carInfo.setCarRight(removeSemicolon(carInfo.getCarRight()));
  105 + int result = carInfoMapper.insertCarInfo(carInfo);
  106 +
  107 + String[] Drivers = carInfo.getDrivers().split(",");
  108 + int carCount = 0;
  109 + for (String driver : Drivers) {
  110 + CarDriverRelation carDriverRelation = new CarDriverRelation();
  111 + carDriverRelation.setCarId(carInfo.getId());
  112 + carDriverRelation.setDriverId(Long.parseLong(driver));
  113 + carCount = carCount+carInfoMapper.addCarDriverRelation(carDriverRelation);
  114 + }
  115 +
  116 + return result;
58 } 117 }
59 118
60 /** 119 /**
61 * 修改运输车辆管理 120 * 修改运输车辆管理
62 - *  
63 - * @param carInfo 运输车辆管理 121 + *
  122 + * @param roadTransportFiles
  123 + * @param drivingLicenseFiles
  124 + * @param carFrontFiles
  125 + * @param carLeftFiles
  126 + * @param carBehindFiles
  127 + * @param carRightFiles
  128 + * @param carInfo 运输车辆管理
64 * @return 结果 129 * @return 结果
65 */ 130 */
66 @Override 131 @Override
67 - public int updateCarInfo(CarInfo carInfo)  
68 - { 132 + public int updateCarInfo(MultipartFile[] roadTransportFiles, MultipartFile[] drivingLicenseFiles, MultipartFile[] carFrontFiles, MultipartFile[] carLeftFiles, MultipartFile[] carBehindFiles, MultipartFile[] carRightFiles, CarInfo carInfo) throws IOException {
69 carInfo.setUpdateTime(DateUtils.getNowDate()); 133 carInfo.setUpdateTime(DateUtils.getNowDate());
  134 + carInfo.setUpdateBy(SecurityUtils.getUsername());
  135 + for (MultipartFile file : roadTransportFiles) {
  136 + carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file));
  137 + }
  138 + for (MultipartFile file : drivingLicenseFiles) {
  139 + carInfo.setDrivingLicense(carInfo.getDrivingLicense()!=null?carInfo.getDrivingLicense()+";"+uploadFile(file):uploadFile(file));
  140 + }
  141 + for (MultipartFile file : carFrontFiles) {
  142 + carInfo.setCarFront(carInfo.getCarFront()!=null?carInfo.getCarFront()+";"+uploadFile(file):uploadFile(file));
  143 + }
  144 + for (MultipartFile file : carLeftFiles) {
  145 + carInfo.setCarLeft(carInfo.getCarLeft()!=null?carInfo.getCarLeft()+";"+uploadFile(file):uploadFile(file));
  146 + }
  147 + for (MultipartFile file : carBehindFiles) {
  148 + carInfo.setCarBehind(carInfo.getCarBehind()!=null?carInfo.getCarBehind()+";"+uploadFile(file):uploadFile(file));
  149 + }
  150 + for (MultipartFile file : carRightFiles) {
  151 + carInfo.setCarRight(carInfo.getCarRight()!=null?carInfo.getCarRight()+";"+uploadFile(file):uploadFile(file));
  152 + }
  153 + carInfo.setRoadTransport(removeSemicolon(carInfo.getRoadTransport()));
  154 + carInfo.setDrivingLicense(removeSemicolon(carInfo.getDrivingLicense()));
  155 + carInfo.setCarFront(removeSemicolon(carInfo.getCarFront()));
  156 + carInfo.setCarLeft(removeSemicolon(carInfo.getCarLeft()));
  157 + carInfo.setCarBehind(removeSemicolon(carInfo.getCarBehind()));
  158 + carInfo.setCarRight(removeSemicolon(carInfo.getCarRight()));
  159 +
  160 + String[] Drivers = carInfo.getDrivers().split(",");
  161 + //删除原有关系
  162 + carInfoMapper.deleteCarDriverRelationByCarId(carInfo.getId());
  163 + //添加新关系
  164 + for (String driver : Drivers) {
  165 + CarDriverRelation carDriverRelation = new CarDriverRelation();
  166 + carDriverRelation.setCarId(carInfo.getId());
  167 + carDriverRelation.setDriverId(Long.parseLong(driver));
  168 + carInfoMapper.addCarDriverRelation(carDriverRelation);
  169 + }
70 return carInfoMapper.updateCarInfo(carInfo); 170 return carInfoMapper.updateCarInfo(carInfo);
71 } 171 }
72 172
@@ -93,4 +193,25 @@ public class CarInfoServiceImpl implements ICarInfoService @@ -93,4 +193,25 @@ public class CarInfoServiceImpl implements ICarInfoService
93 { 193 {
94 return carInfoMapper.deleteCarInfoById(id); 194 return carInfoMapper.deleteCarInfoById(id);
95 } 195 }
  196 +
  197 + /**
  198 + * 文件上传
  199 + *
  200 + * @param file
  201 + * @author 2c
  202 + */
  203 + public static String uploadFile(MultipartFile file) throws IOException {
  204 + // 上传文件路径
  205 + String filePath = trashConfig.getUploadPath();
  206 + // 上传并返回新文件名称
  207 + String newFileName = upload(filePath, file);
  208 + return newFileName;
  209 + }
  210 +
  211 + //去掉第一个分号,如果有的话
  212 + public String removeSemicolon(String str){
  213 + if (str.startsWith(";"))
  214 + str = str.substring(1);
  215 + return str;
  216 + }
96 } 217 }
trash-unit/src/main/java/com/trash/disposalSite/controller/DisposalSiteController.java
1 package com.trash.disposalSite.controller; 1 package com.trash.disposalSite.controller;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +
  6 +import com.trash.common.annotation.RepeatSubmit;
4 import org.springframework.security.access.prepost.PreAuthorize; 7 import org.springframework.security.access.prepost.PreAuthorize;
5 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
6 -import org.springframework.web.bind.annotation.GetMapping;  
7 -import org.springframework.web.bind.annotation.PostMapping;  
8 -import org.springframework.web.bind.annotation.PutMapping;  
9 -import org.springframework.web.bind.annotation.DeleteMapping;  
10 -import org.springframework.web.bind.annotation.PathVariable;  
11 -import org.springframework.web.bind.annotation.RequestBody;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RestController; 9 +import org.springframework.web.bind.annotation.*;
14 import com.trash.common.annotation.Log; 10 import com.trash.common.annotation.Log;
15 import com.trash.common.core.controller.BaseController; 11 import com.trash.common.core.controller.BaseController;
16 import com.trash.common.core.domain.AjaxResult; 12 import com.trash.common.core.domain.AjaxResult;
@@ -19,15 +15,16 @@ import com.trash.disposalSite.domain.DisposalSite; @@ -19,15 +15,16 @@ import com.trash.disposalSite.domain.DisposalSite;
19 import com.trash.disposalSite.service.IDisposalSiteService; 15 import com.trash.disposalSite.service.IDisposalSiteService;
20 import com.trash.common.utils.poi.ExcelUtil; 16 import com.trash.common.utils.poi.ExcelUtil;
21 import com.trash.common.core.page.TableDataInfo; 17 import com.trash.common.core.page.TableDataInfo;
  18 +import org.springframework.web.multipart.MultipartFile;
22 19
23 /** 20 /**
24 * 处理场所管理Controller 21 * 处理场所管理Controller
25 * 22 *
26 * @author trash 23 * @author trash
27 - * @date 2023-11-15 24 + * @date 2023-11-21
28 */ 25 */
29 @RestController 26 @RestController
30 -@RequestMapping("/disposalSite") 27 +@RequestMapping("/unit/disposalSite")
31 public class DisposalSiteController extends BaseController 28 public class DisposalSiteController extends BaseController
32 { 29 {
33 @Autowired 30 @Autowired
@@ -36,7 +33,7 @@ public class DisposalSiteController extends BaseController @@ -36,7 +33,7 @@ public class DisposalSiteController extends BaseController
36 /** 33 /**
37 * 查询处理场所管理列表 34 * 查询处理场所管理列表
38 */ 35 */
39 -// @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:list')") 36 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:list')")
40 @GetMapping("/list") 37 @GetMapping("/list")
41 public TableDataInfo list(DisposalSite disposalSite) 38 public TableDataInfo list(DisposalSite disposalSite)
42 { 39 {
@@ -48,7 +45,7 @@ public class DisposalSiteController extends BaseController @@ -48,7 +45,7 @@ public class DisposalSiteController extends BaseController
48 /** 45 /**
49 * 导出处理场所管理列表 46 * 导出处理场所管理列表
50 */ 47 */
51 - @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:export')") 48 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:export')")
52 @Log(title = "处理场所管理", businessType = BusinessType.EXPORT) 49 @Log(title = "处理场所管理", businessType = BusinessType.EXPORT)
53 @GetMapping("/export") 50 @GetMapping("/export")
54 public AjaxResult export(DisposalSite disposalSite) 51 public AjaxResult export(DisposalSite disposalSite)
@@ -61,7 +58,7 @@ public class DisposalSiteController extends BaseController @@ -61,7 +58,7 @@ public class DisposalSiteController extends BaseController
61 /** 58 /**
62 * 获取处理场所管理详细信息 59 * 获取处理场所管理详细信息
63 */ 60 */
64 - @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:query')") 61 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:query')")
65 @GetMapping(value = "/{id}") 62 @GetMapping(value = "/{id}")
66 public AjaxResult getInfo(@PathVariable("id") Long id) 63 public AjaxResult getInfo(@PathVariable("id") Long id)
67 { 64 {
@@ -71,29 +68,42 @@ public class DisposalSiteController extends BaseController @@ -71,29 +68,42 @@ public class DisposalSiteController extends BaseController
71 /** 68 /**
72 * 新增处理场所管理 69 * 新增处理场所管理
73 */ 70 */
74 - @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:add')") 71 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:add')")
75 @Log(title = "处理场所管理", businessType = BusinessType.INSERT) 72 @Log(title = "处理场所管理", businessType = BusinessType.INSERT)
76 @PostMapping 73 @PostMapping
77 - public AjaxResult add(@RequestBody DisposalSite disposalSite)  
78 - {  
79 - return toAjax(disposalSiteService.insertDisposalSite(disposalSite)); 74 + @RepeatSubmit
  75 + public AjaxResult add(@RequestParam(value = "approvalDocumentFiles") MultipartFile[] approvalDocument,
  76 + @RequestParam(value = "approvalDataFiles") MultipartFile[] approvalData,
  77 + @RequestParam(value = "scenePhotoFiles") MultipartFile[] scenePhoto,
  78 + @RequestParam(value = "carWashingFacilitiesImageFiles") MultipartFile[] carWashingFacilitiesImage,
  79 + @RequestParam(value = "safetyAssessmentReportFiles") MultipartFile[] safetyAssessmentReport,
  80 + @RequestParam(value = "environmentalApprovalFiles") MultipartFile[] environmentalApproval,
  81 + @RequestParam(value = "authorizationFiles") MultipartFile[] authorization,
  82 + @RequestParam(value = "otherInformationFiles") MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException {
  83 + return toAjax(disposalSiteService.insertDisposalSite(approvalDocument,approvalData,scenePhoto,carWashingFacilitiesImage,safetyAssessmentReport,environmentalApproval,authorization,otherInformation,disposalSite));
80 } 84 }
81 85
82 /** 86 /**
83 * 修改处理场所管理 87 * 修改处理场所管理
84 */ 88 */
85 - @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:edit')") 89 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:edit')")
86 @Log(title = "处理场所管理", businessType = BusinessType.UPDATE) 90 @Log(title = "处理场所管理", businessType = BusinessType.UPDATE)
87 @PutMapping 91 @PutMapping
88 - public AjaxResult edit(@RequestBody DisposalSite disposalSite)  
89 - {  
90 - return toAjax(disposalSiteService.updateDisposalSite(disposalSite)); 92 + public AjaxResult edit(@RequestParam(value = "approvalDocumentFiles") MultipartFile[] approvalDocument,
  93 + @RequestParam(value = "approvalDataFiles") MultipartFile[] approvalData,
  94 + @RequestParam(value = "scenePhotoFiles") MultipartFile[] scenePhoto,
  95 + @RequestParam(value = "carWashingFacilitiesImageFiles") MultipartFile[] carWashingFacilitiesImage,
  96 + @RequestParam(value = "safetyAssessmentReportFiles") MultipartFile[] safetyAssessmentReport,
  97 + @RequestParam(value = "environmentalApprovalFiles") MultipartFile[] environmentalApproval,
  98 + @RequestParam(value = "authorizationFiles") MultipartFile[] authorization,
  99 + @RequestParam(value = "otherInformationFiles") MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException {
  100 + return toAjax(disposalSiteService.updateDisposalSite(approvalDocument,approvalData,scenePhoto,carWashingFacilitiesImage,safetyAssessmentReport,environmentalApproval,authorization,otherInformation,disposalSite));
91 } 101 }
92 102
93 /** 103 /**
94 * 删除处理场所管理 104 * 删除处理场所管理
95 */ 105 */
96 - @PreAuthorize("@ss.hasPermi('disposalSite:disposalSite:remove')") 106 + @PreAuthorize("@ss.hasPermi('unit:disposalSite:remove')")
97 @Log(title = "处理场所管理", businessType = BusinessType.DELETE) 107 @Log(title = "处理场所管理", businessType = BusinessType.DELETE)
98 @DeleteMapping("/{ids}") 108 @DeleteMapping("/{ids}")
99 public AjaxResult remove(@PathVariable Long[] ids) 109 public AjaxResult remove(@PathVariable Long[] ids)
trash-unit/src/main/java/com/trash/disposalSite/domain/DisposalSite.java
@@ -11,7 +11,7 @@ import com.trash.common.core.domain.BaseEntity; @@ -11,7 +11,7 @@ import com.trash.common.core.domain.BaseEntity;
11 * 处理场所管理对象 disposal_site 11 * 处理场所管理对象 disposal_site
12 * 12 *
13 * @author trash 13 * @author trash
14 - * @date 2023-11-15 14 + * @date 2023-11-21
15 */ 15 */
16 public class DisposalSite extends BaseEntity 16 public class DisposalSite extends BaseEntity
17 { 17 {
@@ -78,6 +78,10 @@ public class DisposalSite extends BaseEntity @@ -78,6 +78,10 @@ public class DisposalSite extends BaseEntity
78 @Excel(name = "审批方量(m³)") 78 @Excel(name = "审批方量(m³)")
79 private String squareMeasure; 79 private String squareMeasure;
80 80
  81 + /** 剩余方量 */
  82 + @Excel(name = "剩余方量")
  83 + private String surplusSquareMeasure;
  84 +
81 /** 洗车作业设施 */ 85 /** 洗车作业设施 */
82 @Excel(name = "洗车作业设施") 86 @Excel(name = "洗车作业设施")
83 private String carWashingFacilities; 87 private String carWashingFacilities;
@@ -104,11 +108,19 @@ public class DisposalSite extends BaseEntity @@ -104,11 +108,19 @@ public class DisposalSite extends BaseEntity
104 @Excel(name = "办理意见") 108 @Excel(name = "办理意见")
105 private String handlingAdvice; 109 private String handlingAdvice;
106 110
  111 + /** 消纳来源 */
  112 + @Excel(name = "消纳来源")
  113 + private String absorbSource;
  114 +
107 /** 电子围栏 115 /** 电子围栏
108 */ 116 */
109 @Excel(name = "电子围栏") 117 @Excel(name = "电子围栏")
110 private String electronicFence; 118 private String electronicFence;
111 119
  120 + /** 信用状态 */
  121 + @Excel(name = "信用状态")
  122 + private String creditStatus;
  123 +
112 /** 批准文件 */ 124 /** 批准文件 */
113 @Excel(name = "批准文件") 125 @Excel(name = "批准文件")
114 private String approvalDocument; 126 private String approvalDocument;
@@ -126,13 +138,17 @@ public class DisposalSite extends BaseEntity @@ -126,13 +138,17 @@ public class DisposalSite extends BaseEntity
126 @Excel(name = "洗车设施照片") 138 @Excel(name = "洗车设施照片")
127 private String carWashingFacilitiesImage; 139 private String carWashingFacilitiesImage;
128 140
  141 + /** 期限范围 */
  142 + @Excel(name = "期限范围")
  143 + private String termRange;
  144 +
129 /** 安全评估报告 */ 145 /** 安全评估报告 */
130 @Excel(name = "安全评估报告") 146 @Excel(name = "安全评估报告")
131 private String safetyAssessmentReport; 147 private String safetyAssessmentReport;
132 148
133 /** 环评报告及环保部门批复 149 /** 环评报告及环保部门批复
134 */ 150 */
135 - @Excel(name = "环评报告及环保部门批复") 151 + @Excel(name = "环评报告及环保部门批复 ")
136 private String environmentalApproval; 152 private String environmentalApproval;
137 153
138 /** 签署消纳合同授权委托书 */ 154 /** 签署消纳合同授权委托书 */
@@ -148,10 +164,25 @@ public class DisposalSite extends BaseEntity @@ -148,10 +164,25 @@ public class DisposalSite extends BaseEntity
148 private String companyIds; 164 private String companyIds;
149 165
150 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */ 166 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */
151 - @Excel(name = "审批状态,0=审批中,1=审批通过,2=被驳回") 167 + @Excel(name = "审批状态",readConverterExp = "0=审批中,1=审批通过,2=被驳回")
152 private Integer status; 168 private Integer status;
153 169
154 - public void setId(Long id) 170 + /** 二维码 */
  171 + private String qrCode;
  172 +
  173 + /** 审核情况 */
  174 + @Excel(name = "审核情况")
  175 + private String auditStatus;
  176 +
  177 + public String getAuditStatus() {
  178 + return auditStatus;
  179 + }
  180 +
  181 + public void setAuditStatus(String auditStatus) {
  182 + this.auditStatus = auditStatus;
  183 + }
  184 +
  185 + public void setId(Long id)
155 { 186 {
156 this.id = id; 187 this.id = id;
157 } 188 }
@@ -286,6 +317,15 @@ public class DisposalSite extends BaseEntity @@ -286,6 +317,15 @@ public class DisposalSite extends BaseEntity
286 { 317 {
287 return squareMeasure; 318 return squareMeasure;
288 } 319 }
  320 + public void setSurplusSquareMeasure(String surplusSquareMeasure)
  321 + {
  322 + this.surplusSquareMeasure = surplusSquareMeasure;
  323 + }
  324 +
  325 + public String getSurplusSquareMeasure()
  326 + {
  327 + return surplusSquareMeasure;
  328 + }
289 public void setCarWashingFacilities(String carWashingFacilities) 329 public void setCarWashingFacilities(String carWashingFacilities)
290 { 330 {
291 this.carWashingFacilities = carWashingFacilities; 331 this.carWashingFacilities = carWashingFacilities;
@@ -340,6 +380,15 @@ public class DisposalSite extends BaseEntity @@ -340,6 +380,15 @@ public class DisposalSite extends BaseEntity
340 { 380 {
341 return handlingAdvice; 381 return handlingAdvice;
342 } 382 }
  383 + public void setAbsorbSource(String absorbSource)
  384 + {
  385 + this.absorbSource = absorbSource;
  386 + }
  387 +
  388 + public String getAbsorbSource()
  389 + {
  390 + return absorbSource;
  391 + }
343 public void setElectronicFence(String electronicFence) 392 public void setElectronicFence(String electronicFence)
344 { 393 {
345 this.electronicFence = electronicFence; 394 this.electronicFence = electronicFence;
@@ -349,6 +398,15 @@ public class DisposalSite extends BaseEntity @@ -349,6 +398,15 @@ public class DisposalSite extends BaseEntity
349 { 398 {
350 return electronicFence; 399 return electronicFence;
351 } 400 }
  401 + public void setCreditStatus(String creditStatus)
  402 + {
  403 + this.creditStatus = creditStatus;
  404 + }
  405 +
  406 + public String getCreditStatus()
  407 + {
  408 + return creditStatus;
  409 + }
352 public void setApprovalDocument(String approvalDocument) 410 public void setApprovalDocument(String approvalDocument)
353 { 411 {
354 this.approvalDocument = approvalDocument; 412 this.approvalDocument = approvalDocument;
@@ -385,6 +443,15 @@ public class DisposalSite extends BaseEntity @@ -385,6 +443,15 @@ public class DisposalSite extends BaseEntity
385 { 443 {
386 return carWashingFacilitiesImage; 444 return carWashingFacilitiesImage;
387 } 445 }
  446 + public void setTermRange(String termRange)
  447 + {
  448 + this.termRange = termRange;
  449 + }
  450 +
  451 + public String getTermRange()
  452 + {
  453 + return termRange;
  454 + }
388 public void setSafetyAssessmentReport(String safetyAssessmentReport) 455 public void setSafetyAssessmentReport(String safetyAssessmentReport)
389 { 456 {
390 this.safetyAssessmentReport = safetyAssessmentReport; 457 this.safetyAssessmentReport = safetyAssessmentReport;
@@ -439,6 +506,15 @@ public class DisposalSite extends BaseEntity @@ -439,6 +506,15 @@ public class DisposalSite extends BaseEntity
439 { 506 {
440 return status; 507 return status;
441 } 508 }
  509 + public void setQrCode(String qrCode)
  510 + {
  511 + this.qrCode = qrCode;
  512 + }
  513 +
  514 + public String getQrCode()
  515 + {
  516 + return qrCode;
  517 + }
442 518
443 @Override 519 @Override
444 public String toString() { 520 public String toString() {
@@ -458,17 +534,21 @@ public class DisposalSite extends BaseEntity @@ -458,17 +534,21 @@ public class DisposalSite extends BaseEntity
458 .append("validityBeginDate", getValidityBeginDate()) 534 .append("validityBeginDate", getValidityBeginDate())
459 .append("validityEndDate", getValidityEndDate()) 535 .append("validityEndDate", getValidityEndDate())
460 .append("squareMeasure", getSquareMeasure()) 536 .append("squareMeasure", getSquareMeasure())
  537 + .append("surplusSquareMeasure", getSurplusSquareMeasure())
461 .append("carWashingFacilities", getCarWashingFacilities()) 538 .append("carWashingFacilities", getCarWashingFacilities())
462 .append("exitRoadCondition", getExitRoadCondition()) 539 .append("exitRoadCondition", getExitRoadCondition())
463 .append("lightingFacility", getLightingFacility()) 540 .append("lightingFacility", getLightingFacility())
464 .append("videoSurveillanceFacility", getVideoSurveillanceFacility()) 541 .append("videoSurveillanceFacility", getVideoSurveillanceFacility())
465 .append("preparer", getPreparer()) 542 .append("preparer", getPreparer())
466 .append("handlingAdvice", getHandlingAdvice()) 543 .append("handlingAdvice", getHandlingAdvice())
  544 + .append("absorbSource", getAbsorbSource())
467 .append("electronicFence", getElectronicFence()) 545 .append("electronicFence", getElectronicFence())
  546 + .append("creditStatus", getCreditStatus())
468 .append("approvalDocument", getApprovalDocument()) 547 .append("approvalDocument", getApprovalDocument())
469 .append("approvalData", getApprovalData()) 548 .append("approvalData", getApprovalData())
470 .append("scenePhoto", getScenePhoto()) 549 .append("scenePhoto", getScenePhoto())
471 .append("carWashingFacilitiesImage", getCarWashingFacilitiesImage()) 550 .append("carWashingFacilitiesImage", getCarWashingFacilitiesImage())
  551 + .append("termRange", getTermRange())
472 .append("safetyAssessmentReport", getSafetyAssessmentReport()) 552 .append("safetyAssessmentReport", getSafetyAssessmentReport())
473 .append("environmentalApproval", getEnvironmentalApproval()) 553 .append("environmentalApproval", getEnvironmentalApproval())
474 .append("authorization", getAuthorization()) 554 .append("authorization", getAuthorization())
@@ -479,6 +559,7 @@ public class DisposalSite extends BaseEntity @@ -479,6 +559,7 @@ public class DisposalSite extends BaseEntity
479 .append("createBy", getCreateBy()) 559 .append("createBy", getCreateBy())
480 .append("updateTime", getUpdateTime()) 560 .append("updateTime", getUpdateTime())
481 .append("updateBy", getUpdateBy()) 561 .append("updateBy", getUpdateBy())
  562 + .append("qrCode", getQrCode())
482 .toString(); 563 .toString();
483 } 564 }
484 } 565 }
trash-unit/src/main/java/com/trash/disposalSite/mapper/DisposalSiteMapper.java
@@ -7,7 +7,7 @@ import com.trash.disposalSite.domain.DisposalSite; @@ -7,7 +7,7 @@ import com.trash.disposalSite.domain.DisposalSite;
7 * 处理场所管理Mapper接口 7 * 处理场所管理Mapper接口
8 * 8 *
9 * @author trash 9 * @author trash
10 - * @date 2023-11-15 10 + * @date 2023-11-21
11 */ 11 */
12 public interface DisposalSiteMapper 12 public interface DisposalSiteMapper
13 { 13 {
trash-unit/src/main/java/com/trash/disposalSite/service/IDisposalSiteService.java
1 package com.trash.disposalSite.service; 1 package com.trash.disposalSite.service;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
4 import com.trash.disposalSite.domain.DisposalSite; 5 import com.trash.disposalSite.domain.DisposalSite;
  6 +import org.springframework.web.multipart.MultipartFile;
5 7
6 /** 8 /**
7 * 处理场所管理Service接口 9 * 处理场所管理Service接口
8 * 10 *
9 * @author trash 11 * @author trash
10 - * @date 2023-11-15 12 + * @date 2023-11-21
11 */ 13 */
12 public interface IDisposalSiteService 14 public interface IDisposalSiteService
13 { 15 {
@@ -29,19 +31,35 @@ public interface IDisposalSiteService @@ -29,19 +31,35 @@ public interface IDisposalSiteService
29 31
30 /** 32 /**
31 * 新增处理场所管理 33 * 新增处理场所管理
32 - *  
33 - * @param disposalSite 处理场所管理 34 + *
  35 + * @param approvalDocument
  36 + * @param approvalData
  37 + * @param scenePhoto
  38 + * @param carWashingFacilitiesImage
  39 + * @param safetyAssessmentReport
  40 + * @param environmentalApproval
  41 + * @param authorization
  42 + * @param otherInformation
  43 + * @param disposalSite 处理场所管理
34 * @return 结果 44 * @return 结果
35 */ 45 */
36 - int insertDisposalSite(DisposalSite disposalSite); 46 + int insertDisposalSite(MultipartFile[] approvalDocument,MultipartFile[] approvalData,MultipartFile[] scenePhoto,MultipartFile[] carWashingFacilitiesImage,MultipartFile[] safetyAssessmentReport,MultipartFile[] environmentalApproval,MultipartFile[] authorization,MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException;
37 47
38 /** 48 /**
39 * 修改处理场所管理 49 * 修改处理场所管理
40 - *  
41 - * @param disposalSite 处理场所管理 50 + *
  51 + * @param approvalDocument
  52 + * @param approvalData
  53 + * @param scenePhoto
  54 + * @param carWashingFacilitiesImage
  55 + * @param safetyAssessmentReport
  56 + * @param environmentalApproval
  57 + * @param authorization
  58 + * @param otherInformation
  59 + * @param disposalSite 处理场所管理
42 * @return 结果 60 * @return 结果
43 */ 61 */
44 - int updateDisposalSite(DisposalSite disposalSite); 62 + int updateDisposalSite(MultipartFile[] approvalDocument,MultipartFile[] approvalData,MultipartFile[] scenePhoto,MultipartFile[] carWashingFacilitiesImage,MultipartFile[] safetyAssessmentReport,MultipartFile[] environmentalApproval,MultipartFile[] authorization,MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException;
45 63
46 /** 64 /**
47 * 批量删除处理场所管理 65 * 批量删除处理场所管理
trash-unit/src/main/java/com/trash/disposalSite/service/impl/DisposalSiteServiceImpl.java
1 package com.trash.disposalSite.service.impl; 1 package com.trash.disposalSite.service.impl;
2 2
3 -import java.util.List; 3 +import com.trash.common.config.trashConfig;
4 import com.trash.common.utils.DateUtils; 4 import com.trash.common.utils.DateUtils;
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.stereotype.Service;  
7 -import com.trash.disposalSite.mapper.DisposalSiteMapper; 5 +import com.trash.common.utils.SecurityUtils;
8 import com.trash.disposalSite.domain.DisposalSite; 6 import com.trash.disposalSite.domain.DisposalSite;
  7 +import com.trash.disposalSite.mapper.DisposalSiteMapper;
9 import com.trash.disposalSite.service.IDisposalSiteService; 8 import com.trash.disposalSite.service.IDisposalSiteService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import org.springframework.web.multipart.MultipartFile;
  12 +
  13 +import java.io.IOException;
  14 +import java.util.List;
  15 +
  16 +import static com.trash.common.utils.file.FileUploadUtils.upload;
10 17
11 /** 18 /**
12 * 处理场所管理Service业务层处理 19 * 处理场所管理Service业务层处理
13 - * 20 + *
14 * @author trash 21 * @author trash
15 - * @date 2023-11-15 22 + * @date 2023-11-21
16 */ 23 */
17 @Service 24 @Service
18 -public class DisposalSiteServiceImpl implements IDisposalSiteService  
19 -{ 25 +public class DisposalSiteServiceImpl implements IDisposalSiteService {
20 @Autowired 26 @Autowired
21 private DisposalSiteMapper disposalSiteMapper; 27 private DisposalSiteMapper disposalSiteMapper;
22 28
23 /** 29 /**
24 * 查询处理场所管理 30 * 查询处理场所管理
25 - * 31 + *
26 * @param id 处理场所管理ID 32 * @param id 处理场所管理ID
27 * @return 处理场所管理 33 * @return 处理场所管理
28 */ 34 */
29 @Override 35 @Override
30 - public DisposalSite selectDisposalSiteById(Long id)  
31 - { 36 + public DisposalSite selectDisposalSiteById(Long id) {
32 return disposalSiteMapper.selectDisposalSiteById(id); 37 return disposalSiteMapper.selectDisposalSiteById(id);
33 } 38 }
34 39
35 /** 40 /**
36 * 查询处理场所管理列表 41 * 查询处理场所管理列表
37 - * 42 + *
38 * @param disposalSite 处理场所管理 43 * @param disposalSite 处理场所管理
39 * @return 处理场所管理 44 * @return 处理场所管理
40 */ 45 */
41 @Override 46 @Override
42 - public List<DisposalSite> selectDisposalSiteList(DisposalSite disposalSite)  
43 - { 47 + public List<DisposalSite> selectDisposalSiteList(DisposalSite disposalSite) {
44 return disposalSiteMapper.selectDisposalSiteList(disposalSite); 48 return disposalSiteMapper.selectDisposalSiteList(disposalSite);
45 } 49 }
46 50
47 /** 51 /**
48 * 新增处理场所管理 52 * 新增处理场所管理
49 - *  
50 - * @param disposalSite 处理场所管理 53 + *
  54 + * @param approvalDocument
  55 + * @param approvalData
  56 + * @param scenePhoto
  57 + * @param carWashingFacilitiesImage
  58 + * @param safetyAssessmentReport
  59 + * @param environmentalApproval
  60 + * @param authorization
  61 + * @param otherInformation
  62 + * @param disposalSite 处理场所管理
51 * @return 结果 63 * @return 结果
52 */ 64 */
53 @Override 65 @Override
54 - public int insertDisposalSite(DisposalSite disposalSite)  
55 - { 66 + public int insertDisposalSite(MultipartFile[] approvalDocument, MultipartFile[] approvalData, MultipartFile[] scenePhoto, MultipartFile[] carWashingFacilitiesImage, MultipartFile[] safetyAssessmentReport, MultipartFile[] environmentalApproval, MultipartFile[] authorization, MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException {
56 disposalSite.setCreateTime(DateUtils.getNowDate()); 67 disposalSite.setCreateTime(DateUtils.getNowDate());
  68 + disposalSite.setCreateBy(SecurityUtils.getUsername());
  69 + disposalSite.setStatus(0);
  70 + disposalSite.setCreditStatus("正常");
  71 + disposalSite.setTermRange("未超期");
  72 + disposalSite.setAuditStatus("新增审核中");
  73 + for (MultipartFile multipartFile : approvalDocument) {
  74 + disposalSite.setApprovalDocument(disposalSite.getApprovalDocument() != null ? disposalSite.getApprovalDocument() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  75 + }
  76 + for (MultipartFile multipartFile : approvalData) {
  77 + disposalSite.setApprovalData(disposalSite.getApprovalData() != null ? disposalSite.getApprovalData() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  78 + }
  79 + for (MultipartFile multipartFile : scenePhoto) {
  80 + disposalSite.setScenePhoto(disposalSite.getScenePhoto() != null ? disposalSite.getScenePhoto() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  81 + }
  82 + for (MultipartFile multipartFile : carWashingFacilitiesImage) {
  83 + disposalSite.setCarWashingFacilitiesImage(disposalSite.getCarWashingFacilitiesImage() != null ? disposalSite.getCarWashingFacilitiesImage() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  84 + }
  85 + for (MultipartFile multipartFile : safetyAssessmentReport) {
  86 + disposalSite.setSafetyAssessmentReport(disposalSite.getSafetyAssessmentReport() != null ? disposalSite.getSafetyAssessmentReport() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  87 + }
  88 + for (MultipartFile multipartFile : environmentalApproval) {
  89 + disposalSite.setEnvironmentalApproval(disposalSite.getEnvironmentalApproval() != null ? disposalSite.getEnvironmentalApproval() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  90 + }
  91 + for (MultipartFile multipartFile : authorization) {
  92 + disposalSite.setAuthorization(disposalSite.getAuthorization() != null ? disposalSite.getAuthorization() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  93 + }
  94 + for (MultipartFile multipartFile : otherInformation) {
  95 + disposalSite.setOtherInformation(disposalSite.getOtherInformation() != null ? disposalSite.getOtherInformation() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  96 + }
  97 + //去掉第一个分号,如果有的话
  98 + disposalSite.setApprovalDocument(removeSemicolon(disposalSite.getApprovalDocument()));
  99 + disposalSite.setApprovalData(removeSemicolon(disposalSite.getApprovalData()));
  100 + disposalSite.setScenePhoto(removeSemicolon(disposalSite.getScenePhoto()));
  101 + disposalSite.setCarWashingFacilitiesImage(removeSemicolon(disposalSite.getCarWashingFacilitiesImage()));
  102 + disposalSite.setSafetyAssessmentReport(removeSemicolon(disposalSite.getSafetyAssessmentReport()));
  103 + disposalSite.setEnvironmentalApproval(removeSemicolon(disposalSite.getEnvironmentalApproval()));
  104 + disposalSite.setAuthorization(removeSemicolon(disposalSite.getAuthorization()));
  105 + disposalSite.setOtherInformation(removeSemicolon(disposalSite.getOtherInformation()));
57 return disposalSiteMapper.insertDisposalSite(disposalSite); 106 return disposalSiteMapper.insertDisposalSite(disposalSite);
58 } 107 }
59 108
60 /** 109 /**
61 * 修改处理场所管理 110 * 修改处理场所管理
62 - *  
63 - * @param disposalSite 处理场所管理 111 + *
  112 + * @param approvalDocument
  113 + * @param approvalData
  114 + * @param scenePhoto
  115 + * @param carWashingFacilitiesImage
  116 + * @param safetyAssessmentReport
  117 + * @param environmentalApproval
  118 + * @param authorization
  119 + * @param otherInformation
  120 + * @param disposalSite 处理场所管理
64 * @return 结果 121 * @return 结果
65 */ 122 */
66 @Override 123 @Override
67 - public int updateDisposalSite(DisposalSite disposalSite)  
68 - { 124 + public int updateDisposalSite(MultipartFile[] approvalDocument, MultipartFile[] approvalData, MultipartFile[] scenePhoto, MultipartFile[] carWashingFacilitiesImage, MultipartFile[] safetyAssessmentReport, MultipartFile[] environmentalApproval, MultipartFile[] authorization, MultipartFile[] otherInformation, DisposalSite disposalSite) throws IOException {
69 disposalSite.setUpdateTime(DateUtils.getNowDate()); 125 disposalSite.setUpdateTime(DateUtils.getNowDate());
  126 + disposalSite.setUpdateBy(SecurityUtils.getUsername());
  127 + for (MultipartFile multipartFile : approvalDocument) {
  128 + disposalSite.setApprovalDocument(disposalSite.getApprovalDocument() != null ? disposalSite.getApprovalDocument() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  129 + }
  130 + for (MultipartFile multipartFile : approvalData) {
  131 + disposalSite.setApprovalData(disposalSite.getApprovalData() != null ? disposalSite.getApprovalData() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  132 + }
  133 + for (MultipartFile multipartFile : scenePhoto) {
  134 + disposalSite.setScenePhoto(disposalSite.getScenePhoto() != null ? disposalSite.getScenePhoto() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  135 + }
  136 + for (MultipartFile multipartFile : carWashingFacilitiesImage) {
  137 + disposalSite.setCarWashingFacilitiesImage(disposalSite.getCarWashingFacilitiesImage() != null ? disposalSite.getCarWashingFacilitiesImage() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  138 + }
  139 + for (MultipartFile multipartFile : safetyAssessmentReport) {
  140 + disposalSite.setSafetyAssessmentReport(disposalSite.getSafetyAssessmentReport() != null ? disposalSite.getSafetyAssessmentReport() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  141 + }
  142 + for (MultipartFile multipartFile : environmentalApproval) {
  143 + disposalSite.setEnvironmentalApproval(disposalSite.getEnvironmentalApproval() != null ? disposalSite.getEnvironmentalApproval() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  144 + }
  145 + for (MultipartFile multipartFile : authorization) {
  146 + disposalSite.setAuthorization(disposalSite.getAuthorization() != null ? disposalSite.getAuthorization() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  147 + }
  148 + for (MultipartFile multipartFile : otherInformation) {
  149 + disposalSite.setOtherInformation(disposalSite.getOtherInformation() != null ? disposalSite.getOtherInformation() + ";" + uploadFile(multipartFile) : uploadFile(multipartFile));
  150 + }
  151 + disposalSite.setApprovalDocument(removeSemicolon(disposalSite.getApprovalDocument()));
  152 + disposalSite.setApprovalData(removeSemicolon(disposalSite.getApprovalData()));
  153 + disposalSite.setScenePhoto(removeSemicolon(disposalSite.getScenePhoto()));
  154 + disposalSite.setCarWashingFacilitiesImage(removeSemicolon(disposalSite.getCarWashingFacilitiesImage()));
  155 + disposalSite.setSafetyAssessmentReport(removeSemicolon(disposalSite.getSafetyAssessmentReport()));
  156 + disposalSite.setEnvironmentalApproval(removeSemicolon(disposalSite.getEnvironmentalApproval()));
  157 + disposalSite.setAuthorization(removeSemicolon(disposalSite.getAuthorization()));
  158 + disposalSite.setOtherInformation(removeSemicolon(disposalSite.getOtherInformation()));
70 return disposalSiteMapper.updateDisposalSite(disposalSite); 159 return disposalSiteMapper.updateDisposalSite(disposalSite);
71 } 160 }
72 161
73 /** 162 /**
74 * 批量删除处理场所管理 163 * 批量删除处理场所管理
75 - * 164 + *
76 * @param ids 需要删除的处理场所管理ID 165 * @param ids 需要删除的处理场所管理ID
77 * @return 结果 166 * @return 结果
78 */ 167 */
79 @Override 168 @Override
80 - public int deleteDisposalSiteByIds(Long[] ids)  
81 - { 169 + public int deleteDisposalSiteByIds(Long[] ids) {
82 return disposalSiteMapper.deleteDisposalSiteByIds(ids); 170 return disposalSiteMapper.deleteDisposalSiteByIds(ids);
83 } 171 }
84 172
85 /** 173 /**
86 * 删除处理场所管理信息 174 * 删除处理场所管理信息
87 - * 175 + *
88 * @param id 处理场所管理ID 176 * @param id 处理场所管理ID
89 * @return 结果 177 * @return 结果
90 */ 178 */
91 @Override 179 @Override
92 - public int deleteDisposalSiteById(Long id)  
93 - { 180 + public int deleteDisposalSiteById(Long id) {
94 return disposalSiteMapper.deleteDisposalSiteById(id); 181 return disposalSiteMapper.deleteDisposalSiteById(id);
95 } 182 }
  183 +
  184 + /**
  185 + * 文件上传
  186 + *
  187 + * @param file
  188 + * @author 2c
  189 + */
  190 + public static String uploadFile(MultipartFile file) throws IOException {
  191 + // 上传文件路径
  192 + String filePath = trashConfig.getUploadPath();
  193 + // 上传并返回新文件名称
  194 + String newFileName = upload(filePath, file);
  195 + return newFileName;
  196 + }
  197 +
  198 + //去掉第一个分号,如果有的话
  199 + public String removeSemicolon(String str){
  200 + if (str.startsWith(";"))
  201 + str = str.substring(1);
  202 + return str;
  203 + }
96 } 204 }
trash-unit/src/main/java/com/trash/driver/controller/DriverController.java
1 package com.trash.driver.controller; 1 package com.trash.driver.controller;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import com.trash.driver.domain.vo.DriverVo;
4 import org.springframework.security.access.prepost.PreAuthorize; 8 import org.springframework.security.access.prepost.PreAuthorize;
5 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
6 -import org.springframework.web.bind.annotation.GetMapping;  
7 -import org.springframework.web.bind.annotation.PostMapping;  
8 -import org.springframework.web.bind.annotation.PutMapping;  
9 -import org.springframework.web.bind.annotation.DeleteMapping;  
10 -import org.springframework.web.bind.annotation.PathVariable;  
11 -import org.springframework.web.bind.annotation.RequestBody;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RestController; 10 +import org.springframework.web.bind.annotation.*;
14 import com.trash.common.annotation.Log; 11 import com.trash.common.annotation.Log;
15 import com.trash.common.core.controller.BaseController; 12 import com.trash.common.core.controller.BaseController;
16 import com.trash.common.core.domain.AjaxResult; 13 import com.trash.common.core.domain.AjaxResult;
@@ -19,15 +16,16 @@ import com.trash.driver.domain.Driver; @@ -19,15 +16,16 @@ import com.trash.driver.domain.Driver;
19 import com.trash.driver.service.IDriverService; 16 import com.trash.driver.service.IDriverService;
20 import com.trash.common.utils.poi.ExcelUtil; 17 import com.trash.common.utils.poi.ExcelUtil;
21 import com.trash.common.core.page.TableDataInfo; 18 import com.trash.common.core.page.TableDataInfo;
  19 +import org.springframework.web.multipart.MultipartFile;
22 20
23 /** 21 /**
24 * 驾驶员管理Controller 22 * 驾驶员管理Controller
25 * 23 *
26 * @author trash 24 * @author trash
27 - * @date 2023-11-15 25 + * @date 2023-11-21
28 */ 26 */
29 @RestController 27 @RestController
30 -@RequestMapping("/driver") 28 +@RequestMapping("/unit/driver")
31 public class DriverController extends BaseController 29 public class DriverController extends BaseController
32 { 30 {
33 @Autowired 31 @Autowired
@@ -36,32 +34,39 @@ public class DriverController extends BaseController @@ -36,32 +34,39 @@ public class DriverController extends BaseController
36 /** 34 /**
37 * 查询驾驶员管理列表 35 * 查询驾驶员管理列表
38 */ 36 */
39 -// @PreAuthorize("@ss.hasPermi('driver:driver:list')") 37 + @PreAuthorize("@ss.hasPermi('unit:driver:list')")
40 @GetMapping("/list") 38 @GetMapping("/list")
41 - public TableDataInfo list(Driver driver) 39 + public TableDataInfo list(DriverVo driver)
42 { 40 {
43 startPage(); 41 startPage();
44 - List<Driver> list = driverService.selectDriverList(driver); 42 + List<DriverVo> list = driverService.selectDriverList(driver);
45 return getDataTable(list); 43 return getDataTable(list);
46 } 44 }
47 45
  46 + @PreAuthorize("@ss.hasPermi('unit:driver:list')")
  47 + @GetMapping("/listDriverByCompany/{companyId}")
  48 + public List<Map<Object,Object>> listDriverByCompany(@PathVariable("companyId") String companyId)
  49 + {
  50 + return driverService.selectDriverListByCompanyId(companyId);
  51 + }
  52 +
48 /** 53 /**
49 * 导出驾驶员管理列表 54 * 导出驾驶员管理列表
50 */ 55 */
51 - @PreAuthorize("@ss.hasPermi('driver:driver:export')") 56 + @PreAuthorize("@ss.hasPermi('unit:driver:export')")
52 @Log(title = "驾驶员管理", businessType = BusinessType.EXPORT) 57 @Log(title = "驾驶员管理", businessType = BusinessType.EXPORT)
53 @GetMapping("/export") 58 @GetMapping("/export")
54 - public AjaxResult export(Driver driver) 59 + public AjaxResult export(DriverVo driver)
55 { 60 {
56 - List<Driver> list = driverService.selectDriverList(driver);  
57 - ExcelUtil<Driver> util = new ExcelUtil<Driver>(Driver.class); 61 + List<DriverVo> list = driverService.selectDriverList(driver);
  62 + ExcelUtil<DriverVo> util = new ExcelUtil<DriverVo>(DriverVo.class);
58 return util.exportExcel(list, "driver"); 63 return util.exportExcel(list, "driver");
59 } 64 }
60 65
61 /** 66 /**
62 * 获取驾驶员管理详细信息 67 * 获取驾驶员管理详细信息
63 */ 68 */
64 - @PreAuthorize("@ss.hasPermi('driver:driver:query')") 69 + @PreAuthorize("@ss.hasPermi('unit:driver:query')")
65 @GetMapping(value = "/{id}") 70 @GetMapping(value = "/{id}")
66 public AjaxResult getInfo(@PathVariable("id") Long id) 71 public AjaxResult getInfo(@PathVariable("id") Long id)
67 { 72 {
@@ -71,33 +76,42 @@ public class DriverController extends BaseController @@ -71,33 +76,42 @@ public class DriverController extends BaseController
71 /** 76 /**
72 * 新增驾驶员管理 77 * 新增驾驶员管理
73 */ 78 */
74 - @PreAuthorize("@ss.hasPermi('driver:driver:add')") 79 + @PreAuthorize("@ss.hasPermi('unit:driver:add')")
75 @Log(title = "驾驶员管理", businessType = BusinessType.INSERT) 80 @Log(title = "驾驶员管理", businessType = BusinessType.INSERT)
76 @PostMapping 81 @PostMapping
77 - public AjaxResult add(@RequestBody Driver driver)  
78 - {  
79 - return toAjax(driverService.insertDriver(driver)); 82 + public AjaxResult add(@RequestParam(value = "drivingLicenceFiles") MultipartFile[] drivingLicenceFiles,
  83 + @RequestParam(value = "professionalQualificationFiles") MultipartFile[] professionalQualificationFiles,
  84 + @RequestParam(value = "safetyTrainingFiles") MultipartFile[] safetyTrainingFiles,
  85 + @RequestParam(value = "photographOneFiles") MultipartFile[] photographOneFiles,
  86 + @RequestParam(value = "photographTwoFiles") MultipartFile[] photographTwoFiles,
  87 + Driver driver) throws IOException {
  88 + return toAjax(driverService.insertDriver(drivingLicenceFiles,professionalQualificationFiles,safetyTrainingFiles,photographOneFiles,photographTwoFiles,driver));
80 } 89 }
81 90
82 /** 91 /**
83 * 修改驾驶员管理 92 * 修改驾驶员管理
84 */ 93 */
85 - @PreAuthorize("@ss.hasPermi('driver:driver:edit')") 94 + @PreAuthorize("@ss.hasPermi('unit:driver:edit')")
86 @Log(title = "驾驶员管理", businessType = BusinessType.UPDATE) 95 @Log(title = "驾驶员管理", businessType = BusinessType.UPDATE)
87 @PutMapping 96 @PutMapping
88 - public AjaxResult edit(@RequestBody Driver driver)  
89 - {  
90 - return toAjax(driverService.updateDriver(driver)); 97 + public AjaxResult edit(@RequestParam(value = "drivingLicenceFiles") MultipartFile[] drivingLicenceFiles,
  98 + @RequestParam(value = "professionalQualificationFiles") MultipartFile[] professionalQualificationFiles,
  99 + @RequestParam(value = "safetyTrainingFiles") MultipartFile[] safetyTrainingFiles,
  100 + @RequestParam(value = "photographOneFiles") MultipartFile[] photographOneFiles,
  101 + @RequestParam(value = "photographTwoFiles") MultipartFile[] photographTwoFiles,
  102 + Driver driver) throws IOException {
  103 + return toAjax(driverService.updateDriver(drivingLicenceFiles,professionalQualificationFiles,safetyTrainingFiles,photographOneFiles,photographTwoFiles,driver));
91 } 104 }
92 105
93 /** 106 /**
94 * 删除驾驶员管理 107 * 删除驾驶员管理
95 */ 108 */
96 - @PreAuthorize("@ss.hasPermi('driver:driver:remove')") 109 + @PreAuthorize("@ss.hasPermi('unit:driver:remove')")
97 @Log(title = "驾驶员管理", businessType = BusinessType.DELETE) 110 @Log(title = "驾驶员管理", businessType = BusinessType.DELETE)
98 @DeleteMapping("/{ids}") 111 @DeleteMapping("/{ids}")
99 public AjaxResult remove(@PathVariable Long[] ids) 112 public AjaxResult remove(@PathVariable Long[] ids)
100 { 113 {
101 return toAjax(driverService.deleteDriverByIds(ids)); 114 return toAjax(driverService.deleteDriverByIds(ids));
102 } 115 }
  116 +
103 } 117 }
trash-unit/src/main/java/com/trash/driver/domain/Driver.java
@@ -9,9 +9,9 @@ import com.trash.common.core.domain.BaseEntity; @@ -9,9 +9,9 @@ import com.trash.common.core.domain.BaseEntity;
9 9
10 /** 10 /**
11 * 驾驶员管理对象 driver 11 * 驾驶员管理对象 driver
12 - * 12 + *
13 * @author trash 13 * @author trash
14 - * @date 2023-11-15 14 + * @date 2023-11-27
15 */ 15 */
16 public class Driver extends BaseEntity 16 public class Driver extends BaseEntity
17 { 17 {
@@ -77,155 +77,193 @@ public class Driver extends BaseEntity @@ -77,155 +77,193 @@ public class Driver extends BaseEntity
77 @Excel(name = "审批状态,0=审批中,1=审批通过,2=被驳回") 77 @Excel(name = "审批状态,0=审批中,1=审批通过,2=被驳回")
78 private Integer status; 78 private Integer status;
79 79
80 - public void setId(Long id) 80 + /** 一寸免冠照片1 */
  81 + @Excel(name = "一寸免冠照片1")
  82 + private String photographOne;
  83 +
  84 + /** 一寸免冠照片2 */
  85 + @Excel(name = "一寸免冠照片2")
  86 + private String photographTwo;
  87 +
  88 + private String phoneNo;
  89 +
  90 + public String getPhoneNo() {
  91 + return phoneNo;
  92 + }
  93 +
  94 + public void setPhoneNo(String phoneNo) {
  95 + this.phoneNo = phoneNo;
  96 + }
  97 +
  98 + public void setId(Long id)
81 { 99 {
82 this.id = id; 100 this.id = id;
83 } 101 }
84 102
85 - public Long getId() 103 + public Long getId()
86 { 104 {
87 return id; 105 return id;
88 } 106 }
89 - public void setName(String name) 107 + public void setName(String name)
90 { 108 {
91 this.name = name; 109 this.name = name;
92 } 110 }
93 111
94 - public String getName() 112 + public String getName()
95 { 113 {
96 return name; 114 return name;
97 } 115 }
98 - public void setIdentityCard(String identityCard) 116 + public void setIdentityCard(String identityCard)
99 { 117 {
100 this.identityCard = identityCard; 118 this.identityCard = identityCard;
101 } 119 }
102 120
103 - public String getIdentityCard() 121 + public String getIdentityCard()
104 { 122 {
105 return identityCard; 123 return identityCard;
106 } 124 }
107 - public void setCompanyId(Long companyId) 125 + public void setCompanyId(Long companyId)
108 { 126 {
109 this.companyId = companyId; 127 this.companyId = companyId;
110 } 128 }
111 129
112 - public Long getCompanyId() 130 + public Long getCompanyId()
113 { 131 {
114 return companyId; 132 return companyId;
115 } 133 }
116 - public void setProfessionalQualificationBeginDate(Date professionalQualificationBeginDate) 134 + public void setProfessionalQualificationBeginDate(Date professionalQualificationBeginDate)
117 { 135 {
118 this.professionalQualificationBeginDate = professionalQualificationBeginDate; 136 this.professionalQualificationBeginDate = professionalQualificationBeginDate;
119 } 137 }
120 138
121 - public Date getProfessionalQualificationBeginDate() 139 + public Date getProfessionalQualificationBeginDate()
122 { 140 {
123 return professionalQualificationBeginDate; 141 return professionalQualificationBeginDate;
124 } 142 }
125 - public void setProfessionalQualificationEndDate(Date professionalQualificationEndDate) 143 + public void setProfessionalQualificationEndDate(Date professionalQualificationEndDate)
126 { 144 {
127 this.professionalQualificationEndDate = professionalQualificationEndDate; 145 this.professionalQualificationEndDate = professionalQualificationEndDate;
128 } 146 }
129 147
130 - public Date getProfessionalQualificationEndDate() 148 + public Date getProfessionalQualificationEndDate()
131 { 149 {
132 return professionalQualificationEndDate; 150 return professionalQualificationEndDate;
133 } 151 }
134 - public void setDrivingLicenceBeginDate(Date drivingLicenceBeginDate) 152 + public void setDrivingLicenceBeginDate(Date drivingLicenceBeginDate)
135 { 153 {
136 this.drivingLicenceBeginDate = drivingLicenceBeginDate; 154 this.drivingLicenceBeginDate = drivingLicenceBeginDate;
137 } 155 }
138 156
139 - public Date getDrivingLicenceBeginDate() 157 + public Date getDrivingLicenceBeginDate()
140 { 158 {
141 return drivingLicenceBeginDate; 159 return drivingLicenceBeginDate;
142 } 160 }
143 - public void setDrivingLicenceEndDate(Date drivingLicenceEndDate) 161 + public void setDrivingLicenceEndDate(Date drivingLicenceEndDate)
144 { 162 {
145 this.drivingLicenceEndDate = drivingLicenceEndDate; 163 this.drivingLicenceEndDate = drivingLicenceEndDate;
146 } 164 }
147 165
148 - public Date getDrivingLicenceEndDate() 166 + public Date getDrivingLicenceEndDate()
149 { 167 {
150 return drivingLicenceEndDate; 168 return drivingLicenceEndDate;
151 } 169 }
152 - public void setSafetyTrainingDate(Date safetyTrainingDate) 170 + public void setSafetyTrainingDate(Date safetyTrainingDate)
153 { 171 {
154 this.safetyTrainingDate = safetyTrainingDate; 172 this.safetyTrainingDate = safetyTrainingDate;
155 } 173 }
156 174
157 - public Date getSafetyTrainingDate() 175 + public Date getSafetyTrainingDate()
158 { 176 {
159 return safetyTrainingDate; 177 return safetyTrainingDate;
160 } 178 }
161 - public void setSafetyTrainingContent(String safetyTrainingContent) 179 + public void setSafetyTrainingContent(String safetyTrainingContent)
162 { 180 {
163 this.safetyTrainingContent = safetyTrainingContent; 181 this.safetyTrainingContent = safetyTrainingContent;
164 } 182 }
165 183
166 - public String getSafetyTrainingContent() 184 + public String getSafetyTrainingContent()
167 { 185 {
168 return safetyTrainingContent; 186 return safetyTrainingContent;
169 } 187 }
170 - public void setDrivingLicence(String drivingLicence) 188 + public void setDrivingLicence(String drivingLicence)
171 { 189 {
172 this.drivingLicence = drivingLicence; 190 this.drivingLicence = drivingLicence;
173 } 191 }
174 192
175 - public String getDrivingLicence() 193 + public String getDrivingLicence()
176 { 194 {
177 return drivingLicence; 195 return drivingLicence;
178 } 196 }
179 - public void setProfessionalQualification(String professionalQualification) 197 + public void setProfessionalQualification(String professionalQualification)
180 { 198 {
181 this.professionalQualification = professionalQualification; 199 this.professionalQualification = professionalQualification;
182 } 200 }
183 201
184 - public String getProfessionalQualification() 202 + public String getProfessionalQualification()
185 { 203 {
186 return professionalQualification; 204 return professionalQualification;
187 } 205 }
188 - public void setSafetyTraining(String safetyTraining) 206 + public void setSafetyTraining(String safetyTraining)
189 { 207 {
190 this.safetyTraining = safetyTraining; 208 this.safetyTraining = safetyTraining;
191 } 209 }
192 210
193 - public String getSafetyTraining() 211 + public String getSafetyTraining()
194 { 212 {
195 return safetyTraining; 213 return safetyTraining;
196 } 214 }
197 - public void setStatus(Integer status) 215 + public void setStatus(Integer status)
198 { 216 {
199 this.status = status; 217 this.status = status;
200 } 218 }
201 219
202 - public Integer getStatus() 220 + public Integer getStatus()
203 { 221 {
204 return status; 222 return status;
205 } 223 }
  224 + public void setPhotographOne(String photographOne)
  225 + {
  226 + this.photographOne = photographOne;
  227 + }
  228 +
  229 + public String getPhotographOne()
  230 + {
  231 + return photographOne;
  232 + }
  233 + public void setPhotographTwo(String photographTwo)
  234 + {
  235 + this.photographTwo = photographTwo;
  236 + }
  237 +
  238 + public String getPhotographTwo()
  239 + {
  240 + return photographTwo;
  241 + }
206 242
207 @Override 243 @Override
208 public String toString() { 244 public String toString() {
209 return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 245 return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
210 - .append("id", getId())  
211 - .append("name", getName())  
212 - .append("identityCard", getIdentityCard())  
213 - .append("companyId", getCompanyId())  
214 - .append("professionalQualificationBeginDate", getProfessionalQualificationBeginDate())  
215 - .append("professionalQualificationEndDate", getProfessionalQualificationEndDate())  
216 - .append("drivingLicenceBeginDate", getDrivingLicenceBeginDate())  
217 - .append("drivingLicenceEndDate", getDrivingLicenceEndDate())  
218 - .append("safetyTrainingDate", getSafetyTrainingDate())  
219 - .append("safetyTrainingContent", getSafetyTrainingContent())  
220 - .append("remark", getRemark())  
221 - .append("drivingLicence", getDrivingLicence())  
222 - .append("professionalQualification", getProfessionalQualification())  
223 - .append("safetyTraining", getSafetyTraining())  
224 - .append("status", getStatus())  
225 - .append("createTime", getCreateTime())  
226 - .append("createBy", getCreateBy())  
227 - .append("updateTime", getUpdateTime())  
228 - .append("updateBy", getUpdateBy())  
229 - .toString(); 246 + .append("id", getId())
  247 + .append("name", getName())
  248 + .append("identityCard", getIdentityCard())
  249 + .append("companyId", getCompanyId())
  250 + .append("professionalQualificationBeginDate", getProfessionalQualificationBeginDate())
  251 + .append("professionalQualificationEndDate", getProfessionalQualificationEndDate())
  252 + .append("drivingLicenceBeginDate", getDrivingLicenceBeginDate())
  253 + .append("drivingLicenceEndDate", getDrivingLicenceEndDate())
  254 + .append("safetyTrainingDate", getSafetyTrainingDate())
  255 + .append("safetyTrainingContent", getSafetyTrainingContent())
  256 + .append("remark", getRemark())
  257 + .append("drivingLicence", getDrivingLicence())
  258 + .append("professionalQualification", getProfessionalQualification())
  259 + .append("safetyTraining", getSafetyTraining())
  260 + .append("status", getStatus())
  261 + .append("createTime", getCreateTime())
  262 + .append("createBy", getCreateBy())
  263 + .append("updateTime", getUpdateTime())
  264 + .append("updateBy", getUpdateBy())
  265 + .append("photographOne", getPhotographOne())
  266 + .append("photographTwo", getPhotographTwo())
  267 + .toString();
230 } 268 }
231 } 269 }
trash-unit/src/main/java/com/trash/driver/domain/vo/DriverVo.java 0 → 100644
  1 +package com.trash.driver.domain.vo;
  2 +
  3 +import com.trash.driver.domain.Driver;
  4 +
  5 +public class DriverVo extends Driver {
  6 +
  7 + private String companyName;
  8 +
  9 + public String getCompanyName() {
  10 + return companyName;
  11 + }
  12 +
  13 + public void setCompanyName(String companyName) {
  14 + this.companyName = companyName;
  15 + }
  16 +}
trash-unit/src/main/java/com/trash/driver/mapper/DriverMapper.java
1 package com.trash.driver.mapper; 1 package com.trash.driver.mapper;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import java.util.Map;
  5 +
4 import com.trash.driver.domain.Driver; 6 import com.trash.driver.domain.Driver;
  7 +import com.trash.driver.domain.vo.DriverVo;
5 8
6 /** 9 /**
7 * 驾驶员管理Mapper接口 10 * 驾驶员管理Mapper接口
8 * 11 *
9 * @author trash 12 * @author trash
10 - * @date 2023-11-15 13 + * @date 2023-11-21
11 */ 14 */
12 public interface DriverMapper 15 public interface DriverMapper
13 { 16 {
@@ -25,7 +28,14 @@ public interface DriverMapper @@ -25,7 +28,14 @@ public interface DriverMapper
25 * @param driver 驾驶员管理 28 * @param driver 驾驶员管理
26 * @return 驾驶员管理集合 29 * @return 驾驶员管理集合
27 */ 30 */
28 - List<Driver> selectDriverList(Driver driver); 31 + List<DriverVo> selectDriverList(DriverVo driver);
  32 +
  33 + /**
  34 + * 根据公司id驾驶员管理列表
  35 + *
  36 + * @return 驾驶员管理集合
  37 + */
  38 + List<Map<Object,Object>> selectDriverListByCompanyId(String companyId);
29 39
30 /** 40 /**
31 * 新增驾驶员管理 41 * 新增驾驶员管理
trash-unit/src/main/java/com/trash/driver/service/IDriverService.java
1 package com.trash.driver.service; 1 package com.trash.driver.service;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +import java.util.Map;
  6 +
4 import com.trash.driver.domain.Driver; 7 import com.trash.driver.domain.Driver;
  8 +import com.trash.driver.domain.vo.DriverVo;
  9 +import org.springframework.web.multipart.MultipartFile;
5 10
6 /** 11 /**
7 * 驾驶员管理Service接口 12 * 驾驶员管理Service接口
8 * 13 *
9 * @author trash 14 * @author trash
10 - * @date 2023-11-15 15 + * @date 2023-11-21
11 */ 16 */
12 public interface IDriverService 17 public interface IDriverService
13 { 18 {
@@ -25,23 +30,50 @@ public interface IDriverService @@ -25,23 +30,50 @@ public interface IDriverService
25 * @param driver 驾驶员管理 30 * @param driver 驾驶员管理
26 * @return 驾驶员管理集合 31 * @return 驾驶员管理集合
27 */ 32 */
28 - List<Driver> selectDriverList(Driver driver); 33 + List<DriverVo> selectDriverList(DriverVo driver);
  34 +
  35 + /**
  36 + * 根据公司id驾驶员管理列表
  37 + *
  38 + * @return 驾驶员管理集合
  39 + */
  40 + List<Map<Object,Object>> selectDriverListByCompanyId(String companyId);
29 41
30 /** 42 /**
31 * 新增驾驶员管理 43 * 新增驾驶员管理
32 - *  
33 - * @param driver 驾驶员管理 44 + *
  45 + * @param drivingLicenceFiles
  46 + * @param professionalQualificationFiles
  47 + * @param safetyTrainingFiles
  48 + * @param photographOneFiles
  49 + * @param photographTwoFiles
  50 + * @param driver 驾驶员管理
34 * @return 结果 51 * @return 结果
35 */ 52 */
36 - int insertDriver(Driver driver); 53 + int insertDriver(MultipartFile[] drivingLicenceFiles,
  54 + MultipartFile[] professionalQualificationFiles,
  55 + MultipartFile[] safetyTrainingFiles,
  56 + MultipartFile[] photographOneFiles,
  57 + MultipartFile[] photographTwoFiles,
  58 + Driver driver) throws IOException;
37 59
38 /** 60 /**
39 * 修改驾驶员管理 61 * 修改驾驶员管理
40 - *  
41 - * @param driver 驾驶员管理 62 + *
  63 + * @param drivingLicenceFiles
  64 + * @param professionalQualificationFiles
  65 + * @param safetyTrainingFiles
  66 + * @param photographOneFiles
  67 + * @param photographTwoFiles
  68 + * @param driver 驾驶员管理
42 * @return 结果 69 * @return 结果
43 */ 70 */
44 - int updateDriver(Driver driver); 71 + int updateDriver(MultipartFile[] drivingLicenceFiles,
  72 + MultipartFile[] professionalQualificationFiles,
  73 + MultipartFile[] safetyTrainingFiles,
  74 + MultipartFile[] photographOneFiles,
  75 + MultipartFile[] photographTwoFiles,
  76 + Driver driver) throws IOException;
45 77
46 /** 78 /**
47 * 批量删除驾驶员管理 79 * 批量删除驾驶员管理
trash-unit/src/main/java/com/trash/driver/service/impl/DriverServiceImpl.java
1 package com.trash.driver.service.impl; 1 package com.trash.driver.service.impl;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import com.trash.common.config.trashConfig;
4 import com.trash.common.utils.DateUtils; 8 import com.trash.common.utils.DateUtils;
  9 +import com.trash.common.utils.SecurityUtils;
  10 +import com.trash.driver.domain.vo.DriverVo;
5 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
7 import com.trash.driver.mapper.DriverMapper; 13 import com.trash.driver.mapper.DriverMapper;
8 import com.trash.driver.domain.Driver; 14 import com.trash.driver.domain.Driver;
9 import com.trash.driver.service.IDriverService; 15 import com.trash.driver.service.IDriverService;
  16 +import org.springframework.web.multipart.MultipartFile;
  17 +
  18 +import static com.trash.common.utils.file.FileUploadUtils.upload;
10 19
11 /** 20 /**
12 * 驾驶员管理Service业务层处理 21 * 驾驶员管理Service业务层处理
13 * 22 *
14 * @author trash 23 * @author trash
15 - * @date 2023-11-15 24 + * @date 2023-11-21
16 */ 25 */
17 @Service 26 @Service
18 public class DriverServiceImpl implements IDriverService 27 public class DriverServiceImpl implements IDriverService
@@ -39,34 +48,90 @@ public class DriverServiceImpl implements IDriverService @@ -39,34 +48,90 @@ public class DriverServiceImpl implements IDriverService
39 * @return 驾驶员管理 48 * @return 驾驶员管理
40 */ 49 */
41 @Override 50 @Override
42 - public List<Driver> selectDriverList(Driver driver) 51 + public List<DriverVo> selectDriverList(DriverVo driver)
43 { 52 {
44 return driverMapper.selectDriverList(driver); 53 return driverMapper.selectDriverList(driver);
45 } 54 }
46 55
  56 + @Override
  57 + public List<Map<Object, Object>> selectDriverListByCompanyId(String companyId) {
  58 + return driverMapper.selectDriverListByCompanyId(companyId);
  59 + }
  60 +
47 /** 61 /**
48 * 新增驾驶员管理 62 * 新增驾驶员管理
49 - *  
50 - * @param driver 驾驶员管理 63 + *
  64 + * @param drivingLicenceFiles
  65 + * @param professionalQualificationFiles
  66 + * @param safetyTrainingFiles
  67 + * @param photographOneFiles
  68 + * @param photographTwoFiles
  69 + * @param driver 驾驶员管理
51 * @return 结果 70 * @return 结果
52 */ 71 */
53 @Override 72 @Override
54 - public int insertDriver(Driver driver)  
55 - { 73 + public int insertDriver(MultipartFile[] drivingLicenceFiles, MultipartFile[] professionalQualificationFiles, MultipartFile[] safetyTrainingFiles, MultipartFile[] photographOneFiles, MultipartFile[] photographTwoFiles, Driver driver) throws IOException {
56 driver.setCreateTime(DateUtils.getNowDate()); 74 driver.setCreateTime(DateUtils.getNowDate());
  75 + driver.setCreateBy(SecurityUtils.getUsername());
  76 + driver.setStatus(0);
  77 + for (MultipartFile file : drivingLicenceFiles) {
  78 + driver.setDrivingLicence(driver.getDrivingLicence()!=null?driver.getDrivingLicence()+";"+uploadFile(file):uploadFile(file));
  79 + }
  80 + for (MultipartFile file : professionalQualificationFiles) {
  81 + driver.setProfessionalQualification(driver.getProfessionalQualification()!=null?driver.getProfessionalQualification()+";"+uploadFile(file):uploadFile(file));
  82 + }
  83 + for (MultipartFile file : safetyTrainingFiles) {
  84 + driver.setSafetyTraining(driver.getSafetyTraining()!=null?driver.getSafetyTraining()+";"+uploadFile(file):uploadFile(file));
  85 + }
  86 + for (MultipartFile file : photographOneFiles) {
  87 + driver.setPhotographOne(driver.getPhotographOne()!=null?driver.getPhotographOne()+";"+uploadFile(file):uploadFile(file));
  88 + }
  89 + for (MultipartFile file : photographTwoFiles) {
  90 + driver.setPhotographTwo(driver.getPhotographTwo()!=null?driver.getPhotographTwo()+";"+uploadFile(file):uploadFile(file));
  91 + }
  92 + driver.setDrivingLicence(removeSemicolon(driver.getDrivingLicence()));
  93 + driver.setProfessionalQualification(removeSemicolon(driver.getProfessionalQualification()));
  94 + driver.setSafetyTraining(removeSemicolon(driver.getSafetyTraining()));
  95 + driver.setPhotographOne(removeSemicolon(driver.getPhotographOne()));
  96 + driver.setPhotographTwo(removeSemicolon(driver.getPhotographTwo()));
57 return driverMapper.insertDriver(driver); 97 return driverMapper.insertDriver(driver);
58 } 98 }
59 99
60 /** 100 /**
61 * 修改驾驶员管理 101 * 修改驾驶员管理
62 - *  
63 - * @param driver 驾驶员管理 102 + *
  103 + * @param drivingLicenceFiles
  104 + * @param professionalQualificationFiles
  105 + * @param safetyTrainingFiles
  106 + * @param photographOneFiles
  107 + * @param photographTwoFiles
  108 + * @param driver 驾驶员管理
64 * @return 结果 109 * @return 结果
65 */ 110 */
66 @Override 111 @Override
67 - public int updateDriver(Driver driver)  
68 - { 112 + public int updateDriver(MultipartFile[] drivingLicenceFiles, MultipartFile[] professionalQualificationFiles, MultipartFile[] safetyTrainingFiles, MultipartFile[] photographOneFiles, MultipartFile[] photographTwoFiles, Driver driver) throws IOException {
69 driver.setUpdateTime(DateUtils.getNowDate()); 113 driver.setUpdateTime(DateUtils.getNowDate());
  114 + driver.setUpdateBy(SecurityUtils.getUsername());
  115 + for (MultipartFile file : drivingLicenceFiles) {
  116 + driver.setDrivingLicence(driver.getDrivingLicence()!=null?driver.getDrivingLicence()+";"+uploadFile(file):uploadFile(file));
  117 + }
  118 + for (MultipartFile file : professionalQualificationFiles) {
  119 + driver.setProfessionalQualification(driver.getProfessionalQualification()!=null?driver.getProfessionalQualification()+";"+uploadFile(file):uploadFile(file));
  120 + }
  121 + for (MultipartFile file : safetyTrainingFiles) {
  122 + driver.setSafetyTraining(driver.getSafetyTraining()!=null?driver.getSafetyTraining()+";"+uploadFile(file):uploadFile(file));
  123 + }
  124 + for (MultipartFile file : photographOneFiles) {
  125 + driver.setPhotographOne(driver.getPhotographOne()!=null?driver.getPhotographOne()+";"+uploadFile(file):uploadFile(file));
  126 + }
  127 + for (MultipartFile file : photographTwoFiles) {
  128 + driver.setPhotographTwo(driver.getPhotographTwo()!=null?driver.getPhotographTwo()+";"+uploadFile(file):uploadFile(file));
  129 + }
  130 + driver.setDrivingLicence(removeSemicolon(driver.getDrivingLicence()));
  131 + driver.setProfessionalQualification(removeSemicolon(driver.getProfessionalQualification()));
  132 + driver.setSafetyTraining(removeSemicolon(driver.getSafetyTraining()));
  133 + driver.setPhotographOne(removeSemicolon(driver.getPhotographOne()));
  134 + driver.setPhotographTwo(removeSemicolon(driver.getPhotographTwo()));
70 return driverMapper.updateDriver(driver); 135 return driverMapper.updateDriver(driver);
71 } 136 }
72 137
@@ -93,4 +158,25 @@ public class DriverServiceImpl implements IDriverService @@ -93,4 +158,25 @@ public class DriverServiceImpl implements IDriverService
93 { 158 {
94 return driverMapper.deleteDriverById(id); 159 return driverMapper.deleteDriverById(id);
95 } 160 }
  161 +
  162 + /**
  163 + * 文件上传
  164 + *
  165 + * @param file
  166 + * @author 2c
  167 + */
  168 + public static String uploadFile(MultipartFile file) throws IOException {
  169 + // 上传文件路径
  170 + String filePath = trashConfig.getUploadPath();
  171 + // 上传并返回新文件名称
  172 + String newFileName = upload(filePath, file);
  173 + return newFileName;
  174 + }
  175 +
  176 + //去掉第一个分号,如果有的话
  177 + public String removeSemicolon(String str){
  178 + if (str.startsWith(";"))
  179 + str = str.substring(1);
  180 + return str;
  181 + }
96 } 182 }
trash-unit/src/main/java/com/trash/enterprise/controller/TransportationEnterpriseController.java
1 package com.trash.enterprise.controller; 1 package com.trash.enterprise.controller;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
4 import org.springframework.security.access.prepost.PreAuthorize; 5 import org.springframework.security.access.prepost.PreAuthorize;
5 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
6 -import org.springframework.web.bind.annotation.GetMapping;  
7 -import org.springframework.web.bind.annotation.PostMapping;  
8 -import org.springframework.web.bind.annotation.PutMapping;  
9 -import org.springframework.web.bind.annotation.DeleteMapping;  
10 -import org.springframework.web.bind.annotation.PathVariable;  
11 -import org.springframework.web.bind.annotation.RequestBody;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RestController; 7 +import org.springframework.web.bind.annotation.*;
14 import com.trash.common.annotation.Log; 8 import com.trash.common.annotation.Log;
15 import com.trash.common.core.controller.BaseController; 9 import com.trash.common.core.controller.BaseController;
16 import com.trash.common.core.domain.AjaxResult; 10 import com.trash.common.core.domain.AjaxResult;
@@ -19,15 +13,16 @@ import com.trash.enterprise.domain.TransportationEnterprise; @@ -19,15 +13,16 @@ import com.trash.enterprise.domain.TransportationEnterprise;
19 import com.trash.enterprise.service.ITransportationEnterpriseService; 13 import com.trash.enterprise.service.ITransportationEnterpriseService;
20 import com.trash.common.utils.poi.ExcelUtil; 14 import com.trash.common.utils.poi.ExcelUtil;
21 import com.trash.common.core.page.TableDataInfo; 15 import com.trash.common.core.page.TableDataInfo;
  16 +import org.springframework.web.multipart.MultipartFile;
22 17
23 /** 18 /**
24 * 运输企业管理Controller 19 * 运输企业管理Controller
25 * 20 *
26 * @author trash 21 * @author trash
27 - * @date 2023-11-15 22 + * @date 2023-11-21
28 */ 23 */
29 @RestController 24 @RestController
30 -@RequestMapping("/enterprise") 25 +@RequestMapping("/unit/enterprise")
31 public class TransportationEnterpriseController extends BaseController 26 public class TransportationEnterpriseController extends BaseController
32 { 27 {
33 @Autowired 28 @Autowired
@@ -36,7 +31,7 @@ public class TransportationEnterpriseController extends BaseController @@ -36,7 +31,7 @@ public class TransportationEnterpriseController extends BaseController
36 /** 31 /**
37 * 查询运输企业管理列表 32 * 查询运输企业管理列表
38 */ 33 */
39 - //@PreAuthorize("@ss.hasPermi('enterprise:enterprise:list')") 34 + @PreAuthorize("@ss.hasPermi('unit:enterprise:list')")
40 @GetMapping("/list") 35 @GetMapping("/list")
41 public TableDataInfo list(TransportationEnterprise transportationEnterprise) 36 public TableDataInfo list(TransportationEnterprise transportationEnterprise)
42 { 37 {
@@ -48,7 +43,7 @@ public class TransportationEnterpriseController extends BaseController @@ -48,7 +43,7 @@ public class TransportationEnterpriseController extends BaseController
48 /** 43 /**
49 * 导出运输企业管理列表 44 * 导出运输企业管理列表
50 */ 45 */
51 - @PreAuthorize("@ss.hasPermi('enterprise:enterprise:export')") 46 + @PreAuthorize("@ss.hasPermi('unit:enterprise:export')")
52 @Log(title = "运输企业管理", businessType = BusinessType.EXPORT) 47 @Log(title = "运输企业管理", businessType = BusinessType.EXPORT)
53 @GetMapping("/export") 48 @GetMapping("/export")
54 public AjaxResult export(TransportationEnterprise transportationEnterprise) 49 public AjaxResult export(TransportationEnterprise transportationEnterprise)
@@ -61,7 +56,7 @@ public class TransportationEnterpriseController extends BaseController @@ -61,7 +56,7 @@ public class TransportationEnterpriseController extends BaseController
61 /** 56 /**
62 * 获取运输企业管理详细信息 57 * 获取运输企业管理详细信息
63 */ 58 */
64 - @PreAuthorize("@ss.hasPermi('enterprise:enterprise:query')") 59 + @PreAuthorize("@ss.hasPermi('unit:enterprise:query')")
65 @GetMapping(value = "/{id}") 60 @GetMapping(value = "/{id}")
66 public AjaxResult getInfo(@PathVariable("id") Long id) 61 public AjaxResult getInfo(@PathVariable("id") Long id)
67 { 62 {
@@ -71,29 +66,37 @@ public class TransportationEnterpriseController extends BaseController @@ -71,29 +66,37 @@ public class TransportationEnterpriseController extends BaseController
71 /** 66 /**
72 * 新增运输企业管理 67 * 新增运输企业管理
73 */ 68 */
74 - @PreAuthorize("@ss.hasPermi('enterprise:enterprise:add')") 69 + @PreAuthorize("@ss.hasPermi('unit:enterprise:add')")
75 @Log(title = "运输企业管理", businessType = BusinessType.INSERT) 70 @Log(title = "运输企业管理", businessType = BusinessType.INSERT)
76 @PostMapping 71 @PostMapping
77 - public AjaxResult add(@RequestBody TransportationEnterprise transportationEnterprise)  
78 - {  
79 - return toAjax(transportationEnterpriseService.insertTransportationEnterprise(transportationEnterprise)); 72 + public AjaxResult add(@RequestParam(value = "transportPermissionFiles") MultipartFile[] transportPermissionFiles,
  73 + @RequestParam(value = "enterpriseBusinessLicenseFiles") MultipartFile[] enterpriseBusinessLicenseFiles,
  74 + @RequestParam(value = "safetyOfficerQualificationCertificateFiles") MultipartFile[] safetyOfficerQualificationCertificateFiles,
  75 + @RequestParam(value = "safetyCertificateFiles") MultipartFile[] safetyCertificateFiles,
  76 + @RequestParam(value = "carParkPanoramaFiles") MultipartFile[] carParkPanoramaFiles,
  77 + TransportationEnterprise transportationEnterprise) throws IOException {
  78 + return toAjax(transportationEnterpriseService.insertTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles, transportationEnterprise));
80 } 79 }
81 80
82 /** 81 /**
83 * 修改运输企业管理 82 * 修改运输企业管理
84 */ 83 */
85 - @PreAuthorize("@ss.hasPermi('enterprise:enterprise:edit')") 84 + @PreAuthorize("@ss.hasPermi('unit:enterprise:edit')")
86 @Log(title = "运输企业管理", businessType = BusinessType.UPDATE) 85 @Log(title = "运输企业管理", businessType = BusinessType.UPDATE)
87 @PutMapping 86 @PutMapping
88 - public AjaxResult edit(@RequestBody TransportationEnterprise transportationEnterprise)  
89 - {  
90 - return toAjax(transportationEnterpriseService.updateTransportationEnterprise(transportationEnterprise)); 87 + public AjaxResult edit(@RequestParam(value = "transportPermissionFiles") MultipartFile[] transportPermissionFiles,
  88 + @RequestParam(value = "enterpriseBusinessLicenseFiles") MultipartFile[] enterpriseBusinessLicenseFiles,
  89 + @RequestParam(value = "safetyOfficerQualificationCertificateFiles") MultipartFile[] safetyOfficerQualificationCertificateFiles,
  90 + @RequestParam(value = "safetyCertificateFiles") MultipartFile[] safetyCertificateFiles,
  91 + @RequestParam(value = "carParkPanoramaFiles") MultipartFile[] carParkPanoramaFiles,
  92 + TransportationEnterprise transportationEnterprise) throws IOException {
  93 + return toAjax(transportationEnterpriseService.updateTransportationEnterprise(transportPermissionFiles, enterpriseBusinessLicenseFiles, safetyOfficerQualificationCertificateFiles, safetyCertificateFiles, carParkPanoramaFiles, transportationEnterprise));
91 } 94 }
92 95
93 /** 96 /**
94 * 删除运输企业管理 97 * 删除运输企业管理
95 */ 98 */
96 - @PreAuthorize("@ss.hasPermi('enterprise:enterprise:remove')") 99 + @PreAuthorize("@ss.hasPermi('unit:enterprise:remove')")
97 @Log(title = "运输企业管理", businessType = BusinessType.DELETE) 100 @Log(title = "运输企业管理", businessType = BusinessType.DELETE)
98 @DeleteMapping("/{ids}") 101 @DeleteMapping("/{ids}")
99 public AjaxResult remove(@PathVariable Long[] ids) 102 public AjaxResult remove(@PathVariable Long[] ids)
trash-unit/src/main/java/com/trash/enterprise/domain/TransportationEnterprise.java
@@ -12,7 +12,7 @@ import com.trash.common.core.domain.BaseEntity; @@ -12,7 +12,7 @@ import com.trash.common.core.domain.BaseEntity;
12 * 运输企业管理对象 transportation_enterprise 12 * 运输企业管理对象 transportation_enterprise
13 * 13 *
14 * @author trash 14 * @author trash
15 - * @date 2023-11-15 15 + * @date 2023-11-21
16 */ 16 */
17 public class TransportationEnterprise extends BaseEntity 17 public class TransportationEnterprise extends BaseEntity
18 { 18 {
@@ -113,7 +113,7 @@ public class TransportationEnterprise extends BaseEntity @@ -113,7 +113,7 @@ public class TransportationEnterprise extends BaseEntity
113 private String businessUnit; 113 private String businessUnit;
114 114
115 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */ 115 /** 审批状态,0=审批中,1=审批通过,2=被驳回 */
116 - @Excel(name = "审批状态,0=审批中,1=审批通过,2=被驳回") 116 + @Excel(name = "审批状态",readConverterExp = "0=审批中,1=审批通过,2=被驳回")
117 private Integer status; 117 private Integer status;
118 118
119 /** 父公司id */ 119 /** 父公司id */
@@ -124,6 +124,14 @@ public class TransportationEnterprise extends BaseEntity @@ -124,6 +124,14 @@ public class TransportationEnterprise extends BaseEntity
124 @Excel(name = "公司类型", readConverterExp = "0=经营单位,1运输公司") 124 @Excel(name = "公司类型", readConverterExp = "0=经营单位,1运输公司")
125 private Integer companyType; 125 private Integer companyType;
126 126
  127 + /** 信用状态 */
  128 + @Excel(name = "信用状态")
  129 + private String creditStatus;
  130 +
  131 + /** 二维码 */
  132 + @Excel(name = "二维码")
  133 + private String qrCode;
  134 +
127 public void setId(Long id) 135 public void setId(Long id)
128 { 136 {
129 this.id = id; 137 this.id = id;
@@ -358,6 +366,24 @@ public class TransportationEnterprise extends BaseEntity @@ -358,6 +366,24 @@ public class TransportationEnterprise extends BaseEntity
358 { 366 {
359 return companyType; 367 return companyType;
360 } 368 }
  369 + public void setCreditStatus(String creditStatus)
  370 + {
  371 + this.creditStatus = creditStatus;
  372 + }
  373 +
  374 + public String getCreditStatus()
  375 + {
  376 + return creditStatus;
  377 + }
  378 + public void setQrCode(String qrCode)
  379 + {
  380 + this.qrCode = qrCode;
  381 + }
  382 +
  383 + public String getQrCode()
  384 + {
  385 + return qrCode;
  386 + }
361 387
362 @Override 388 @Override
363 public String toString() { 389 public String toString() {
@@ -393,6 +419,8 @@ public class TransportationEnterprise extends BaseEntity @@ -393,6 +419,8 @@ public class TransportationEnterprise extends BaseEntity
393 .append("updateBy", getUpdateBy()) 419 .append("updateBy", getUpdateBy())
394 .append("parentId", getParentId()) 420 .append("parentId", getParentId())
395 .append("companyType", getCompanyType()) 421 .append("companyType", getCompanyType())
  422 + .append("creditStatus", getCreditStatus())
  423 + .append("qrCode", getQrCode())
396 .toString(); 424 .toString();
397 } 425 }
398 } 426 }
trash-unit/src/main/java/com/trash/enterprise/mapper/TransportationEnterpriseMapper.java
@@ -7,7 +7,7 @@ import com.trash.enterprise.domain.TransportationEnterprise; @@ -7,7 +7,7 @@ import com.trash.enterprise.domain.TransportationEnterprise;
7 * 运输企业管理Mapper接口 7 * 运输企业管理Mapper接口
8 * 8 *
9 * @author trash 9 * @author trash
10 - * @date 2023-11-15 10 + * @date 2023-11-21
11 */ 11 */
12 public interface TransportationEnterpriseMapper 12 public interface TransportationEnterpriseMapper
13 { 13 {
trash-unit/src/main/java/com/trash/enterprise/service/ITransportationEnterpriseService.java
1 package com.trash.enterprise.service; 1 package com.trash.enterprise.service;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
4 import com.trash.enterprise.domain.TransportationEnterprise; 5 import com.trash.enterprise.domain.TransportationEnterprise;
  6 +import org.springframework.web.multipart.MultipartFile;
5 7
6 /** 8 /**
7 * 运输企业管理Service接口 9 * 运输企业管理Service接口
8 * 10 *
9 * @author trash 11 * @author trash
10 - * @date 2023-11-15 12 + * @date 2023-11-21
11 */ 13 */
12 public interface ITransportationEnterpriseService 14 public interface ITransportationEnterpriseService
13 { 15 {
@@ -29,19 +31,39 @@ public interface ITransportationEnterpriseService @@ -29,19 +31,39 @@ public interface ITransportationEnterpriseService
29 31
30 /** 32 /**
31 * 新增运输企业管理 33 * 新增运输企业管理
32 - *  
33 - * @param transportationEnterprise 运输企业管理 34 + *
  35 + * @param transportPermissionFiles
  36 + * @param enterpriseBusinessLicenseFiles
  37 + * @param safetyOfficerQualificationCertificateFiles
  38 + * @param safetyCertificateFiles
  39 + * @param carParkPanoramaFiles
  40 + * @param transportationEnterprise 运输企业管理
34 * @return 结果 41 * @return 结果
35 */ 42 */
36 - int insertTransportationEnterprise(TransportationEnterprise transportationEnterprise); 43 + int insertTransportationEnterprise(MultipartFile[] transportPermissionFiles,
  44 + MultipartFile[] enterpriseBusinessLicenseFiles,
  45 + MultipartFile[] safetyOfficerQualificationCertificateFiles,
  46 + MultipartFile[] safetyCertificateFiles,
  47 + MultipartFile[] carParkPanoramaFiles,
  48 + TransportationEnterprise transportationEnterprise) throws IOException;
37 49
38 /** 50 /**
39 * 修改运输企业管理 51 * 修改运输企业管理
40 - *  
41 - * @param transportationEnterprise 运输企业管理 52 + *
  53 + * @param transportPermissionFiles
  54 + * @param enterpriseBusinessLicenseFiles
  55 + * @param safetyOfficerQualificationCertificateFiles
  56 + * @param safetyCertificateFiles
  57 + * @param carParkPanoramaFiles
  58 + * @param transportationEnterprise 运输企业管理
42 * @return 结果 59 * @return 结果
43 */ 60 */
44 - int updateTransportationEnterprise(TransportationEnterprise transportationEnterprise); 61 + int updateTransportationEnterprise(MultipartFile[] transportPermissionFiles,
  62 + MultipartFile[] enterpriseBusinessLicenseFiles,
  63 + MultipartFile[] safetyOfficerQualificationCertificateFiles,
  64 + MultipartFile[] safetyCertificateFiles,
  65 + MultipartFile[] carParkPanoramaFiles,
  66 + TransportationEnterprise transportationEnterprise) throws IOException;
45 67
46 /** 68 /**
47 * 批量删除运输企业管理 69 * 批量删除运输企业管理
trash-unit/src/main/java/com/trash/enterprise/service/impl/TransportationEnterpriseServiceImpl.java
1 package com.trash.enterprise.service.impl; 1 package com.trash.enterprise.service.impl;
2 2
  3 +import java.io.IOException;
3 import java.util.List; 4 import java.util.List;
  5 +
  6 +import com.trash.common.config.trashConfig;
4 import com.trash.common.utils.DateUtils; 7 import com.trash.common.utils.DateUtils;
  8 +import com.trash.common.utils.SecurityUtils;
5 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
7 import com.trash.enterprise.mapper.TransportationEnterpriseMapper; 11 import com.trash.enterprise.mapper.TransportationEnterpriseMapper;
8 import com.trash.enterprise.domain.TransportationEnterprise; 12 import com.trash.enterprise.domain.TransportationEnterprise;
9 import com.trash.enterprise.service.ITransportationEnterpriseService; 13 import com.trash.enterprise.service.ITransportationEnterpriseService;
  14 +import org.springframework.web.multipart.MultipartFile;
  15 +
  16 +import static com.trash.common.utils.file.FileUploadUtils.upload;
10 17
11 /** 18 /**
12 * 运输企业管理Service业务层处理 19 * 运输企业管理Service业务层处理
13 * 20 *
14 * @author trash 21 * @author trash
15 - * @date 2023-11-15 22 + * @date 2023-11-21
16 */ 23 */
17 @Service 24 @Service
18 public class TransportationEnterpriseServiceImpl implements ITransportationEnterpriseService 25 public class TransportationEnterpriseServiceImpl implements ITransportationEnterpriseService
@@ -46,27 +53,80 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter @@ -46,27 +53,80 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter
46 53
47 /** 54 /**
48 * 新增运输企业管理 55 * 新增运输企业管理
49 - *  
50 - * @param transportationEnterprise 运输企业管理 56 + *
  57 + * @param transportPermissionFiles
  58 + * @param enterpriseBusinessLicenseFiles
  59 + * @param safetyOfficerQualificationCertificateFiles
  60 + * @param safetyCertificateFiles
  61 + * @param carParkPanoramaFiles
  62 + * @param transportationEnterprise 运输企业管理
51 * @return 结果 63 * @return 结果
52 */ 64 */
53 @Override 65 @Override
54 - public int insertTransportationEnterprise(TransportationEnterprise transportationEnterprise)  
55 - { 66 + public int insertTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, TransportationEnterprise transportationEnterprise) throws IOException {
56 transportationEnterprise.setCreateTime(DateUtils.getNowDate()); 67 transportationEnterprise.setCreateTime(DateUtils.getNowDate());
  68 + transportationEnterprise.setCreateBy(SecurityUtils.getUsername());
  69 + transportationEnterprise.setStatus(0);
  70 + transportationEnterprise.setCreditStatus("正常");
  71 + for (MultipartFile file : transportPermissionFiles) {
  72 + transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission()!=null?transportationEnterprise.getTransportPermission()+";"+upload(file):upload(file));
  73 + }
  74 + for (MultipartFile file : enterpriseBusinessLicenseFiles) {
  75 + transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense()!=null?transportationEnterprise.getEnterpriseBusinessLicense()+";"+upload(file):upload(file));
  76 + }
  77 + for (MultipartFile file : safetyOfficerQualificationCertificateFiles) {
  78 + transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate()!=null?transportationEnterprise.getSafetyOfficerQualificationCertificate()+";"+upload(file):upload(file));
  79 + }
  80 + for (MultipartFile file : safetyCertificateFiles) {
  81 + transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate()!=null?transportationEnterprise.getSafetyCertificate()+";"+upload(file):upload(file));
  82 + }
  83 + for (MultipartFile file : carParkPanoramaFiles) {
  84 + transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file));
  85 + }
  86 + //去掉第一个分号,如果有的话
  87 + transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission()));
  88 + transportationEnterprise.setEnterpriseBusinessLicense(removeSemicolon(transportationEnterprise.getEnterpriseBusinessLicense()));
  89 + transportationEnterprise.setSafetyOfficerQualificationCertificate(removeSemicolon(transportationEnterprise.getSafetyOfficerQualificationCertificate()));
  90 + transportationEnterprise.setSafetyCertificate(removeSemicolon(transportationEnterprise.getSafetyCertificate()));
  91 + transportationEnterprise.setCarParkPanorama(removeSemicolon(transportationEnterprise.getCarParkPanorama()));
57 return transportationEnterpriseMapper.insertTransportationEnterprise(transportationEnterprise); 92 return transportationEnterpriseMapper.insertTransportationEnterprise(transportationEnterprise);
58 } 93 }
59 94
60 /** 95 /**
61 * 修改运输企业管理 96 * 修改运输企业管理
62 - *  
63 - * @param transportationEnterprise 运输企业管理 97 + *
  98 + * @param transportPermissionFiles
  99 + * @param enterpriseBusinessLicenseFiles
  100 + * @param safetyOfficerQualificationCertificateFiles
  101 + * @param safetyCertificateFiles
  102 + * @param carParkPanoramaFiles
  103 + * @param transportationEnterprise 运输企业管理
64 * @return 结果 104 * @return 结果
65 */ 105 */
66 @Override 106 @Override
67 - public int updateTransportationEnterprise(TransportationEnterprise transportationEnterprise)  
68 - { 107 + public int updateTransportationEnterprise(MultipartFile[] transportPermissionFiles, MultipartFile[] enterpriseBusinessLicenseFiles, MultipartFile[] safetyOfficerQualificationCertificateFiles, MultipartFile[] safetyCertificateFiles, MultipartFile[] carParkPanoramaFiles, TransportationEnterprise transportationEnterprise) throws IOException {
69 transportationEnterprise.setUpdateTime(DateUtils.getNowDate()); 108 transportationEnterprise.setUpdateTime(DateUtils.getNowDate());
  109 + transportationEnterprise.setUpdateBy(SecurityUtils.getUsername());
  110 + for (MultipartFile file : transportPermissionFiles) {
  111 + transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission()!=null?transportationEnterprise.getTransportPermission()+";"+upload(file):upload(file));
  112 + }
  113 + for (MultipartFile file : enterpriseBusinessLicenseFiles) {
  114 + transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense()!=null?transportationEnterprise.getEnterpriseBusinessLicense()+";"+upload(file):upload(file));
  115 + }
  116 + for (MultipartFile file : safetyOfficerQualificationCertificateFiles) {
  117 + transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate()!=null?transportationEnterprise.getSafetyOfficerQualificationCertificate()+";"+upload(file):upload(file));
  118 + }
  119 + for (MultipartFile file : safetyCertificateFiles) {
  120 + transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate()!=null?transportationEnterprise.getSafetyCertificate()+";"+upload(file):upload(file));
  121 + }
  122 + for (MultipartFile file : carParkPanoramaFiles) {
  123 + transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file));
  124 + }
  125 + transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission()));
  126 + transportationEnterprise.setEnterpriseBusinessLicense(removeSemicolon(transportationEnterprise.getEnterpriseBusinessLicense()));
  127 + transportationEnterprise.setSafetyOfficerQualificationCertificate(removeSemicolon(transportationEnterprise.getSafetyOfficerQualificationCertificate()));
  128 + transportationEnterprise.setSafetyCertificate(removeSemicolon(transportationEnterprise.getSafetyCertificate()));
  129 + transportationEnterprise.setCarParkPanorama(removeSemicolon(transportationEnterprise.getCarParkPanorama()));
70 return transportationEnterpriseMapper.updateTransportationEnterprise(transportationEnterprise); 130 return transportationEnterpriseMapper.updateTransportationEnterprise(transportationEnterprise);
71 } 131 }
72 132
@@ -93,4 +153,25 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter @@ -93,4 +153,25 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter
93 { 153 {
94 return transportationEnterpriseMapper.deleteTransportationEnterpriseById(id); 154 return transportationEnterpriseMapper.deleteTransportationEnterpriseById(id);
95 } 155 }
  156 +
  157 + /**
  158 + * 文件上传
  159 + *
  160 + * @param file
  161 + * @author 2c
  162 + */
  163 + public static String uploadFile(MultipartFile file) throws IOException {
  164 + // 上传文件路径
  165 + String filePath = trashConfig.getUploadPath();
  166 + // 上传并返回新文件名称
  167 + String newFileName = upload(filePath, file);
  168 + return newFileName;
  169 + }
  170 +
  171 + //去掉第一个分号,如果有的话
  172 + public String removeSemicolon(String str){
  173 + if (str.startsWith(";"))
  174 + str = str.substring(1);
  175 + return str;
  176 + }
96 } 177 }
trash-unit/src/main/resources/mapper/carInfo/CarInfoMapper.xml deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper  
3 -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
4 -"http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
5 -<mapper namespace="com.trash.carInfo.mapper.CarInfoMapper">  
6 -  
7 - <resultMap type="CarInfo" id="CarInfoResult">  
8 - <result property="id" column="id" />  
9 - <result property="companyId" column="company_id" />  
10 - <result property="carType" column="car_type" />  
11 - <result property="carCode" column="car_code" />  
12 - <result property="carBrank" column="car_brank" />  
13 - <result property="emissionStandard" column="emission_standard" />  
14 - <result property="roadTransportDate" column="road_transport_date" />  
15 - <result property="drivingLicenseDate" column="driving_license_date" />  
16 - <result property="enterDate" column="enter_date" />  
17 - <result property="farmeNumber" column="farme_number" />  
18 - <result property="carIdentification" column="car_identification" />  
19 - <result property="containerVolume" column="container_volume" />  
20 - <result property="carColor" column="car_color" />  
21 - <result property="carEquipment" column="car_equipment" />  
22 - <result property="remark" column="remark" />  
23 - <result property="roadTransport" column="road_transport" />  
24 - <result property="drivingLicense" column="driving_license" />  
25 - <result property="carFront" column="car_front" />  
26 - <result property="carLeft" column="car_left" />  
27 - <result property="carBehind" column="car_behind" />  
28 - <result property="carRight" column="car_right" />  
29 - <result property="drivers" column="drivers" />  
30 - <result property="status" column="status" />  
31 - <result property="createTime" column="create_time" />  
32 - <result property="createBy" column="create_by" />  
33 - <result property="updateTime" column="update_time" />  
34 - <result property="updateBy" column="update_by" />  
35 - </resultMap>  
36 -  
37 - <sql id="selectCarInfoVo">  
38 - 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 from car_info  
39 - </sql>  
40 -  
41 - <select id="selectCarInfoList" parameterType="CarInfo" resultMap="CarInfoResult">  
42 - <include refid="selectCarInfoVo"/>  
43 - <where>  
44 - <if test="companyId != null "> and company_id = #{companyId}</if>  
45 - <if test="carType != null and carType != ''"> and car_type = #{carType}</if>  
46 - <if test="carCode != null and carCode != ''"> and car_code = #{carCode}</if>  
47 - <if test="carBrank != null and carBrank != ''"> and car_brank = #{carBrank}</if>  
48 - <if test="emissionStandard != null and emissionStandard != ''"> and emission_standard = #{emissionStandard}</if>  
49 - <if test="roadTransportDate != null "> and road_transport_date = #{roadTransportDate}</if>  
50 - <if test="drivingLicenseDate != null "> and driving_license_date = #{drivingLicenseDate}</if>  
51 - <if test="enterDate != null "> and enter_date = #{enterDate}</if>  
52 - <if test="farmeNumber != null and farmeNumber != ''"> and farme_number = #{farmeNumber}</if>  
53 - <if test="carIdentification != null and carIdentification != ''"> and car_identification = #{carIdentification}</if>  
54 - <if test="containerVolume != null and containerVolume != ''"> and container_volume = #{containerVolume}</if>  
55 - <if test="carColor != null and carColor != ''"> and car_color = #{carColor}</if>  
56 - <if test="carEquipment != null and carEquipment != ''"> and car_equipment = #{carEquipment}</if>  
57 - <if test="roadTransport != null and roadTransport != ''"> and road_transport = #{roadTransport}</if>  
58 - <if test="drivingLicense != null and drivingLicense != ''"> and driving_license = #{drivingLicense}</if>  
59 - <if test="carFront != null and carFront != ''"> and car_front = #{carFront}</if>  
60 - <if test="carLeft != null and carLeft != ''"> and car_left = #{carLeft}</if>  
61 - <if test="carBehind != null and carBehind != ''"> and car_behind = #{carBehind}</if>  
62 - <if test="carRight != null and carRight != ''"> and car_right = #{carRight}</if>  
63 - <if test="drivers != null and drivers != ''"> and drivers = #{drivers}</if>  
64 - <if test="status != null "> and status = #{status}</if>  
65 - </where>  
66 - </select>  
67 -  
68 - <select id="selectCarInfoById" parameterType="Long" resultMap="CarInfoResult">  
69 - <include refid="selectCarInfoVo"/>  
70 - where id = #{id}  
71 - </select>  
72 -  
73 - <insert id="insertCarInfo" parameterType="CarInfo" useGeneratedKeys="true" keyProperty="id">  
74 - insert into car_info  
75 - <trim prefix="(" suffix=")" suffixOverrides=",">  
76 - <if test="companyId != null">company_id,</if>  
77 - <if test="carType != null">car_type,</if>  
78 - <if test="carCode != null">car_code,</if>  
79 - <if test="carBrank != null">car_brank,</if>  
80 - <if test="emissionStandard != null">emission_standard,</if>  
81 - <if test="roadTransportDate != null">road_transport_date,</if>  
82 - <if test="drivingLicenseDate != null">driving_license_date,</if>  
83 - <if test="enterDate != null">enter_date,</if>  
84 - <if test="farmeNumber != null">farme_number,</if>  
85 - <if test="carIdentification != null">car_identification,</if>  
86 - <if test="containerVolume != null">container_volume,</if>  
87 - <if test="carColor != null">car_color,</if>  
88 - <if test="carEquipment != null">car_equipment,</if>  
89 - <if test="remark != null">remark,</if>  
90 - <if test="roadTransport != null">road_transport,</if>  
91 - <if test="drivingLicense != null">driving_license,</if>  
92 - <if test="carFront != null">car_front,</if>  
93 - <if test="carLeft != null">car_left,</if>  
94 - <if test="carBehind != null">car_behind,</if>  
95 - <if test="carRight != null">car_right,</if>  
96 - <if test="drivers != null">drivers,</if>  
97 - <if test="status != null">status,</if>  
98 - <if test="createTime != null">create_time,</if>  
99 - <if test="createBy != null">create_by,</if>  
100 - <if test="updateTime != null">update_time,</if>  
101 - <if test="updateBy != null">update_by,</if>  
102 - </trim>  
103 - <trim prefix="values (" suffix=")" suffixOverrides=",">  
104 - <if test="companyId != null">#{companyId},</if>  
105 - <if test="carType != null">#{carType},</if>  
106 - <if test="carCode != null">#{carCode},</if>  
107 - <if test="carBrank != null">#{carBrank},</if>  
108 - <if test="emissionStandard != null">#{emissionStandard},</if>  
109 - <if test="roadTransportDate != null">#{roadTransportDate},</if>  
110 - <if test="drivingLicenseDate != null">#{drivingLicenseDate},</if>  
111 - <if test="enterDate != null">#{enterDate},</if>  
112 - <if test="farmeNumber != null">#{farmeNumber},</if>  
113 - <if test="carIdentification != null">#{carIdentification},</if>  
114 - <if test="containerVolume != null">#{containerVolume},</if>  
115 - <if test="carColor != null">#{carColor},</if>  
116 - <if test="carEquipment != null">#{carEquipment},</if>  
117 - <if test="remark != null">#{remark},</if>  
118 - <if test="roadTransport != null">#{roadTransport},</if>  
119 - <if test="drivingLicense != null">#{drivingLicense},</if>  
120 - <if test="carFront != null">#{carFront},</if>  
121 - <if test="carLeft != null">#{carLeft},</if>  
122 - <if test="carBehind != null">#{carBehind},</if>  
123 - <if test="carRight != null">#{carRight},</if>  
124 - <if test="drivers != null">#{drivers},</if>  
125 - <if test="status != null">#{status},</if>  
126 - <if test="createTime != null">#{createTime},</if>  
127 - <if test="createBy != null">#{createBy},</if>  
128 - <if test="updateTime != null">#{updateTime},</if>  
129 - <if test="updateBy != null">#{updateBy},</if>  
130 - </trim>  
131 - </insert>  
132 -  
133 - <update id="updateCarInfo" parameterType="CarInfo">  
134 - update car_info  
135 - <trim prefix="SET" suffixOverrides=",">  
136 - <if test="companyId != null">company_id = #{companyId},</if>  
137 - <if test="carType != null">car_type = #{carType},</if>  
138 - <if test="carCode != null">car_code = #{carCode},</if>  
139 - <if test="carBrank != null">car_brank = #{carBrank},</if>  
140 - <if test="emissionStandard != null">emission_standard = #{emissionStandard},</if>  
141 - <if test="roadTransportDate != null">road_transport_date = #{roadTransportDate},</if>  
142 - <if test="drivingLicenseDate != null">driving_license_date = #{drivingLicenseDate},</if>  
143 - <if test="enterDate != null">enter_date = #{enterDate},</if>  
144 - <if test="farmeNumber != null">farme_number = #{farmeNumber},</if>  
145 - <if test="carIdentification != null">car_identification = #{carIdentification},</if>  
146 - <if test="containerVolume != null">container_volume = #{containerVolume},</if>  
147 - <if test="carColor != null">car_color = #{carColor},</if>  
148 - <if test="carEquipment != null">car_equipment = #{carEquipment},</if>  
149 - <if test="remark != null">remark = #{remark},</if>  
150 - <if test="roadTransport != null">road_transport = #{roadTransport},</if>  
151 - <if test="drivingLicense != null">driving_license = #{drivingLicense},</if>  
152 - <if test="carFront != null">car_front = #{carFront},</if>  
153 - <if test="carLeft != null">car_left = #{carLeft},</if>  
154 - <if test="carBehind != null">car_behind = #{carBehind},</if>  
155 - <if test="carRight != null">car_right = #{carRight},</if>  
156 - <if test="drivers != null">drivers = #{drivers},</if>  
157 - <if test="status != null">status = #{status},</if>  
158 - <if test="createTime != null">create_time = #{createTime},</if>  
159 - <if test="createBy != null">create_by = #{createBy},</if>  
160 - <if test="updateTime != null">update_time = #{updateTime},</if>  
161 - <if test="updateBy != null">update_by = #{updateBy},</if>  
162 - </trim>  
163 - where id = #{id}  
164 - </update>  
165 -  
166 - <delete id="deleteCarInfoById" parameterType="Long">  
167 - delete from car_info where id = #{id}  
168 - </delete>  
169 -  
170 - <delete id="deleteCarInfoByIds" parameterType="String">  
171 - delete from car_info where id in  
172 - <foreach item="id" collection="array" open="(" separator="," close=")">  
173 - #{id}  
174 - </foreach>  
175 - </delete>  
176 -  
177 -</mapper>  
178 \ No newline at end of file 0 \ No newline at end of file
trash-unit/src/main/resources/mapper/unit/CarInfoMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.carInfo.mapper.CarInfoMapper">
  6 +
  7 + <resultMap type="CarInfo" id="CarInfoResult">
  8 + <result property="id" column="id" />
  9 + <result property="companyId" column="company_id" />
  10 + <result property="carType" column="car_type" />
  11 + <result property="carCode" column="car_code" />
  12 + <result property="carBrank" column="car_brank" />
  13 + <result property="emissionStandard" column="emission_standard" />
  14 + <result property="roadTransportDate" column="road_transport_date" />
  15 + <result property="drivingLicenseDate" column="driving_license_date" />
  16 + <result property="enterDate" column="enter_date" />
  17 + <result property="farmeNumber" column="farme_number" />
  18 + <result property="carIdentification" column="car_identification" />
  19 + <result property="containerVolume" column="container_volume" />
  20 + <result property="lengthWidthHeight" column="length_width_height" />
  21 + <result property="carColor" column="car_color" />
  22 + <result property="carEquipment" column="car_equipment" />
  23 + <result property="remark" column="remark" />
  24 + <result property="roadTransport" column="road_transport" />
  25 + <result property="drivingLicense" column="driving_license" />
  26 + <result property="carFront" column="car_front" />
  27 + <result property="carLeft" column="car_left" />
  28 + <result property="carBehind" column="car_behind" />
  29 + <result property="carRight" column="car_right" />
  30 + <result property="drivers" column="drivers" />
  31 + <result property="status" column="status" />
  32 + <result property="createTime" column="create_time" />
  33 + <result property="createBy" column="create_by" />
  34 + <result property="updateTime" column="update_time" />
  35 + <result property="updateBy" column="update_by" />
  36 + <result property="creditStatus" column="credit_status" />
  37 + <result property="qrCode" column="qr_code" />
  38 + </resultMap>
  39 +
  40 + <resultMap type="CarInfoVo" id="CarInfoVoResult">
  41 + <result property="id" column="id" />
  42 + <result property="companyId" column="company_id" />
  43 + <result property="carType" column="car_type" />
  44 + <result property="carCode" column="car_code" />
  45 + <result property="carBrank" column="car_brank" />
  46 + <result property="emissionStandard" column="emission_standard" />
  47 + <result property="roadTransportDate" column="road_transport_date" />
  48 + <result property="drivingLicenseDate" column="driving_license_date" />
  49 + <result property="enterDate" column="enter_date" />
  50 + <result property="farmeNumber" column="farme_number" />
  51 + <result property="carIdentification" column="car_identification" />
  52 + <result property="containerVolume" column="container_volume" />
  53 + <result property="lengthWidthHeight" column="length_width_height" />
  54 + <result property="carColor" column="car_color" />
  55 + <result property="carEquipment" column="car_equipment" />
  56 + <result property="remark" column="remark" />
  57 + <result property="roadTransport" column="road_transport" />
  58 + <result property="drivingLicense" column="driving_license" />
  59 + <result property="carFront" column="car_front" />
  60 + <result property="carLeft" column="car_left" />
  61 + <result property="carBehind" column="car_behind" />
  62 + <result property="carRight" column="car_right" />
  63 + <result property="drivers" column="drivers" />
  64 + <result property="status" column="status" />
  65 + <result property="createTime" column="create_time" />
  66 + <result property="createBy" column="create_by" />
  67 + <result property="updateTime" column="update_time" />
  68 + <result property="updateBy" column="update_by" />
  69 + <result property="creditStatus" column="credit_status" />
  70 + <result property="qrCode" column="qr_code" />
  71 + <result property="companyName" column="companyName" />
  72 + <result property="driversName" column="driversName" />
  73 + </resultMap>
  74 +
  75 + <sql id="selectCarInfoVo">
  76 + 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
  77 + </sql>
  78 +
  79 + <sql id="selectCarInfoForCompanyVo">
  80 + select car.id,
  81 + company_id,
  82 + car_type,
  83 + car_code,
  84 + car_brank,
  85 + emission_standard,
  86 + road_transport_date,
  87 + driving_license_date,
  88 + car.enter_date,
  89 + farme_number,
  90 + car_identification,
  91 + container_volume,
  92 + length_width_height,
  93 + car_color,
  94 + car_equipment,
  95 + car.remark,
  96 + road_transport,
  97 + driving_license,
  98 + car_front,
  99 + car_left,
  100 + car_behind,
  101 + car_right,
  102 + drivers,
  103 + car.status,
  104 + car.create_time,
  105 + car.create_by,
  106 + car.update_time,
  107 + car.update_by,
  108 + car.credit_status,
  109 + car.qr_code,
  110 + c.name companyName,
  111 + d.driversName
  112 + from car_info car
  113 + left join transportation_enterprise c on car.company_id = c.id
  114 + left join (select cdr.car_id, GROUP_CONCAT(name) driversName
  115 + from car_driver_relation cdr
  116 + left join driver d on d.id = cdr.driver_id
  117 + group by cdr.car_id) d on d.car_id = car.id
  118 + </sql>
  119 +
  120 + <select id="selectCarInfoList" parameterType="CarInfoVo" resultMap="CarInfoVoResult">
  121 + <include refid="selectCarInfoForCompanyVo"/>
  122 + <where>
  123 + <if test="companyName != null and companyName != ''"> and c.name like concat('%',#{companyName},'%')</if>
  124 + <if test="carType != null and carType != ''"> and car_type = #{carType}</if>
  125 + <if test="carCode != null and carCode != ''"> and car_code like concat('%',#{carCode},'%')</if>
  126 + <if test="carBrank != null and carBrank != ''"> and car_brank like concat('%',#{carBrank},'%')</if>
  127 + <if test="emissionStandard != null and emissionStandard != ''"> and emission_standard = #{emissionStandard}</if>
  128 + <if test="roadTransportDate != null "> and road_transport_date = #{roadTransportDate}</if>
  129 + <if test="drivingLicenseDate != null "> and driving_license_date = #{drivingLicenseDate}</if>
  130 + <if test="enterDate != null "> and enter_date = #{enterDate}</if>
  131 + <if test="farmeNumber != null and farmeNumber != ''"> and farme_number = #{farmeNumber}</if>
  132 + <if test="carIdentification != null and carIdentification != ''"> and car_identification = #{carIdentification}</if>
  133 + <if test="containerVolume != null and containerVolume != ''"> and container_volume = #{containerVolume}</if>
  134 + <if test="carColor != null and carColor != ''"> and car_color = #{carColor}</if>
  135 + <if test="carEquipment != null and carEquipment != ''"> and car_equipment = #{carEquipment}</if>
  136 + <if test="roadTransport != null and roadTransport != ''"> and road_transport = #{roadTransport}</if>
  137 + <if test="drivingLicense != null and drivingLicense != ''"> and driving_license = #{drivingLicense}</if>
  138 + <if test="carFront != null and carFront != ''"> and car_front = #{carFront}</if>
  139 + <if test="carLeft != null and carLeft != ''"> and car_left = #{carLeft}</if>
  140 + <if test="carBehind != null and carBehind != ''"> and car_behind = #{carBehind}</if>
  141 + <if test="carRight != null and carRight != ''"> and car_right = #{carRight}</if>
  142 + <if test="drivers != null and drivers != ''"> and drivers = #{drivers}</if>
  143 + <if test="status != null "> and car.status = #{status}</if>
  144 + <if test="creditStatus != null and creditStatus != ''"> and car.credit_status = #{creditStatus}</if>
  145 + </where>
  146 + </select>
  147 +
  148 + <select id="selectCarInfoById" parameterType="Long" resultMap="CarInfoResult">
  149 + <include refid="selectCarInfoVo"/>
  150 + where id = #{id}
  151 + </select>
  152 +
  153 + <insert id="insertCarInfo" parameterType="CarInfo" useGeneratedKeys="true" keyProperty="id">
  154 + insert into car_info
  155 + <trim prefix="(" suffix=")" suffixOverrides=",">
  156 + <if test="companyId != null">company_id,</if>
  157 + <if test="carType != null">car_type,</if>
  158 + <if test="carCode != null">car_code,</if>
  159 + <if test="carBrank != null">car_brank,</if>
  160 + <if test="emissionStandard != null">emission_standard,</if>
  161 + <if test="roadTransportDate != null">road_transport_date,</if>
  162 + <if test="drivingLicenseDate != null">driving_license_date,</if>
  163 + <if test="enterDate != null">enter_date,</if>
  164 + <if test="farmeNumber != null">farme_number,</if>
  165 + <if test="carIdentification != null">car_identification,</if>
  166 + <if test="containerVolume != null">container_volume,</if>
  167 + <if test="carColor != null">car_color,</if>
  168 + <if test="carEquipment != null">car_equipment,</if>
  169 + <if test="remark != null">remark,</if>
  170 + <if test="roadTransport != null">road_transport,</if>
  171 + <if test="drivingLicense != null">driving_license,</if>
  172 + <if test="carFront != null">car_front,</if>
  173 + <if test="carLeft != null">car_left,</if>
  174 + <if test="carBehind != null">car_behind,</if>
  175 + <if test="carRight != null">car_right,</if>
  176 + <if test="drivers != null">drivers,</if>
  177 + <if test="status != null">status,</if>
  178 + <if test="createTime != null">create_time,</if>
  179 + <if test="createBy != null">create_by,</if>
  180 + <if test="updateTime != null">update_time,</if>
  181 + <if test="updateBy != null">update_by,</if>
  182 + <if test="creditStatus != null">credit_status,</if>
  183 + <if test="qrCode != null">qr_code,</if>
  184 + <if test="lengthWidthHeight != null">length_width_height,</if>
  185 + </trim>
  186 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  187 + <if test="companyId != null">#{companyId},</if>
  188 + <if test="carType != null">#{carType},</if>
  189 + <if test="carCode != null">#{carCode},</if>
  190 + <if test="carBrank != null">#{carBrank},</if>
  191 + <if test="emissionStandard != null">#{emissionStandard},</if>
  192 + <if test="roadTransportDate != null">#{roadTransportDate},</if>
  193 + <if test="drivingLicenseDate != null">#{drivingLicenseDate},</if>
  194 + <if test="enterDate != null">#{enterDate},</if>
  195 + <if test="farmeNumber != null">#{farmeNumber},</if>
  196 + <if test="carIdentification != null">#{carIdentification},</if>
  197 + <if test="containerVolume != null">#{containerVolume},</if>
  198 + <if test="carColor != null">#{carColor},</if>
  199 + <if test="carEquipment != null">#{carEquipment},</if>
  200 + <if test="remark != null">#{remark},</if>
  201 + <if test="roadTransport != null">#{roadTransport},</if>
  202 + <if test="drivingLicense != null">#{drivingLicense},</if>
  203 + <if test="carFront != null">#{carFront},</if>
  204 + <if test="carLeft != null">#{carLeft},</if>
  205 + <if test="carBehind != null">#{carBehind},</if>
  206 + <if test="carRight != null">#{carRight},</if>
  207 + <if test="drivers != null">#{drivers},</if>
  208 + <if test="status != null">#{status},</if>
  209 + <if test="createTime != null">#{createTime},</if>
  210 + <if test="createBy != null">#{createBy},</if>
  211 + <if test="updateTime != null">#{updateTime},</if>
  212 + <if test="updateBy != null">#{updateBy},</if>
  213 + <if test="creditStatus != null">#{creditStatus},</if>
  214 + <if test="qrCode != null">#{qrCode},</if>
  215 + <if test="lengthWidthHeight != null">#{lengthWidthHeight},</if>
  216 + </trim>
  217 + </insert>
  218 +
  219 + <update id="updateCarInfo" parameterType="CarInfo">
  220 + update car_info
  221 + <trim prefix="SET" suffixOverrides=",">
  222 + <if test="companyId != null">company_id = #{companyId},</if>
  223 + <if test="carType != null">car_type = #{carType},</if>
  224 + <if test="carCode != null">car_code = #{carCode},</if>
  225 + <if test="carBrank != null">car_brank = #{carBrank},</if>
  226 + <if test="emissionStandard != null">emission_standard = #{emissionStandard},</if>
  227 + <if test="roadTransportDate != null">road_transport_date = #{roadTransportDate},</if>
  228 + <if test="drivingLicenseDate != null">driving_license_date = #{drivingLicenseDate},</if>
  229 + <if test="enterDate != null">enter_date = #{enterDate},</if>
  230 + <if test="farmeNumber != null">farme_number = #{farmeNumber},</if>
  231 + <if test="carIdentification != null">car_identification = #{carIdentification},</if>
  232 + <if test="containerVolume != null">container_volume = #{containerVolume},</if>
  233 + <if test="carColor != null">car_color = #{carColor},</if>
  234 + <if test="carEquipment != null">car_equipment = #{carEquipment},</if>
  235 + <if test="remark != null">remark = #{remark},</if>
  236 + <if test="roadTransport != null">road_transport = #{roadTransport},</if>
  237 + <if test="drivingLicense != null">driving_license = #{drivingLicense},</if>
  238 + <if test="carFront != null">car_front = #{carFront},</if>
  239 + <if test="carLeft != null">car_left = #{carLeft},</if>
  240 + <if test="carBehind != null">car_behind = #{carBehind},</if>
  241 + <if test="carRight != null">car_right = #{carRight},</if>
  242 + <if test="drivers != null">drivers = #{drivers},</if>
  243 + <if test="status != null">status = #{status},</if>
  244 + <if test="createTime != null">create_time = #{createTime},</if>
  245 + <if test="createBy != null">create_by = #{createBy},</if>
  246 + <if test="updateTime != null">update_time = #{updateTime},</if>
  247 + <if test="updateBy != null">update_by = #{updateBy},</if>
  248 + <if test="creditStatus != null">credit_status = #{creditStatus},</if>
  249 + <if test="qrCode != null">qr_code = #{qrCode},</if>
  250 + <if test="lengthWidthHeight != null">length_width_height = #{lengthWidthHeight},</if>
  251 + </trim>
  252 + where id = #{id}
  253 + </update>
  254 +
  255 + <delete id="deleteCarInfoById" parameterType="Long">
  256 + delete from car_info where id = #{id}
  257 + </delete>
  258 +
  259 + <delete id="deleteCarInfoByIds" parameterType="String">
  260 + delete from car_info where id in
  261 + <foreach item="id" collection="array" open="(" separator="," close=")">
  262 + #{id}
  263 + </foreach>
  264 + </delete>
  265 +
  266 +
  267 + <insert id="addCarDriverRelation" parameterType="CarDriverRelation">
  268 + insert into car_driver_relation(car_id,driver_id)
  269 + values(#{carId},#{driverId})
  270 + </insert>
  271 +
  272 + <delete id="deleteCarDriverRelationByCarId" parameterType="Long">
  273 + delete from car_driver_relation where car_id = #{carId}
  274 + </delete>
  275 +</mapper>
0 \ No newline at end of file 276 \ No newline at end of file
trash-unit/src/main/resources/mapper/disposalSite/DisposalSiteMapper.xml renamed to trash-unit/src/main/resources/mapper/unit/DisposalSiteMapper.xml
@@ -20,17 +20,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -20,17 +20,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
20 <result property="validityBeginDate" column="validity_begin_date" /> 20 <result property="validityBeginDate" column="validity_begin_date" />
21 <result property="validityEndDate" column="validity_end_date" /> 21 <result property="validityEndDate" column="validity_end_date" />
22 <result property="squareMeasure" column="square_measure" /> 22 <result property="squareMeasure" column="square_measure" />
  23 + <result property="surplusSquareMeasure" column="surplus_square_measure" />
23 <result property="carWashingFacilities" column="car_washing_facilities" /> 24 <result property="carWashingFacilities" column="car_washing_facilities" />
24 <result property="exitRoadCondition" column="exit_road_condition" /> 25 <result property="exitRoadCondition" column="exit_road_condition" />
25 <result property="lightingFacility" column="lighting_facility" /> 26 <result property="lightingFacility" column="lighting_facility" />
26 <result property="videoSurveillanceFacility" column="video_surveillance_facility" /> 27 <result property="videoSurveillanceFacility" column="video_surveillance_facility" />
27 <result property="preparer" column="preparer" /> 28 <result property="preparer" column="preparer" />
28 <result property="handlingAdvice" column="handling_advice" /> 29 <result property="handlingAdvice" column="handling_advice" />
  30 + <result property="absorbSource" column="absorb_source" />
29 <result property="electronicFence" column="electronic_fence" /> 31 <result property="electronicFence" column="electronic_fence" />
  32 + <result property="creditStatus" column="credit_status" />
30 <result property="approvalDocument" column="approval_document" /> 33 <result property="approvalDocument" column="approval_document" />
31 <result property="approvalData" column="approval_data" /> 34 <result property="approvalData" column="approval_data" />
32 <result property="scenePhoto" column="scene_photo" /> 35 <result property="scenePhoto" column="scene_photo" />
33 <result property="carWashingFacilitiesImage" column="car_washing_facilities_image" /> 36 <result property="carWashingFacilitiesImage" column="car_washing_facilities_image" />
  37 + <result property="termRange" column="term_range" />
34 <result property="safetyAssessmentReport" column="safety_assessment_report" /> 38 <result property="safetyAssessmentReport" column="safety_assessment_report" />
35 <result property="environmentalApproval" column="environmental_approval" /> 39 <result property="environmentalApproval" column="environmental_approval" />
36 <result property="authorization" column="authorization" /> 40 <result property="authorization" column="authorization" />
@@ -41,10 +45,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -41,10 +45,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
41 <result property="createBy" column="create_by" /> 45 <result property="createBy" column="create_by" />
42 <result property="updateTime" column="update_time" /> 46 <result property="updateTime" column="update_time" />
43 <result property="updateBy" column="update_by" /> 47 <result property="updateBy" column="update_by" />
  48 + <result property="qrCode" column="qr_code" />
  49 + <result property="auditStatus" column="audit_status" />
44 </resultMap> 50 </resultMap>
45 51
46 <sql id="selectDisposalSiteVo"> 52 <sql id="selectDisposalSiteVo">
47 - select id, name, certificate_number, address, engineering_property, site_type, local_area, operating_area, trash_type, construction_unit, construction_unit_person, construction_unit_person_phone, validity_begin_date, validity_end_date, square_measure, car_washing_facilities, exit_road_condition, lighting_facility, video_surveillance_facility, preparer, handling_advice, electronic_fence, approval_document, approval_data, scene_photo, car_washing_facilities_image, safety_assessment_report, environmental_approval, authorization, other_information, company_ids, status, create_time, create_by, update_time, update_by from disposal_site 53 + select id, name, certificate_number, address, engineering_property, site_type, local_area, operating_area, trash_type, construction_unit, construction_unit_person, construction_unit_person_phone, validity_begin_date, validity_end_date, square_measure, surplus_square_measure, car_washing_facilities, exit_road_condition, lighting_facility, video_surveillance_facility, preparer, handling_advice, absorb_source, electronic_fence, credit_status, approval_document, approval_data, scene_photo, car_washing_facilities_image, term_range, safety_assessment_report, environmental_approval, `authorization`, other_information, company_ids, status, create_time, create_by, update_time, update_by, qr_code,audit_status from disposal_site
48 </sql> 54 </sql>
49 55
50 <select id="selectDisposalSiteList" parameterType="DisposalSite" resultMap="DisposalSiteResult"> 56 <select id="selectDisposalSiteList" parameterType="DisposalSite" resultMap="DisposalSiteResult">
@@ -64,23 +70,29 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -64,23 +70,29 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
64 <if test="validityBeginDate != null "> and validity_begin_date = #{validityBeginDate}</if> 70 <if test="validityBeginDate != null "> and validity_begin_date = #{validityBeginDate}</if>
65 <if test="validityEndDate != null "> and validity_end_date = #{validityEndDate}</if> 71 <if test="validityEndDate != null "> and validity_end_date = #{validityEndDate}</if>
66 <if test="squareMeasure != null and squareMeasure != ''"> and square_measure = #{squareMeasure}</if> 72 <if test="squareMeasure != null and squareMeasure != ''"> and square_measure = #{squareMeasure}</if>
  73 + <if test="surplusSquareMeasure != null and surplusSquareMeasure != ''"> and surplus_square_measure = #{surplusSquareMeasure}</if>
67 <if test="carWashingFacilities != null and carWashingFacilities != ''"> and car_washing_facilities = #{carWashingFacilities}</if> 74 <if test="carWashingFacilities != null and carWashingFacilities != ''"> and car_washing_facilities = #{carWashingFacilities}</if>
68 <if test="exitRoadCondition != null and exitRoadCondition != ''"> and exit_road_condition = #{exitRoadCondition}</if> 75 <if test="exitRoadCondition != null and exitRoadCondition != ''"> and exit_road_condition = #{exitRoadCondition}</if>
69 <if test="lightingFacility != null and lightingFacility != ''"> and lighting_facility = #{lightingFacility}</if> 76 <if test="lightingFacility != null and lightingFacility != ''"> and lighting_facility = #{lightingFacility}</if>
70 <if test="videoSurveillanceFacility != null and videoSurveillanceFacility != ''"> and video_surveillance_facility = #{videoSurveillanceFacility}</if> 77 <if test="videoSurveillanceFacility != null and videoSurveillanceFacility != ''"> and video_surveillance_facility = #{videoSurveillanceFacility}</if>
71 <if test="preparer != null and preparer != ''"> and preparer = #{preparer}</if> 78 <if test="preparer != null and preparer != ''"> and preparer = #{preparer}</if>
72 <if test="handlingAdvice != null and handlingAdvice != ''"> and handling_advice = #{handlingAdvice}</if> 79 <if test="handlingAdvice != null and handlingAdvice != ''"> and handling_advice = #{handlingAdvice}</if>
  80 + <if test="absorbSource != null and absorbSource != ''"> and absorb_source = #{absorbSource}</if>
73 <if test="electronicFence != null and electronicFence != ''"> and electronic_fence = #{electronicFence}</if> 81 <if test="electronicFence != null and electronicFence != ''"> and electronic_fence = #{electronicFence}</if>
  82 + <if test="creditStatus != null and creditStatus != ''"> and credit_status = #{creditStatus}</if>
74 <if test="approvalDocument != null and approvalDocument != ''"> and approval_document = #{approvalDocument}</if> 83 <if test="approvalDocument != null and approvalDocument != ''"> and approval_document = #{approvalDocument}</if>
75 <if test="approvalData != null and approvalData != ''"> and approval_data = #{approvalData}</if> 84 <if test="approvalData != null and approvalData != ''"> and approval_data = #{approvalData}</if>
76 <if test="scenePhoto != null and scenePhoto != ''"> and scene_photo = #{scenePhoto}</if> 85 <if test="scenePhoto != null and scenePhoto != ''"> and scene_photo = #{scenePhoto}</if>
77 <if test="carWashingFacilitiesImage != null and carWashingFacilitiesImage != ''"> and car_washing_facilities_image = #{carWashingFacilitiesImage}</if> 86 <if test="carWashingFacilitiesImage != null and carWashingFacilitiesImage != ''"> and car_washing_facilities_image = #{carWashingFacilitiesImage}</if>
  87 + <if test="termRange != null and termRange != ''"> and term_range = #{termRange}</if>
78 <if test="safetyAssessmentReport != null and safetyAssessmentReport != ''"> and safety_assessment_report = #{safetyAssessmentReport}</if> 88 <if test="safetyAssessmentReport != null and safetyAssessmentReport != ''"> and safety_assessment_report = #{safetyAssessmentReport}</if>
79 <if test="environmentalApproval != null and environmentalApproval != ''"> and environmental_approval = #{environmentalApproval}</if> 89 <if test="environmentalApproval != null and environmentalApproval != ''"> and environmental_approval = #{environmentalApproval}</if>
80 <if test="authorization != null and authorization != ''"> and authorization = #{authorization}</if> 90 <if test="authorization != null and authorization != ''"> and authorization = #{authorization}</if>
81 <if test="otherInformation != null and otherInformation != ''"> and other_information = #{otherInformation}</if> 91 <if test="otherInformation != null and otherInformation != ''"> and other_information = #{otherInformation}</if>
82 <if test="companyIds != null and companyIds != ''"> and company_ids = #{companyIds}</if> 92 <if test="companyIds != null and companyIds != ''"> and company_ids = #{companyIds}</if>
83 <if test="status != null "> and status = #{status}</if> 93 <if test="status != null "> and status = #{status}</if>
  94 + <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
  95 + <if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
84 </where> 96 </where>
85 </select> 97 </select>
86 98
@@ -106,17 +118,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -106,17 +118,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
106 <if test="validityBeginDate != null">validity_begin_date,</if> 118 <if test="validityBeginDate != null">validity_begin_date,</if>
107 <if test="validityEndDate != null">validity_end_date,</if> 119 <if test="validityEndDate != null">validity_end_date,</if>
108 <if test="squareMeasure != null">square_measure,</if> 120 <if test="squareMeasure != null">square_measure,</if>
  121 + <if test="surplusSquareMeasure != null">surplus_square_measure,</if>
109 <if test="carWashingFacilities != null">car_washing_facilities,</if> 122 <if test="carWashingFacilities != null">car_washing_facilities,</if>
110 <if test="exitRoadCondition != null">exit_road_condition,</if> 123 <if test="exitRoadCondition != null">exit_road_condition,</if>
111 <if test="lightingFacility != null">lighting_facility,</if> 124 <if test="lightingFacility != null">lighting_facility,</if>
112 <if test="videoSurveillanceFacility != null">video_surveillance_facility,</if> 125 <if test="videoSurveillanceFacility != null">video_surveillance_facility,</if>
113 <if test="preparer != null">preparer,</if> 126 <if test="preparer != null">preparer,</if>
114 <if test="handlingAdvice != null">handling_advice,</if> 127 <if test="handlingAdvice != null">handling_advice,</if>
  128 + <if test="absorbSource != null">absorb_source,</if>
115 <if test="electronicFence != null">electronic_fence,</if> 129 <if test="electronicFence != null">electronic_fence,</if>
  130 + <if test="creditStatus != null">credit_status,</if>
116 <if test="approvalDocument != null">approval_document,</if> 131 <if test="approvalDocument != null">approval_document,</if>
117 <if test="approvalData != null">approval_data,</if> 132 <if test="approvalData != null">approval_data,</if>
118 <if test="scenePhoto != null">scene_photo,</if> 133 <if test="scenePhoto != null">scene_photo,</if>
119 <if test="carWashingFacilitiesImage != null">car_washing_facilities_image,</if> 134 <if test="carWashingFacilitiesImage != null">car_washing_facilities_image,</if>
  135 + <if test="termRange != null">term_range,</if>
120 <if test="safetyAssessmentReport != null">safety_assessment_report,</if> 136 <if test="safetyAssessmentReport != null">safety_assessment_report,</if>
121 <if test="environmentalApproval != null">environmental_approval,</if> 137 <if test="environmentalApproval != null">environmental_approval,</if>
122 <if test="authorization != null">authorization,</if> 138 <if test="authorization != null">authorization,</if>
@@ -127,6 +143,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -127,6 +143,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
127 <if test="createBy != null">create_by,</if> 143 <if test="createBy != null">create_by,</if>
128 <if test="updateTime != null">update_time,</if> 144 <if test="updateTime != null">update_time,</if>
129 <if test="updateBy != null">update_by,</if> 145 <if test="updateBy != null">update_by,</if>
  146 + <if test="qrCode != null">qr_code,</if>
  147 + <if test="auditStatus != null">audit_status,</if>
130 </trim> 148 </trim>
131 <trim prefix="values (" suffix=")" suffixOverrides=","> 149 <trim prefix="values (" suffix=")" suffixOverrides=",">
132 <if test="name != null">#{name},</if> 150 <if test="name != null">#{name},</if>
@@ -143,17 +161,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -143,17 +161,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
143 <if test="validityBeginDate != null">#{validityBeginDate},</if> 161 <if test="validityBeginDate != null">#{validityBeginDate},</if>
144 <if test="validityEndDate != null">#{validityEndDate},</if> 162 <if test="validityEndDate != null">#{validityEndDate},</if>
145 <if test="squareMeasure != null">#{squareMeasure},</if> 163 <if test="squareMeasure != null">#{squareMeasure},</if>
  164 + <if test="surplusSquareMeasure != null">#{surplusSquareMeasure},</if>
146 <if test="carWashingFacilities != null">#{carWashingFacilities},</if> 165 <if test="carWashingFacilities != null">#{carWashingFacilities},</if>
147 <if test="exitRoadCondition != null">#{exitRoadCondition},</if> 166 <if test="exitRoadCondition != null">#{exitRoadCondition},</if>
148 <if test="lightingFacility != null">#{lightingFacility},</if> 167 <if test="lightingFacility != null">#{lightingFacility},</if>
149 <if test="videoSurveillanceFacility != null">#{videoSurveillanceFacility},</if> 168 <if test="videoSurveillanceFacility != null">#{videoSurveillanceFacility},</if>
150 <if test="preparer != null">#{preparer},</if> 169 <if test="preparer != null">#{preparer},</if>
151 <if test="handlingAdvice != null">#{handlingAdvice},</if> 170 <if test="handlingAdvice != null">#{handlingAdvice},</if>
  171 + <if test="absorbSource != null">#{absorbSource},</if>
152 <if test="electronicFence != null">#{electronicFence},</if> 172 <if test="electronicFence != null">#{electronicFence},</if>
  173 + <if test="creditStatus != null">#{creditStatus},</if>
153 <if test="approvalDocument != null">#{approvalDocument},</if> 174 <if test="approvalDocument != null">#{approvalDocument},</if>
154 <if test="approvalData != null">#{approvalData},</if> 175 <if test="approvalData != null">#{approvalData},</if>
155 <if test="scenePhoto != null">#{scenePhoto},</if> 176 <if test="scenePhoto != null">#{scenePhoto},</if>
156 <if test="carWashingFacilitiesImage != null">#{carWashingFacilitiesImage},</if> 177 <if test="carWashingFacilitiesImage != null">#{carWashingFacilitiesImage},</if>
  178 + <if test="termRange != null">#{termRange},</if>
157 <if test="safetyAssessmentReport != null">#{safetyAssessmentReport},</if> 179 <if test="safetyAssessmentReport != null">#{safetyAssessmentReport},</if>
158 <if test="environmentalApproval != null">#{environmentalApproval},</if> 180 <if test="environmentalApproval != null">#{environmentalApproval},</if>
159 <if test="authorization != null">#{authorization},</if> 181 <if test="authorization != null">#{authorization},</if>
@@ -164,6 +186,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -164,6 +186,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
164 <if test="createBy != null">#{createBy},</if> 186 <if test="createBy != null">#{createBy},</if>
165 <if test="updateTime != null">#{updateTime},</if> 187 <if test="updateTime != null">#{updateTime},</if>
166 <if test="updateBy != null">#{updateBy},</if> 188 <if test="updateBy != null">#{updateBy},</if>
  189 + <if test="qrCode != null">#{qrCode},</if>
  190 + <if test="auditStatus != null">#{auditStatus},</if>
167 </trim> 191 </trim>
168 </insert> 192 </insert>
169 193
@@ -184,17 +208,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -184,17 +208,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
184 <if test="validityBeginDate != null">validity_begin_date = #{validityBeginDate},</if> 208 <if test="validityBeginDate != null">validity_begin_date = #{validityBeginDate},</if>
185 <if test="validityEndDate != null">validity_end_date = #{validityEndDate},</if> 209 <if test="validityEndDate != null">validity_end_date = #{validityEndDate},</if>
186 <if test="squareMeasure != null">square_measure = #{squareMeasure},</if> 210 <if test="squareMeasure != null">square_measure = #{squareMeasure},</if>
  211 + <if test="surplusSquareMeasure != null">surplus_square_measure = #{surplusSquareMeasure},</if>
187 <if test="carWashingFacilities != null">car_washing_facilities = #{carWashingFacilities},</if> 212 <if test="carWashingFacilities != null">car_washing_facilities = #{carWashingFacilities},</if>
188 <if test="exitRoadCondition != null">exit_road_condition = #{exitRoadCondition},</if> 213 <if test="exitRoadCondition != null">exit_road_condition = #{exitRoadCondition},</if>
189 <if test="lightingFacility != null">lighting_facility = #{lightingFacility},</if> 214 <if test="lightingFacility != null">lighting_facility = #{lightingFacility},</if>
190 <if test="videoSurveillanceFacility != null">video_surveillance_facility = #{videoSurveillanceFacility},</if> 215 <if test="videoSurveillanceFacility != null">video_surveillance_facility = #{videoSurveillanceFacility},</if>
191 <if test="preparer != null">preparer = #{preparer},</if> 216 <if test="preparer != null">preparer = #{preparer},</if>
192 <if test="handlingAdvice != null">handling_advice = #{handlingAdvice},</if> 217 <if test="handlingAdvice != null">handling_advice = #{handlingAdvice},</if>
  218 + <if test="absorbSource != null">absorb_source = #{absorbSource},</if>
193 <if test="electronicFence != null">electronic_fence = #{electronicFence},</if> 219 <if test="electronicFence != null">electronic_fence = #{electronicFence},</if>
  220 + <if test="creditStatus != null">credit_status = #{creditStatus},</if>
194 <if test="approvalDocument != null">approval_document = #{approvalDocument},</if> 221 <if test="approvalDocument != null">approval_document = #{approvalDocument},</if>
195 <if test="approvalData != null">approval_data = #{approvalData},</if> 222 <if test="approvalData != null">approval_data = #{approvalData},</if>
196 <if test="scenePhoto != null">scene_photo = #{scenePhoto},</if> 223 <if test="scenePhoto != null">scene_photo = #{scenePhoto},</if>
197 <if test="carWashingFacilitiesImage != null">car_washing_facilities_image = #{carWashingFacilitiesImage},</if> 224 <if test="carWashingFacilitiesImage != null">car_washing_facilities_image = #{carWashingFacilitiesImage},</if>
  225 + <if test="termRange != null">term_range = #{termRange},</if>
198 <if test="safetyAssessmentReport != null">safety_assessment_report = #{safetyAssessmentReport},</if> 226 <if test="safetyAssessmentReport != null">safety_assessment_report = #{safetyAssessmentReport},</if>
199 <if test="environmentalApproval != null">environmental_approval = #{environmentalApproval},</if> 227 <if test="environmentalApproval != null">environmental_approval = #{environmentalApproval},</if>
200 <if test="authorization != null">authorization = #{authorization},</if> 228 <if test="authorization != null">authorization = #{authorization},</if>
@@ -205,6 +233,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -205,6 +233,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
205 <if test="createBy != null">create_by = #{createBy},</if> 233 <if test="createBy != null">create_by = #{createBy},</if>
206 <if test="updateTime != null">update_time = #{updateTime},</if> 234 <if test="updateTime != null">update_time = #{updateTime},</if>
207 <if test="updateBy != null">update_by = #{updateBy},</if> 235 <if test="updateBy != null">update_by = #{updateBy},</if>
  236 + <if test="qrCode != null">qr_code = #{qrCode},</if>
  237 + <if test="auditStatus != null">audit_status = #{auditStatus},</if>
208 </trim> 238 </trim>
209 where id = #{id} 239 where id = #{id}
210 </update> 240 </update>
trash-unit/src/main/resources/mapper/driver/DriverMapper.xml renamed to trash-unit/src/main/resources/mapper/unit/DriverMapper.xml
@@ -3,57 +3,76 @@ @@ -3,57 +3,76 @@
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.trash.driver.mapper.DriverMapper"> 5 <mapper namespace="com.trash.driver.mapper.DriverMapper">
6 - 6 +
7 <resultMap type="Driver" id="DriverResult"> 7 <resultMap type="Driver" id="DriverResult">
8 - <result property="id" column="id" />  
9 - <result property="name" column="name" />  
10 - <result property="identityCard" column="identity_card" />  
11 - <result property="companyId" column="company_id" />  
12 - <result property="professionalQualificationBeginDate" column="professional_qualification_begin_date" />  
13 - <result property="professionalQualificationEndDate" column="professional_qualification_end_date" />  
14 - <result property="drivingLicenceBeginDate" column="driving_licence_begin_date" />  
15 - <result property="drivingLicenceEndDate" column="driving_licence_end_date" />  
16 - <result property="safetyTrainingDate" column="safety_training_date" />  
17 - <result property="safetyTrainingContent" column="safety_training_content" />  
18 - <result property="remark" column="remark" />  
19 - <result property="drivingLicence" column="driving_licence" />  
20 - <result property="professionalQualification" column="professional_qualification" />  
21 - <result property="safetyTraining" column="safety_training" />  
22 - <result property="status" column="status" />  
23 - <result property="createTime" column="create_time" />  
24 - <result property="createBy" column="create_by" />  
25 - <result property="updateTime" column="update_time" />  
26 - <result property="updateBy" column="update_by" /> 8 + <result property="id" column="id"/>
  9 + <result property="name" column="name"/>
  10 + <result property="identityCard" column="identity_card"/>
  11 + <result property="companyId" column="company_id"/>
  12 + <result property="professionalQualificationBeginDate" column="professional_qualification_begin_date"/>
  13 + <result property="professionalQualificationEndDate" column="professional_qualification_end_date"/>
  14 + <result property="drivingLicenceBeginDate" column="driving_licence_begin_date"/>
  15 + <result property="drivingLicenceEndDate" column="driving_licence_end_date"/>
  16 + <result property="safetyTrainingDate" column="safety_training_date"/>
  17 + <result property="safetyTrainingContent" column="safety_training_content"/>
  18 + <result property="remark" column="remark"/>
  19 + <result property="drivingLicence" column="driving_licence"/>
  20 + <result property="professionalQualification" column="professional_qualification"/>
  21 + <result property="safetyTraining" column="safety_training"/>
  22 + <result property="status" column="status"/>
  23 + <result property="createTime" column="create_time"/>
  24 + <result property="createBy" column="create_by"/>
  25 + <result property="updateTime" column="update_time"/>
  26 + <result property="updateBy" column="update_by"/>
  27 + <result property="photographOne" column="photograph_one"/>
  28 + <result property="photographTwo" column="photograph_two"/>
  29 + <result property="phoneNo" column="phoneNo"/>
  30 + </resultMap>
  31 + <resultMap type="DriverVo" id="DriverVoResult" extends="DriverResult">
  32 + <result property="companyName" column="companyName"/>
27 </resultMap> 33 </resultMap>
28 34
29 <sql id="selectDriverVo"> 35 <sql id="selectDriverVo">
30 - select id, name, identity_card, company_id, professional_qualification_begin_date, professional_qualification_end_date, driving_licence_begin_date, driving_licence_end_date, safety_training_date, safety_training_content, remark, driving_licence, professional_qualification, safety_training, status, create_time, create_by, update_time, update_by from driver 36 + select id, name, identity_card, company_id, professional_qualification_begin_date, professional_qualification_end_date, driving_licence_begin_date, driving_licence_end_date, safety_training_date, safety_training_content, remark, driving_licence, professional_qualification, safety_training, status, create_time, create_by, update_time, update_by, photograph_one, photograph_two,phoneNo from driver
31 </sql> 37 </sql>
32 38
33 - <select id="selectDriverList" parameterType="Driver" resultMap="DriverResult">  
34 - <include refid="selectDriverVo"/>  
35 - <where>  
36 - <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>  
37 - <if test="identityCard != null and identityCard != ''"> and identity_card = #{identityCard}</if> 39 + <sql id="selectDriverCompanyVo">
  40 + select d.id, d.name,c.name companyName, identity_card, company_id, professional_qualification_begin_date, professional_qualification_end_date, driving_licence_begin_date, driving_licence_end_date, safety_training_date, safety_training_content, d.remark, driving_licence, professional_qualification, safety_training, d.status, d.create_time, d.create_by, d.update_time, d.update_by, photograph_one, photograph_two,phoneNo from driver d
  41 + left join transportation_enterprise c on d.company_id = c.id
  42 + </sql>
  43 +
  44 + <select id="selectDriverList" parameterType="DriverVo" resultMap="DriverVoResult">
  45 + <include refid="selectDriverCompanyVo"/>
  46 + <where>
  47 + <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  48 + <if test="companyName != null and companyName != ''"> and c.name like concat('%', #{companyName}, '%')</if>
  49 + <if test="identityCard != null and identityCard != ''"> and identity_card = #{identityCard}</if>
38 <if test="companyId != null "> and company_id = #{companyId}</if> 50 <if test="companyId != null "> and company_id = #{companyId}</if>
39 <if test="professionalQualificationBeginDate != null "> and professional_qualification_begin_date = #{professionalQualificationBeginDate}</if> 51 <if test="professionalQualificationBeginDate != null "> and professional_qualification_begin_date = #{professionalQualificationBeginDate}</if>
40 <if test="professionalQualificationEndDate != null "> and professional_qualification_end_date = #{professionalQualificationEndDate}</if> 52 <if test="professionalQualificationEndDate != null "> and professional_qualification_end_date = #{professionalQualificationEndDate}</if>
41 <if test="drivingLicenceBeginDate != null "> and driving_licence_begin_date = #{drivingLicenceBeginDate}</if> 53 <if test="drivingLicenceBeginDate != null "> and driving_licence_begin_date = #{drivingLicenceBeginDate}</if>
42 <if test="drivingLicenceEndDate != null "> and driving_licence_end_date = #{drivingLicenceEndDate}</if> 54 <if test="drivingLicenceEndDate != null "> and driving_licence_end_date = #{drivingLicenceEndDate}</if>
43 <if test="safetyTrainingDate != null "> and safety_training_date = #{safetyTrainingDate}</if> 55 <if test="safetyTrainingDate != null "> and safety_training_date = #{safetyTrainingDate}</if>
44 - <if test="safetyTrainingContent != null and safetyTrainingContent != ''"> and safety_training_content = #{safetyTrainingContent}</if>  
45 - <if test="drivingLicence != null and drivingLicence != ''"> and driving_licence = #{drivingLicence}</if>  
46 - <if test="professionalQualification != null and professionalQualification != ''"> and professional_qualification = #{professionalQualification}</if>  
47 - <if test="safetyTraining != null and safetyTraining != ''"> and safety_training = #{safetyTraining}</if> 56 + <if test="safetyTrainingContent != null and safetyTrainingContent != ''"> and safety_training_content = #{safetyTrainingContent}</if>
  57 + <if test="drivingLicence != null and drivingLicence != ''"> and driving_licence = #{drivingLicence}</if>
  58 + <if test="professionalQualification != null and professionalQualification != ''"> and professional_qualification = #{professionalQualification}</if>
  59 + <if test="safetyTraining != null and safetyTraining != ''"> and safety_training = #{safetyTraining}</if>
48 <if test="status != null "> and status = #{status}</if> 60 <if test="status != null "> and status = #{status}</if>
  61 + <if test="photographOne != null and photographOne != ''"> and photograph_one = #{photographOne}</if>
  62 + <if test="photographTwo != null and photographTwo != ''"> and photograph_two = #{photographTwo}</if>
  63 + <if test="phoneNo != null and phoneNo != ''"> and phoneNo = #{phoneNo}</if>
49 </where> 64 </where>
50 </select> 65 </select>
51 - 66 +
  67 + <select id="selectDriverListByCompanyId" parameterType="String" resultType="map">
  68 + select id,name as label from driver where company_id = #{companyId}
  69 + </select>
  70 +
52 <select id="selectDriverById" parameterType="Long" resultMap="DriverResult"> 71 <select id="selectDriverById" parameterType="Long" resultMap="DriverResult">
53 <include refid="selectDriverVo"/> 72 <include refid="selectDriverVo"/>
54 where id = #{id} 73 where id = #{id}
55 </select> 74 </select>
56 - 75 +
57 <insert id="insertDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> 76 <insert id="insertDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id">
58 insert into driver 77 insert into driver
59 <trim prefix="(" suffix=")" suffixOverrides=","> 78 <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -75,7 +94,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -75,7 +94,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
75 <if test="createBy != null">create_by,</if> 94 <if test="createBy != null">create_by,</if>
76 <if test="updateTime != null">update_time,</if> 95 <if test="updateTime != null">update_time,</if>
77 <if test="updateBy != null">update_by,</if> 96 <if test="updateBy != null">update_by,</if>
78 - </trim> 97 + <if test="photographOne != null">photograph_one,</if>
  98 + <if test="photographTwo != null">photograph_two,</if>
  99 + <if test="phoneNo != null">phoneNo,</if>
  100 + </trim>
79 <trim prefix="values (" suffix=")" suffixOverrides=","> 101 <trim prefix="values (" suffix=")" suffixOverrides=",">
80 <if test="name != null">#{name},</if> 102 <if test="name != null">#{name},</if>
81 <if test="identityCard != null">#{identityCard},</if> 103 <if test="identityCard != null">#{identityCard},</if>
@@ -95,7 +117,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -95,7 +117,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
95 <if test="createBy != null">#{createBy},</if> 117 <if test="createBy != null">#{createBy},</if>
96 <if test="updateTime != null">#{updateTime},</if> 118 <if test="updateTime != null">#{updateTime},</if>
97 <if test="updateBy != null">#{updateBy},</if> 119 <if test="updateBy != null">#{updateBy},</if>
98 - </trim> 120 + <if test="photographOne != null">#{photographOne},</if>
  121 + <if test="photographTwo != null">#{photographTwo},</if>
  122 + <if test="phoneNo != null">#{phoneNo},</if>
  123 + </trim>
99 </insert> 124 </insert>
100 125
101 <update id="updateDriver" parameterType="Driver"> 126 <update id="updateDriver" parameterType="Driver">
@@ -119,19 +144,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -119,19 +144,21 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
119 <if test="createBy != null">create_by = #{createBy},</if> 144 <if test="createBy != null">create_by = #{createBy},</if>
120 <if test="updateTime != null">update_time = #{updateTime},</if> 145 <if test="updateTime != null">update_time = #{updateTime},</if>
121 <if test="updateBy != null">update_by = #{updateBy},</if> 146 <if test="updateBy != null">update_by = #{updateBy},</if>
  147 + <if test="photographOne != null">photograph_one = #{photographOne},</if>
  148 + <if test="photographTwo != null">photograph_two = #{photographTwo},</if>
  149 + <if test="phoneNo != null">phoneNo = #{phoneNo},</if>
122 </trim> 150 </trim>
123 where id = #{id} 151 where id = #{id}
124 </update> 152 </update>
125 153
126 <delete id="deleteDriverById" parameterType="Long"> 154 <delete id="deleteDriverById" parameterType="Long">
127 - delete from driver where id = #{id} 155 + delete
  156 + from driver
  157 + where id = #{id}
128 </delete> 158 </delete>
129 159
130 <delete id="deleteDriverByIds" parameterType="String"> 160 <delete id="deleteDriverByIds" parameterType="String">
131 - delete from driver where id in  
132 - <foreach item="id" collection="array" open="(" separator="," close=")">  
133 - #{id}  
134 - </foreach> 161 + delete from driver where id in
  162 + <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach>
135 </delete> 163 </delete>
136 -  
137 </mapper> 164 </mapper>
138 \ No newline at end of file 165 \ No newline at end of file
trash-unit/src/main/resources/mapper/enterprise/TransportationEnterpriseMapper.xml renamed to trash-unit/src/main/resources/mapper/unit/TransportationEnterpriseMapper.xml
@@ -36,10 +36,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -36,10 +36,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
36 <result property="updateBy" column="update_by" /> 36 <result property="updateBy" column="update_by" />
37 <result property="parentId" column="parent_id" /> 37 <result property="parentId" column="parent_id" />
38 <result property="companyType" column="company_type" /> 38 <result property="companyType" column="company_type" />
  39 + <result property="creditStatus" column="credit_status" />
  40 + <result property="qrCode" column="qr_code" />
39 </resultMap> 41 </resultMap>
40 42
41 <sql id="selectTransportationEnterpriseVo"> 43 <sql id="selectTransportationEnterpriseVo">
42 - select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, 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 from transportation_enterprise 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
43 </sql> 45 </sql>
44 46
45 <select id="selectTransportationEnterpriseList" parameterType="TransportationEnterprise" resultMap="TransportationEnterpriseResult"> 47 <select id="selectTransportationEnterpriseList" parameterType="TransportationEnterprise" resultMap="TransportationEnterpriseResult">
@@ -70,6 +72,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -70,6 +72,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
70 <if test="status != null "> and status = #{status}</if> 72 <if test="status != null "> and status = #{status}</if>
71 <if test="parentId != null "> and parent_id = #{parentId}</if> 73 <if test="parentId != null "> and parent_id = #{parentId}</if>
72 <if test="companyType != null "> and company_type = #{companyType}</if> 74 <if test="companyType != null "> and company_type = #{companyType}</if>
  75 + <if test="creditStatus != null and creditStatus != ''"> and credit_status = #{creditStatus}</if>
  76 + <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
73 </where> 77 </where>
74 </select> 78 </select>
75 79
@@ -111,6 +115,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -111,6 +115,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
111 <if test="updateBy != null">update_by,</if> 115 <if test="updateBy != null">update_by,</if>
112 <if test="parentId != null">parent_id,</if> 116 <if test="parentId != null">parent_id,</if>
113 <if test="companyType != null">company_type,</if> 117 <if test="companyType != null">company_type,</if>
  118 + <if test="creditStatus != null">credit_status,</if>
  119 + <if test="qrCode != null">qr_code,</if>
114 </trim> 120 </trim>
115 <trim prefix="values (" suffix=")" suffixOverrides=","> 121 <trim prefix="values (" suffix=")" suffixOverrides=",">
116 <if test="name != null">#{name},</if> 122 <if test="name != null">#{name},</if>
@@ -143,6 +149,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -143,6 +149,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
143 <if test="updateBy != null">#{updateBy},</if> 149 <if test="updateBy != null">#{updateBy},</if>
144 <if test="parentId != null">#{parentId},</if> 150 <if test="parentId != null">#{parentId},</if>
145 <if test="companyType != null">#{companyType},</if> 151 <if test="companyType != null">#{companyType},</if>
  152 + <if test="creditStatus != null">#{creditStatus},</if>
  153 + <if test="qrCode != null">#{qrCode},</if>
146 </trim> 154 </trim>
147 </insert> 155 </insert>
148 156
@@ -179,6 +187,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -179,6 +187,8 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
179 <if test="updateBy != null">update_by = #{updateBy},</if> 187 <if test="updateBy != null">update_by = #{updateBy},</if>
180 <if test="parentId != null">parent_id = #{parentId},</if> 188 <if test="parentId != null">parent_id = #{parentId},</if>
181 <if test="companyType != null">company_type = #{companyType},</if> 189 <if test="companyType != null">company_type = #{companyType},</if>
  190 + <if test="creditStatus != null">credit_status = #{creditStatus},</if>
  191 + <if test="qrCode != null">qr_code = #{qrCode},</if>
182 </trim> 192 </trim>
183 where id = #{id} 193 where id = #{id}
184 </update> 194 </update>
trash-workFlow/src/main/java/com/trash/casefile/kafka/Consumer.java
@@ -40,7 +40,7 @@ public class Consumer { @@ -40,7 +40,7 @@ public class Consumer {
40 @Autowired 40 @Autowired
41 private IViolationWarningInformationService violationWarningInformationService; 41 private IViolationWarningInformationService violationWarningInformationService;
42 42
43 - @KafkaListener(topics = "record_process_alarm") 43 +// @KafkaListener(topics = "record_process_alarm")
44 public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException { 44 public void consume(ConsumerRecord<?, ?> record, Acknowledgment ack) throws InterruptedException, IOException {
45 log.info("kafka消费数据成功,offset:"+ record.offset() +",data:" + record.value()); 45 log.info("kafka消费数据成功,offset:"+ record.offset() +",data:" + record.value());
46 String id = insertKafkaCompensation(record.value().toString()); 46 String id = insertKafkaCompensation(record.value().toString());
trash-workFlow/src/main/java/com/trash/office/mapper/UploadFileMapper.java
@@ -58,4 +58,12 @@ public interface UploadFileMapper @@ -58,4 +58,12 @@ public interface UploadFileMapper
58 * @return 结果 58 * @return 结果
59 */ 59 */
60 int deleteUploadFileByIds(Long[] ids); 60 int deleteUploadFileByIds(Long[] ids);
  61 +
  62 + /**
  63 + * 根据表名删除文件上传
  64 + *
  65 + * @param tableName 表名
  66 + * @return 结果
  67 + */
  68 + int deleteUploadFileByTableName(String tableName);
61 } 69 }
trash-workFlow/src/main/java/com/trash/other/controller/DocumentDataController.java 0 → 100644
  1 +package com.trash.other.controller;
  2 +
  3 +import java.io.IOException;
  4 +import java.util.List;
  5 +import org.springframework.security.access.prepost.PreAuthorize;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.*;
  8 +import com.trash.common.annotation.Log;
  9 +import com.trash.common.core.controller.BaseController;
  10 +import com.trash.common.core.domain.AjaxResult;
  11 +import com.trash.common.enums.BusinessType;
  12 +import com.trash.other.domain.DocumentData;
  13 +import com.trash.other.service.IDocumentDataService;
  14 +import com.trash.common.utils.poi.ExcelUtil;
  15 +import com.trash.common.core.page.TableDataInfo;
  16 +import org.springframework.web.multipart.MultipartFile;
  17 +
  18 +/**
  19 + * 文件资料Controller
  20 + *
  21 + * @author trash
  22 + * @date 2023-11-28
  23 + */
  24 +@RestController
  25 +@RequestMapping("/other/documentData")
  26 +public class DocumentDataController extends BaseController
  27 +{
  28 + @Autowired
  29 + private IDocumentDataService documentDataService;
  30 +
  31 + /**
  32 + * 查询文件资料列表
  33 + */
  34 + @PreAuthorize("@ss.hasPermi('other:documentData:list')")
  35 + @GetMapping("/list")
  36 + public TableDataInfo list(DocumentData documentData)
  37 + {
  38 + startPage();
  39 + List<DocumentData> list = documentDataService.selectDocumentDataList(documentData);
  40 + return getDataTable(list);
  41 + }
  42 +
  43 + /**
  44 + * 导出文件资料列表
  45 + */
  46 + @PreAuthorize("@ss.hasPermi('other:documentData:export')")
  47 + @Log(title = "文件资料", businessType = BusinessType.EXPORT)
  48 + @GetMapping("/export")
  49 + public AjaxResult export(DocumentData documentData)
  50 + {
  51 + List<DocumentData> list = documentDataService.selectDocumentDataList(documentData);
  52 + ExcelUtil<DocumentData> util = new ExcelUtil<DocumentData>(DocumentData.class);
  53 + return util.exportExcel(list, "documentData");
  54 + }
  55 +
  56 + /**
  57 + * 获取文件资料详细信息
  58 + */
  59 + @PreAuthorize("@ss.hasPermi('other:documentData:query')")
  60 + @GetMapping(value = "/{id}")
  61 + public AjaxResult getInfo(@PathVariable("id") Long id)
  62 + {
  63 + return AjaxResult.success(documentDataService.selectDocumentDataById(id));
  64 + }
  65 +
  66 + /**
  67 + * 新增文件资料
  68 + */
  69 + @PreAuthorize("@ss.hasPermi('other:documentData:add')")
  70 + @Log(title = "文件资料", businessType = BusinessType.INSERT)
  71 + @PostMapping
  72 + public AjaxResult add(@RequestParam(value = "fileList") MultipartFile[] files, DocumentData documentData) throws IOException {
  73 + return toAjax(documentDataService.insertDocumentData(files, documentData));
  74 + }
  75 +
  76 + /**
  77 + * 修改文件资料
  78 + */
  79 + @PreAuthorize("@ss.hasPermi('other:documentData:edit')")
  80 + @Log(title = "文件资料", businessType = BusinessType.UPDATE)
  81 + @PutMapping
  82 + public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files,DocumentData documentData) throws IOException {
  83 + return toAjax(documentDataService.updateDocumentData(files, documentData));
  84 + }
  85 +
  86 + /**
  87 + * 删除文件资料
  88 + */
  89 + @PreAuthorize("@ss.hasPermi('other:documentData:remove')")
  90 + @Log(title = "文件资料", businessType = BusinessType.DELETE)
  91 + @DeleteMapping("/{ids}")
  92 + public AjaxResult remove(@PathVariable Long[] ids)
  93 + {
  94 + return toAjax(documentDataService.deleteDocumentDataByIds(ids));
  95 + }
  96 +}
trash-workFlow/src/main/java/com/trash/other/controller/IncorruptController.java 0 → 100644
  1 +package com.trash.other.controller;
  2 +
  3 +import com.trash.common.annotation.Log;
  4 +import com.trash.common.core.controller.BaseController;
  5 +import com.trash.common.core.domain.AjaxResult;
  6 +import com.trash.common.enums.BusinessType;
  7 +import com.trash.office.domain.UploadFile;
  8 +import com.trash.other.service.IIncorruptService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.security.access.prepost.PreAuthorize;
  11 +import org.springframework.web.bind.annotation.*;
  12 +import org.springframework.web.multipart.MultipartFile;
  13 +
  14 +import java.io.IOException;
  15 +import java.util.List;
  16 +
  17 +/**
  18 + * 文件资料Controller
  19 + *
  20 + * @author trash
  21 + * @date 2023-11-28
  22 + */
  23 +@RestController
  24 +@RequestMapping("/other/incorrupt")
  25 +public class IncorruptController extends BaseController
  26 +{
  27 + @Autowired
  28 + private IIncorruptService incorruptService;
  29 +
  30 + /**
  31 + * 查询文件资料列表
  32 + */
  33 + @PreAuthorize("@ss.hasPermi('other:incorrupt:list')")
  34 + @GetMapping("/list/{tableName}")
  35 + public List<UploadFile> list(@PathVariable("tableName") String tableName)
  36 + {
  37 + return incorruptService.selectOtherDataList(tableName);
  38 + }
  39 +
  40 + /**
  41 + * 新增文件资料
  42 + */
  43 + @PreAuthorize("@ss.hasPermi('other:incorrupt:add')")
  44 + @Log(title = "廉政&廉洁教育", businessType = BusinessType.INSERT)
  45 + @PostMapping
  46 + public AjaxResult add(@RequestParam("files")MultipartFile[] files,String tableName) throws IOException {
  47 + return toAjax(incorruptService.insertIncorrupt(files,tableName));
  48 + }
  49 +
  50 +// /**
  51 +// * 修改文件资料
  52 +// */
  53 +// @PreAuthorize("@ss.hasPermi('other:documentData:edit')")
  54 +// @Log(title = "文件资料", businessType = BusinessType.UPDATE)
  55 +// @PutMapping
  56 +// public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files,DocumentData documentData) throws IOException {
  57 +// return toAjax(documentDataService.updateDocumentData(files, documentData));
  58 +// }
  59 +
  60 +}
trash-workFlow/src/main/java/com/trash/other/domain/DocumentData.java 0 → 100644
  1 +package com.trash.other.domain;
  2 +
  3 +import org.apache.commons.lang3.builder.ToStringBuilder;
  4 +import org.apache.commons.lang3.builder.ToStringStyle;
  5 +import com.trash.common.annotation.Excel;
  6 +import com.trash.common.core.domain.BaseEntity;
  7 +
  8 +/**
  9 + * 文件资料对象 document_data
  10 + *
  11 + * @author trash
  12 + * @date 2023-11-28
  13 + */
  14 +public class DocumentData extends BaseEntity
  15 +{
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /** $column.columnComment */
  19 + private Long id;
  20 +
  21 + /** 标题 */
  22 + @Excel(name = "标题")
  23 + private String title;
  24 +
  25 + /** 内容 */
  26 + @Excel(name = "内容")
  27 + private String content;
  28 +
  29 + /** 附件 */
  30 + @Excel(name = "附件")
  31 + private String files;
  32 +
  33 + public void setId(Long id)
  34 + {
  35 + this.id = id;
  36 + }
  37 +
  38 + public Long getId()
  39 + {
  40 + return id;
  41 + }
  42 + public void setTitle(String title)
  43 + {
  44 + this.title = title;
  45 + }
  46 +
  47 + public String getTitle()
  48 + {
  49 + return title;
  50 + }
  51 + public void setContent(String content)
  52 + {
  53 + this.content = content;
  54 + }
  55 +
  56 + public String getContent()
  57 + {
  58 + return content;
  59 + }
  60 + public void setFiles(String files)
  61 + {
  62 + this.files = files;
  63 + }
  64 +
  65 + public String getFiles()
  66 + {
  67 + return files;
  68 + }
  69 +
  70 + @Override
  71 + public String toString() {
  72 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  73 + .append("id", getId())
  74 + .append("title", getTitle())
  75 + .append("content", getContent())
  76 + .append("files", getFiles())
  77 + .append("createTime", getCreateTime())
  78 + .append("createBy", getCreateBy())
  79 + .append("updateTime", getUpdateTime())
  80 + .append("updateBy", getUpdateBy())
  81 + .toString();
  82 + }
  83 +}
trash-workFlow/src/main/java/com/trash/other/mapper/DocumentDataMapper.java 0 → 100644
  1 +package com.trash.other.mapper;
  2 +
  3 +import java.util.List;
  4 +import com.trash.other.domain.DocumentData;
  5 +
  6 +/**
  7 + * 文件资料Mapper接口
  8 + *
  9 + * @author trash
  10 + * @date 2023-11-28
  11 + */
  12 +public interface DocumentDataMapper
  13 +{
  14 + /**
  15 + * 查询文件资料
  16 + *
  17 + * @param id 文件资料ID
  18 + * @return 文件资料
  19 + */
  20 + DocumentData selectDocumentDataById(Long id);
  21 +
  22 + /**
  23 + * 查询文件资料列表
  24 + *
  25 + * @param documentData 文件资料
  26 + * @return 文件资料集合
  27 + */
  28 + List<DocumentData> selectDocumentDataList(DocumentData documentData);
  29 +
  30 + /**
  31 + * 新增文件资料
  32 + *
  33 + * @param documentData 文件资料
  34 + * @return 结果
  35 + */
  36 + int insertDocumentData(DocumentData documentData);
  37 +
  38 + /**
  39 + * 修改文件资料
  40 + *
  41 + * @param documentData 文件资料
  42 + * @return 结果
  43 + */
  44 + int updateDocumentData(DocumentData documentData);
  45 +
  46 + /**
  47 + * 删除文件资料
  48 + *
  49 + * @param id 文件资料ID
  50 + * @return 结果
  51 + */
  52 + int deleteDocumentDataById(Long id);
  53 +
  54 + /**
  55 + * 批量删除文件资料
  56 + *
  57 + * @param ids 需要删除的数据ID
  58 + * @return 结果
  59 + */
  60 + int deleteDocumentDataByIds(Long[] ids);
  61 +}
trash-workFlow/src/main/java/com/trash/other/service/IDocumentDataService.java 0 → 100644
  1 +package com.trash.other.service;
  2 +
  3 +import java.io.IOException;
  4 +import java.util.List;
  5 +import com.trash.other.domain.DocumentData;
  6 +import org.springframework.web.multipart.MultipartFile;
  7 +
  8 +/**
  9 + * 文件资料Service接口
  10 + *
  11 + * @author trash
  12 + * @date 2023-11-28
  13 + */
  14 +public interface IDocumentDataService
  15 +{
  16 + /**
  17 + * 查询文件资料
  18 + *
  19 + * @param id 文件资料ID
  20 + * @return 文件资料
  21 + */
  22 + DocumentData selectDocumentDataById(Long id);
  23 +
  24 + /**
  25 + * 查询文件资料列表
  26 + *
  27 + * @param documentData 文件资料
  28 + * @return 文件资料集合
  29 + */
  30 + List<DocumentData> selectDocumentDataList(DocumentData documentData);
  31 +
  32 + /**
  33 + * 新增文件资料
  34 + *
  35 + * @param files
  36 + * @param documentData 文件资料
  37 + * @return 结果
  38 + */
  39 + int insertDocumentData(MultipartFile[] files, DocumentData documentData) throws IOException;
  40 +
  41 + /**
  42 + * 修改文件资料
  43 + *
  44 + * @param files
  45 + * @param documentData 文件资料
  46 + * @return 结果
  47 + */
  48 + int updateDocumentData(MultipartFile[] files,DocumentData documentData) throws IOException;
  49 +
  50 + /**
  51 + * 批量删除文件资料
  52 + *
  53 + * @param ids 需要删除的文件资料ID
  54 + * @return 结果
  55 + */
  56 + int deleteDocumentDataByIds(Long[] ids);
  57 +
  58 + /**
  59 + * 删除文件资料信息
  60 + *
  61 + * @param id 文件资料ID
  62 + * @return 结果
  63 + */
  64 + int deleteDocumentDataById(Long id);
  65 +}
trash-workFlow/src/main/java/com/trash/other/service/IIncorruptService.java 0 → 100644
  1 +package com.trash.other.service;
  2 +
  3 +import com.trash.office.domain.UploadFile;
  4 +import org.springframework.web.multipart.MultipartFile;
  5 +
  6 +import java.io.IOException;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 其他专项资料Service接口
  11 + *
  12 + * @author trash
  13 + * @date 2023-05-11
  14 + */
  15 +public interface IIncorruptService
  16 +{
  17 +
  18 +
  19 + List<UploadFile> selectOtherDataList(String tableName);
  20 +
  21 +
  22 + int insertIncorrupt(MultipartFile[] files, String tableName) throws IOException;
  23 +
  24 +
  25 +}
trash-workFlow/src/main/java/com/trash/other/service/impl/DocumentDataServiceImpl.java 0 → 100644
  1 +package com.trash.other.service.impl;
  2 +
  3 +import java.io.IOException;
  4 +import java.util.List;
  5 +
  6 +import com.trash.common.config.trashConfig;
  7 +import com.trash.common.utils.DateUtils;
  8 +import com.trash.common.utils.SecurityUtils;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import com.trash.other.mapper.DocumentDataMapper;
  12 +import com.trash.other.domain.DocumentData;
  13 +import com.trash.other.service.IDocumentDataService;
  14 +import org.springframework.web.multipart.MultipartFile;
  15 +
  16 +import static com.trash.common.utils.file.FileUploadUtils.upload;
  17 +
  18 +/**
  19 + * 文件资料Service业务层处理
  20 + *
  21 + * @author trash
  22 + * @date 2023-11-28
  23 + */
  24 +@Service
  25 +public class DocumentDataServiceImpl implements IDocumentDataService
  26 +{
  27 + @Autowired
  28 + private DocumentDataMapper documentDataMapper;
  29 +
  30 + /**
  31 + * 查询文件资料
  32 + *
  33 + * @param id 文件资料ID
  34 + * @return 文件资料
  35 + */
  36 + @Override
  37 + public DocumentData selectDocumentDataById(Long id)
  38 + {
  39 + return documentDataMapper.selectDocumentDataById(id);
  40 + }
  41 +
  42 + /**
  43 + * 查询文件资料列表
  44 + *
  45 + * @param documentData 文件资料
  46 + * @return 文件资料
  47 + */
  48 + @Override
  49 + public List<DocumentData> selectDocumentDataList(DocumentData documentData)
  50 + {
  51 + return documentDataMapper.selectDocumentDataList(documentData);
  52 + }
  53 +
  54 + /**
  55 + * 新增文件资料
  56 + *
  57 + * @param files
  58 + * @param documentData 文件资料
  59 + * @return 结果
  60 + */
  61 + @Override
  62 + public int insertDocumentData(MultipartFile[] files, DocumentData documentData) throws IOException {
  63 + for (MultipartFile file:files){
  64 + documentData.setFiles(documentData.getFiles()!=null?documentData.getFiles()+";"+uploadFile(file):uploadFile(file));
  65 + }
  66 + documentData.setFiles(removeSemicolon(documentData.getFiles()));
  67 + return documentDataMapper.insertDocumentData(documentData);
  68 + }
  69 +
  70 + /**
  71 + * 修改文件资料
  72 + *
  73 + * @param files
  74 + * @param documentData 文件资料
  75 + * @return 结果
  76 + */
  77 + @Override
  78 + public int updateDocumentData(MultipartFile[] files, DocumentData documentData) throws IOException {
  79 + documentData.setUpdateTime(DateUtils.getNowDate());
  80 + documentData.setUpdateBy(SecurityUtils.getUsername());
  81 + for (MultipartFile file:files){
  82 + documentData.setFiles(documentData.getFiles()!=null?documentData.getFiles()+";"+uploadFile(file):uploadFile(file));
  83 + }
  84 + documentData.setFiles(removeSemicolon(documentData.getFiles()));
  85 + return documentDataMapper.updateDocumentData(documentData);
  86 + }
  87 +
  88 + /**
  89 + * 批量删除文件资料
  90 + *
  91 + * @param ids 需要删除的文件资料ID
  92 + * @return 结果
  93 + */
  94 + @Override
  95 + public int deleteDocumentDataByIds(Long[] ids)
  96 + {
  97 + return documentDataMapper.deleteDocumentDataByIds(ids);
  98 + }
  99 +
  100 + /**
  101 + * 删除文件资料信息
  102 + *
  103 + * @param id 文件资料ID
  104 + * @return 结果
  105 + */
  106 + @Override
  107 + public int deleteDocumentDataById(Long id)
  108 + {
  109 + return documentDataMapper.deleteDocumentDataById(id);
  110 + }
  111 +
  112 + /**
  113 + * 文件上传
  114 + *
  115 + * @param file
  116 + * @author 2c
  117 + */
  118 + public static String uploadFile(MultipartFile file) throws IOException {
  119 + // 上传文件路径
  120 + String filePath = trashConfig.getUploadPath();
  121 + // 上传并返回新文件名称
  122 + String newFileName = upload(filePath, file);
  123 + return newFileName;
  124 + }
  125 +
  126 + //去掉第一个分号,如果有的话
  127 + public String removeSemicolon(String str){
  128 + if (str.startsWith(";"))
  129 + str = str.substring(1);
  130 + return str;
  131 + }
  132 +}
trash-workFlow/src/main/java/com/trash/other/service/impl/IncorruptServiceImpl.java 0 → 100644
  1 +package com.trash.other.service.impl;
  2 +
  3 +import com.trash.common.utils.file.FileUploadUtils;
  4 +import com.trash.office.domain.UploadFile;
  5 +import com.trash.office.mapper.UploadFileMapper;
  6 +import com.trash.other.service.IIncorruptService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +import org.springframework.web.multipart.MultipartFile;
  10 +
  11 +import java.io.IOException;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 其他专项资料Service业务层处理
  16 + *
  17 + * @author trash
  18 + * @date 2023-05-11
  19 + */
  20 +@Service
  21 +public class IncorruptServiceImpl implements IIncorruptService {
  22 + @Autowired
  23 + private UploadFileMapper uploadFileMapper;
  24 +
  25 +
  26 + @Override
  27 + public List<UploadFile> selectOtherDataList(String tableName) {
  28 + UploadFile uploadFile = new UploadFile();
  29 + uploadFile.setTableName(tableName);
  30 + return uploadFileMapper.selectUploadFileList(uploadFile);
  31 + }
  32 +
  33 + @Override
  34 + public int insertIncorrupt(MultipartFile[] files, String tableName) throws IOException {
  35 + UploadFile uploadFile = new UploadFile();
  36 + for (MultipartFile file : files) {
  37 + uploadFile.setTableName(tableName);
  38 + uploadFile.setTableNumber("1");
  39 + uploadFile.setFileName(file.getOriginalFilename());
  40 + uploadFile.setFilePath(FileUploadUtils.uploadFile(file));
  41 + }
  42 + uploadFileMapper.deleteUploadFileByTableName(tableName);
  43 + return uploadFileMapper.insertUploadFile(uploadFile);
  44 + }
  45 +
  46 +}
trash-workFlow/src/main/resources/mapper/office/UploadFileMapper.xml
@@ -71,5 +71,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -71,5 +71,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
71 #{id} 71 #{id}
72 </foreach> 72 </foreach>
73 </delete> 73 </delete>
74 - 74 +
  75 +
  76 + <delete id="deleteUploadFileByTableName" parameterType="String">
  77 + delete from upload_file
  78 + <if test="tableName != null">
  79 + where table_name = #{tableName}
  80 + </if>
  81 + </delete>
75 </mapper> 82 </mapper>
76 \ No newline at end of file 83 \ No newline at end of file
trash-workFlow/src/main/resources/mapper/other/DocumentDataMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.other.mapper.DocumentDataMapper">
  6 +
  7 + <resultMap type="DocumentData" id="DocumentDataResult">
  8 + <result property="id" column="id" />
  9 + <result property="title" column="title" />
  10 + <result property="content" column="content" />
  11 + <result property="files" column="files" />
  12 + <result property="createTime" column="create_time" />
  13 + <result property="createBy" column="create_by" />
  14 + <result property="updateTime" column="update_time" />
  15 + <result property="updateBy" column="update_by" />
  16 + </resultMap>
  17 +
  18 + <sql id="selectDocumentDataVo">
  19 + select id, title, content, files, create_time, create_by, update_time, update_by from document_data
  20 + </sql>
  21 +
  22 + <select id="selectDocumentDataList" parameterType="DocumentData" resultMap="DocumentDataResult">
  23 + <include refid="selectDocumentDataVo"/>
  24 + <where>
  25 + <if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
  26 + <if test="content != null and content != ''"> and content = #{content}</if>
  27 + <if test="files != null and files != ''"> and files = #{files}</if>
  28 + </where>
  29 + </select>
  30 +
  31 + <select id="selectDocumentDataById" parameterType="Long" resultMap="DocumentDataResult">
  32 + <include refid="selectDocumentDataVo"/>
  33 + where id = #{id}
  34 + </select>
  35 +
  36 + <insert id="insertDocumentData" parameterType="DocumentData" useGeneratedKeys="true" keyProperty="id">
  37 + insert into document_data
  38 + <trim prefix="(" suffix=")" suffixOverrides=",">
  39 + <if test="title != null">title,</if>
  40 + <if test="content != null">content,</if>
  41 + <if test="files != null">files,</if>
  42 + <if test="createTime != null">create_time,</if>
  43 + <if test="createBy != null">create_by,</if>
  44 + <if test="updateTime != null">update_time,</if>
  45 + <if test="updateBy != null">update_by,</if>
  46 + </trim>
  47 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  48 + <if test="title != null">#{title},</if>
  49 + <if test="content != null">#{content},</if>
  50 + <if test="files != null">#{files},</if>
  51 + <if test="createTime != null">#{createTime},</if>
  52 + <if test="createBy != null">#{createBy},</if>
  53 + <if test="updateTime != null">#{updateTime},</if>
  54 + <if test="updateBy != null">#{updateBy},</if>
  55 + </trim>
  56 + </insert>
  57 +
  58 + <update id="updateDocumentData" parameterType="DocumentData">
  59 + update document_data
  60 + <trim prefix="SET" suffixOverrides=",">
  61 + <if test="title != null">title = #{title},</if>
  62 + <if test="content != null">content = #{content},</if>
  63 + <if test="files != null">files = #{files},</if>
  64 + <if test="createTime != null">create_time = #{createTime},</if>
  65 + <if test="createBy != null">create_by = #{createBy},</if>
  66 + <if test="updateTime != null">update_time = #{updateTime},</if>
  67 + <if test="updateBy != null">update_by = #{updateBy},</if>
  68 + </trim>
  69 + where id = #{id}
  70 + </update>
  71 +
  72 + <delete id="deleteDocumentDataById" parameterType="Long">
  73 + delete from document_data where id = #{id}
  74 + </delete>
  75 +
  76 + <delete id="deleteDocumentDataByIds" parameterType="String">
  77 + delete from document_data where id in
  78 + <foreach item="id" collection="array" open="(" separator="," close=")">
  79 + #{id}
  80 + </foreach>
  81 + </delete>
  82 +
  83 +</mapper>
0 \ No newline at end of file 84 \ No newline at end of file