4d529b37 by 夏齐

接收接口完善和新增校验功能

1 parent 1dbb1b9a
...@@ -95,6 +95,15 @@ public class DgBdcdyDO implements Serializable { ...@@ -95,6 +95,15 @@ public class DgBdcdyDO implements Serializable {
95 */ 95 */
96 @TableField("ZXSJ") 96 @TableField("ZXSJ")
97 private Date zxsj; 97 private Date zxsj;
98 98 /**
99 * 不动产单元类型
100 */
101 @TableField("BDCDYLX")
102 private String bdcdylx;
103 /**
104 * 是否挂接
105 */
106 @TableField("SFGJ")
107 private String sfgj;
99 108
100 } 109 }
......
...@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
7 import lombok.Data; 7 import lombok.Data;
8 import lombok.EqualsAndHashCode; 8 import lombok.EqualsAndHashCode;
9 9
10 import javax.validation.constraints.NotEmpty;
11
10 /** 12 /**
11 * <p> 13 * <p>
12 * 档案不动产信息新增请求实体 14 * 档案不动产信息新增请求实体
...@@ -32,36 +34,42 @@ public class AddDgBdcdyRequest implements Serializable { ...@@ -32,36 +34,42 @@ public class AddDgBdcdyRequest implements Serializable {
32 /** 34 /**
33 * 权利标识码 35 * 权利标识码
34 */ 36 */
37 @NotEmpty(message = "权利标识码【bsmQl】不能为空")
35 @ApiModelProperty(name = "bsmQl", value = "权利标识码") 38 @ApiModelProperty(name = "bsmQl", value = "权利标识码")
36 private String bsmQl; 39 private String bsmQl;
37 40
38 /** 41 /**
39 * 不动产单元ID 42 * 不动产单元ID
40 */ 43 */
44 @NotEmpty(message = "不动产单元ID【bdcdyid】不能为空")
41 @ApiModelProperty(name = "bdcdyid", value = "不动产单元ID") 45 @ApiModelProperty(name = "bdcdyid", value = "不动产单元ID")
42 private String bdcdyid; 46 private String bdcdyid;
43 47
44 /** 48 /**
45 * 不动产单元号 49 * 不动产单元号
46 */ 50 */
51 @NotEmpty(message = "不动产单元号【bdcdyh】不能为空")
47 @ApiModelProperty(name = "bdcdyh", value = "不动产单元号") 52 @ApiModelProperty(name = "bdcdyh", value = "不动产单元号")
48 private String bdcdyh; 53 private String bdcdyh;
49 54
50 /** 55 /**
51 * 坐落 56 * 坐落
52 */ 57 */
58 @NotEmpty(message = "坐落【zl】不能为空")
53 @ApiModelProperty(name = "zl", value = "坐落") 59 @ApiModelProperty(name = "zl", value = "坐落")
54 private String zl; 60 private String zl;
55 61
56 /** 62 /**
57 * 权利人 63 * 权利人
58 */ 64 */
65 @NotEmpty(message = "权利人【qlr】不能为空")
59 @ApiModelProperty(name = "qlr", value = "权利人") 66 @ApiModelProperty(name = "qlr", value = "权利人")
60 private String qlr; 67 private String qlr;
61 68
62 /** 69 /**
63 * 权利人证件号 70 * 权利人证件号
64 */ 71 */
72 @NotEmpty(message = "权利人证件号【zjhm】不能为空")
65 @ApiModelProperty(name = "zjhm", value = "权利人证件号") 73 @ApiModelProperty(name = "zjhm", value = "权利人证件号")
66 private String zjhm; 74 private String zjhm;
67 75
...@@ -74,12 +82,14 @@ public class AddDgBdcdyRequest implements Serializable { ...@@ -74,12 +82,14 @@ public class AddDgBdcdyRequest implements Serializable {
74 /** 82 /**
75 * 不动产权证号 83 * 不动产权证号
76 */ 84 */
85 @NotEmpty(message = "不动产权证号【bdcqzh】不能为空")
77 @ApiModelProperty(name = "bdcqzh", value = "不动产权证号") 86 @ApiModelProperty(name = "bdcqzh", value = "不动产权证号")
78 private String bdcqzh; 87 private String bdcqzh;
79 88
80 /** 89 /**
81 * 登记时间 90 * 登记时间
82 */ 91 */
92 @NotEmpty(message = "登记时间【djsj】不能为空")
83 @ApiModelProperty(name = "djsj", value = "登记时间") 93 @ApiModelProperty(name = "djsj", value = "登记时间")
84 private Date djsj; 94 private Date djsj;
85 95
...@@ -88,6 +98,16 @@ public class AddDgBdcdyRequest implements Serializable { ...@@ -88,6 +98,16 @@ public class AddDgBdcdyRequest implements Serializable {
88 */ 98 */
89 @ApiModelProperty(name = "zxsj", value = "注销时间") 99 @ApiModelProperty(name = "zxsj", value = "注销时间")
90 private Date zxsj; 100 private Date zxsj;
91 101 /**
102 * 不动产单元类型
103 */
104 @NotEmpty(message = "不动产单元类型【bdcdylx】不能为空")
105 @ApiModelProperty(name = "bdcdylx", value = "不动产单元类型")
106 private String bdcdylx;
107 /**
108 * 是否挂接
109 */
110 @ApiModelProperty(name = "sfgj", value = "是否挂接")
111 private String sfgj;
92 112
93 } 113 }
......
...@@ -90,7 +90,11 @@ public class DgBusinessDO implements Serializable { ...@@ -90,7 +90,11 @@ public class DgBusinessDO implements Serializable {
90 */ 90 */
91 @TableField("SJSJ") 91 @TableField("SJSJ")
92 private Date sjsj; 92 private Date sjsj;
93 93 /**
94 * 收件人员
95 */
96 @TableField("SJRY")
97 private String sjry;
94 /** 98 /**
95 * 原业务标识码 99 * 原业务标识码
96 */ 100 */
......
...@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty;
9 import lombok.Data; 9 import lombok.Data;
10 import lombok.EqualsAndHashCode; 10 import lombok.EqualsAndHashCode;
11 11
12 import javax.validation.constraints.NotEmpty;
13
12 /** 14 /**
13 * <p> 15 * <p>
14 * 档案业务信息新增请求实体 16 * 档案业务信息新增请求实体
...@@ -34,30 +36,35 @@ public class AddDgBusinessRequest implements Serializable { ...@@ -34,30 +36,35 @@ public class AddDgBusinessRequest implements Serializable {
34 /** 36 /**
35 * 业务号 37 * 业务号
36 */ 38 */
39 @NotEmpty(message = "业务号【ywh】不能为空")
37 @ApiModelProperty(name = "ywh", value = "业务号") 40 @ApiModelProperty(name = "ywh", value = "业务号")
38 private String ywh; 41 private String ywh;
39 42
40 /** 43 /**
41 * 登记类型 44 * 登记类型
42 */ 45 */
46 @NotEmpty(message = "登记类型【djlx】不能为空")
43 @ApiModelProperty(name = "djlx", value = "登记类型") 47 @ApiModelProperty(name = "djlx", value = "登记类型")
44 private String djlx; 48 private String djlx;
45 49
46 /** 50 /**
47 * 权利类型 51 * 权利类型
48 */ 52 */
53 @NotEmpty(message = "权利类型【qllx】不能为空")
49 @ApiModelProperty(name = "qllx", value = "权利类型") 54 @ApiModelProperty(name = "qllx", value = "权利类型")
50 private String qllx; 55 private String qllx;
51 56
52 /** 57 /**
53 * 登记机构编码 58 * 登记机构编码
54 */ 59 */
60 @NotEmpty(message = "登记机构编码【djjgbm】不能为空")
55 @ApiModelProperty(name = "djjgbm", value = "登记机构编码") 61 @ApiModelProperty(name = "djjgbm", value = "登记机构编码")
56 private String djjgbm; 62 private String djjgbm;
57 63
58 /** 64 /**
59 * 登记机构名称 65 * 登记机构名称
60 */ 66 */
67 @NotEmpty(message = "登记机构名称【djjgmc】不能为空")
61 @ApiModelProperty(name = "djjgmc", value = "登记机构名称") 68 @ApiModelProperty(name = "djjgmc", value = "登记机构名称")
62 private String djjgmc; 69 private String djjgmc;
63 /** 70 /**
...@@ -70,23 +77,24 @@ public class AddDgBusinessRequest implements Serializable { ...@@ -70,23 +77,24 @@ public class AddDgBusinessRequest implements Serializable {
70 */ 77 */
71 @ApiModelProperty(name = "zxlx", value = "注销类型") 78 @ApiModelProperty(name = "zxlx", value = "注销类型")
72 private String zxlx; 79 private String zxlx;
73
74
75 /**
76 * 登记业务名称
77 */
78 @ApiModelProperty(name = "djywmc", value = "登记业务名称")
79 private String djywmc;
80
81 /** 80 /**
82 * 收件时间 81 * 收件时间
83 */ 82 */
83 @NotEmpty(message = "收件时间【sjsj】不能为空")
84 @ApiModelProperty(name = "sjsj", value = "收件时间") 84 @ApiModelProperty(name = "sjsj", value = "收件时间")
85 private Date sjsj; 85 private Date sjsj;
86 86
87 /** 87 /**
88 * 收件人员
89 */
90 @NotEmpty(message = "收件人员【sjry】不能为空")
91 @ApiModelProperty(name = "sjry", value = "收件人员")
92 private String sjry;
93
94 /**
88 * 原业务标识码 95 * 原业务标识码
89 */ 96 */
97 @NotEmpty(message = "原业务标识码【bsmYw】不能为空")
90 @ApiModelProperty(name = "bsmYw", value = "原业务标识码") 98 @ApiModelProperty(name = "bsmYw", value = "原业务标识码")
91 private String bsmYw; 99 private String bsmYw;
92 } 100 }
......
...@@ -23,4 +23,6 @@ public interface DgArchivesCatalogConverter{ ...@@ -23,4 +23,6 @@ public interface DgArchivesCatalogConverter{
23 DgArchivesCatalogListVO do2ListVO(DgArchivesCatalogDO dgarchivescatalogDO); 23 DgArchivesCatalogListVO do2ListVO(DgArchivesCatalogDO dgarchivescatalogDO);
24 24
25 List<DgArchivesCatalogListVO> doList2ListVOList(List<DgArchivesCatalogDO> dgarchivescatalogDOList); 25 List<DgArchivesCatalogListVO> doList2ListVOList(List<DgArchivesCatalogDO> dgarchivescatalogDOList);
26
27 List<DgArchivesCatalogDO> addcataListDO(List<AddDgArchivesCatalogRequest> request);
26 } 28 }
......
...@@ -23,7 +23,11 @@ public class AddDgArchivesCatalogRequest implements Serializable { ...@@ -23,7 +23,11 @@ public class AddDgArchivesCatalogRequest implements Serializable {
23 23
24 private static final long serialVersionUID = 1L; 24 private static final long serialVersionUID = 1L;
25 25
26 26 /**
27 * 目录标识码
28 */
29 @ApiModelProperty(name = "bsm_catalog", value = "目录标识码")
30 private String bsm_catalog;
27 /** 31 /**
28 * 档案标识码 32 * 档案标识码
29 */ 33 */
......
...@@ -65,6 +65,11 @@ public class DgFileDO implements Serializable { ...@@ -65,6 +65,11 @@ public class DgFileDO implements Serializable {
65 */ 65 */
66 @TableField("FJSIZE") 66 @TableField("FJSIZE")
67 private String fjsize; 67 private String fjsize;
68 /**
69 * 附件来源(1:业务附件,2:补录附件)
70 */
71 @TableField("FJLY")
72 private String fjly;
68 73
69 74
70 } 75 }
......
...@@ -58,6 +58,10 @@ public class AddDgFileRequest implements Serializable { ...@@ -58,6 +58,10 @@ public class AddDgFileRequest implements Serializable {
58 */ 58 */
59 @ApiModelProperty(name = "fjsize", value = "附件大小") 59 @ApiModelProperty(name = "fjsize", value = "附件大小")
60 private String fjsize; 60 private String fjsize;
61 61 /**
62 * 附件来源(1:业务附件,2:补录附件)
63 */
64 @ApiModelProperty(name = "fjly", value = "附件来源(1:业务附件,2:补录附件)")
65 private String fjly;
62 66
63 } 67 }
......
...@@ -8,8 +8,10 @@ import io.swagger.annotations.Api; ...@@ -8,8 +8,10 @@ import io.swagger.annotations.Api;
8 import io.swagger.annotations.ApiOperation; 8 import io.swagger.annotations.ApiOperation;
9 import io.swagger.annotations.ApiParam; 9 import io.swagger.annotations.ApiParam;
10 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.validation.BindingResult;
11 import org.springframework.web.bind.annotation.*; 12 import org.springframework.web.bind.annotation.*;
12 13
14 import javax.validation.Valid;
13 import java.util.List; 15 import java.util.List;
14 16
15 /** 17 /**
...@@ -29,8 +31,16 @@ public class DgReceiveController { ...@@ -29,8 +31,16 @@ public class DgReceiveController {
29 31
30 @PostMapping("insertDgReceive") 32 @PostMapping("insertDgReceive")
31 @ApiOperation("新增接收记录接口") 33 @ApiOperation("新增接收记录接口")
32 public Result insertDgReceive(@RequestBody AddDgReceiveRequest request){ 34 public Result insertDgReceive(@Valid @RequestBody AddDgReceiveRequest request, BindingResult bindingResult) {
33 return dgreceiveService.insertDgReceive(request); 35 if (bindingResult.hasErrors()){
36 return Result.checkError(bindingResult.getAllErrors().get(0).getDefaultMessage());
37 }
38 try {
39 dgreceiveService.insertDgReceive(request);
40 }catch (Exception ex){
41 return Result.error(ex.getMessage());
42 }
43 return Result.ok();
34 } 44 }
35 @PostMapping("search") 45 @PostMapping("search")
36 @ApiOperation(value = "根据条件进行列表查询") 46 @ApiOperation(value = "根据条件进行列表查询")
......
...@@ -13,6 +13,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -13,6 +13,8 @@ import io.swagger.annotations.ApiModelProperty;
13 import lombok.Data; 13 import lombok.Data;
14 import lombok.EqualsAndHashCode; 14 import lombok.EqualsAndHashCode;
15 15
16 import javax.validation.constraints.NotEmpty;
17
16 /** 18 /**
17 * <p> 19 * <p>
18 * 档案接收记录新增请求实体 20 * 档案接收记录新增请求实体
...@@ -35,56 +37,67 @@ public class AddDgReceiveRequest implements Serializable { ...@@ -35,56 +37,67 @@ public class AddDgReceiveRequest implements Serializable {
35 /** 37 /**
36 * 业务来源编码 38 * 业务来源编码
37 */ 39 */
40 @NotEmpty(message = "业务来源编码【ywlyjbm】不能为空")
38 @ApiModelProperty(name = "ywlyjbm", value = "业务来源编码") 41 @ApiModelProperty(name = "ywlyjbm", value = "业务来源编码")
39 private String ywlyjbm; 42 private String ywlyjbm;
40 /** 43 /**
41 * 权利类型 44 * 权利类型
42 */ 45 */
46 @NotEmpty(message = "权利类型【qllx】不能为空")
43 @ApiModelProperty(name = "qllx", value = "权利类型") 47 @ApiModelProperty(name = "qllx", value = "权利类型")
44 private String qllx; 48 private String qllx;
45 /** 49 /**
46 * 登记类型 50 * 登记类型
47 */ 51 */
52 @NotEmpty(message = "登记类型【djlx】不能为空")
48 @ApiModelProperty(name = "djlx", value = "登记类型") 53 @ApiModelProperty(name = "djlx", value = "登记类型")
49 private String djlx; 54 private String djlx;
50 /** 55 /**
51 * 收件人员 56 * 收件人员
52 */ 57 */
58 @NotEmpty(message = "收件人员【sjry】不能为空")
53 @ApiModelProperty(name = "sjry", value = "收件人员") 59 @ApiModelProperty(name = "sjry", value = "收件人员")
54 private String sjry; 60 private String sjry;
55 /** 61 /**
56 * 收件时间 62 * 收件时间
57 */ 63 */
64 @NotEmpty(message = "收件时间【sjsj】不能为空")
58 @ApiModelProperty(name = "sjsj", value = "收件时间") 65 @ApiModelProperty(name = "sjsj", value = "收件时间")
59 private Date sjsj; 66 private Date sjsj;
60 /** 67 /**
61 * 业务号 68 * 业务号
62 */ 69 */
70 @NotEmpty(message = "业务号【ywh】不能为空")
63 @ApiModelProperty(name = "ywh", value = "业务号") 71 @ApiModelProperty(name = "ywh", value = "业务号")
64 private String ywh; 72 private String ywh;
65 /** 73 /**
66 * 不动产单元号 74 * 不动产单元号
67 */ 75 */
76 @NotEmpty(message = "不动产单元号【bdcdyh】不能为空")
68 @ApiModelProperty(name = "bdcdyh", value = "不动产单元号") 77 @ApiModelProperty(name = "bdcdyh", value = "不动产单元号")
69 private String bdcdyh; 78 private String bdcdyh;
70 /** 79 /**
71 * 单元总数 80 * 单元总数
72 */ 81 */
82 @NotEmpty(message = "单元总数【dyzs】不能为空")
73 @ApiModelProperty(name = "dyzs", value = "单元总数") 83 @ApiModelProperty(name = "dyzs", value = "单元总数")
74 private BigDecimal dyzs; 84 private BigDecimal dyzs;
75 /** 85 /**
76 * 不动产权证号 86 * 不动产权证号
77 */ 87 */
88 @NotEmpty(message = "不动产权证号【bdcqzh】不能为空")
78 @ApiModelProperty(name = "bdcqzh", value = "不动产权证号") 89 @ApiModelProperty(name = "bdcqzh", value = "不动产权证号")
79 private String bdcqzh; 90 private String bdcqzh;
80 /** 91 /**
81 * 权利人 92 * 权利人
82 */ 93 */
94 @NotEmpty(message = "权利人【qlr】不能为空")
83 @ApiModelProperty(name = "qlr", value = "权利人") 95 @ApiModelProperty(name = "qlr", value = "权利人")
84 private String qlr; 96 private String qlr;
85 /** 97 /**
86 * 权利人证件号码 98 * 权利人证件号码
87 */ 99 */
100 @NotEmpty(message = "权利人证件号码【zjhm】不能为空")
88 @ApiModelProperty(name = "zjhm", value = "权利人证件号码") 101 @ApiModelProperty(name = "zjhm", value = "权利人证件号码")
89 private String zjhm; 102 private String zjhm;
90 /** 103 /**
...@@ -95,24 +108,47 @@ public class AddDgReceiveRequest implements Serializable { ...@@ -95,24 +108,47 @@ public class AddDgReceiveRequest implements Serializable {
95 /** 108 /**
96 * 坐落 109 * 坐落
97 */ 110 */
111 @NotEmpty(message = "坐落【zl】不能为空")
98 @ApiModelProperty(name = "zl", value = "坐落") 112 @ApiModelProperty(name = "zl", value = "坐落")
99 private String zl; 113 private String zl;
100 /** 114 /**
101 * 登记时间 115 * 登记时间
102 */ 116 */
117 @NotEmpty(message = "登记时间【djsj】不能为空")
103 @ApiModelProperty(name = "djsj", value = "登记时间") 118 @ApiModelProperty(name = "djsj", value = "登记时间")
104 private Date djsj; 119 private Date djsj;
105 /** 120 /**
106 * 接收时间 121 * 接收时间
107 */ 122 */
123 @NotEmpty(message = "接收时间【jssj】不能为空")
108 @ApiModelProperty(name = "jssj", value = "接收时间") 124 @ApiModelProperty(name = "jssj", value = "接收时间")
109 private Date jssj; 125 private Date jssj;
110 /** 126 /**
111 * 推送机构编码 127 * 推送机构编码
112 */ 128 */
129 @NotEmpty(message = "推送机构编码【tsjgbm】不能为空")
113 @ApiModelProperty(name = "tsjgbm", value = "推送机构编码") 130 @ApiModelProperty(name = "tsjgbm", value = "推送机构编码")
114 private String tsjgbm; 131 private String tsjgbm;
115 /** 132 /**
133 * 登记业务编码
134 */
135 @NotEmpty(message = "登记业务编码【djywbm】不能为空")
136 @ApiModelProperty(name = "djywbm", value = "登记业务编码")
137 private String djywbm;
138 /**
139 * 登记业务名称
140 */
141 @NotEmpty(message = "登记业务名称【djywmc】不能为空")
142 @ApiModelProperty(name = "djywmc", value = "登记业务名称")
143 private String djywmc;
144 /**
145 * 业务标识码
146 */
147 @NotEmpty(message = "业务标识码【bsm_yw】不能为空")
148 @ApiModelProperty(name = "bsm_yw", value = "业务标识码")
149 private String bsm_yw;
150
151 /**
116 * 推送业务信息 152 * 推送业务信息
117 */ 153 */
118 @ApiModelProperty(name = "businessRequest", value = "推送业务信息") 154 @ApiModelProperty(name = "businessRequest", value = "推送业务信息")
......
...@@ -39,7 +39,7 @@ public interface DgReceiveService extends IService<DgReceiveDO> { ...@@ -39,7 +39,7 @@ public interface DgReceiveService extends IService<DgReceiveDO> {
39 * @param request 39 * @param request
40 * @return 40 * @return
41 */ 41 */
42 Result insertDgReceive(AddDgReceiveRequest request); 42 Result insertDgReceive(AddDgReceiveRequest request) throws Exception;
43 43
44 44
45 45
......
1 package com.pashanhoo.receive.service.impl; 1 package com.pashanhoo.receive.service.impl;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 import com.baomidou.mybatisplus.core.toolkit.IdWorker; 4 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
5 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 import com.pashanhoo.archive.entity.DgArchivesConverter; 7 import com.pashanhoo.archive.entity.DgArchivesConverter;
6 import com.pashanhoo.archive.entity.DgArchivesDO; 8 import com.pashanhoo.archive.entity.DgArchivesDO;
...@@ -17,10 +19,22 @@ import com.pashanhoo.business.entity.vo.AddDgBusinessRequest; ...@@ -17,10 +19,22 @@ import com.pashanhoo.business.entity.vo.AddDgBusinessRequest;
17 import com.pashanhoo.business.entity.vo.DgBusinessSearchRequest; 19 import com.pashanhoo.business.entity.vo.DgBusinessSearchRequest;
18 import com.pashanhoo.business.mapper.DgBusinessMapper; 20 import com.pashanhoo.business.mapper.DgBusinessMapper;
19 import com.pashanhoo.business.service.DgBusinessService; 21 import com.pashanhoo.business.service.DgBusinessService;
22 import com.pashanhoo.catalog.entity.DgArchivesCatalogConverter;
23 import com.pashanhoo.catalog.entity.DgArchivesCatalogDO;
24 import com.pashanhoo.catalog.entity.vo.AddDgArchivesCatalogRequest;
25 import com.pashanhoo.catalog.service.DgArchivesCatalogService;
20 import com.pashanhoo.common.Result; 26 import com.pashanhoo.common.Result;
27 import com.pashanhoo.common.util.fileupload.MinioUtil;
28 import com.pashanhoo.file.entity.DgFileConverter;
29 import com.pashanhoo.file.entity.DgFileDO;
30 import com.pashanhoo.file.entity.vo.FileAttribute;
31 import com.pashanhoo.file.service.DgFileService;
21 import com.pashanhoo.receive.entity.DgReceiveConverter; 32 import com.pashanhoo.receive.entity.DgReceiveConverter;
22 import com.pashanhoo.receive.entity.DgReceiveDO; 33 import com.pashanhoo.receive.entity.DgReceiveDO;
23 import com.pashanhoo.receive.entity.vo.*; 34 import com.pashanhoo.receive.entity.vo.AddDgReceiveRequest;
35 import com.pashanhoo.receive.entity.vo.DgReceiveListVO;
36 import com.pashanhoo.receive.entity.vo.DgReceiveSearchRequest;
37 import com.pashanhoo.receive.entity.vo.DjywbmVO;
24 import com.pashanhoo.receive.mapper.DgReceiveMapper; 38 import com.pashanhoo.receive.mapper.DgReceiveMapper;
25 import com.pashanhoo.receive.service.DgReceiveService; 39 import com.pashanhoo.receive.service.DgReceiveService;
26 import com.pashanhoo.receiverelation.entity.DgReceiveRelationConverter; 40 import com.pashanhoo.receiverelation.entity.DgReceiveRelationConverter;
...@@ -29,12 +43,12 @@ import com.pashanhoo.receiverelation.entity.vo.AddDgReceiveRelationRequest; ...@@ -29,12 +43,12 @@ import com.pashanhoo.receiverelation.entity.vo.AddDgReceiveRelationRequest;
29 import com.pashanhoo.receiverelation.service.DgReceiveRelationService; 43 import com.pashanhoo.receiverelation.service.DgReceiveRelationService;
30 import org.springframework.beans.factory.annotation.Autowired; 44 import org.springframework.beans.factory.annotation.Autowired;
31 import org.springframework.stereotype.Service; 45 import org.springframework.stereotype.Service;
32
33 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
34 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
35 import org.springframework.transaction.annotation.Transactional; 46 import org.springframework.transaction.annotation.Transactional;
47 import org.springframework.util.Assert;
36 48
37 import java.math.BigDecimal; 49 import java.io.File;
50 import java.io.FileInputStream;
51 import java.io.InputStream;
38 import java.util.ArrayList; 52 import java.util.ArrayList;
39 import java.util.Date; 53 import java.util.Date;
40 import java.util.List; 54 import java.util.List;
...@@ -72,6 +86,16 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive ...@@ -72,6 +86,16 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive
72 private DgReceiveRelationService relationService; 86 private DgReceiveRelationService relationService;
73 @Autowired 87 @Autowired
74 private DgReceiveRelationConverter relationConverter; 88 private DgReceiveRelationConverter relationConverter;
89 @Autowired
90 private DgArchivesCatalogConverter catalogConverter;
91 @Autowired
92 private DgArchivesCatalogService catalogService;
93 @Autowired
94 private DgFileConverter fileConverter;
95 @Autowired
96 private DgFileService fileService;
97 @Autowired
98 private MinioUtil minioUtil;
75 99
76 /** 100 /**
77 * 新增记录 101 * 新增记录
...@@ -79,22 +103,31 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive ...@@ -79,22 +103,31 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive
79 * @return 103 * @return
80 */ 104 */
81 @Override 105 @Override
82 public Result insertDgReceive(AddDgReceiveRequest request) { 106 @Transactional(rollbackFor = Exception.class)
107 public Result insertDgReceive(AddDgReceiveRequest request) throws Exception{
108 long starttime=System.currentTimeMillis();
109 //TODO字段值校验
110
111 //新增接收表信息=============start===========
83 //获取接收编码 112 //获取接收编码
84 String receiveBsm= IdWorker.get32UUID(); 113 String receiveBsm= IdWorker.get32UUID();
85 request.setBms_receive(receiveBsm); 114 request.setBms_receive(receiveBsm);
86 //新增接收表信息=============start=========== 115 DjywbmVO djywbmVO=dgreceiveMapper.getDjywbmInfo(request.getDjywbm());
87 DgReceiveDO dgreceiveDO = dgreceiveConverter.addRequest2DO(request); 116 DgReceiveDO dgreceiveDO = dgreceiveConverter.addRequest2DO(request);
88 //TODO获取归档方式 117 if(djywbmVO!=null){
89 if(dgreceiveDO.getGdfs()==null || "".equals(dgreceiveDO.getGdfs())){ 118 dgreceiveDO.setDjywbm(djywbmVO.getDjywbm());
90 dgreceiveDO.setGdfs("1"); 119 dgreceiveDO.setDjywmc(djywbmVO.getDjywmc());
120 dgreceiveDO.setGdfs(djywbmVO.getGdfs());
91 } 121 }
92 this.save(dgreceiveDO); 122 this.save(dgreceiveDO);
93 //新增接收表信息=============end=========== 123 //新增接收表信息=============end===========
124
94 //获取登记传入的不动产单元List集合数据 125 //获取登记传入的不动产单元List集合数据
95 List<AddDgBdcdyRequest> bdcdyRequestList=request.getBdcdyRequestList(); 126 List<AddDgBdcdyRequest> bdcdyRequestList=request.getBdcdyRequestList();
96 //获取登记传入的业务数据 127 //获取登记传入的业务数据
97 AddDgBusinessRequest businessRequest=request.getBusinessRequest(); 128 AddDgBusinessRequest businessRequest=request.getBusinessRequest();
129 //获取目录信息
130 List<AddDgArchivesCatalogRequest> catalogRequestList=request.getCatalogRequests();
98 //归档方式(1:按业务归档,2:按单元归档,3:档案补充归档) 131 //归档方式(1:按业务归档,2:按单元归档,3:档案补充归档)
99 if("1".equals(dgreceiveDO.getGdfs())){ 132 if("1".equals(dgreceiveDO.getGdfs())){
100 //新增档案表基础信息 133 //新增档案表基础信息
...@@ -108,23 +141,27 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive ...@@ -108,23 +141,27 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive
108 relationRequest.setBmsReceive(receiveBsm); 141 relationRequest.setBmsReceive(receiveBsm);
109 relationRequest.setBsmArchives(bsm_archives); 142 relationRequest.setBsmArchives(bsm_archives);
110 relationService.insertDgReceiveRelation(relationRequest); 143 relationService.insertDgReceiveRelation(relationRequest);
144 //新增目录和文件信息
145 dealCatalogAndFile(catalogRequestList,bsm_archives);
111 }else if("2".equals(dgreceiveDO.getGdfs())){ 146 }else if("2".equals(dgreceiveDO.getGdfs())){
112 List<AddDgReceiveRelationRequest> relationRequestList=new ArrayList<AddDgReceiveRelationRequest>(); 147 List<AddDgReceiveRelationRequest> relationRequestList=new ArrayList<AddDgReceiveRelationRequest>();
113 List<AddDgArchivesRequest> archivesRequest=new ArrayList<AddDgArchivesRequest>(bdcdyRequestList.size()); 148 List<AddDgArchivesRequest> archivesRequest=new ArrayList<AddDgArchivesRequest>(bdcdyRequestList.size());
114 AddDgArchivesRequest request1=null; 149 AddDgArchivesRequest archivesRequest1=null;
115 AddDgReceiveRelationRequest receiveRelationRequest=null; 150 AddDgReceiveRelationRequest receiveRelationRequest=null;
116 for (int i = 0; i < bdcdyRequestList.size(); i++) { 151 for (int i = 0; i < bdcdyRequestList.size(); i++) {
117 //组装档案表基础信息 152 //组装档案表基础信息
118 String bsm_archives= IdWorker.get32UUID(); 153 String bsm_archives= IdWorker.get32UUID();
119 request1=new AddDgArchivesRequest(); 154 archivesRequest1=new AddDgArchivesRequest();
120 request1.setBsmArchives(bsm_archives); 155 archivesRequest1.setBsmArchives(bsm_archives);
121 request1.setDazt(1); 156 archivesRequest1.setDazt(1);
122 archivesRequest.add(request1); 157 archivesRequest.add(archivesRequest1);
123 //组装接收表和档案表关联关系表 158 //组装接收表和档案表关联关系表
124 receiveRelationRequest=new AddDgReceiveRelationRequest(); 159 receiveRelationRequest=new AddDgReceiveRelationRequest();
125 receiveRelationRequest.setBmsReceive(receiveBsm); 160 receiveRelationRequest.setBmsReceive(receiveBsm);
126 receiveRelationRequest.setBsmArchives(bsm_archives); 161 receiveRelationRequest.setBsmArchives(bsm_archives);
127 relationRequestList.add(receiveRelationRequest); 162 relationRequestList.add(receiveRelationRequest);
163 //新增目录和文件信息
164 dealCatalogAndFile(catalogRequestList,bsm_archives);
128 } 165 }
129 //批量新增接收表和档案表关联关系表 166 //批量新增接收表和档案表关联关系表
130 List<DgReceiveRelationDO> receiveRelationDOList=relationConverter.addReceiveRelationList(relationRequestList); 167 List<DgReceiveRelationDO> receiveRelationDOList=relationConverter.addReceiveRelationList(relationRequestList);
...@@ -134,10 +171,10 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive ...@@ -134,10 +171,10 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive
134 archivesService.saveBatch(archivesDOList); 171 archivesService.saveBatch(archivesDOList);
135 }else if("3".equals(dgreceiveDO.getGdfs())){ 172 }else if("3".equals(dgreceiveDO.getGdfs())){
136 //通过业务号和注销业务号查询业务表是否有数据,有数据则修改 173 //通过业务号和注销业务号查询业务表是否有数据,有数据则修改
137 DgBusinessSearchRequest request2=new DgBusinessSearchRequest(); 174 DgBusinessSearchRequest searchRequest=new DgBusinessSearchRequest();
138 request2.setYwh(businessRequest.getYwh()); 175 searchRequest.setYwh(businessRequest.getYwh());
139 request2.setZxywh(businessRequest.getZxywh()); 176 searchRequest.setZxywh(businessRequest.getZxywh());
140 DgBusinessDO businessDO=businessService.searchDgBusiness(request2); 177 DgBusinessDO businessDO=businessService.searchDgBusiness(searchRequest);
141 if(businessDO!=null){ 178 if(businessDO!=null){
142 businessDO.setZxlx(businessRequest.getZxlx()); 179 businessDO.setZxlx(businessRequest.getZxlx());
143 //更新业务表中的注销类型 180 //更新业务表中的注销类型
...@@ -158,11 +195,57 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive ...@@ -158,11 +195,57 @@ public class DgReceiveServiceImpl extends ServiceImpl<DgReceiveMapper, DgReceive
158 } 195 }
159 //新增业务表 196 //新增业务表
160 businessService.insertDgBusiness(businessRequest); 197 businessService.insertDgBusiness(businessRequest);
161 //新增不动产单元号表 198 //批量新增不动产单元号表
162 List<DgBdcdyDO> bdcdyDOList=bdcdyConverter.addRequestListDO(bdcdyRequestList); 199 List<DgBdcdyDO> bdcdyDOList=bdcdyConverter.addRequestListDO(bdcdyRequestList);
163 bdcdyService.saveBatch(bdcdyDOList); 200 bdcdyService.saveBatch(bdcdyDOList);
201 long endtime=System.currentTimeMillis();
202 System.out.println("===================该方法总共耗时:"+(endtime-starttime)/1000+"秒");
164 return Result.ok(); 203 return Result.ok();
165 } 204 }
205
206 /**
207 * 公共增加目录表和文件表信息
208 * @param catalogRequestList
209 * @param bsm_archives
210 */
211 private void dealCatalogAndFile(List<AddDgArchivesCatalogRequest> catalogRequestList,String bsm_archives) throws Exception{
212 try {
213 //批量组装文件信息=======start=========
214 List<DgFileDO> fileDOList=new ArrayList<DgFileDO>();
215 DgFileDO fileDO=null;
216 for (int j = 0; j < catalogRequestList.size(); j++) {
217 catalogRequestList.get(j).setBsmArchives(bsm_archives);
218 String cataLogBsm= IdWorker.get32UUID();
219 catalogRequestList.get(j).setBsm_catalog(cataLogBsm);
220 List<String> fileList=catalogRequestList.get(j).getFileList();
221 for (int k = 0; k <fileList.size() ; k++) {
222 fileDO=new DgFileDO();
223 File file=new File(fileList.get(k));
224 InputStream is =new FileInputStream(file);
225 String filetype=file.getName().substring(file.getName().lastIndexOf("."));
226 //文件上传
227 FileAttribute attribute=minioUtil.transferToMinio(is,file.getName(),filetype,String.valueOf(file.length()));
228 fileDO.setBsmCatalog(cataLogBsm);
229 fileDO.setKzm(attribute.getExpandName());
230 fileDO.setScr("admin");
231 fileDO.setFjurl(attribute.getSaveUrl());
232 fileDO.setFjsize(attribute.getFileSize());
233 fileDO.setFjly("1");
234 fileDOList.add(fileDO);
235 }
236 }
237 //批量组装文件信息=======end=========
238 //批量组装目录信息
239 List<DgArchivesCatalogDO> catalogDOList=catalogConverter.addcataListDO(catalogRequestList);
240 //批量新增目录信息
241 catalogService.saveBatch(catalogDOList);
242 //批量新增对应文件信息
243 fileService.saveBatch(fileDOList);
244 }catch (Exception ex){
245 throw ex;
246 }
247 }
248
166 /** 249 /**
167 * 根据条件进行列表查询 250 * 根据条件进行列表查询
168 * @param request 251 * @param request
......
...@@ -40,6 +40,6 @@ ...@@ -40,6 +40,6 @@
40 </foreach> 40 </foreach>
41 </update> 41 </update>
42 <select id="getDjywbmInfo" resultType="com.pashanhoo.receive.entity.vo.DjywbmVO"> 42 <select id="getDjywbmInfo" resultType="com.pashanhoo.receive.entity.vo.DjywbmVO">
43 select * from SYS_CONVERT_DJYWBM t where oncedjywbm=#{oncedjywbm,jdbcType=VARCHAR} 43 select * from SYS_CONVERT_DJYWBM t where oncedjywbm=#{oncedjywbm,jdbcType=VARCHAR} and state='1'
44 </select> 44 </select>
45 </mapper> 45 </mapper>
......