You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

544 lines
16 KiB

3 years ago
​
​
​
​
3 years ago
3 years ago
3 years ago
3 years ago
​
​
3 years ago
1 year ago
​
​
3 years ago
3 years ago
3 years ago
​
3 years ago
3 years ago
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
  1. package com.spring.modules.change.controller;
  2. import com.spring.common.utils.PageUtils;
  3. import com.spring.common.utils.R;
  4. import com.spring.modules.base.data.PlmPropertiesItemData;
  5. import com.spring.modules.base.data.PlmPropertiesModelHeaderData;
  6. import com.spring.modules.base.entity.Bu;
  7. import com.spring.modules.change.entity.*;
  8. import com.spring.modules.change.service.ChangeManagementService;
  9. import com.spring.modules.change.vo.*;
  10. import com.spring.modules.oss.entity.SysOssEntity;
  11. import com.spring.modules.part.entity.ComponentPartData;
  12. import com.spring.modules.part.service.BomManagementService;
  13. import com.spring.modules.part.vo.BomHeaderVo;
  14. import com.spring.modules.project.data.PlmProjectPartData;
  15. import com.spring.modules.proofing.entity.ProofingDelegateAccess;
  16. import com.spring.modules.proofing.vo.ProofingDelegateAccessVo;
  17. import com.spring.modules.quotation.vo.SysOssVo;
  18. import com.spring.modules.sift.vo.QuerySavedVo;
  19. import com.spring.modules.sys.dao.SysMenuDao;
  20. import com.spring.modules.sys.entity.SysUserEntity;
  21. import org.apache.shiro.SecurityUtils;
  22. import org.springframework.beans.factory.annotation.Autowired;
  23. import org.springframework.format.annotation.DateTimeFormat;
  24. import org.springframework.web.bind.annotation.*;
  25. import org.springframework.web.multipart.MultipartFile;
  26. import java.time.LocalDate;
  27. import java.util.Date;
  28. import java.util.List;
  29. import java.util.Map;
  30. @RestController
  31. @RequestMapping("plm/changeManagement")
  32. public class ChangeManagementController {
  33. @Autowired
  34. private ChangeManagementService changeManagementService;
  35. @Autowired
  36. private SysMenuDao sysMenuDao;
  37. /**
  38. * 获取技术参数卡列表
  39. * @param data
  40. * @return
  41. */
  42. @PostMapping(value="/technicalSpecificationSearch")
  43. @ResponseBody
  44. public R technicalSpecificationSearch(@RequestBody TechnicalSpecificationData data) {
  45. PageUtils page = changeManagementService.technicalSpecificationSearch(data);
  46. return R.ok().put("page", page);
  47. }
  48. @PostMapping(value="/technicalSpecificationSearch/any")
  49. @ResponseBody
  50. public R technicalSpecificationSearchAny(@RequestBody QuerySavedVo data) {
  51. PageUtils page = changeManagementService.technicalSpecificationSearchAny(data);
  52. return R.ok().put("page", page);
  53. }
  54. /**
  55. * 获取技术参数卡列表
  56. * @param data
  57. * @return
  58. */
  59. @PostMapping(value="/technicalSpecificationSearch2")
  60. @ResponseBody
  61. public R technicalSpecificationSearch2(@RequestBody TechnicalSpecificationData data) {
  62. List<TechnicalSpecificationData> list = changeManagementService.technicalSpecificationSearch2(data);
  63. return R.ok().put("rows", list);
  64. }
  65. /**
  66. * 根据用户编码获得用户部门
  67. * @param data
  68. * @return
  69. */
  70. @PostMapping(value="/getDepartmentByUserName")
  71. @ResponseBody
  72. public R getDepartmentByUserName(@RequestBody SysUserVo data) {
  73. List<SysUserVo> list = changeManagementService.getDepartmentByUserName(data);
  74. return R.ok().put("rows", list);
  75. }
  76. /**
  77. * 获取申请单号
  78. * @param data
  79. * @return
  80. */
  81. @PostMapping(value="/changeRequestTempSave")
  82. @ResponseBody
  83. public R changeRequestTempSave(@RequestBody TransNoEntity data) {
  84. Map<String, Object> map = changeManagementService.changeRequestTempSave(data);
  85. return R.ok().put("rows", map);
  86. }
  87. /**
  88. * 新增变更申请
  89. * @param data
  90. * @return
  91. */
  92. @PostMapping(value="/changeRequestSave")
  93. @ResponseBody
  94. public R ChangeRequestSave(@RequestBody ChangeRequestVo data) {
  95. changeManagementService.changeRequestSave(data);
  96. return R.ok();
  97. }
  98. /**
  99. * 根据变更单号删除文件
  100. * @param data
  101. * @return
  102. */
  103. @PostMapping(value="/deleteChangeFiles")
  104. @ResponseBody
  105. public R deleteChangeFiles(@RequestBody ChangeRequestEntity data) {
  106. changeManagementService.deleteChangeFiles(data);
  107. return R.ok();
  108. }
  109. // ================================================================================================================= //
  110. /**
  111. * 获取工程变更记录列表
  112. * @param data
  113. * @return
  114. */
  115. @PostMapping(value="/changeRecordSearch")
  116. @ResponseBody
  117. public R changeRecordSearch(@RequestBody ChangeRequestVo data) {
  118. PageUtils page = changeManagementService.changeRecordSearch(data);
  119. return R.ok().put("page", page);
  120. }
  121. @PostMapping(value="/changeRecordSearch/any")
  122. @ResponseBody
  123. public R changeRecordSearchAny(@RequestBody QuerySavedVo data) {
  124. PageUtils page = changeManagementService.changeRecordSearchAny(data);
  125. return R.ok().put("page", page);
  126. }
  127. /**
  128. * 变更单详情的列表
  129. * @param data
  130. * @return
  131. */
  132. @PostMapping(value="/changeDetailSearch")
  133. @ResponseBody
  134. public R changeDetailSearch(@RequestBody ChangeRequestDetailVo data) {
  135. List<ChangeRequestDetailVo> list = changeManagementService.changeDetailSearch(data);
  136. return R.ok().put("rows", list);
  137. }
  138. /**
  139. * 变更单文件的列表
  140. * @param data
  141. * @return
  142. */
  143. @PostMapping(value="/changeFileSearch")
  144. @ResponseBody
  145. public R changeFileSearch(@RequestBody SysOssEntity data) {
  146. List<SysOssEntity> list = changeManagementService.changeFileSearch(data);
  147. return R.ok().put("rows", list);
  148. }
  149. /**
  150. * 删除变更单文件
  151. * @param data
  152. * @return
  153. */
  154. @PostMapping(value="/deleteChangeFile")
  155. @ResponseBody
  156. public R deleteChangeFile(@RequestBody SysOssEntity data) {
  157. changeManagementService.deleteChangeFile(data);
  158. return R.ok();
  159. }
  160. /**
  161. * 查询库存成本影响
  162. * @param data
  163. * @return
  164. */
  165. @PostMapping(value="/costImpactSearch")
  166. @ResponseBody
  167. public R costImpactSearch(@RequestBody ChangeRequestEntity data) {
  168. ChangeCostImpactVo row = changeManagementService.costImpactSearch(data);
  169. return R.ok().put("rows", row);
  170. }
  171. /**
  172. * 查询执行信息
  173. * @param data
  174. * @return
  175. */
  176. @PostMapping(value="/executionInfoSearch")
  177. @ResponseBody
  178. public R executionInfoSearch(@RequestBody ChangeRequestEntity data) {
  179. Map<String, Object> map = changeManagementService.executionInfoSearch(data);
  180. return R.ok().put("rows", map);
  181. }
  182. /**
  183. * 新增库存成本影响
  184. * @param data
  185. * @return
  186. */
  187. @PostMapping(value="/costImpactSave")
  188. @ResponseBody
  189. public R costImpactSave(@RequestBody ChangeCostImpactEntity data) {
  190. changeManagementService.costImpactSave(data);
  191. return R.ok();
  192. }
  193. /**
  194. * 新增执行信息
  195. * @param data
  196. * @return
  197. */
  198. @PostMapping(value="/executionSave")
  199. @ResponseBody
  200. public R executionSave(@RequestBody ChangeExecutionInfoVo data) {
  201. changeManagementService.executionSave(data);
  202. return R.ok();
  203. }
  204. /**
  205. * 新增库存成本影响(变更记录页面)
  206. * @param data
  207. * @return
  208. */
  209. @PostMapping(value="/costImpactUpdate")
  210. @ResponseBody
  211. public R costImpactUpdate(@RequestBody ChangeCostImpactEntity data) {
  212. Map<String, Object> map = changeManagementService.costImpactUpdate(data);
  213. return R.ok().put("rows", map);
  214. }
  215. /**
  216. * 查询ECN种类数据
  217. * @param data
  218. * @return
  219. */
  220. @PostMapping(value="/getEcnTypeData")
  221. @ResponseBody
  222. public R getEcnTypeData(@RequestBody EcnTypeHeaderData data) {
  223. List<EcnTypeHeaderData> list = changeManagementService.getEcnTypeData(data);
  224. return R.ok().put("rows", list);
  225. }
  226. /**
  227. * 查询ECN的模板
  228. * @param data
  229. * @return
  230. */
  231. @PostMapping(value="/getEcnModel")
  232. @ResponseBody
  233. public R getEcnModel(@RequestBody PlmPropertiesModelHeaderData data) {
  234. List<PlmPropertiesModelHeaderData> list = changeManagementService.getEcnModel(data);
  235. return R.ok().put("rows", list);
  236. }
  237. /**
  238. * 查询模板属性
  239. * @param data
  240. * @return
  241. */
  242. @PostMapping(value="/getItemList")
  243. @ResponseBody
  244. public R getItemList(@RequestBody PlmPropertiesModelHeaderData data) {
  245. List<ChangeItemData> list = changeManagementService.getItemList(data);
  246. return R.ok().put("rows", list);
  247. }
  248. /**
  249. * 查询变更明细
  250. * @param data
  251. * @return
  252. */
  253. @PostMapping(value="/requestDetailSearch")
  254. @ResponseBody
  255. public R requestDetailSearch(@RequestBody ChangeRequestEntity data) {
  256. List<ChangeRequestDetailEntity> list = changeManagementService.requestDetailSearch(data);
  257. return R.ok().put("rows", list);
  258. }
  259. /**
  260. * 删除变更明细
  261. * @param data
  262. * @return
  263. */
  264. @PostMapping(value="/deleteChangeDetail")
  265. @ResponseBody
  266. public R deleteChangeDetail(@RequestBody ChangeRequestDetailEntity data) {
  267. changeManagementService.deleteChangeDetail(data);
  268. return R.ok();
  269. }
  270. /**
  271. * 查询所选择的ECN种类
  272. * @param data
  273. * @return
  274. */
  275. @PostMapping(value="/getChooseEcnType")
  276. @ResponseBody
  277. public R getChooseEcnType(@RequestBody ChangeRequestEntity data) {
  278. List<EcnTypeHeaderData> list = changeManagementService.getChooseEcnType(data);
  279. return R.ok().put("rows", list);
  280. }
  281. /**
  282. * 编辑变更单基础信息
  283. * @param data
  284. * @return
  285. */
  286. @PostMapping(value="/changeRequestUpdate")
  287. @ResponseBody
  288. public R changeRequestUpdate(@RequestBody ChangeRequestVo data) {
  289. Map<String, Object> map = changeManagementService.changeRequestUpdate(data);
  290. return R.ok().put("rows", map);
  291. }
  292. /**
  293. * 修改执行信息
  294. * @param data
  295. * @return
  296. */
  297. @PostMapping(value="/executionUpdate")
  298. @ResponseBody
  299. public R executionUpdate(@RequestBody ChangeExecutionInfoVo data) {
  300. Map<String, Object> map = changeManagementService.executionUpdate(data);
  301. return R.ok().put("rows", map);
  302. }
  303. /**
  304. * 新增会签信息
  305. * @param data
  306. * @return
  307. */
  308. @PostMapping(value="/countersignatureSave")
  309. @ResponseBody
  310. public R countersignatureSave(@RequestBody ChangeExecutionInfoVo data) {
  311. changeManagementService.countersignatureSave(data);
  312. return R.ok();
  313. }
  314. /**
  315. * 查询会签信息
  316. * @param data
  317. * @return
  318. */
  319. @PostMapping(value="/countersignatureSearch")
  320. @ResponseBody
  321. public R countersignatureSearch(@RequestBody ChangeRequestEntity data) {
  322. Map<String, Object> map = changeManagementService.countersignatureSearch(data);
  323. return R.ok().put("rows", map);
  324. }
  325. /**
  326. * 修改会签信息
  327. * @param data
  328. * @return
  329. */
  330. @PostMapping(value="/countersignatureUpdate")
  331. @ResponseBody
  332. public R countersignatureUpdate(@RequestBody ChangeExecutionInfoVo data) {
  333. Map<String, Object> map = changeManagementService.countersignatureUpdate(data);
  334. return R.ok().put("rows", map);
  335. }
  336. /**
  337. * 下达
  338. * @param data
  339. * @return
  340. */
  341. @PostMapping(value="/issueChange")
  342. @ResponseBody
  343. public R issueChange(@RequestBody ChangeRequestVo data) {
  344. changeManagementService.issueChange(data);
  345. return R.ok();
  346. }
  347. /**
  348. * 提交
  349. * @param data
  350. * @return
  351. */
  352. @PostMapping(value="/submitChange")
  353. @ResponseBody
  354. public R submitChange(@RequestBody ChangeRequestVo data) {
  355. changeManagementService.submitChange(data);
  356. return R.ok();
  357. }
  358. /**
  359. * 流程关闭
  360. * @param data
  361. * @return
  362. */
  363. @PostMapping(value="/closeProcess")
  364. @ResponseBody
  365. public R closeProcess(@RequestBody CloseProcessVo data) {
  366. SysUserEntity user = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
  367. data.setUserName(user.getUsername());
  368. changeManagementService.closeProcess(data);
  369. return R.ok();
  370. }
  371. /**
  372. * 获取节点权限
  373. * @param data
  374. * @return
  375. */
  376. @PostMapping(value="/getNodeAuthority")
  377. @ResponseBody
  378. public R getNodeAuthority(@RequestBody ChangeRequestVo data) {
  379. Map<String, List<RequestNodeAuthorityEntity>> map = changeManagementService.getNodeAuthority(data);
  380. return R.ok().put("rows", map);
  381. }
  382. /**
  383. * 获取节点权限(新版)
  384. * @param data
  385. * @return
  386. */
  387. @PostMapping(value="/getNodeAuthorityForCheck")
  388. @ResponseBody
  389. public R getNodeAuthorityForCheck(@RequestBody ChangeRequestVo data) {
  390. String result = changeManagementService.getNodeAuthorityRQ(data);
  391. return R.ok().put("strResult", result);
  392. }
  393. /**
  394. * 查询审批信息
  395. * @param data
  396. * @return
  397. */
  398. @PostMapping(value="/getApprovalList")
  399. @ResponseBody
  400. public R getApprovalList(@RequestBody ProcessFormVo data) {
  401. List<ProcessFormVo> list = changeManagementService.getApprovalList(data);
  402. return R.ok().put("rows", list);
  403. }
  404. /**
  405. * 根据site查bu
  406. * @param data
  407. * @return
  408. */
  409. @PostMapping(value="/getBuBySite")
  410. @ResponseBody
  411. public R getBuBySite(@RequestBody Bu data) {
  412. List<Bu> list = changeManagementService.getBuBySite(data);
  413. return R.ok().put("rows", list);
  414. }
  415. /**
  416. * 根据视图查物料计划
  417. * @param data
  418. * @return
  419. */
  420. @PostMapping(value="/choosePartNoList")
  421. @ResponseBody
  422. public R choosePartNoList(@RequestBody PlmProjectPartData data) {
  423. PageUtils page = changeManagementService.choosePartNoList(data);
  424. return R.ok().put("page", page);
  425. }
  426. /**
  427. * TP执行
  428. * @param data
  429. * @return
  430. */
  431. @PostMapping(value="/tpExecute")
  432. @ResponseBody
  433. public R tpExecute(@RequestBody ChangeRequestVo data) {
  434. changeManagementService.tpExecute(data);
  435. return R.ok();
  436. }
  437. /**
  438. * 会签执行
  439. * @param data
  440. * @return
  441. */
  442. @PostMapping(value="/csExecute")
  443. @ResponseBody
  444. public R csExecute(@RequestBody ChangeRequestVo data) {
  445. changeManagementService.csExecute(data);
  446. return R.ok();
  447. }
  448. /**
  449. * 删除临时变更单数据
  450. */
  451. @PostMapping(value="/deleteTempChangeInfo")
  452. @ResponseBody
  453. public R deleteTempChangeInfo(@RequestBody ChangeRequestVo data) {
  454. changeManagementService.deleteTempChangeInfo(data);
  455. return R.ok();
  456. }
  457. /**
  458. * 删除临时变更单数据
  459. */
  460. /**
  461. * 校验流程节点特殊管控权限
  462. * roleId: 9=选择评估信息, 10=选择执行信息, 11=选择执行人, 12=选择会签信息
  463. * @param data
  464. * @return
  465. */
  466. @PostMapping(value="/checkProcessControl")
  467. @ResponseBody
  468. public R checkProcessControl(@RequestBody ChangeRequestVo data) {
  469. changeManagementService.checkProcessControl(data);
  470. return R.ok();
  471. }
  472. @PostMapping(value="/checkSuperAdmin")
  473. @ResponseBody
  474. public R checkSuperAdmin() {
  475. boolean flag = !sysMenuDao.checkSuperAdmin(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId()).isEmpty();
  476. // 是否超级管理员
  477. return R.ok().put("superAdmin", flag);
  478. }
  479. @PostMapping(value="/searchDelegateAccess")
  480. @ResponseBody
  481. public R searchDelegateAccess(@RequestBody ChangeDelegateAccess delegateAccess) {
  482. List<ChangeDelegateAccess> list = changeManagementService.searchDelegateAccess(delegateAccess);
  483. return R.ok().put("rows", list);
  484. }
  485. /**
  486. * 更新异常数据(调用存储过程)
  487. * @param data
  488. * @return
  489. */
  490. @PostMapping(value="/updateShowInQueryFlag")
  491. @ResponseBody
  492. public R updateShowInQueryFlag(@RequestBody Map<String, String> data) {
  493. String site = data.get("site");
  494. changeManagementService.updateShowInQueryFlag(site);
  495. return R.ok("更新成功");
  496. }
  497. }