Commit 9fa13a2ca7ba0c3d77bafbc17eac7d6e6e320199
Merge branch 'develop4' of http://www.huahengrobot.com:90/wms/wms4 into develop4
# Conflicts: # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
Showing
26 changed files
with
479 additions
and
72 deletions
ant-design-vue-jeecg/package-lock.json
... | ... | @@ -6072,9 +6072,9 @@ |
6072 | 6072 | "integrity": "sha512-6zCYv0bxVP6ppQ/XpZsTQZNDC2zUutl8Yes2TDj7LyIDyBhq2N9JbQjcqQo6mAe8IVfszW5pmE0yHvAYD0zEmQ==" |
6073 | 6073 | }, |
6074 | 6074 | "node_modules/caniuse-lite": { |
6075 | - "version": "1.0.30001097", | |
6076 | - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz", | |
6077 | - "integrity": "sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA==" | |
6075 | + "version": "1.0.30001449", | |
6076 | + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz", | |
6077 | + "integrity": "sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw==" | |
6078 | 6078 | }, |
6079 | 6079 | "node_modules/case-sensitive-paths-webpack-plugin": { |
6080 | 6080 | "version": "2.3.0", |
... | ... | @@ -27024,9 +27024,9 @@ |
27024 | 27024 | "integrity": "sha512-6zCYv0bxVP6ppQ/XpZsTQZNDC2zUutl8Yes2TDj7LyIDyBhq2N9JbQjcqQo6mAe8IVfszW5pmE0yHvAYD0zEmQ==" |
27025 | 27025 | }, |
27026 | 27026 | "caniuse-lite": { |
27027 | - "version": "1.0.30001097", | |
27028 | - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz", | |
27029 | - "integrity": "sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA==" | |
27027 | + "version": "1.0.30001449", | |
27028 | + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz", | |
27029 | + "integrity": "sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw==" | |
27030 | 27030 | }, |
27031 | 27031 | "case-sensitive-paths-webpack-plugin": { |
27032 | 27032 | "version": "2.3.0", |
... | ... |
ant-design-vue-jeecg/package.json
... | ... | @@ -58,13 +58,13 @@ |
58 | 58 | "@vue/cli-service": "^3.3.0", |
59 | 59 | "@vue/eslint-config-standard": "^4.0.0", |
60 | 60 | "babel-eslint": "7.2.3", |
61 | + "compression-webpack-plugin": "^3.1.0", | |
61 | 62 | "eslint": "^5.16.0", |
62 | 63 | "eslint-plugin-vue": "^5.1.0", |
64 | + "html-webpack-plugin": "^4.2.0", | |
63 | 65 | "less": "^3.9.0", |
64 | 66 | "less-loader": "^4.1.0", |
65 | 67 | "vue-template-compiler": "^2.6.10", |
66 | - "html-webpack-plugin": "^4.2.0", | |
67 | - "compression-webpack-plugin": "^3.1.0", | |
68 | 68 | "webpack": "^4.23.0" |
69 | 69 | }, |
70 | 70 | "eslintConfig": { |
... | ... |
ant-design-vue-jeecg/src/views/user/LoginAccount.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <div> |
3 | 3 | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
4 | 4 | <a-form-model-item required prop="username"> |
5 | - <a-input v-model="model.username" size="large" placeholder="请输入帐户名 / admin" @keyup="getWarehouse"> | |
5 | + <a-input v-model="model.username" size="large" placeholder="请输入帐户名 / admin" @blur="getWarehouse"> | |
6 | 6 | <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/> |
7 | 7 | </a-input> |
8 | 8 | </a-form-model-item> |
... | ... | @@ -16,8 +16,8 @@ |
16 | 16 | <a-form-model-item prop="warehouseCode"> |
17 | 17 | <a-select |
18 | 18 | show-search |
19 | - placeholder="请选择仓库" | |
20 | - option-filter-prop="children" | |
19 | + placeholder="请选择仓库!" | |
20 | + option-filter-prop="label" | |
21 | 21 | :filter-option="filterOption" |
22 | 22 | v-model="model.warehouseCode"> |
23 | 23 | <a-select-option v-for="item in warehouseList" :key="item.name" :value="item.code">{{ |
... | ... | @@ -61,10 +61,10 @@ export default { |
61 | 61 | password: [{ |
62 | 62 | required: true, message: '请输入密码!', validator: 'click' |
63 | 63 | }], |
64 | - warehouseCode: [{required: true, message: '请选择仓库', validator: 'click'}], | |
65 | - | |
64 | + warehouseCode: [{ | |
65 | + required: true, message: '请选择仓库!', validator: 'click' | |
66 | + }], | |
66 | 67 | } |
67 | - | |
68 | 68 | } |
69 | 69 | }, |
70 | 70 | created() { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java
... | ... | @@ -120,7 +120,7 @@ public class LoginController { |
120 | 120 | // 用户登录信息 |
121 | 121 | userInfo(sysUser, result, warehouseCode); |
122 | 122 | // update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码 |
123 | -// redisUtil.del(realKey); | |
123 | + // redisUtil.del(realKey); | |
124 | 124 | // update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码 |
125 | 125 | LoginUser loginUser = new LoginUser(); |
126 | 126 | BeanUtils.copyProperties(sysUser, loginUser); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java
... | ... | @@ -28,6 +28,7 @@ import org.jeecg.common.util.oConvertUtils; |
28 | 28 | import org.jeecg.modules.message.websocket.WebSocket; |
29 | 29 | import org.jeecg.modules.system.entity.SysAnnouncement; |
30 | 30 | import org.jeecg.modules.system.entity.SysAnnouncementSend; |
31 | +import org.jeecg.modules.system.entity.SysUser; | |
31 | 32 | import org.jeecg.modules.system.service.ISysAnnouncementSendService; |
32 | 33 | import org.jeecg.modules.system.service.ISysAnnouncementService; |
33 | 34 | import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl; |
... | ... | @@ -334,16 +335,16 @@ public class SysAnnouncementController { |
334 | 335 | @RequestMapping(value = "/listByUser", method = RequestMethod.GET) |
335 | 336 | public Result<Map<String, Object>> listByUser(@RequestParam(required = false, defaultValue = "5") Integer pageSize) { |
336 | 337 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); |
337 | - LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); | |
338 | - String userId = sysUser.getId().toString(); | |
338 | + LoginUser loginUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); | |
339 | + String userId = loginUser.getId().toString(); | |
339 | 340 | // 1.将系统消息补充到用户通告阅读标记表中 |
340 | 341 | LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>(); |
341 | 342 | querySaWrapper.eq(SysAnnouncement::getMsgType, CommonConstant.MSG_TYPE_ALL); // 全部人员 |
342 | 343 | querySaWrapper.eq(SysAnnouncement::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); // 未删除 |
343 | 344 | querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND); // 已发布 |
344 | - querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime()); // 新注册用户不看结束通知 | |
345 | + querySaWrapper.ge(SysAnnouncement::getEndTime, loginUser.getCreateTime()); // 新注册用户不看结束通知 | |
345 | 346 | // update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理-------------------- |
346 | - querySaWrapper.notInSql(SysAnnouncement::getId, "select annt_id from sys_announcement_send where user_id='" + userId + "'"); | |
347 | + querySaWrapper.notInSql(SysAnnouncement::getId, "select annt_id from sys_announcement_send where user_id ='" + userId + "'"); | |
347 | 348 | // update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理-------------------- |
348 | 349 | List<SysAnnouncement> announcements = sysAnnouncementService.list(querySaWrapper); |
349 | 350 | if (announcements.size() > 0) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysUser.java
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java
... | ... | @@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
39 | 39 | import org.springframework.cache.annotation.Cacheable; |
40 | 40 | import org.springframework.stereotype.Service; |
41 | 41 | import org.springframework.util.AntPathMatcher; |
42 | +import org.springframework.util.CollectionUtils; | |
42 | 43 | import org.springframework.util.PathMatcher; |
43 | 44 | |
44 | 45 | import javax.annotation.Resource; |
... | ... | @@ -379,7 +380,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { |
379 | 380 | } |
380 | 381 | SysAnnouncementSend announcementSend = new SysAnnouncementSend(); |
381 | 382 | announcementSend.setAnntId(anntId); |
382 | - announcementSend.setUserId(sysUser.getId()); | |
383 | + announcementSend.setUserId(Integer.parseInt(sysUser.getId())); | |
383 | 384 | announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG); |
384 | 385 | sysAnnouncementSendMapper.insert(announcementSend); |
385 | 386 | JSONObject obj = new JSONObject(); |
... | ... | @@ -453,7 +454,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { |
453 | 454 | } |
454 | 455 | SysAnnouncementSend announcementSend = new SysAnnouncementSend(); |
455 | 456 | announcementSend.setAnntId(anntId); |
456 | - announcementSend.setUserId(sysUser.getId()); | |
457 | + announcementSend.setUserId(Integer.parseInt(sysUser.getId())); | |
457 | 458 | announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG); |
458 | 459 | sysAnnouncementSendMapper.insert(announcementSend); |
459 | 460 | JSONObject obj = new JSONObject(); |
... | ... | @@ -717,7 +718,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { |
717 | 718 | @Override |
718 | 719 | public List<LoginUser> queryAllUserByIds(String[] userIds) { |
719 | 720 | QueryWrapper<SysUser> queryWrapper = new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0); |
720 | - queryWrapper.in("id", userIds); | |
721 | + queryWrapper.in("id", CollectionUtils.arrayToList(userIds)); | |
721 | 722 | List<LoginUser> loginUsers = new ArrayList<>(); |
722 | 723 | List<SysUser> sysUsers = userMapper.selectList(queryWrapper); |
723 | 724 | for (SysUser user : sysUsers) { |
... | ... | @@ -956,7 +957,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { |
956 | 957 | } |
957 | 958 | SysAnnouncementSend announcementSend = new SysAnnouncementSend(); |
958 | 959 | announcementSend.setAnntId(anntId); |
959 | - announcementSend.setUserId(sysUser.getId()); | |
960 | + announcementSend.setUserId(Integer.parseInt(sysUser.getId())); | |
960 | 961 | announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG); |
961 | 962 | sysAnnouncementSendMapper.insert(announcementSend); |
962 | 963 | JSONObject obj = new JSONObject(); |
... | ... | @@ -1008,7 +1009,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { |
1008 | 1009 | } |
1009 | 1010 | SysAnnouncementSend announcementSend = new SysAnnouncementSend(); |
1010 | 1011 | announcementSend.setAnntId(anntId); |
1011 | - announcementSend.setUserId(sysUser.getId()); | |
1012 | + announcementSend.setUserId(Integer.parseInt(sysUser.getId())); | |
1012 | 1013 | announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG); |
1013 | 1014 | sysAnnouncementSendMapper.insert(announcementSend); |
1014 | 1015 | JSONObject obj = new JSONObject(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java
... | ... | @@ -94,7 +94,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl |
94 | 94 | }).collect(Collectors.toList()); |
95 | 95 | res.put(d.getDictCode(), dictModelList); |
96 | 96 | } |
97 | - log.debug("-------登录加载系统字典-----" + res.toString()); | |
97 | + log.debug("\r\n-----登录加载系统字典-----\r\n" + res.toString()); | |
98 | 98 | return res; |
99 | 99 | } |
100 | 100 | |
... | ... | @@ -104,7 +104,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl |
104 | 104 | * @param key |
105 | 105 | * @return |
106 | 106 | */ |
107 | - | |
108 | 107 | @Override |
109 | 108 | @Cacheable(value = CacheConstant.SYS_DICT_CACHE, key = "#code+':'+#key", unless = "#result == null ") |
110 | 109 | public String queryDictTextByKey(String code, String key) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysThirdAccountServiceImpl.java
... | ... | @@ -109,7 +109,7 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe |
109 | 109 | // 保存用户角色 |
110 | 110 | SysUserRole userRole = new SysUserRole(); |
111 | 111 | userRole.setRoleId(sysRole.getId()); |
112 | - userRole.setUserId(sysUser.getId()); | |
112 | + userRole.setUserId(Integer.parseInt(sysUser.getId())); | |
113 | 113 | sysUserRoleMapper.insert(userRole); |
114 | 114 | return sysUser.getId().toString(); |
115 | 115 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
... | ... | @@ -155,7 +155,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
155 | 155 | if (oConvertUtils.isNotEmpty(roles)) { |
156 | 156 | String[] arr = roles.split(","); |
157 | 157 | for (String roleId : arr) { |
158 | - SysUserRole userRole = new SysUserRole(user.getId(), Integer.valueOf(roleId)); | |
158 | + SysUserRole userRole = new SysUserRole(Integer.valueOf(user.getId()), Integer.valueOf(roleId)); | |
159 | 159 | sysUserRoleMapper.insert(userRole); |
160 | 160 | } |
161 | 161 | } |
... | ... | @@ -171,7 +171,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
171 | 171 | if (oConvertUtils.isNotEmpty(roles)) { |
172 | 172 | String[] arr = roles.split(","); |
173 | 173 | for (String roleId : arr) { |
174 | - SysUserRole userRole = new SysUserRole(user.getId(), Integer.valueOf(roleId)); | |
174 | + SysUserRole userRole = new SysUserRole(Integer.valueOf(user.getId()), Integer.valueOf(roleId)); | |
175 | 175 | sysUserRoleMapper.insert(userRole); |
176 | 176 | } |
177 | 177 | } |
... | ... | @@ -327,7 +327,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
327 | 327 | if (oConvertUtils.isNotEmpty(selectedParts)) { |
328 | 328 | String[] arr = selectedParts.split(","); |
329 | 329 | for (String deaprtId : arr) { |
330 | - SysUserDepart userDeaprt = new SysUserDepart(user.getId(), Integer.valueOf(deaprtId)); | |
330 | + SysUserDepart userDeaprt = new SysUserDepart(Integer.valueOf(user.getId()), Integer.valueOf(deaprtId)); | |
331 | 331 | sysUserDepartMapper.insert(userDeaprt); |
332 | 332 | } |
333 | 333 | } |
... | ... | @@ -347,7 +347,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
347 | 347 | if (userDepartList != null && userDepartList.size() > 0) { |
348 | 348 | for (SysUserDepart depart : userDepartList) { |
349 | 349 | // 修改已关联部门删除部门用户角色关系 |
350 | - if (!Arrays.asList(arr).contains(depart.getDepId())) { | |
350 | + if (!Arrays.asList(arr).contains(depart.getDepId() + "")) { | |
351 | 351 | List<SysDepartRole> sysDepartRoleList = |
352 | 352 | sysDepartRoleMapper.selectList(new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId, depart.getDepId())); |
353 | 353 | |
... | ... | @@ -368,7 +368,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
368 | 368 | sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId())); |
369 | 369 | if (oConvertUtils.isNotEmpty(departs)) { |
370 | 370 | for (String departId : arr) { |
371 | - SysUserDepart userDepart = new SysUserDepart(user.getId(), Integer.valueOf(departId)); | |
371 | + SysUserDepart userDepart = new SysUserDepart(Integer.valueOf(user.getId()), Integer.valueOf(departId)); | |
372 | 372 | sysUserDepartMapper.insert(userDepart); |
373 | 373 | } |
374 | 374 | } |
... | ... | @@ -468,7 +468,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
468 | 468 | // 保存用户角色 |
469 | 469 | SysUserRole userRole = new SysUserRole(); |
470 | 470 | userRole.setRoleId(sysRole.getId()); |
471 | - userRole.setUserId(sysUser.getId()); | |
471 | + userRole.setUserId(Integer.valueOf(sysUser.getId())); | |
472 | 472 | sysUserRoleMapper.insert(userRole); |
473 | 473 | } |
474 | 474 | |
... | ... | @@ -486,7 +486,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
486 | 486 | if (oConvertUtils.isNotEmpty(selectedRoles)) { |
487 | 487 | String[] arr = selectedRoles.split(","); |
488 | 488 | for (String roleId : arr) { |
489 | - SysUserRole userRole = new SysUserRole(user.getId(), Integer.valueOf(roleId)); | |
489 | + SysUserRole userRole = new SysUserRole(Integer.valueOf(user.getId()), Integer.valueOf(roleId)); | |
490 | 490 | sysUserRoleMapper.insert(userRole); |
491 | 491 | } |
492 | 492 | } |
... | ... | @@ -494,7 +494,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
494 | 494 | if (oConvertUtils.isNotEmpty(selectedDeparts)) { |
495 | 495 | String[] arr = selectedDeparts.split(","); |
496 | 496 | for (String deaprtId : arr) { |
497 | - SysUserDepart userDeaprt = new SysUserDepart(user.getId(), Integer.valueOf(deaprtId)); | |
497 | + SysUserDepart userDeaprt = new SysUserDepart(Integer.valueOf(user.getId()), Integer.valueOf(deaprtId)); | |
498 | 498 | sysUserDepartMapper.insert(userDeaprt); |
499 | 499 | } |
500 | 500 | } |
... | ... | @@ -512,7 +512,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
512 | 512 | if (oConvertUtils.isNotEmpty(roles)) { |
513 | 513 | String[] arr = roles.split(","); |
514 | 514 | for (String roleId : arr) { |
515 | - SysUserRole userRole = new SysUserRole(user.getId(), Integer.valueOf(roleId)); | |
515 | + SysUserRole userRole = new SysUserRole(Integer.valueOf(user.getId()), Integer.valueOf(roleId)); | |
516 | 516 | sysUserRoleMapper.insert(userRole); |
517 | 517 | } |
518 | 518 | } |
... | ... | @@ -527,7 +527,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
527 | 527 | if (userDepartList != null && userDepartList.size() > 0) { |
528 | 528 | for (SysUserDepart depart : userDepartList) { |
529 | 529 | // 修改已关联部门删除部门用户角色关系 |
530 | - if (!Arrays.asList(arr).contains(depart.getDepId())) { | |
530 | + if (!Arrays.asList(arr).contains(depart.getDepId() + "")) { | |
531 | 531 | List<SysDepartRole> sysDepartRoleList = |
532 | 532 | sysDepartRoleMapper.selectList(new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId, depart.getDepId())); |
533 | 533 | List<String> roleIds = new ArrayList<>(); |
... | ... | @@ -547,7 +547,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
547 | 547 | sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId())); |
548 | 548 | if (oConvertUtils.isNotEmpty(departs)) { |
549 | 549 | for (String departId : arr) { |
550 | - SysUserDepart userDepart = new SysUserDepart(user.getId(), Integer.valueOf(departId)); | |
550 | + SysUserDepart userDepart = new SysUserDepart(Integer.valueOf(user.getId()), Integer.valueOf(departId)); | |
551 | 551 | sysUserDepartMapper.insert(userDepart); |
552 | 552 | } |
553 | 553 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/controller/ReceiptController.java
... | ... | @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; |
6 | 6 | import org.jeecg.common.api.vo.Result; |
7 | 7 | import org.jeecg.common.aspect.annotation.AutoLog; |
8 | 8 | import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean; |
9 | +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean; | |
9 | 10 | import org.jeecg.modules.wms.api.mobile.service.IMobileService; |
10 | 11 | import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; |
11 | 12 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
... | ... | @@ -50,4 +51,22 @@ public class ReceiptController extends HuahengBaseController { |
50 | 51 | }); |
51 | 52 | return result; |
52 | 53 | } |
54 | + | |
55 | + @AutoLog(value = "PDA入库-快速入库") | |
56 | + @ApiOperation(value = "PDA入库-快速入库", notes = "快速入库") | |
57 | + @PostMapping("/quickReceipt") | |
58 | + @ResponseBody | |
59 | + @ApiLogger(apiName = "PDA入库-快速入库", from = "PDA") | |
60 | + public Result<?> quickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) { | |
61 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
62 | + bean.setWarehouseCode(warehouseCode); | |
63 | + | |
64 | + Result<?> result = handleMultiProcess("quickReceipt", new MultiProcessListener() { | |
65 | + @Override | |
66 | + public Result<?> doProcess() { | |
67 | + return mobileService.quickReceipt(bean, warehouseCode); | |
68 | + } | |
69 | + }); | |
70 | + return result; | |
71 | + } | |
53 | 72 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/QuickReceiptBean.java
0 → 100644
1 | +package org.jeecg.modules.wms.api.mobile.entity; | |
2 | + | |
3 | +import io.swagger.annotations.ApiModelProperty; | |
4 | +import lombok.Data; | |
5 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Data | |
10 | +public class QuickReceiptBean { | |
11 | + @ApiModelProperty(value = "托盘号", required = true) | |
12 | + private String containerCode; | |
13 | + @ApiModelProperty(value = "库位号", required = false) | |
14 | + private String locationCode; | |
15 | + @ApiModelProperty(value = "单据类型", required = true) | |
16 | + private String receiptType; | |
17 | + @ApiModelProperty(value = "货主编码", required = true) | |
18 | + private String companyCode; | |
19 | + @ApiModelProperty(value = "仓库编码", required = false) | |
20 | + private String warehouseCode; | |
21 | + @ApiModelProperty(value = "收货明细", required = true) | |
22 | + private List<ReceiptDetail> receiptDetails; | |
23 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/IMobileService.java
... | ... | @@ -2,9 +2,11 @@ package org.jeecg.modules.wms.api.mobile.service; |
2 | 2 | |
3 | 3 | import org.jeecg.common.api.vo.Result; |
4 | 4 | import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean; |
5 | +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean; | |
5 | 6 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
6 | 7 | |
7 | 8 | public interface IMobileService { |
8 | 9 | |
9 | 10 | Result<TaskHeader> callBox(CallBoxBean bean, String warehouseCode); |
11 | + Result<TaskHeader> quickReceipt(QuickReceiptBean bean, String warehouseCode); | |
10 | 12 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java
... | ... | @@ -5,19 +5,30 @@ import javax.annotation.Resource; |
5 | 5 | import org.apache.commons.lang3.StringUtils; |
6 | 6 | import org.jeecg.common.api.vo.Result; |
7 | 7 | import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean; |
8 | +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean; | |
8 | 9 | import org.jeecg.modules.wms.api.mobile.service.IMobileService; |
9 | 10 | import org.jeecg.modules.wms.config.container.entity.Container; |
10 | 11 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
11 | 12 | import org.jeecg.modules.wms.config.location.entity.Location; |
12 | 13 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
14 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
15 | +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
16 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService; | |
17 | +import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; | |
18 | +import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | |
19 | +import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; | |
13 | 20 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
14 | 21 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
15 | 22 | import org.jeecg.utils.constant.QuantityConstant; |
23 | +import org.springframework.beans.factory.annotation.Autowired; | |
16 | 24 | import org.springframework.stereotype.Service; |
17 | 25 | import org.springframework.transaction.annotation.Transactional; |
18 | 26 | |
19 | 27 | import com.aliyun.oss.ServiceException; |
20 | 28 | |
29 | +import java.util.ArrayList; | |
30 | +import java.util.List; | |
31 | + | |
21 | 32 | /** |
22 | 33 | */ |
23 | 34 | @Service |
... | ... | @@ -32,6 +43,15 @@ public class MobileService implements IMobileService { |
32 | 43 | @Resource |
33 | 44 | private ITaskHeaderService taskHeaderService; |
34 | 45 | |
46 | + @Autowired | |
47 | + private IReceiptHeaderService receiptHeaderService; | |
48 | + | |
49 | + @Autowired | |
50 | + private IReceiptDetailService receiptDetailService; | |
51 | + | |
52 | + @Resource | |
53 | + private IReceiveService receiveService; | |
54 | + | |
35 | 55 | @Override |
36 | 56 | @Transactional(rollbackFor = Exception.class) |
37 | 57 | public Result<TaskHeader> callBox(CallBoxBean bean, String warehouseCode) { |
... | ... | @@ -99,4 +119,62 @@ public class MobileService implements IMobileService { |
99 | 119 | |
100 | 120 | return Result.OK("呼叫料盒成功", taskHeader); |
101 | 121 | } |
122 | + | |
123 | + @Override | |
124 | + @Transactional(rollbackFor = Exception.class) | |
125 | + public Result<TaskHeader> quickReceipt(QuickReceiptBean bean, String warehouseCode) { | |
126 | + if (StringUtils.isEmpty(bean.getContainerCode())) { | |
127 | + return Result.error("托盘号containerCode不能为空"); | |
128 | + } | |
129 | + if (StringUtils.isEmpty(bean.getReceiptType())) { | |
130 | + return Result.error("单据类型不能为空"); | |
131 | + } | |
132 | + if (StringUtils.isEmpty(bean.getCompanyCode())) { | |
133 | + return Result.error("货主companyCode不能为空"); | |
134 | + } | |
135 | + if (bean.getReceiptDetails() == null || bean.getReceiptDetails().size() == 0) { | |
136 | + return Result.error("收货明细不能为空"); | |
137 | + } | |
138 | + | |
139 | + //创建入库单 | |
140 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
141 | + receiptHeader.setType(bean.getReceiptType()); | |
142 | + receiptHeader.setCompanyCode(bean.getCompanyCode()); | |
143 | + receiptHeader.setWarehouseCode(bean.getWarehouseCode()); | |
144 | + Result<ReceiptHeader> rs1 = receiptHeaderService.saveReceiptHeader(receiptHeader); | |
145 | + | |
146 | + if (rs1.isSuccess()) { | |
147 | + receiptHeader = rs1.getResult(); | |
148 | + } else { | |
149 | + throw new ServiceException(rs1.getMessage()); | |
150 | + } | |
151 | + | |
152 | + List<Receive> receiveList = new ArrayList<>(); | |
153 | + for (ReceiptDetail d : bean.getReceiptDetails()) { | |
154 | + d.setReceiptId(receiptHeader.getId()); | |
155 | + Result rs2 = receiptDetailService.saveReceiptDetail(d); | |
156 | + if(!rs2.isSuccess()) { | |
157 | + throw new ServiceException(rs2.getMessage()); | |
158 | + } | |
159 | + Receive v = new Receive(); | |
160 | + v.setId(d.getId()); | |
161 | + v.setQty(d.getQty()); | |
162 | + v.setTaskQty(d.getQty()); | |
163 | + v.setInventoryStatus(d.getInventoryStatus()); | |
164 | + v.setMaterialCode(d.getMaterialCode()); | |
165 | + v.setMaterialName(d.getMaterialName()); | |
166 | + v.setBatch(d.getBatch()); | |
167 | + v.setMateiralSpec(d.getMaterialSpec()); | |
168 | + v.setMaterialUnit(d.getMaterialUnit()); | |
169 | + v.setContainerCode(bean.getContainerCode()); | |
170 | + receiveList.add(v); | |
171 | + } | |
172 | + | |
173 | + Result<TaskHeader> rs3 = receiveService.receivingAndCreateTask(receiveList, warehouseCode); | |
174 | + if(rs3.isSuccess()) { | |
175 | + return rs3; | |
176 | + }else{ | |
177 | + throw new ServiceException(rs3.getMessage()); | |
178 | + } | |
179 | + } | |
102 | 180 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... | ... | @@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.*; |
19 | 19 | |
20 | 20 | import io.swagger.annotations.ApiOperation; |
21 | 21 | |
22 | +import java.util.Map; | |
23 | + | |
22 | 24 | @RestController |
23 | 25 | @RequestMapping("/API/WMS/v2") |
24 | 26 | public class WcsController extends HuahengBaseController { |
... | ... | @@ -130,8 +132,7 @@ public class WcsController extends HuahengBaseController { |
130 | 132 | }); |
131 | 133 | return result; |
132 | 134 | } |
133 | - | |
134 | - /** | |
135 | + /** | |
135 | 136 | * 设置物料信息 |
136 | 137 | * @return |
137 | 138 | */ |
... | ... | @@ -143,5 +144,4 @@ public class WcsController extends HuahengBaseController { |
143 | 144 | public Result setMaterialInfo(@RequestBody MaterialInfoEntity materialInfoEntity) { |
144 | 145 | Result result = wcsService.setMaterialInfo(materialInfoEntity); |
145 | 146 | return result; |
146 | - } | |
147 | -} | |
147 | + }} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java
... | ... | @@ -17,10 +17,7 @@ public interface WcsService { |
17 | 17 | Result wcsTaskAssign(TaskHeader taskHeader); |
18 | 18 | |
19 | 19 | WcsTask switchTaskTypeToWcs(WcsTask wcsTask); |
20 | - | |
21 | - /** | |
20 | + /** | |
22 | 21 | * 设置物料信息,包括长、宽、高、重量 |
23 | 22 | */ |
24 | - Result setMaterialInfo(MaterialInfoEntity materialInfoEntity); | |
25 | - | |
26 | -} | |
23 | + Result setMaterialInfo(MaterialInfoEntity materialInfoEntity);} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.api.wcs.service; |
2 | 2 | |
3 | +import java.math.BigDecimal; | |
3 | 4 | import java.util.ArrayList; |
5 | +import java.util.Date; | |
4 | 6 | import java.util.List; |
5 | 7 | import java.util.stream.Collectors; |
6 | 8 | |
... | ... | @@ -13,6 +15,8 @@ import org.jeecg.modules.wms.api.wcs.entity.WcsTask; |
13 | 15 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
14 | 16 | import org.jeecg.modules.wms.config.container.entity.Container; |
15 | 17 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
18 | +import org.jeecg.modules.wms.config.containerType.entity.ContainerType; | |
19 | +import org.jeecg.modules.wms.config.containerType.service.impl.ContainerTypeServiceImpl; | |
16 | 20 | import org.jeecg.modules.wms.config.location.entity.Location; |
17 | 21 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
18 | 22 | import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh; |
... | ... | @@ -22,6 +26,7 @@ import org.jeecg.modules.wms.config.locationType.service.ILocationTypeService; |
22 | 26 | import org.jeecg.modules.wms.config.material.entity.Material; |
23 | 27 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
24 | 28 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
29 | +import org.jeecg.modules.wms.config.receiptType.entity.ReceiptType; | |
25 | 30 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
26 | 31 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
27 | 32 | import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; |
... | ... | @@ -76,6 +81,8 @@ public class WcsServiceImpl implements WcsService { |
76 | 81 | private ILocationService locationService; |
77 | 82 | @Resource |
78 | 83 | private IAddressService addressService; |
84 | + @Resource | |
85 | + private ContainerTypeServiceImpl containerTypeServiceImpl; | |
79 | 86 | |
80 | 87 | @Override |
81 | 88 | @Transactional(rollbackFor = Exception.class) |
... | ... | @@ -415,8 +422,7 @@ public class WcsServiceImpl implements WcsService { |
415 | 422 | } |
416 | 423 | return wcsTask; |
417 | 424 | } |
418 | - | |
419 | - @Override | |
425 | + @Override | |
420 | 426 | public Result setMaterialInfo(MaterialInfoEntity materialInfoEntity) { |
421 | 427 | int taskNo = materialInfoEntity.getTaskNo(); |
422 | 428 | TaskHeader taskHeader = taskHeaderService.getById(taskNo); |
... | ... | @@ -432,5 +438,4 @@ public class WcsServiceImpl implements WcsService { |
432 | 438 | return Result.error("设置物料信息失败,更新任务信息失败"); |
433 | 439 | } |
434 | 440 | return Result.ok("设置物料信息成功"); |
435 | - } | |
436 | -} | |
441 | + }} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java
... | ... | @@ -4,7 +4,10 @@ import java.io.Serializable; |
4 | 4 | import java.io.UnsupportedEncodingException; |
5 | 5 | import java.util.Date; |
6 | 6 | import java.math.BigDecimal; |
7 | +import java.util.List; | |
8 | + | |
7 | 9 | import com.baomidou.mybatisplus.annotation.IdType; |
10 | +import com.baomidou.mybatisplus.annotation.TableField; | |
8 | 11 | import com.baomidou.mybatisplus.annotation.TableId; |
9 | 12 | import com.baomidou.mybatisplus.annotation.TableName; |
10 | 13 | import lombok.Data; |
... | ... | @@ -123,4 +126,19 @@ public class Location implements Serializable { |
123 | 126 | /** 更新日期 */ |
124 | 127 | @ApiModelProperty(value = "更新日期") |
125 | 128 | private Date updateTime; |
129 | + /** 物料编码 */ | |
130 | + @TableField(exist = false) | |
131 | + private List<String> materialCode; | |
132 | + /** 物料名称 */ | |
133 | + @TableField(exist = false) | |
134 | + private List<String> materialName; | |
135 | + /** 批次 */ | |
136 | + @TableField(exist = false) | |
137 | + private List<String> batch; | |
138 | + /** 数量 */ | |
139 | + @TableField(exist = false) | |
140 | + private List<BigDecimal> qty; | |
141 | + /** 库存所在库位状态 */ | |
142 | + @TableField(exist = false) | |
143 | + private String locationAttribute; | |
126 | 144 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/controller/LocationMonitorController.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.locationMonitor.controller; | |
2 | +import java.math.BigDecimal; | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.HashMap; | |
5 | +import java.util.List; | |
6 | +import java.util.stream.Collectors; | |
7 | +import javax.annotation.Resource; | |
8 | +import javax.servlet.http.HttpServletRequest; | |
9 | + | |
10 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
11 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
12 | +import org.jeecg.common.api.vo.Result; | |
13 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
14 | +import org.jeecg.modules.wms.config.container.service.IContainerService; | |
15 | +import org.jeecg.modules.wms.config.location.entity.Location; | |
16 | +import org.jeecg.modules.wms.config.location.service.ILocationService; | |
17 | +import lombok.extern.slf4j.Slf4j; | |
18 | + | |
19 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | |
20 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | |
21 | +import org.jeecg.modules.wms.config.locationMonitor.entity.LocationStatus; | |
22 | +import org.jeecg.utils.HuahengJwtUtil; | |
23 | +import org.jeecg.utils.StringUtils; | |
24 | +import org.jeecg.utils.constant.QuantityConstant; | |
25 | +import org.springframework.beans.factory.annotation.Autowired; | |
26 | +import org.springframework.web.bind.annotation.*; | |
27 | +import io.swagger.annotations.Api; | |
28 | + | |
29 | + /** | |
30 | + * @Description: 库存监控 | |
31 | + * @Author: lty | |
32 | + * @Date: 2023/1/29 | |
33 | + */ | |
34 | +@Api(tags="库存监控") | |
35 | +@RestController | |
36 | +@RequestMapping("/location/locationMonitor") | |
37 | +@Slf4j | |
38 | +public class LocationMonitorController{ | |
39 | + @Autowired | |
40 | + private IContainerService containerService; | |
41 | + @Resource | |
42 | + private ILocationService locationService; | |
43 | + @Resource | |
44 | + private IInventoryDetailService inventoryDetailService; | |
45 | + | |
46 | + | |
47 | + /** | |
48 | + * 库存概括 | |
49 | + */ | |
50 | + @GetMapping("/getStatus") | |
51 | + @ResponseBody | |
52 | + public Result getStatus(String zoneCode) { | |
53 | + HashMap<String, Integer> map = new HashMap<>(); | |
54 | + LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); | |
55 | + queryWrapper.eq(Location::getZoneCode,zoneCode); | |
56 | + List<Location> locationList = locationService.list(queryWrapper); | |
57 | + map.put("location", locationList.size()); | |
58 | + queryWrapper = Wrappers.lambdaQuery(); | |
59 | + queryWrapper.and(wrapper->wrapper.isNull(Location::getContainerCode).or().eq(Location::getContainerCode,"")) | |
60 | + .eq(Location::getZoneCode,zoneCode); | |
61 | + List<Location> emptyLocationList = locationService.list(queryWrapper); | |
62 | + map.put("emptyLocation", emptyLocationList.size()); | |
63 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper2 = Wrappers.lambdaQuery(); | |
64 | + containerLambdaQueryWrapper2.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY); | |
65 | + List<Container> containerList2 = containerService.list(containerLambdaQueryWrapper2); | |
66 | + List<String> containerCodeList2 = containerList2.stream().map(Container::getCode).collect(Collectors.toList()); | |
67 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper2 = Wrappers.lambdaQuery(); | |
68 | + locationLambdaQueryWrapper2.in(Location::getContainerCode, containerCodeList2); | |
69 | + locationLambdaQueryWrapper2.eq(Location::getZoneCode, zoneCode); | |
70 | + List<Location> haveEmptyContainLocation = locationService.list(locationLambdaQueryWrapper2); | |
71 | + map.put("haveContainLocation", haveEmptyContainLocation.size()); | |
72 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
73 | + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_SOME); | |
74 | + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | |
75 | + int containerListSize = containerList.size(); | |
76 | + List<String> containerCodeList = containerList.stream().map(Container::getCode).collect(Collectors.toList()); | |
77 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
78 | + locationLambdaQueryWrapper.in(containerListSize !=0, Location::getContainerCode, containerCodeList); | |
79 | + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode); | |
80 | + List<Location> haveInventoryLocation = locationService.list(locationLambdaQueryWrapper); | |
81 | + map.put("haveInventoryLocation", haveInventoryLocation.size()); | |
82 | + return Result.ok(map); | |
83 | + } | |
84 | + | |
85 | + /** | |
86 | + * 查询库位列表 | |
87 | + */ | |
88 | + @PostMapping("/getLocationInfo") | |
89 | + @ResponseBody | |
90 | + public Result getLocationInfo (String type, String row, String line, String layer, String grid, HttpServletRequest req) { | |
91 | + if(StringUtils.isEmpty(type)) { | |
92 | + return Result.error("type不能为空"); | |
93 | + } | |
94 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
95 | + /* 查询库位信息*/ | |
96 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
97 | + locationLambdaQueryWrapper.eq(StringUtils.isNotEmpty(row), Location::getRow, row) | |
98 | + .eq(StringUtils.isNotEmpty(line), Location::getIcolumn, line) | |
99 | + .eq(StringUtils.isNotEmpty(layer), Location::getLayer, layer) | |
100 | + .eq(StringUtils.isNotEmpty(grid),Location::getGrid, grid) | |
101 | + .eq(Location::getWarehouseCode, warehouseCode) | |
102 | + .eq(StringUtils.isNotEmpty(type), Location::getZoneCode, type); | |
103 | + List<Location> locations = locationService.list(locationLambdaQueryWrapper); | |
104 | + List<Location> locationList = new ArrayList<>(); | |
105 | + | |
106 | + /* 查询库存明细*/ | |
107 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambda = Wrappers.lambdaQuery(); | |
108 | + inventoryDetailLambda.eq(InventoryDetail::getWarehouseCode, warehouseCode); | |
109 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambda); | |
110 | + | |
111 | + for (Location location1 : locations) { | |
112 | + InventoryDetail inventoryDetail = null; | |
113 | + String materialName = null; | |
114 | + for (InventoryDetail inventoryDetail2 : inventoryDetailList) { | |
115 | + if(location1.getCode().equals(inventoryDetail2.getLocationCode())) { | |
116 | + inventoryDetail = inventoryDetail2; | |
117 | + } | |
118 | + } | |
119 | + List<InventoryDetail> inventoryDetails = inventoryDetailList.stream().filter(inventoryDetail1 -> | |
120 | + inventoryDetail1.getLocationCode().equals(location1.getCode())).collect(Collectors.toList()); | |
121 | + | |
122 | + int locationAttribute = 0; | |
123 | + String status = location1.getStatus(); | |
124 | + String containerCode = location1.getContainerCode(); | |
125 | + List<String> materialNameList = inventoryDetails.stream().map(InventoryDetail::getMaterialName).collect(Collectors.toList()); | |
126 | + List<String> batchList = inventoryDetails.stream().map(InventoryDetail::getBatch).collect(Collectors.toList()); | |
127 | + List<String> materialCodeList = inventoryDetails.stream().map(InventoryDetail::getMaterialCode).collect(Collectors.toList()); | |
128 | + List<BigDecimal> qtyList = inventoryDetails.stream().map(InventoryDetail::getQty).collect(Collectors.toList()); | |
129 | + if(QuantityConstant.STATUS_LOCATION_EMPTY.equals(status)) { | |
130 | + if(StringUtils.isEmpty(containerCode)) { | |
131 | + locationAttribute = LocationStatus.IDLE_EMPTY_LOCATION; | |
132 | + } else { | |
133 | + if(inventoryDetail == null) { | |
134 | + locationAttribute = LocationStatus.IDLE_EMPTY_CONTAINER; | |
135 | + } else { | |
136 | + location1.setMaterialName(materialNameList); | |
137 | + location1.setMaterialCode(materialCodeList); | |
138 | + location1.setBatch(batchList); | |
139 | + location1.setQty(qtyList); | |
140 | + locationAttribute = LocationStatus.IDLE_FULL_CONTAINER; | |
141 | + } | |
142 | + } | |
143 | + } else if(QuantityConstant.STATUS_LOCATION_LOCK.equals(status)) { | |
144 | + if(StringUtils.isEmpty(containerCode)) { | |
145 | + locationAttribute = LocationStatus.LOCK_EMPTY_LOCATION; | |
146 | + } else { | |
147 | + if(inventoryDetail == null) { | |
148 | + locationAttribute = LocationStatus.LOCK_EMPTY_CONTAINER; | |
149 | + } else { | |
150 | + location1.setMaterialName(materialNameList); | |
151 | + location1.setMaterialCode(materialCodeList); | |
152 | + location1.setBatch(batchList); | |
153 | + location1.setQty(qtyList); | |
154 | + locationAttribute = LocationStatus.LOCK_FULL_CONTAINER; | |
155 | + } | |
156 | + } | |
157 | + } | |
158 | + | |
159 | +// if(location1.getDeleted()) { | |
160 | +// if(StringUtils.isEmpty(containerCode)) { | |
161 | +// locationAttribute = LocationStatus.DISABLE_EMPTY_LOCATION; | |
162 | +// } else { | |
163 | +// if(inventoryDetail == null) { | |
164 | +// locationAttribute = LocationStatus.DISABLE_EMPTY_CONTAINER; | |
165 | +// } else { | |
166 | +// location1.setMaterialName(materialNameList); | |
167 | +// location1.setMaterialCode(materialCodeList); | |
168 | +// location1.setBatch(batchList); | |
169 | +// location1.setQty(qtyList); | |
170 | +// locationAttribute = LocationStatus.DISABLE_FULL_CONTAINER; | |
171 | +// } | |
172 | +// } | |
173 | +// } | |
174 | + | |
175 | + location1.setLocationAttribute(String.valueOf(locationAttribute)); | |
176 | + locationList.add(location1); | |
177 | + } | |
178 | + return Result.ok(locations); | |
179 | + } | |
180 | + | |
181 | + | |
182 | + /** | |
183 | + * 查询库位列表 | |
184 | + */ | |
185 | + @PostMapping("/getAllLocation") | |
186 | + @ResponseBody | |
187 | + public Result getAllLocation (String type) { | |
188 | + if(StringUtils.isEmpty(type)) { | |
189 | + return Result.error("type不能为空"); | |
190 | + } | |
191 | + return Result.ok(locationService.getAllLocation(type)); | |
192 | + } | |
193 | + | |
194 | + } | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/entity/LocationStatus.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.locationMonitor.entity; | |
2 | + | |
3 | +/** | |
4 | + * | |
5 | + * @author lty | |
6 | + * @date 2023/1/29 | |
7 | + */ | |
8 | +public class LocationStatus { | |
9 | + | |
10 | + /** 空柜丢失 */ | |
11 | + public static final int IDLE_EMPTY_LOST = 0; | |
12 | + /** 空柜空闲 */ | |
13 | + public static final int IDLE_EMPTY_LOCATION = 1; | |
14 | + /** 空盘空闲 */ | |
15 | + public static final int IDLE_EMPTY_CONTAINER = 2; | |
16 | + /** 半盘空闲 */ | |
17 | + public static final int IDLE_HALF_CONTAINER = 3; | |
18 | + /** 满盘空闲 */ | |
19 | + public static final int IDLE_FULL_CONTAINER = 4; | |
20 | + /** 空柜锁定 */ | |
21 | + public static final int LOCK_EMPTY_LOCATION = 5; | |
22 | + /** 空盘锁定 */ | |
23 | + public static final int LOCK_EMPTY_CONTAINER = 6; | |
24 | + /** 半盘锁定 */ | |
25 | + public static final int LOCK_HALF_CONTAINER = 7; | |
26 | + /** 满盘锁定 */ | |
27 | + public static final int LOCK_FULL_CONTAINER = 8; | |
28 | + /** 空柜禁用 */ | |
29 | + public static final int DISABLE_EMPTY_LOCATION = 9; | |
30 | + /** 空盘禁用 */ | |
31 | + public static final int DISABLE_EMPTY_CONTAINER = 10; | |
32 | + /** 半盘禁用 */ | |
33 | + public static final int DISABLE_HALF_CONTAINER = 11; | |
34 | + /** 满盘禁用 */ | |
35 | + public static final int DISABLE_FULL_CONTAINER = 12; | |
36 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/service/LocationMonitorService.java
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/service/impl/LocationMonitorServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.config.locationMonitor.service.impl; | |
2 | + | |
3 | + | |
4 | +import org.jeecg.modules.wms.config.locationMonitor.service.LocationMonitorService; | |
5 | +import org.springframework.stereotype.Service; | |
6 | + | |
7 | +/** | |
8 | + * @Description: 库存交易记录 | |
9 | + * @Author: jeecg-boot | |
10 | + * @Date: 2022-11-17 | |
11 | + * @Version: V1.0 | |
12 | + */ | |
13 | +@Service | |
14 | +public class LocationMonitorServiceImpl implements LocationMonitorService { | |
15 | + | |
16 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiLogAspect.java
... | ... | @@ -66,9 +66,8 @@ public class ApiLogAspect { |
66 | 66 | |
67 | 67 | @Around("logPointCut() && @annotation(apiLogger)") |
68 | 68 | public Object around(ProceedingJoinPoint point, ApiLogger apiLogger) throws Throwable { |
69 | - if ("WMS".equalsIgnoreCase(apiLogger.from())) | |
70 | 69 | // 实际上静态方法上的Aop注解无法拦截到 |
71 | - { | |
70 | + if ("WMS".equalsIgnoreCase(apiLogger.from())) { | |
72 | 71 | return aroundWms2XXX(point, apiLogger); |
73 | 72 | } else { |
74 | 73 | return aroundXXX2Wms(point, apiLogger); |
... | ... | @@ -81,13 +80,16 @@ public class ApiLogAspect { |
81 | 80 | ApiLog log = initApiLog(apiLogger, point); |
82 | 81 | try { |
83 | 82 | ret = point.proceed(); |
84 | - } catch (Exception e) { | |
85 | - setApiLogException(log, e); | |
83 | + } catch (Throwable e) { | |
84 | + setApiLogThrowable(log, e); | |
86 | 85 | ret = Result.error(e.getMessage()); |
87 | - } finally { | |
88 | - finishApiLog(log, ret); | |
89 | 86 | return ret; |
87 | + } finally { | |
88 | + if (ret != null) { | |
89 | + finishApiLog(log, ret); | |
90 | + } | |
90 | 91 | } |
92 | + return ret; | |
91 | 93 | } |
92 | 94 | |
93 | 95 | /** 处理WMS调用xxx接口的日志 **/ |
... | ... | @@ -103,21 +105,16 @@ public class ApiLogAspect { |
103 | 105 | connection = (HttpURLConnection)point.getArgs()[0]; |
104 | 106 | body = (String)point.getArgs()[1]; |
105 | 107 | initApiLog(connection, body); |
106 | - } catch (Exception e) { | |
107 | - | |
108 | - } | |
109 | - | |
110 | - try { | |
111 | 108 | ret = point.proceed(); |
112 | - } catch (Exception e) { | |
113 | - setApiLogException(log, e); | |
114 | - throw e; | |
109 | + } catch (Throwable e) { | |
110 | + setApiLogThrowable(log, e); | |
111 | + ret = Result.error(e.getMessage()); | |
115 | 112 | } finally { |
116 | 113 | if (ret != null) { |
117 | 114 | finishApiLog(log, connection, ret.toString()); |
118 | 115 | } |
119 | - return ret; | |
120 | 116 | } |
117 | + return ret; | |
121 | 118 | } |
122 | 119 | |
123 | 120 | /** |
... | ... | @@ -410,6 +407,16 @@ public class ApiLogAspect { |
410 | 407 | ex.printStackTrace(); |
411 | 408 | } |
412 | 409 | } |
410 | + | |
411 | + public static void setApiLogThrowable(ApiLog log, Throwable e) { | |
412 | + try { | |
413 | + String exception = ExceptionUtils.getFullStackTrace(e); | |
414 | + String shortExpInfo = e.getMessage() + "\n" + org.apache.commons.lang3.StringUtils.left(exception, 1000); | |
415 | + log.setException(shortExpInfo); | |
416 | + } catch (Exception ex) { | |
417 | + ex.printStackTrace(); | |
418 | + } | |
419 | + } | |
413 | 420 | |
414 | 421 | private void rebuildRequestHeader(ApiLog log) { |
415 | 422 | try { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/IReceiptHeaderService.java
... | ... | @@ -29,7 +29,7 @@ public interface IReceiptHeaderService extends IService<ReceiptHeader> { |
29 | 29 | /** |
30 | 30 | * |
31 | 31 | */ |
32 | - public Result saveReceiptHeader(ReceiptHeader receiptHeader); | |
32 | + public Result<ReceiptHeader> saveReceiptHeader(ReceiptHeader receiptHeader); | |
33 | 33 | |
34 | 34 | public String createCode(String receiptType); |
35 | 35 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -83,7 +83,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
83 | 83 | |
84 | 84 | @Override |
85 | 85 | @Transactional |
86 | - public Result saveReceiptHeader(ReceiptHeader receiptHeader) { | |
86 | + public Result<ReceiptHeader> saveReceiptHeader(ReceiptHeader receiptHeader) { | |
87 | 87 | LambdaQueryWrapper<ReceiptType> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
88 | 88 | lambdaQueryWrapper.eq(ReceiptType::getCode, receiptHeader.getType()).eq(ReceiptType::getWarehouseCode, receiptHeader.getWarehouseCode()); |
89 | 89 | ReceiptType receiptType = receiptTypeService.getOne(lambdaQueryWrapper); |
... | ... | @@ -101,7 +101,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
101 | 101 | if (!success) { |
102 | 102 | return Result.OK("添加失败!"); |
103 | 103 | } |
104 | - return Result.OK("添加成功!"); | |
104 | + return Result.OK("添加成功!", receiptHeader); | |
105 | 105 | } |
106 | 106 | |
107 | 107 | @Override |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -447,7 +447,6 @@ public class QuantityConstant { |
447 | 447 | public static final String RULE_ALLOCATION = "allocationRule"; |
448 | 448 | public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation"; |
449 | 449 | public static final String DOUBLE_FORK_SEARCH_LOCATION = "doubleForkSearchLocation"; |
450 | - public static final String EMPTY_CONTAINER_WEIGHT = "emptyWeight"; | |
451 | 450 | public static final String WAREHOUSING_WEIGHING = "warehousingWeighing"; |
452 | 451 | public static final String EXCEPTION_TO_CACHE = "exceptionToCache"; |
453 | 452 | public static final String CONTAINER_SPEC = "containerSpec"; |
... | ... |