kangwei:
法律法规模块、标准规范模块修改-后端
正在显示
3 个修改的文件
包含
155 行增加
和
16 行删除
... | @@ -9,12 +9,15 @@ import com.skua.core.aspect.annotation.AutoLog; | ... | @@ -9,12 +9,15 @@ import com.skua.core.aspect.annotation.AutoLog; |
9 | import com.skua.core.context.BaseContextHandler; | 9 | import com.skua.core.context.BaseContextHandler; |
10 | import com.skua.core.query.QueryGenerator; | 10 | import com.skua.core.query.QueryGenerator; |
11 | import com.skua.core.util.DateUtils; | 11 | import com.skua.core.util.DateUtils; |
12 | import com.skua.modules.erp.entity.ErpSettlement; | ||
13 | import com.skua.modules.erp.vo.PurchaseContractVO; | ||
12 | import com.skua.modules.material.entity.MaterialInfo; | 14 | import com.skua.modules.material.entity.MaterialInfo; |
13 | import com.skua.modules.material.entity.MaterialInfoHandleRecord; | 15 | import com.skua.modules.material.entity.MaterialInfoHandleRecord; |
14 | import com.skua.modules.material.entity.MaterialInformation; | 16 | import com.skua.modules.material.entity.MaterialInformation; |
15 | import com.skua.modules.material.service.IMaterialInfoHandleRecordService; | 17 | import com.skua.modules.material.service.IMaterialInfoHandleRecordService; |
16 | import com.skua.modules.material.service.IMaterialInfoService; | 18 | import com.skua.modules.material.service.IMaterialInfoService; |
17 | import com.skua.modules.system.service.ISysDepartService; | 19 | import com.skua.modules.system.service.ISysDepartService; |
20 | import com.skua.tool.util.JSUtils; | ||
18 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
19 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
20 | import io.swagger.annotations.ApiParam; | 23 | import io.swagger.annotations.ApiParam; |
... | @@ -37,10 +40,7 @@ import javax.servlet.http.HttpServletResponse; | ... | @@ -37,10 +40,7 @@ import javax.servlet.http.HttpServletResponse; |
37 | import java.io.IOException; | 40 | import java.io.IOException; |
38 | import java.io.UnsupportedEncodingException; | 41 | import java.io.UnsupportedEncodingException; |
39 | import java.net.URLDecoder; | 42 | import java.net.URLDecoder; |
40 | import java.util.ArrayList; | 43 | import java.util.*; |
41 | import java.util.Arrays; | ||
42 | import java.util.List; | ||
43 | import java.util.Map; | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * <pre> | 46 | * <pre> |
... | @@ -75,20 +75,118 @@ public class MaterialInfoController { | ... | @@ -75,20 +75,118 @@ public class MaterialInfoController { |
75 | public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo, | 75 | public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo, |
76 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 76 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
77 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | 77 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
78 | String departIds = null; | 78 | /* String departIds = null; |
79 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
80 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
81 | if (StringUtils.isBlank(materialInfo.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { | 79 | if (StringUtils.isBlank(materialInfo.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { |
82 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts()); | 80 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts()); |
83 | }else{ | 81 | }else{ |
84 | departIds = departService.getChildDepartId(materialInfo.getDepartId()); | 82 | departIds = departService.getChildDepartId(materialInfo.getDepartId()); |
85 | } | 83 | } |
86 | IPage<MaterialInfo> pageList = materialInfoService.getList(page, materialInfo, departIds); | 84 | IPage<MaterialInfo> pageList = materialInfoService.getList(page, materialInfo, departIds); |
85 | */ | ||
86 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
87 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
88 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | ||
89 | queryWrapper.eq("status","3"); | ||
90 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | ||
91 | result.setSuccess(true); | ||
92 | result.setResult(pageList); | ||
93 | return result; | ||
94 | } | ||
95 | |||
96 | @AutoLog(value = "厂区资料管理-法律法规分页列表") | ||
97 | @ApiOperation(value = "厂区资料管理-法律法规分页列表", notes = "厂区资料管理-法律法规分页列表") | ||
98 | @GetMapping(value = "/list") | ||
99 | public Result<IPage<MaterialInfo>> queryFLFGPageList(MaterialInfo materialInfo, | ||
100 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
101 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||
102 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
103 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
104 | QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper(); | ||
105 | queryWrapper.eq("del_flag","0"); | ||
106 | if(StringUtils.isNotEmpty(materialInfo.getFacInformationName())){ | ||
107 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); | ||
108 | } | ||
109 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ | ||
110 | queryWrapper.eq("rules_type",materialInfo.getRulesType()); | ||
111 | } | ||
112 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ | ||
113 | queryWrapper.eq("laws_type",materialInfo.getLawsType()); | ||
114 | } | ||
115 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ | ||
116 | queryWrapper.eq("standards_type",materialInfo.getStandardsType()); | ||
117 | } | ||
118 | queryWrapper.eq("status","3"); | ||
119 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | ||
120 | result.setSuccess(true); | ||
121 | result.setResult(pageList); | ||
122 | return result; | ||
123 | } | ||
124 | |||
125 | @AutoLog(value = "厂区资料管理-待审核列表") | ||
126 | @ApiOperation(value = "厂区资料管理-待审核列表", notes = "厂区资料管理-待审核列表") | ||
127 | @GetMapping(value = "/unAuditList") | ||
128 | public Result<IPage<MaterialInfo>> queryUnAuditPageList(MaterialInfo materialInfo, | ||
129 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
130 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||
131 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
132 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
133 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | ||
134 | queryWrapper.in("status","'1','2'"); | ||
135 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | ||
136 | result.setSuccess(true); | ||
137 | result.setResult(pageList); | ||
138 | return result; | ||
139 | } | ||
140 | @AutoLog(value = "厂区资料管理-我的") | ||
141 | @ApiOperation(value = "厂区资料管理-我的", notes = "厂区资料管理-我的") | ||
142 | @GetMapping(value = "/myList") | ||
143 | public Result<IPage<MaterialInfo>> queryMyPageList(MaterialInfo materialInfo, | ||
144 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
145 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||
146 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
147 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
148 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | ||
149 | //queryWrapper.in("status","'1','2'"); | ||
150 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | ||
87 | result.setSuccess(true); | 151 | result.setSuccess(true); |
88 | result.setResult(pageList); | 152 | result.setResult(pageList); |
89 | return result; | 153 | return result; |
90 | } | 154 | } |
91 | 155 | ||
156 | |||
157 | private QueryWrapper<MaterialInfo> getMaterialInfoQueryWrapper(MaterialInfo materialInfo){ | ||
158 | QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper(); | ||
159 | String departIds = null; | ||
160 | if (StringUtils.isBlank(materialInfo.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { | ||
161 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts()); | ||
162 | }else{ | ||
163 | departIds = departService.getChildDepartId(materialInfo.getDepartId()); | ||
164 | } | ||
165 | // Page<MaterialInfo> page = new Page<ErpSettlement>(pageNo, pageSize); | ||
166 | queryWrapper.eq("del_flag","0"); | ||
167 | queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,",")); | ||
168 | if(StringUtils.isNotEmpty(materialInfo.getFacInformationtype())){ | ||
169 | queryWrapper.eq("fac_informationtype",materialInfo.getFacInformationtype()); | ||
170 | } | ||
171 | //facInformationName | ||
172 | if(StringUtils.isNotEmpty(materialInfo.getFacInformationName())){ | ||
173 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); | ||
174 | } | ||
175 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ | ||
176 | queryWrapper.eq("rules_type",materialInfo.getRulesType()); | ||
177 | } | ||
178 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ | ||
179 | queryWrapper.eq("laws_type",materialInfo.getLawsType()); | ||
180 | } | ||
181 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ | ||
182 | queryWrapper.eq("standards_type",materialInfo.getStandardsType()); | ||
183 | } | ||
184 | return queryWrapper; | ||
185 | } | ||
186 | |||
187 | |||
188 | |||
189 | |||
92 | /** | 190 | /** |
93 | * 添加 | 191 | * 添加 |
94 | * @param materialInfo | 192 | * @param materialInfo |
... | @@ -137,6 +235,39 @@ public class MaterialInfoController { | ... | @@ -137,6 +235,39 @@ public class MaterialInfoController { |
137 | return result; | 235 | return result; |
138 | } | 236 | } |
139 | 237 | ||
238 | @AutoLog(value = "厂区资料管理-送审") | ||
239 | @ApiOperation(value="厂区资料管理-送审", notes="厂区资料管理-送审") | ||
240 | @GetMapping(value = "/sendAudit") | ||
241 | public Result<MaterialInfo> sendAudit(@RequestParam(name="id",required=true) String id) { | ||
242 | Result<MaterialInfo> result = new Result<>(); | ||
243 | MaterialInfo materialInfo = materialInfoService.getById(id); | ||
244 | if(materialInfo==null) { | ||
245 | result.error500("未找到对应实体"); | ||
246 | }else { | ||
247 | materialInfo.setStatus("1"); | ||
248 | materialInfoService.updateById(materialInfo); | ||
249 | result.setResult(materialInfo); | ||
250 | result.setSuccess(true); | ||
251 | } | ||
252 | return result; | ||
253 | } | ||
254 | @AutoLog(value = "厂区资料管理-审批") | ||
255 | @ApiOperation(value="厂区资料管理-审批", notes="厂区资料管理-审批(status=3 审核通过,status=2 驳回)") | ||
256 | @PutMapping(value = "/audit") | ||
257 | public Result<MaterialInfo> auditPurchasePlan(@RequestBody MaterialInfo materialInfo) { | ||
258 | Result<MaterialInfo> result = new Result<>(); | ||
259 | //purchaseContract.setStatus("1"); | ||
260 | //purchaseContract.setApplyUser(BaseContextHandler.getUserId()); | ||
261 | //purchaseContract.setApplyTime(DateUtils.now()); | ||
262 | materialInfo.setApproveUser(BaseContextHandler.getUserName()); | ||
263 | materialInfo.setUpdateTime(new Date()); | ||
264 | materialInfoService.updateById(materialInfo); | ||
265 | result.setResult(materialInfo); | ||
266 | result.setSuccess(true); | ||
267 | return result; | ||
268 | } | ||
269 | |||
270 | |||
140 | /** | 271 | /** |
141 | * <pre> | 272 | * <pre> |
142 | * 更新浏览量/下载量 | 273 | * 更新浏览量/下载量 | ... | ... |
... | @@ -30,21 +30,20 @@ public class MaterialInfo { | ... | @@ -30,21 +30,20 @@ public class MaterialInfo { |
30 | @ApiModelProperty(value = "id") | 30 | @ApiModelProperty(value = "id") |
31 | private String id; | 31 | private String id; |
32 | /**厂区资料文件名*/ | 32 | /**厂区资料文件名*/ |
33 | @Excel(name = "厂区资料文件名", width = 15) | 33 | @Excel(name = "厂区资料文件名", width = 15 , orderNum = "3") |
34 | @ApiModelProperty(value = "厂区资料文件名") | 34 | @ApiModelProperty(value = "厂区资料文件名") |
35 | private String facInformationName; | 35 | private String facInformationName; |
36 | /**厂区资料文件名类型*/ | 36 | /**厂区资料文件名类型*/ |
37 | @Excel(name = "厂区资料文件名类型", width = 15) | 37 | @Excel(name = "厂区资料文件名类型", width = 15,dicCode = "fac_information_type",orderNum = "4") |
38 | @ApiModelProperty(value = "厂区资料文件名类型") | 38 | @ApiModelProperty(value = "厂区资料文件名类型") |
39 | @Dict(dicCode = "fac_information_type") | 39 | @Dict(dicCode = "fac_information_type") |
40 | private String facInformationtype; | 40 | private String facInformationtype; |
41 | /**删除状态(0,正常,1已删除)*/ | 41 | /**删除状态(0,正常,1已删除)*/ |
42 | @Excel(name = "删除状态(0,正常,1已删除)", width = 15) | ||
43 | @ApiModelProperty(value = "删除状态(0,正常,1已删除)") | 42 | @ApiModelProperty(value = "删除状态(0,正常,1已删除)") |
44 | private String delFlag; | 43 | private String delFlag; |
45 | /**创建人*/ | 44 | /**创建人*/ |
46 | @Excel(name = "创建人", width = 15) | 45 | @Excel(name = "创建人", width = 15,dictTable = "sys_user",dicCode = "username",dicText = "realname" ,orderNum = "6") |
47 | @ApiModelProperty(value = "创建人") | 46 | @ApiModelProperty(value = "创建人" ) |
48 | @Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname") | 47 | @Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname") |
49 | private String createBy; | 48 | private String createBy; |
50 | /**创建时间*/ | 49 | /**创建时间*/ |
... | @@ -54,25 +53,24 @@ public class MaterialInfo { | ... | @@ -54,25 +53,24 @@ public class MaterialInfo { |
54 | @ApiModelProperty(value = "创建时间") | 53 | @ApiModelProperty(value = "创建时间") |
55 | private Date createTime; | 54 | private Date createTime; |
56 | /**更新人*/ | 55 | /**更新人*/ |
57 | @Excel(name = "更新人", width = 15) | ||
58 | @ApiModelProperty(value = "更新人") | 56 | @ApiModelProperty(value = "更新人") |
59 | private String updateBy; | 57 | private String updateBy; |
60 | /**更新时间*/ | 58 | /**更新时间*/ |
61 | @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | 59 | |
62 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | 60 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
63 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 61 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
64 | @ApiModelProperty(value = "更新时间") | 62 | @ApiModelProperty(value = "更新时间") |
65 | private Date updateTime; | 63 | private Date updateTime; |
66 | /**附件地址*/ | 64 | /**附件地址*/ |
67 | @Excel(name = "附件地址", width = 15) | ||
68 | @ApiModelProperty(value = "附件地址") | 65 | @ApiModelProperty(value = "附件地址") |
69 | private String docuAddr; | 66 | private String docuAddr; |
70 | /**所属厂区*/ | 67 | /**所属厂区*/ |
71 | @Excel(name = "所属厂区", width = 15) | 68 | @Excel(name = "所属厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name" ,orderNum = "1") |
72 | @ApiModelProperty(value = "所属厂区") | 69 | @ApiModelProperty(value = "所属厂区") |
73 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") | 70 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") |
74 | private String departId; | 71 | private String departId; |
75 | /**内容摘要*/ | 72 | /**内容摘要*/ |
73 | @Excel(name = "内容摘要", width = 20, orderNum = "5") | ||
76 | @ApiModelProperty(value = "内容摘要") | 74 | @ApiModelProperty(value = "内容摘要") |
77 | private String contentSummary; | 75 | private String contentSummary; |
78 | /**文件类型*/ | 76 | /**文件类型*/ |
... | @@ -87,6 +85,7 @@ public class MaterialInfo { | ... | @@ -87,6 +85,7 @@ public class MaterialInfo { |
87 | private String rulesType; | 85 | private String rulesType; |
88 | /**法律法规类型*/ | 86 | /**法律法规类型*/ |
89 | @Dict(dicCode = "laws_type") | 87 | @Dict(dicCode = "laws_type") |
88 | @Excel(name = "法律法规类型", width = 15,dicCode = "laws_type" ,orderNum = "2") | ||
90 | @ApiModelProperty(value = "法律法规类型") | 89 | @ApiModelProperty(value = "法律法规类型") |
91 | private String lawsType; | 90 | private String lawsType; |
92 | /**法律法规归属*/ | 91 | /**法律法规归属*/ |
... | @@ -132,4 +131,10 @@ public class MaterialInfo { | ... | @@ -132,4 +131,10 @@ public class MaterialInfo { |
132 | @Dict(dicCode = "purchase_plan_status") | 131 | @Dict(dicCode = "purchase_plan_status") |
133 | private String status; | 132 | private String status; |
134 | 133 | ||
134 | @ApiModelProperty(value = "审批人") | ||
135 | private String approveUser; | ||
136 | /**审批人*/ | ||
137 | @ApiModelProperty(value = "审批意见") | ||
138 | private String approveMessage; | ||
139 | |||
135 | } | 140 | } | ... | ... |
... | @@ -96,6 +96,9 @@ public class MybatisInterceptor implements Interceptor { | ... | @@ -96,6 +96,9 @@ public class MybatisInterceptor implements Interceptor { |
96 | add("danger_level_manage_share"); | 96 | add("danger_level_manage_share"); |
97 | // 库存表 | 97 | // 库存表 |
98 | add("equipment_sparepart"); | 98 | add("equipment_sparepart"); |
99 | |||
100 | //material_info | ||
101 | add("material_info"); | ||
99 | }}; | 102 | }}; |
100 | 103 | ||
101 | //过滤不需要走部门ID查询的URL | 104 | //过滤不需要走部门ID查询的URL | ... | ... |
-
请 注册 或 登录 后发表评论