CommonService.java 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369
  1. package com.dk.mdm.service.common;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.dk.common.infrastructure.constant.Constant;
  5. import com.dk.common.mapper.BaseMapper;
  6. import com.dk.common.model.pojo.PageList;
  7. import com.dk.common.model.vo.core.UserVO;
  8. import com.dk.common.response.ResponseCodeEnum;
  9. import com.dk.common.response.ResponseResultUtil;
  10. import com.dk.common.response.ResponseResultVO;
  11. import com.dk.common.service.BaseService;
  12. import com.dk.mdm.mapper.common.CommonMapper;
  13. import com.dk.mdm.infrastructure.util.AuthUtils;
  14. import lombok.extern.slf4j.Slf4j;
  15. import org.postgresql.util.PGobject;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.stereotype.Service;
  18. import org.springframework.util.CollectionUtils;
  19. import java.util.*;
  20. import java.util.stream.Collectors;
  21. /**
  22. * @author : 周兴
  23. * @desc : 控件数据源API
  24. * @date : 2023/1/3 17:21
  25. */
  26. @Service
  27. @Slf4j
  28. public class CommonService extends BaseService<Map<String, Object>> {
  29. @Override
  30. public BaseMapper<Map<String, Object>> getRepository() {
  31. return commonMapper;
  32. }
  33. @Autowired
  34. private CommonMapper commonMapper;
  35. @Autowired
  36. private AuthUtils authUtils;
  37. /**
  38. * @desc : 获取数据字典项目
  39. * @author : 王英杰
  40. * @date : 2023/1/6 11:41
  41. */
  42. public ResponseResultVO<List<Map<String, Object>>> getDictionaryItemData(Map<String, Object> param) {
  43. // 获取系统基础数据
  44. List<Map<String, Object>> list = commonMapper.getDictionaryItemData(param);
  45. return ResponseResultUtil.success(list);
  46. }
  47. /**
  48. * @desc : 刷新基础数据
  49. * @author : 周兴
  50. * @date : 2023/5/11 10:19
  51. */
  52. public ResponseResultVO refreshBasicData(Map<String, Object> param) {
  53. UserVO user = authUtils.getUser();
  54. if (param.get("appCode") != null) {
  55. user.setAppCode(param.get("appCode").toString());
  56. }
  57. Map userMap = new HashMap();
  58. userMap.put("userId", user.getUserId());
  59. userMap.put("appCode", user.getAppCode());
  60. return ResponseResultUtil.success(new HashMap<String, Object>(3) {{
  61. put("menu", commonMapper.getMenuByUser(user.getAppCode(), user.getUserId()));
  62. put("function", (user.getRoleIds() != null && user.getRoleIds().indexOf(-1) >= 0)
  63. ? commonMapper.getUserFunctionAdmin(userMap) : commonMapper.getUserFunction(userMap));
  64. put("userTableSetting", commonMapper.getUserTableInfo(userMap));
  65. }});
  66. }
  67. /**
  68. * @desc : 获取序号最大值
  69. * @author : 周兴
  70. * @date : 2023/1/6 11:41t_user_right
  71. */
  72. public ResponseResultVO<Integer> getMaxDisplayNo(Map<String, Object> param) {
  73. // 获取系统基础数据
  74. Integer maxDisplayNo = commonMapper.getMaxDisplayNo(param);
  75. maxDisplayNo = maxDisplayNo == null ? 1 : (maxDisplayNo + 1);
  76. return ResponseResultUtil.success(maxDisplayNo);
  77. }
  78. /**
  79. * @desc : 获取系统表数据种类
  80. * @author : 周兴
  81. * @date : 2023/1/6 11:41
  82. */
  83. public ResponseResultVO<List<Map<String, Object>>> getDataKind(Map<String, Object> param) {
  84. // 获取系统基础数据
  85. List<Map<String, Object>> list = commonMapper.getDataKind(param);
  86. return ResponseResultUtil.success(list);
  87. }
  88. /**
  89. * @desc : 获取型号分类
  90. * @author : 周兴
  91. * @date : 2023/1/6 11:41
  92. */
  93. public ResponseResultVO<List<Map<String, Object>>> getModelCategory(Map<String, Object> param) {
  94. // 获取系统基础数据
  95. List<Map<String, Object>> list = commonMapper.getModelCategory(param);
  96. return ResponseResultUtil.success(list);
  97. }
  98. /**
  99. * @desc : 获取型号分类分类
  100. * @author : 洪旭东
  101. * @date : 2023-03-28 16:11
  102. */
  103. public ResponseResultVO<PageList<Map<String, Object>>> getModelCategoryByPage(Map<String, Object> param) {
  104. this.getLimit(param);
  105. return super.mergeListWithCount(param, commonMapper.getModelCategory(param),
  106. commonMapper.countModelCategory(param));
  107. }
  108. /**
  109. * @desc : 获取工种
  110. * @author : 姜宁
  111. * @date : 2023/1/9 13:22
  112. */
  113. public ResponseResultVO<List<Map<String, Object>>> getJob(Map<String, Object> param) {
  114. // 获取系统基础数据
  115. List<Map<String, Object>> list = commonMapper.getJob(param);
  116. return ResponseResultUtil.success(list);
  117. }
  118. /**
  119. * @desc : 获取职务
  120. * @author : 姜宁
  121. * @date : 2023/1/9 13:43
  122. */
  123. public ResponseResultVO<List<Map<String, Object>>> getPost(Map<String, Object> param) {
  124. // 获取系统基础数据
  125. List<Map<String, Object>> list = commonMapper.getPost(param);
  126. return ResponseResultUtil.success(list);
  127. }
  128. /**
  129. * @desc : 获取组织部门
  130. * @author : 姜宁
  131. * @date : 2023/1/9 13:50
  132. */
  133. public ResponseResultVO<List<Map<String, Object>>> getOrg(Map<String, Object> param) {
  134. // 获取系统基础数据
  135. List<Map<String, Object>> list = commonMapper.getOrg(param);
  136. return ResponseResultUtil.success(list);
  137. }
  138. /**
  139. * @desc : 获取部门
  140. * @author : 姜宁
  141. * @date : 2023/1/29 17:01
  142. */
  143. public ResponseResultVO<PageList<Map<String, Object>>> getOrgByPage(Map<String, Object> param) {
  144. // 校验分页参数
  145. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  146. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  147. }
  148. // 分页参数赋值
  149. param = this.getLimit(param);
  150. return super.mergeListWithCount(param, commonMapper.getOrg(param),
  151. commonMapper.getOrgCountByPage(param));
  152. }
  153. /**
  154. * @desc : 获取商品品牌
  155. * @author : 夏常明
  156. * @date : 2023/1/10 14:24
  157. */
  158. public ResponseResultVO<List<Map<String, Object>>> getBrand(Map<String, Object> param) {
  159. // 获取系统基础数据
  160. List<Map<String, Object>> list = commonMapper.getBrand(param);
  161. return ResponseResultUtil.success(list);
  162. }
  163. /**
  164. * @desc : 获取缺陷分类
  165. * @author : 夏常明
  166. * @date : 2023/1/12 9:09
  167. */
  168. public ResponseResultVO<List<Map<String, Object>>> getDefectType(Map<String, Object> param) {
  169. // 获取系统基础数据
  170. List<Map<String, Object>> list = commonMapper.getDefectType(param);
  171. return ResponseResultUtil.success(list);
  172. }
  173. /**
  174. * @desc : 获取角色
  175. * @author : 姜宁
  176. * @date : 2023/1/29 14:28
  177. */
  178. public ResponseResultVO<List<Map<String, Object>>> getRole(Map<String, Object> param) {
  179. // 获取系统基础数据
  180. List<Map<String, Object>> list = commonMapper.getRole(param);
  181. return ResponseResultUtil.success(list);
  182. }
  183. /**
  184. * @desc : 获取员工信息
  185. * @author : 周兴
  186. * @date : 2023/2/2 13:11
  187. */
  188. public ResponseResultVO<List<Map<String, Object>>> getStaff(Map<String, Object> param) {
  189. // 获取员工
  190. List<Map<String, Object>> list = commonMapper.getStaffByPage(param);
  191. return ResponseResultUtil.success(list);
  192. }
  193. /**
  194. * @desc : 获取员工
  195. * @author : 姜宁
  196. * @date : 2023/1/29 17:01
  197. */
  198. public ResponseResultVO<PageList<Map<String, Object>>> getStaffByPage(Map<String, Object> param) {
  199. // 校验分页参数
  200. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  201. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  202. }
  203. // 分页参数赋值
  204. param = this.getLimit(param);
  205. return super.mergeListWithCount(param, commonMapper.getStaffByPage(param),
  206. commonMapper.getStaffCountByPage(param));
  207. }
  208. /**
  209. * @desc : 查询系统参数
  210. * @author : 周兴
  211. * @date : 2023/1/29 17:04
  212. */
  213. public ResponseResultVO getSettingValue(Map<String, Object> param) {
  214. if (param.get("code").getClass().getName() == "java.util.ArrayList") {
  215. param.put("codes", param.get("code"));
  216. // 如果是数组,那么调用多个的查询
  217. Map<String, Map<String, String>> settingMap = commonMapper.getSettingValues(param);
  218. // 定义返回值
  219. JSONObject object = JSONObject.parseObject(((PGobject) settingMap.get("f_get_setting_values")).getValue());
  220. return ResponseResultUtil.success(object);
  221. } else {
  222. // 单个
  223. String setting = commonMapper.getSettingValue(param);
  224. // 定义返回值
  225. return ResponseResultUtil.success(setting);
  226. }
  227. }
  228. /**
  229. * @desc : 获取工厂区域
  230. * @author : 常皓宁
  231. * @date : 2023/1/30 11:33
  232. */
  233. public ResponseResultVO<List<Map<String, Object>>> getFactorySpace(Map<String, Object> param) {
  234. // 获取工厂区域
  235. List<Map<String, Object>> list = commonMapper.getFactorySpace(param);
  236. return ResponseResultUtil.success(list);
  237. }
  238. /**
  239. * @desc : 查询系统参数分类
  240. * @author : 夏常明
  241. * @date : 2023/1/30 16:05
  242. */
  243. public ResponseResultVO<List<Map<String, Object>>> getSettingKind(Map<String, Object> param) {
  244. // 获取系统基础数据
  245. List<Map<String, Object>> list = commonMapper.getSettingKind(param);
  246. return ResponseResultUtil.success(list);
  247. }
  248. /**
  249. * @desc : 设置分页参数
  250. * @author : 姜宁
  251. * @date : 2023/2/1 14:00
  252. */
  253. private Map<String, Object> getLimit(Map<String, Object> param) {
  254. if (param.get("limit") != null) {
  255. param.put("currentPage", 1);
  256. param.put("pageSize", param.get("limit"));
  257. }
  258. param.put("start", ((int) param.get("currentPage") - 1) * (int) param.get("pageSize"));
  259. param.put("end", param.get("pageSize"));
  260. return param;
  261. }
  262. /**
  263. * @desc : 获取组织部门
  264. * @author : 姜宁
  265. * @date : 2023/2/1 14:09
  266. */
  267. public ResponseResultVO<PageList<Map<String, Object>>> getOrganizationByPage(Map<String, Object> param) {
  268. // 校验分页参数
  269. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  270. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  271. }
  272. // 分页参数赋值
  273. param = this.getLimit(param);
  274. return super.mergeListWithCount(param, commonMapper.getOrganizationByPage(param),
  275. commonMapper.getOrganizationCountByPage(param));
  276. }
  277. /**
  278. * @desc : 获取窑炉
  279. * @author : 常皓宁
  280. * @date : 2023/2/1 16:21
  281. */
  282. public ResponseResultVO<List<Map<String, Object>>> getKiln(Map<String, Object> param) {
  283. // 获取窑炉
  284. List<Map<String, Object>> list = commonMapper.getKiln(param);
  285. return ResponseResultUtil.success(list);
  286. }
  287. /**
  288. * @desc : 获取窑炉分页
  289. * @author : 洪旭东
  290. * @date : 2023-03-07 09:34
  291. */
  292. public ResponseResultVO<PageList<Map<String, Object>>> getKilnByPage(Map<String, Object> param) {
  293. // 校验分页参数
  294. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  295. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  296. }
  297. // 分页参数赋值
  298. this.getLimit(param);
  299. return super.mergeListWithCount(param, commonMapper.getKiln(param),
  300. commonMapper.countKiln(param));
  301. }
  302. /**
  303. * @desc : 查询模具型号
  304. * @author : 洪旭东
  305. * @date : 2023-02-03 10:35
  306. */
  307. public ResponseResultVO<List<Map<String, Object>>> getModelMould(Map<String, Object> param) {
  308. // 查询模具型号
  309. List<Map<String, Object>> list = commonMapper.getModelMould(param);
  310. return ResponseResultUtil.success(list);
  311. }
  312. /**
  313. * @desc : 获取窑车位置
  314. * @author : 常皓宁
  315. * @date : 2023/2/2 13:08
  316. */
  317. public ResponseResultVO<List<Map<String, Object>>> getKilnCarPlace(Map<String, Object> param) {
  318. // 获取窑车位置
  319. List<Map<String, Object>> list = commonMapper.getKilnCarPlace(param);
  320. return ResponseResultUtil.success(list);
  321. }
  322. /**
  323. * @desc : 获取用户
  324. * @author : 洪旭东
  325. * @date : 2023-02-03 11:45
  326. */
  327. public ResponseResultVO<PageList<Map<String, Object>>> getUserByPage(Map<String, Object> param) {
  328. this.getLimit(param);
  329. return super.mergeListWithCount(param, commonMapper.getUser(param),
  330. commonMapper.countUser(param));
  331. }
  332. /**
  333. * @desc : 获取产品视图
  334. * @author : 夏常明
  335. * @date : 2023/2/3 9:44
  336. */
  337. public ResponseResultVO<List<Map<String, Object>>> getProductView(Map<String, Object> param) {
  338. // 获取产品视图
  339. List<Map<String, Object>> list = commonMapper.getProductView(param);
  340. return ResponseResultUtil.success(list);
  341. }
  342. /**
  343. * @desc : 获取产品商标
  344. * @author : 夏常明
  345. * @date : 2023/2/3 10:23
  346. */
  347. public ResponseResultVO<List<Map<String, Object>>> getProductLogo(Map<String, Object> param) {
  348. // 获取产品商标
  349. List<Map<String, Object>> list = commonMapper.getProductLogo(param);
  350. return ResponseResultUtil.success(list);
  351. }
  352. /**
  353. * @desc : 获取产品釉色
  354. * @author : 夏常明
  355. * @date : 2023/2/3 13:14
  356. */
  357. public ResponseResultVO<List<Map<String, Object>>> getProductColour(Map<String, Object> param) {
  358. // 获取产品商标
  359. List<Map<String, Object>> list = commonMapper.getProductColour(param);
  360. return ResponseResultUtil.success(list);
  361. }
  362. /**
  363. * @desc : 查询产品ERP物料
  364. * @author : 洪旭东
  365. * @date : 2023-05-12 13:48
  366. */
  367. public ResponseResultVO<List<Map<String, Object>>> getProductErpSku(Map<String, Object> param) {
  368. List<Map<String, Object>> list = commonMapper.getProductErpSku(param);
  369. return ResponseResultUtil.success(list);
  370. }
  371. /**
  372. * @desc : 获取模具档案
  373. * @author : 洪旭东
  374. * @date : 2023-02-07 13:05
  375. */
  376. public ResponseResultVO<PageList<Map<String, Object>>> getMouldByPage(Map<String, Object> param) {
  377. this.getLimit(param);
  378. return super.mergeListWithCount(param, commonMapper.getMould(param),
  379. commonMapper.countMould(param));
  380. }
  381. /**
  382. * @desc : 获取数据字典
  383. * @author : 姜宁
  384. * @date : 2023/2/7 14:47
  385. */
  386. public ResponseResultVO<List<Map<String, Object>>> getDictionaryData(Map<String, Object> param) {
  387. // 获取数据字典
  388. List<Map<String, Object>> list = commonMapper.getDictionaryData(param);
  389. return ResponseResultUtil.success(list);
  390. }
  391. /**
  392. * @desc : 获取最大窑车序号
  393. * @author : 常皓宁
  394. * @date : 2023/2/7 14:36
  395. */
  396. public ResponseResultVO<Integer> getMaxCarNo(Map<String, Object> param) {
  397. // 获取系统基础数据
  398. Integer maxCarNo = commonMapper.getMaxCarNo(param);
  399. maxCarNo = maxCarNo == null ? 1 : (maxCarNo + 1);
  400. return ResponseResultUtil.success(maxCarNo);
  401. }
  402. /**
  403. * @desc : 获取产品位置
  404. * @date : 2023/2/8 14:22
  405. * @author : 寇珊珊
  406. */
  407. public ResponseResultVO<List<Map<String, Object>>> getProductPlace(Map<String, Object> param) {
  408. List<Map<String, Object>> list = commonMapper.getProductPlace(param);
  409. return ResponseResultUtil.success(list);
  410. }
  411. /**
  412. * @desc : 获取模具型号
  413. * @author : 姜宁
  414. * @date : 2023/2/8 15:43
  415. */
  416. public ResponseResultVO<PageList<Map<String, Object>>> getModelMouldByPage(Map<String, Object> param) {
  417. // 校验分页参数
  418. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  419. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  420. }
  421. // 分页参数赋值
  422. param = this.getLimit(param);
  423. return super.mergeListWithCount(param, commonMapper.getModelMouldByPage(param),
  424. commonMapper.getModelMouldCountByPage(param));
  425. }
  426. /**
  427. * @desc : 获取产品型号数量
  428. * @author : 洪旭东
  429. * @date : 2023-02-08 11:21
  430. */
  431. public ResponseResultVO<PageList<Map<String, Object>>> getModelProduct(Map<String, Object> param) {
  432. this.getLimit(param);
  433. return super.mergeListWithCount(param, commonMapper.getModelProduct(param),
  434. commonMapper.countModelProduct(param));
  435. }
  436. /**
  437. * @desc : 获取获取载具型号
  438. * @author : 常皓宁
  439. * @date : 2023/2/7 14:36
  440. */
  441. public ResponseResultVO<List<Map<String, Object>>> getModelCarrier(Map<String, Object> param) {
  442. // 获取获取载具型号
  443. List<Map<String, Object>> list = commonMapper.getModelCarrier(param);
  444. return ResponseResultUtil.success(list);
  445. }
  446. /**
  447. * @desc : 获取获取设备型号
  448. * @author : 常皓宁
  449. * @date : 2023/2/7 14:36
  450. */
  451. public ResponseResultVO<List<Map<String, Object>>> getModelEquipment(Map<String, Object> param) {
  452. // 获取获取载具型号
  453. List<Map<String, Object>> list = commonMapper.getModelEquipment(param);
  454. return ResponseResultUtil.success(list);
  455. }
  456. /**
  457. * @desc : 根据模具型号id 查询模具产出型号和可变更产品型号
  458. * @author : 夏常明
  459. * @date : 2023/2/9 10:09
  460. */
  461. public ResponseResultVO<List<Map<String, Object>>> getMouldOutputById(Map<String, Object> param) {
  462. //模具产出型号
  463. List<Map<String, Object>> MouldOutputList = commonMapper.getMouldOutputById(param);
  464. // 返回的staffList需要重新赋值
  465. if (!CollectionUtils.isEmpty(MouldOutputList)) {
  466. for (Map<String, Object> stringObjectMap : MouldOutputList) {
  467. if (stringObjectMap.get("modelProductList") != null) {
  468. String labelString = ((PGobject) stringObjectMap.get("modelProductList")).getValue();
  469. JSONArray object = JSONArray.parseArray(labelString);
  470. stringObjectMap.replace("modelProductList", object);
  471. }
  472. }
  473. }
  474. return ResponseResultUtil.success(MouldOutputList);
  475. }
  476. /**
  477. * @desc : 根据模具型号id 查询模具产出型号和可变更产品型号
  478. * @author : 夏常明
  479. * @date : 2023/2/9 10:09
  480. */
  481. public ResponseResultVO<List<Map<String, Object>>> getModelPdt(Map<String, Object> param) {
  482. //模具产出型号
  483. List<Map<String, Object>> ModelPdtList = commonMapper.getModelPdt(param);
  484. return ResponseResultUtil.success(ModelPdtList);
  485. }
  486. /**
  487. * @desc : 查询产品缺陷扣罚数据
  488. * @author : 夏常明
  489. * @date : 2023/2/10 11:46
  490. */
  491. public ResponseResultVO<List<Map<String, Object>>> getDefectFines(Map<String, Object> param) {
  492. // 查询产品缺陷扣罚数据
  493. List<Map<String, Object>> list = commonMapper.getDefectFines(param);
  494. return ResponseResultUtil.success(list);
  495. }
  496. /**
  497. * @desc : 查询打印模板分类
  498. * @author : 常皓宁
  499. * @date : 2023/2/14 14:35
  500. */
  501. public ResponseResultVO<List<Map<String, Object>>> getLabelPrintType(Map<String, Object> param) {
  502. // 查询产品缺陷扣罚数据
  503. List<Map<String, Object>> list = commonMapper.getLabelPrintType(param);
  504. return ResponseResultUtil.success(list);
  505. }
  506. /**
  507. * @desc : 获取成型线分组
  508. * @author : 洪旭东
  509. * @date : 2023-02-15 13:34
  510. */
  511. public ResponseResultVO<PageList<Map<String, Object>>> getMoldlineGroupByPage(Map<String, Object> param) {
  512. this.getLimit(param);
  513. return super.mergeListWithCount(param, commonMapper.getMoldlineGroup(param),
  514. commonMapper.countMoldlineGroup(param));
  515. }
  516. /**
  517. * @desc : 查询工位
  518. * @author : 夏常明
  519. * @date : 2023/2/15 14:44
  520. */
  521. public ResponseResultVO<List<Map<String, Object>>> getWorkStation(Map<String, Object> param) {
  522. // 查询工位
  523. List<Map<String, Object>> list = commonMapper.getWorkStation(param);
  524. return ResponseResultUtil.success(list);
  525. }
  526. /**
  527. * @desc : 查询工位 分页
  528. * @author : 洪旭东
  529. * @date : 2023-03-01 14:45
  530. */
  531. public ResponseResultVO<PageList<Map<String, Object>>> getWorkStationByPage(Map<String, Object> param) {
  532. this.getLimit(param);
  533. return super.mergeListWithCount(param, commonMapper.getWorkStation(param),
  534. commonMapper.countWorkStation(param));
  535. }
  536. /**
  537. * @desc : 获取工艺节点
  538. * @author : 常皓宁
  539. * @date : 2023/2/15 16:12
  540. */
  541. public ResponseResultVO<PageList<Map<String, Object>>> getProcessNodeByPage(Map<String, Object> param) {
  542. // 校验分页参数
  543. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  544. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  545. }
  546. // 分页参数赋值
  547. param = this.getLimit(param);
  548. return super.mergeListWithCount(param, commonMapper.getProcessNodeByPage(param),
  549. commonMapper.getProcessNodeCountByPage(param));
  550. }
  551. /**
  552. * @desc : 获取工号
  553. * @author : 常皓宁
  554. * @date : 2023/2/17 15:41
  555. */
  556. public ResponseResultVO<List<Map<String, Object>>> getWorkStationUser(Map<String, Object> param) {
  557. // 查询工位
  558. List<Map<String, Object>> list = commonMapper.getWorkStationUser(param);
  559. return ResponseResultUtil.success(list);
  560. }
  561. /**
  562. * @desc : 获取工号(分页)
  563. * @author : 周兴
  564. * @date : 2023/2/20 10:39
  565. */
  566. public ResponseResultVO<PageList<Map<String, Object>>> getWorkStationUserPage(Map<String, Object> param) {
  567. // 校验分页参数
  568. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  569. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  570. }
  571. // 分页参数赋值
  572. param = this.getLimit(param);
  573. return super.mergeListWithCount(param, commonMapper.getWorkStationUser(param),
  574. commonMapper.getWorkStationUserCount(param));
  575. }
  576. /**
  577. * @desc : 根据成型线Id获取成型记录信息
  578. * @author : 周兴
  579. * @date : 2023/2/18 19:47
  580. */
  581. public ResponseResultVO<List<Map<String, Object>>> getMoldingItemByMoldlineId(Map<String, Object> param) {
  582. // 查询成型记录信息
  583. List<Map<String, Object>> list = commonMapper.getMoldingItemByMoldlineId(param);
  584. return ResponseResultUtil.success(list);
  585. }
  586. /**
  587. * @desc : 产品信息(条码变更)
  588. * @author : 夏常明
  589. * @date : 2023/2/20 10:39
  590. */
  591. public ResponseResultVO<PageList<Map<String, Object>>> getProductForChange(Map<String, Object> param) {
  592. // 校验分页参数
  593. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  594. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  595. }
  596. // 分页参数赋值
  597. param = this.getLimit(param);
  598. return super.mergeListWithCount(param, commonMapper.getProductForChange(param),
  599. commonMapper.getProductForChangeCount(param));
  600. }
  601. /**
  602. * @desc : 查询损坯原因/产品缺陷/未成型原因
  603. * @author : 周兴
  604. * @date : 2023/2/18 19:47
  605. */
  606. public ResponseResultVO<List<Map<String, Object>>> getProductDefect(Map<String, Object> param) {
  607. // 查询损坯原因/产品缺陷/未成型原因
  608. List<Map<String, Object>> list = commonMapper.getProductDefect(param);
  609. return ResponseResultUtil.success(list);
  610. }
  611. /**
  612. * @desc : 产品信息(条码变更)
  613. * @author : 夏常明
  614. * @date : 2023/2/20 10:39
  615. */
  616. public ResponseResultVO<PageList<Map<String, Object>>> getColourForSet(Map<String, Object> param) {
  617. // 校验分页参数
  618. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  619. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  620. }
  621. // 分页参数赋值
  622. param = this.getLimit(param);
  623. return super.mergeListWithCount(param, commonMapper.getColourForSet(param),
  624. commonMapper.getColourForSetCount(param));
  625. }
  626. /**
  627. * @desc : 产品信息(商标釉色)
  628. * @author : 夏常明
  629. * @date : 2023/2/20 10:39
  630. */
  631. public ResponseResultVO<PageList<Map<String, Object>>> getLogoForSet(Map<String, Object> param) {
  632. // 校验分页参数
  633. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  634. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  635. }
  636. // 分页参数赋值
  637. param = this.getLimit(param);
  638. return super.mergeListWithCount(param, commonMapper.getLogoForSet(param),
  639. commonMapper.getColourForSetCount(param));
  640. }
  641. /**
  642. * @desc : 查询成型产品型号
  643. * @author : 洪旭东
  644. * @date : 2023-04-19 13:00
  645. */
  646. public ResponseResultVO<PageList<Map<String, Object>>> getProductModel(Map<String, Object> param) {
  647. // 校验分页参数
  648. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  649. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  650. }
  651. // 分页参数赋值
  652. this.getLimit(param);
  653. return super.mergeListWithCount(param, commonMapper.getProductModel(param),
  654. commonMapper.getColourForSetCount(param));
  655. }
  656. /**
  657. * @desc : 根据工号编码值等查询工号
  658. * @date : 2023/2/21 16:46
  659. * @author : 寇珊珊
  660. */
  661. public ResponseResultVO<List<Map<String, Object>>> getUserByCode(Map<String, Object> param) {
  662. List<Map<String, Object>> list = commonMapper.getUserByCode(param);
  663. return ResponseResultUtil.success(list);
  664. }
  665. /**
  666. * @desc : 根据工号编码值等查询工号分页
  667. * @date : 2023/2/21 16:46
  668. * @author : 寇珊珊
  669. */
  670. public ResponseResultVO<PageList<Map<String, Object>>> getUserByCodePage(Map<String, Object> param) {
  671. // 校验分页参数
  672. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  673. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  674. }
  675. // 分页参数赋值
  676. param = this.getLimit(param);
  677. param.put("userType", Constant.IntegerConstant.USER_TYPE_WORK_TEAM.getValue());
  678. return super.mergeListWithCount(param, commonMapper.getUserByCode(param),
  679. commonMapper.getUserByCodeCount(param));
  680. }
  681. /**
  682. * @desc : 获取工艺节点
  683. * @author : 常皓宁
  684. * @date : 2023/2/15 16:12
  685. */
  686. public ResponseResultVO<List<Map<String, Object>>> getProcessNode(Map<String, Object> param) {
  687. // 查询工艺节点数据
  688. List<Map<String, Object>> list = commonMapper.getProcessNode(param);
  689. return ResponseResultUtil.success(list);
  690. }
  691. /**
  692. * @desc : 产品信息(条码变更)
  693. * @author : 夏常明
  694. * @date : 2023/2/20 10:39
  695. */
  696. public ResponseResultVO<PageList<Map<String, Object>>> getMoldLinePage(Map<String, Object> param) {
  697. // 校验分页参数
  698. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  699. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  700. }
  701. // 分页参数赋值
  702. param = this.getLimit(param);
  703. return super.mergeListWithCount(param, commonMapper.getMoldLinePage(param),
  704. commonMapper.getMoldLinePageCount(param));
  705. }
  706. /**
  707. * @desc : 工位工号(工位打卡选择工位)
  708. * @author : 夏常明
  709. * @date : 2023/2/27 14:52
  710. */
  711. public ResponseResultVO<List<Map<String, Object>>> getWsStation(Map<String, Object> param) {
  712. // 查询工艺节点数据
  713. List<Map<String, Object>> list = commonMapper.getWsStation(param);
  714. return ResponseResultUtil.success(list);
  715. }
  716. /**
  717. * @desc : 根据用户Id获取班组信息
  718. * @author : 周兴
  719. * @date : 2023/2/27 14:52
  720. */
  721. public ResponseResultVO<List<Map<String, Object>>> getWorkTeamByUserId(Map<String, Object> param) {
  722. List<Map<String, Object>> list = commonMapper.getWorkTeamByUserId(param);
  723. return ResponseResultUtil.success(list);
  724. }
  725. /**
  726. * @desc : 查询产品分级 分页
  727. * @author : 洪旭东
  728. * @date : 2023-03-03 09:17
  729. */
  730. public ResponseResultVO<PageList<Map<String, Object>>> getProductGradeByPage(Map<String, Object> param) {
  731. this.getLimit(param);
  732. return super.mergeListWithCount(param, commonMapper.getProductGrade(param),
  733. commonMapper.countProductGrade(param));
  734. }
  735. /**
  736. * @desc : 查询产品分级
  737. * @author : 洪旭东
  738. * @date : 2023-03-03 09:17
  739. */
  740. public ResponseResultVO<List<Map<String, Object>>> getProductGrade(Map<String, Object> param) {
  741. return ResponseResultUtil.success(commonMapper.getProductGrade(param));
  742. }
  743. /**
  744. * @desc : 查询工艺流程(分页)
  745. * @author : 夏常明
  746. * @date : 2023/3/3 14:05
  747. */
  748. public ResponseResultVO<PageList<Map<String, Object>>> getProcessFlow(Map<String, Object> param) {
  749. // 校验分页参数
  750. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  751. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  752. }
  753. // 分页参数赋值
  754. param = this.getLimit(param);
  755. return super.mergeListWithCount(param, commonMapper.getProcessFlow(param),
  756. commonMapper.getProcessFlowCount(param));
  757. }
  758. /**
  759. * @desc : 查询产品分类(分页)
  760. * @author : 夏常明
  761. * @date : 2023/3/3 14:05
  762. */
  763. public ResponseResultVO<PageList<Map<String, Object>>> getModelCategoryPage(Map<String, Object> param) {
  764. // 校验分页参数
  765. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  766. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  767. }
  768. // 分页参数赋值
  769. param = this.getLimit(param);
  770. return super.mergeListWithCount(param, commonMapper.getModelCategoryPage(param),
  771. commonMapper.getModelCategoryCount(param));
  772. }
  773. /**
  774. * @desc : 查询打印机
  775. * @author : 夏常明
  776. * @date : 2023/3/7 10:41
  777. */
  778. public ResponseResultVO<List<Map<String, Object>>> getLabelPrinter(Map<String, Object> param) {
  779. return ResponseResultUtil.success(commonMapper.getLabelPrinter(param));
  780. }
  781. /**
  782. * @desc : 查询打印模板
  783. * @author : 夏常明
  784. * @date : 2023/3/7 10:41
  785. */
  786. public ResponseResultVO<List<Map<String, Object>>> getLabelPrintLayout(Map<String, Object> param) {
  787. return ResponseResultUtil.success(commonMapper.getLabelPrintLayout(param));
  788. }
  789. /**
  790. * @desc : 获取用户
  791. * @author : 姜宁
  792. * @date : 2023/3/14 9:51
  793. */
  794. public ResponseResultVO<List<Map<String, Object>>> getUser(Map<String, Object> param) {
  795. return ResponseResultUtil.success(commonMapper.getUser(param));
  796. }
  797. /**
  798. * @desc : 查询工种 分页
  799. * @author : 洪旭东
  800. * @date : 2023-03-20 11:23
  801. */
  802. public ResponseResultVO<PageList<Map<String, Object>>> getJobByPage(Map<String, Object> param) {
  803. this.getLimit(param);
  804. return super.mergeListWithCount(param, commonMapper.getJob(param),
  805. commonMapper.countJob(param));
  806. }
  807. /**
  808. * @desc : 查询班组员工
  809. * @author : 洪旭东
  810. * @date : 2023-03-20 13:13
  811. */
  812. public ResponseResultVO<PageList<Map<String, Object>>> getTeamStaff(Map<String, Object> param) {
  813. return super.mergeListWithCount(param, commonMapper.getTeamStaff(param),
  814. commonMapper.countTeamStaff(param));
  815. }
  816. /**
  817. * @desc : 获取结转账务日期
  818. * @author : 姜宁
  819. * @date : 2023/3/21 9:24
  820. */
  821. public ResponseResultVO<String> getCarryoverAccountDate(Map<String, Object> param) {
  822. // 获取系统参数默认结转账务日
  823. Map<String, Object> sysParam = new HashMap<>();
  824. sysParam.put("code", Constant.StringConstant.SYS_PDM_001.getName());
  825. sysParam.put("ftyId", param.get("ftyId"));
  826. String accountDay = commonMapper.getSettingValue(sysParam);
  827. // 获取账务日开始和结束
  828. Map<String, Object> accountParam = new HashMap<>();
  829. accountParam.put("accountDay", accountDay.equals("") ? null : Integer.parseInt(accountDay));
  830. accountParam.put("month", param.get("month"));
  831. String accountDate = commonMapper.selectAccountDate(accountParam);
  832. // 获取开始日和结束日
  833. List stringDate = Arrays.asList(accountDate.split(String.valueOf(',')));
  834. if (CollectionUtils.isEmpty(stringDate) || stringDate.size() < 4) {
  835. return ResponseResultUtil.error(ResponseCodeEnum.SELECT_ACCOUNDATE_FAIL);
  836. }
  837. return ResponseResultUtil.success(accountDate);
  838. }
  839. /**
  840. * @desc : 获取工位(工位打卡选择工位)
  841. * @author : 姜宁
  842. * @date : 2023/3/30 10:38
  843. */
  844. public ResponseResultVO<List<Map<String, Object>>> getWsStationByUser(Map<String, Object> param) {
  845. List<Map<String, Object>> list = new ArrayList<>();
  846. //获取工位工号
  847. List<Map<String, Object>> list1 = commonMapper.getWsStation(param);
  848. //获取工位(工位打卡选择工位,工号未绑定工位时,获取工序工号绑定的工位)
  849. List<Map<String, Object>> list2 = commonMapper.getWsStationByNode(param);
  850. //获取工位(工位打卡选择工位,工位未绑定工序和用户)
  851. List<Map<String, Object>> list3 = commonMapper.getWsStationNoUser(param);
  852. list.addAll(list1);
  853. list.addAll(list2);
  854. list.addAll(list3);
  855. list = list.stream().distinct().collect(Collectors.toList());
  856. return ResponseResultUtil.success(list);
  857. }
  858. /**
  859. * @desc : 获取湿温度计分页
  860. * @date : 2023/4/3 10:39
  861. * @author : 寇珊珊
  862. */
  863. public ResponseResultVO<PageList<Map<String, Object>>> thmeterRecordByPage(Map<String, Object> param) {
  864. // 分页参数赋值
  865. param = this.getLimit(param);
  866. return super.mergeListWithCount(param, commonMapper.thmeterRecordByPage(param),
  867. commonMapper.getThmeterRecordByCount(param));
  868. }
  869. /**
  870. * @desc : 获取湿温度计
  871. * @date : 2023/4/3 14:29
  872. * @author : 寇珊珊
  873. */
  874. public ResponseResultVO<List<Map<String, Object>>> getThmeterRecord(Map<String, Object> param) {
  875. return ResponseResultUtil.success(commonMapper.getThmeterRecord(param));
  876. }
  877. /**
  878. * @desc : 获取用户隐藏列信息
  879. * @author : 周兴
  880. * @date : 2023/4/4 15:05
  881. */
  882. public ResponseResultVO<List<Map<String, Object>>> getUserTableInfo(Map<String, Object> param) {
  883. return ResponseResultUtil.success(commonMapper.getUserTableInfo(param));
  884. }
  885. /**
  886. * @desc : 获取用户功能
  887. * @author : 周兴
  888. * @date : 2023/4/4 15:05
  889. */
  890. public ResponseResultVO<List<Map<String, Object>>> getUserFunction(Map<String, Object> param) {
  891. return ResponseResultUtil.success(commonMapper.getUserFunction(param));
  892. }
  893. /**
  894. * @desc : 查导航菜单(自定义报表用)
  895. * @author : 周兴
  896. * @date : 2023/4/4 15:05
  897. */
  898. public ResponseResultVO<List<Map<String, Object>>> getMenuNavigation(Map<String, Object> param) {
  899. return ResponseResultUtil.success(commonMapper.getMenuNavigation(param));
  900. }
  901. /**
  902. * @desc : 查询标签打印项目
  903. * @author : 洪旭东
  904. * @date : 2023-04-12 13:24
  905. */
  906. public ResponseResultVO<List<Map<String, Object>>> getLabelPrintItem(Map<String, Object> param) {
  907. return ResponseResultUtil.success(commonMapper.getLabelPrintItem(param));
  908. }
  909. /**
  910. * @desc : 获取员工用于报工记录查询
  911. * @date : 2023/4/17 15:07
  912. * @author : 寇珊珊
  913. */
  914. public ResponseResultVO<PageList<Map<String, Object>>> getStaffWithWork(Map<String, Object> param) {
  915. // 校验分页参数
  916. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  917. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  918. }
  919. // 分页参数赋值
  920. param = this.getLimit(param);
  921. return super.mergeListWithCount(param, commonMapper.getStaffWithWorkByPage(param),
  922. commonMapper.getStaffWithWorkByCount(param));
  923. }
  924. /**
  925. * @desc : 查询标签分类的类型
  926. * @author : 洪旭东
  927. * @date : 2023-05-08 17:03
  928. */
  929. public ResponseResultVO<List<Map<String, Object>>> getLabelPrintTypeKind() {
  930. return ResponseResultUtil.success(commonMapper.getLabelPrintTypeKind(new HashMap<>()));
  931. }
  932. /**
  933. * @desc : 查询产品型号标签
  934. * @author : 洪旭东
  935. * @date : 2023-05-11 15:00
  936. */
  937. public ResponseResultVO<List<Map<String, Object>>> getModelProductLabelType() {
  938. return ResponseResultUtil.success(commonMapper.getModelProductLabelType(new HashMap<>()));
  939. }
  940. /**
  941. * @desc : 获取窑炉类型
  942. * @author : 洪旭东
  943. * @date : 2023-05-19 10:38
  944. */
  945. public ResponseResultVO<List<Map<String, Object>>> getKilnType(Map<String, Object> param) {
  946. return ResponseResultUtil.success(commonMapper.getKilnType(param));
  947. }
  948. /**
  949. * @desc : 获取成型线类型
  950. * @author : 洪旭东
  951. * @date : 2023-05-19 10:38
  952. */
  953. public ResponseResultVO<List<Map<String, Object>>> getMoldlineType(Map<String, Object> param) {
  954. return ResponseResultUtil.success(commonMapper.getMoldlineType(param));
  955. }
  956. /**
  957. * @desc : 获取物料编码
  958. * @date : 2023/5/24 14:05
  959. * @author : 寇珊珊
  960. */
  961. public ResponseResultVO<PageList<Map<String, Object>>> getModelMaterialByPage(Map<String, Object> param) {
  962. // 校验分页参数
  963. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  964. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  965. }
  966. // 分页参数赋值
  967. param = this.getLimit(param);
  968. return super.mergeListWithCount(param, commonMapper.getModelMaterialByPage(param),
  969. commonMapper.getModelMaterialCountByPage(param));
  970. }
  971. /**
  972. * @desc : 获取物料编码
  973. * @date : 2023/6/30 9:51
  974. * @author : 寇珊珊
  975. */
  976. public ResponseResultVO<List<Map<String, Object>>> getModelMaterial(Map<String, Object> param) {
  977. return ResponseResultUtil.success(commonMapper.getModelMaterial(param));
  978. }
  979. /**
  980. * @desc : 产品信息数量
  981. * @date : 2023/5/26 13:48
  982. * @author : 寇珊珊
  983. */
  984. public ResponseResultVO<List<Map<String, Object>>> getProductForChangeNoPage(Map<String, Object> param) {
  985. return ResponseResultUtil.success(commonMapper.getProductForChangeNoPage(param));
  986. }
  987. /**
  988. * @desc : 获取数据类型
  989. * @author : 周兴
  990. * @date : 2023/6/2 11:01
  991. */
  992. public ResponseResultVO<List<Map<String, Object>>> getValueKind(Map<String, Object> param) {
  993. return ResponseResultUtil.success(commonMapper.getValueKind(param));
  994. }
  995. /**
  996. * @desc : 获取计量单位
  997. * @author : 常皓宁
  998. * @date : 2023/6/15 8:46
  999. */
  1000. public ResponseResultVO<List<Map<String, Object>>> getModelUnits(Map<String, Object> param) {
  1001. return ResponseResultUtil.success(commonMapper.getModelUnits(param));
  1002. }
  1003. /**
  1004. * @desc : 获取产品型号、物料型号
  1005. * @author : 常皓宁
  1006. * @date : 2023/6/15 13:37
  1007. */
  1008. public ResponseResultVO<List<Map<String, Object>>> getModelBase(Map<String, Object> param) {
  1009. return ResponseResultUtil.success(commonMapper.getModelBase(param));
  1010. }
  1011. /**
  1012. * @desc : 获取产品型号、物料型号分页
  1013. * @author : 常皓宁
  1014. * @date : 2023/6/15 13:37
  1015. */
  1016. public ResponseResultVO<PageList<Map<String, Object>>> getModelBaseByPage(Map<String, Object> param) {
  1017. this.getLimit(param);
  1018. return super.mergeListWithCount(param, commonMapper.getModelBase(param),
  1019. commonMapper.countModelBase(param));
  1020. }
  1021. /**
  1022. * @desc : 获取报工项目
  1023. * @author : 付斌
  1024. * @date : 2023/6/19 9:12
  1025. */
  1026. public ResponseResultVO<List<Map<String, Object>>> getWorkProject(Map<String, Object> param) {
  1027. // 查询工艺节点数据
  1028. List<Map<String, Object>> list = commonMapper.getWorkProject(param);
  1029. return ResponseResultUtil.success(list);
  1030. }
  1031. /**
  1032. * @desc : 获取报工项目
  1033. * @author : 付斌
  1034. * @date : 2023/6/19 9:12
  1035. */
  1036. public ResponseResultVO<PageList<Map<String, Object>>> getWorkProjectByPage(Map<String, Object> param) {
  1037. // 校验分页参数
  1038. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  1039. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  1040. }
  1041. // 分页参数赋值
  1042. param = this.getLimit(param);
  1043. return super.mergeListWithCount(param, commonMapper.getWorkProjectByPage(param),
  1044. commonMapper.getWorkProjectCountByPage(param));
  1045. }
  1046. /**
  1047. * @desc : 查询产品缺陷
  1048. * @author : 常皓宁
  1049. * @date : 2023/6/25 10:05
  1050. */
  1051. public ResponseResultVO<PageList<Map<String, Object>>> getProductDefectsByPage(Map<String, Object> param) {
  1052. this.getLimit(param);
  1053. return super.mergeListWithCount(param, commonMapper.getProductDefects(param),
  1054. commonMapper.countProductDefects(param));
  1055. }
  1056. /**
  1057. * @desc : 查询产品缺陷
  1058. * @author : 常皓宁
  1059. * @date : 2023/6/25 10:05
  1060. */
  1061. public ResponseResultVO<List<Map<String, Object>>> getProductDefects(Map<String, Object> param) {
  1062. return ResponseResultUtil.success(commonMapper.getProductDefects(param));
  1063. }
  1064. /**
  1065. * @desc : 获取应用
  1066. * @author : 洪旭东
  1067. * @date : 2023-06-30 14:56
  1068. */
  1069. public ResponseResultVO<List<Map<String, String>>> getApplication() {
  1070. return ResponseResultUtil.success(commonMapper.getApplication());
  1071. }
  1072. /**
  1073. * @desc : 获取产品
  1074. * @date : 2023/7/14 14:44
  1075. * @author : 寇珊珊
  1076. */
  1077. public ResponseResultVO<Map<String, String>> getProduct(Map<String, Object> param) {
  1078. return ResponseResultUtil.success(commonMapper.getProduct(param));
  1079. }
  1080. /**
  1081. * @desc : 获取工位打印机
  1082. * @date : 2023/7/14 14:44
  1083. * @author : 寇珊珊
  1084. */
  1085. public ResponseResultVO<List<Map<String, String>>> getWsPrinter(Map<String, Object> param) {
  1086. return ResponseResultUtil.success(commonMapper.getWsPrinter(param));
  1087. }
  1088. /**
  1089. * @desc : 获取仓库
  1090. * @author : 洪旭东
  1091. * @date : 2023-08-09 14:31
  1092. */
  1093. public ResponseResultVO<PageList<Map<String, Object>>> getWarehouseByPage(Map<String, Object> param) {
  1094. this.getLimit(param);
  1095. return super.mergeListWithCount(param, commonMapper.getWarehouseByPage(param),
  1096. commonMapper.countWarehouseByPage(param));
  1097. }
  1098. /**
  1099. * @desc : 获取仓位
  1100. * @author : 洪旭东
  1101. * @date : 2023-08-09 14:31
  1102. */
  1103. public ResponseResultVO<PageList<Map<String, Object>>> getWarehousePlaceByPage(Map<String, Object> param) {
  1104. this.getLimit(param);
  1105. return super.mergeListWithCount(param, commonMapper.getWarehousePlaceByPage(param),
  1106. commonMapper.countWarehousePlaceByPage(param));
  1107. }
  1108. /**
  1109. * @desc : 获取单据
  1110. * @author : 周兴
  1111. * @date : 2023/9/14 11:06
  1112. */
  1113. public ResponseResultVO<List<Map<String, Object>>> getDoc(Map<String, Object> param) {
  1114. return ResponseResultUtil.success(commonMapper.getDoc(param));
  1115. }
  1116. /**
  1117. * @desc : 获取下拉选
  1118. * @author : 洪旭东
  1119. * @date : 2023-09-25 09:03
  1120. */
  1121. public ResponseResultVO<List<Map<String, Object>>> getSelectType(Map<String, Object> param) {
  1122. return ResponseResultUtil.success(commonMapper.getSelectType(param));
  1123. }
  1124. /**
  1125. * @desc : 获取放大镜
  1126. * @author : 洪旭东
  1127. * @date : 2023-09-25 09:03
  1128. */
  1129. public ResponseResultVO<List<Map<String, Object>>> getSelectMagnifier(Map<String, Object> param) {
  1130. return ResponseResultUtil.success(commonMapper.getSelectMagnifier(param));
  1131. }
  1132. /**
  1133. * @desc : 获取理化检验单
  1134. * @author : 洪旭东
  1135. * @date : 2023-12-01 16:39
  1136. */
  1137. public ResponseResultVO<PageList<Map<String, Object>>> getPhysicalCollectByPage(Map<String, Object> param) {
  1138. this.getLimit(param);
  1139. return super.mergeListWithCount(param, commonMapper.getPhysicalCollectByPage(param),
  1140. commonMapper.countPhysicalCollectByPage(param));
  1141. }
  1142. /**
  1143. * @desc : 获取生产工单
  1144. * @author : 洪旭东
  1145. * @date : 2023-12-25 10:59
  1146. */
  1147. public ResponseResultVO<PageList<Map<String, Object>>> getSheetProduceByPage(Map<String, Object> param) {
  1148. this.getLimit(param);
  1149. return super.mergeListWithCount(param, commonMapper.getSheetProduceByPage(param),
  1150. commonMapper.countSheetProduceByPage(param));
  1151. }
  1152. /**
  1153. * @desc : 获取载具型号分页查询
  1154. * @author : 姜宁
  1155. * @date : 2024/1/3 10:53
  1156. */
  1157. public ResponseResultVO<PageList<Map<String, Object>>> getModelCarrierByPage(Map<String, Object> param) {
  1158. this.getLimit(param);
  1159. return super.mergeListWithCount(param, commonMapper.getModelCarrierByPage(param),
  1160. commonMapper.countModelCarrierByPage(param));
  1161. }
  1162. /**
  1163. * @desc : 获取商品
  1164. * @author : 姜宁
  1165. * @date : 2023/1/9 13:50
  1166. */
  1167. public ResponseResultVO<List<Map<String, Object>>> getGoods(Map<String, Object> param) {
  1168. // 获取系统基础数据
  1169. List<Map<String, Object>> list = commonMapper.getGoods(param);
  1170. return ResponseResultUtil.success(list);
  1171. }
  1172. /**
  1173. * @desc : 获取商品数量
  1174. * @author : 姜宁
  1175. * @date : 2023/1/29 17:01
  1176. */
  1177. public ResponseResultVO<PageList<Map<String, Object>>> getGoodsPage(Map<String, Object> param) {
  1178. // 校验分页参数
  1179. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  1180. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  1181. }
  1182. // 分页参数赋值
  1183. param = this.getLimit(param);
  1184. return super.mergeListWithCount(param, commonMapper.getGoods(param),
  1185. commonMapper.getGoodsCountByPage(param));
  1186. }
  1187. /**
  1188. * @desc : 获取商品
  1189. * @author : 姜宁
  1190. * @date : 2023/1/9 13:50
  1191. */
  1192. public ResponseResultVO<List<Map<String, Object>>> getCustomer(Map<String, Object> param) {
  1193. // 获取系统基础数据
  1194. List<Map<String, Object>> list = commonMapper.getCustomer(param);
  1195. return ResponseResultUtil.success(list);
  1196. }
  1197. /**
  1198. * @desc : 获取商品数量
  1199. * @author : 姜宁
  1200. * @date : 2023/1/29 17:01
  1201. */
  1202. public ResponseResultVO<PageList<Map<String, Object>>> GetCustomerByPage(Map<String, Object> param) {
  1203. // 校验分页参数
  1204. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  1205. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  1206. }
  1207. // 分页参数赋值
  1208. param = this.getLimit(param);
  1209. return super.mergeListWithCount(param, commonMapper.getCustomer(param),
  1210. commonMapper.getCustomerCountByPage(param));
  1211. }
  1212. /**
  1213. * @desc : 获取供应商
  1214. * @author : 常皓宁
  1215. * @date : 2024/3/1 9:20
  1216. */
  1217. public ResponseResultVO<List<Map<String, Object>>> getSupplier(Map<String, Object> param) {
  1218. // 获取公司
  1219. List<Map<String, Object>> list = commonMapper.getSupplier(param);
  1220. return ResponseResultUtil.success(list);
  1221. }
  1222. /**
  1223. * @desc : 获取供应商(分页)
  1224. * @author : 常皓宁
  1225. * @date : 2024/3/1 9:20
  1226. */
  1227. public ResponseResultVO<PageList<Map<String, Object>>> getSupplierByPage(Map<String, Object> param) {
  1228. // 校验分页参数
  1229. if (param.get("pageSize") == null || param.get("currentPage") == null) {
  1230. return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
  1231. }
  1232. // 分页参数赋值
  1233. param = this.getLimit(param);
  1234. // 定义返回值
  1235. PageList data = new PageList<>();
  1236. // 获取公司
  1237. List<Map<String, Object>> list = commonMapper.getSupplier(param);
  1238. // 获取总数量
  1239. Long total = commonMapper.countSupplier(param);
  1240. // 组装返回值
  1241. data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
  1242. return ResponseResultUtil.success(data);
  1243. }
  1244. }