CommonService.java 55 KB

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