CommonService.java 56 KB

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