Commit 1289878824ad67d1aa54f3626787136f275e9f33
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop
# Conflicts: # .idea/workspace.xml # src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java # src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
Showing
60 changed files
with
1855 additions
and
437 deletions
.idea/compiler.xml
... | ... | @@ -6,8 +6,8 @@ |
6 | 6 | <sourceOutputDir name="target/generated-sources/annotations" /> |
7 | 7 | <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
8 | 8 | <outputRelativeToContentRoot value="true" /> |
9 | - <module name="huaheng" /> | |
10 | 9 | <module name="wms2" /> |
10 | + <module name="huaheng" /> | |
11 | 11 | </profile> |
12 | 12 | </annotationProcessing> |
13 | 13 | </component> |
... | ... |
.idea/misc.xml
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | </list> |
12 | 12 | </option> |
13 | 13 | </component> |
14 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
14 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
15 | 15 | <output url="file://$PROJECT_DIR$/out" /> |
16 | 16 | </component> |
17 | 17 | </project> |
18 | 18 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/FilterConfigDetail/controller/FilterConfigDetailController.java
... | ... | @@ -30,13 +30,13 @@ import java.util.ArrayList; |
30 | 30 | import java.util.List; |
31 | 31 | |
32 | 32 | /** |
33 | - * 订单分析过滤子表 | |
33 | + * 规则配置明细 | |
34 | 34 | * @author ricard |
35 | 35 | * @date 19.8.26 |
36 | 36 | * |
37 | 37 | */ |
38 | 38 | |
39 | -@Api(tags={"订单分析过滤子表"}) | |
39 | +@Api(tags={"规则配置明细"}) | |
40 | 40 | @Controller |
41 | 41 | @RequestMapping("/config/filterConfigDetail") |
42 | 42 | public class FilterConfigDetailController extends BaseController { |
... | ... | @@ -55,10 +55,10 @@ public class FilterConfigDetailController extends BaseController { |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * 查询订单分析结果 | |
58 | + * 查询规则配置明细 | |
59 | 59 | */ |
60 | 60 | @RequiresPermissions("config:filterConfigDetail:list") |
61 | - @Log(title = "配置-订单分析过滤子表", operating="查看订单分析过滤子表", action = BusinessType.GRANT) | |
61 | + @Log(title = "配置-规则配置明细", operating="查看规则配置明细", action = BusinessType.GRANT) | |
62 | 62 | @PostMapping("/list") |
63 | 63 | @ResponseBody |
64 | 64 | public TableDataInfo list(FilterConfigDetail filterConfigDetail, String createdBegin, String createdEnd) |
... | ... | @@ -94,7 +94,7 @@ public class FilterConfigDetailController extends BaseController { |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | - * 新增订单分析过滤子表 | |
97 | + * 新增规则配置明细 | |
98 | 98 | */ |
99 | 99 | @GetMapping("/add/{headerId}") |
100 | 100 | public String add(@PathVariable("headerId")Integer headerId, ModelMap mmap) |
... | ... | @@ -105,10 +105,10 @@ public class FilterConfigDetailController extends BaseController { |
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
108 | - * 新增订单分析过滤子表 | |
108 | + * 新增规则配置明细 | |
109 | 109 | */ |
110 | 110 | @RequiresPermissions("config:filterConfigDetail:add") |
111 | - @Log(title = "配置-订单分析过滤子表", operating = "新增订单分析过滤子表", action = BusinessType.INSERT) | |
111 | + @Log(title = "配置-规则配置明细", operating = "新增规则配置明细", action = BusinessType.INSERT) | |
112 | 112 | @PostMapping("/add") |
113 | 113 | @ResponseBody |
114 | 114 | public AjaxResult addSave(FilterConfigDetail filterConfigDetail) { |
... | ... | @@ -119,7 +119,7 @@ public class FilterConfigDetailController extends BaseController { |
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * 修改订单分析过滤子表 | |
122 | + * 修改规则配置明细 | |
123 | 123 | */ |
124 | 124 | @GetMapping("/edit/{id}") |
125 | 125 | public String edit(@PathVariable("id") Integer id, ModelMap mmap) { |
... | ... | @@ -128,10 +128,10 @@ public class FilterConfigDetailController extends BaseController { |
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * 修改订单分析过滤子表 | |
131 | + * 修改规则配置明细 | |
132 | 132 | */ |
133 | 133 | @RequiresPermissions("config:filterConfigDetail:edit") |
134 | - @Log(title = "通用-订单分析过滤子表", operating = "修改订单分析过滤子表", action = BusinessType.UPDATE) | |
134 | + @Log(title = "配置-规则配置明细", operating = "修改规则配置明细", action = BusinessType.UPDATE) | |
135 | 135 | @PostMapping("/edit") |
136 | 136 | @ResponseBody |
137 | 137 | public AjaxResult editSave(FilterConfigDetail filterConfigDetail) { |
... | ... | @@ -140,11 +140,10 @@ public class FilterConfigDetailController extends BaseController { |
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * 删除订单分析过滤子表 | |
143 | + * 删除规则配置明细 | |
144 | 144 | */ |
145 | - @ApiOperation(value="删除订单分析过滤子表", notes="根据id批量删除订单分析过滤子表,参数示例1,2,3", httpMethod = "POST") | |
146 | 145 | @RequiresPermissions("config:filterConfigDetail:remove") |
147 | - @Log(title = "通用-订单分析过滤子表", operating = "删除订单分析过滤子表", action = BusinessType.DELETE) | |
146 | + @Log(title = "配置-规则配置明细", operating = "删除规则配置明细", action = BusinessType.DELETE) | |
148 | 147 | @PostMapping( "/remove") |
149 | 148 | @ResponseBody |
150 | 149 | public AjaxResult remove(String ids) { |
... | ... |
src/main/java/com/huaheng/pc/config/FilterConfigDetail/service/FilterConfigDetailService.java
1 | 1 | package com.huaheng.pc.config.FilterConfigDetail.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
3 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.utils.security.ShiroUtils; | |
4 | 7 | import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; |
5 | 8 | import com.huaheng.pc.config.FilterConfigDetail.mapper.FilterConfigDetailMapper; |
6 | 9 | import org.springframework.stereotype.Service; |
7 | 10 | |
8 | -@Service | |
11 | +import java.util.List; | |
12 | +import java.util.Map; | |
13 | + | |
14 | +@Service("FilterConfigDetailService") | |
9 | 15 | public class FilterConfigDetailService extends ServiceImpl<FilterConfigDetailMapper, FilterConfigDetail> { |
10 | 16 | |
17 | + /** | |
18 | + * 查询定位自定义sql,供前端页面选择使用 | |
19 | + * @return | |
20 | + */ | |
21 | + public List<Map<String, Object>> queryFilterConfigDetail(){ | |
22 | + LambdaQueryWrapper<FilterConfigDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
23 | + lambdaQueryWrapper.select(FilterConfigDetail::getCode, FilterConfigDetail::getDescription) | |
24 | + .eq(FilterConfigDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
25 | + return this.listMaps(lambdaQueryWrapper); | |
26 | + } | |
11 | 27 | } |
... | ... |
src/main/java/com/huaheng/pc/config/FilterConfigHeader/controller/FilterConfigHeaderController.java
... | ... | @@ -30,13 +30,13 @@ import java.util.ArrayList; |
30 | 30 | import java.util.List; |
31 | 31 | |
32 | 32 | /** |
33 | - * 订单分析过滤主表 | |
33 | + * 规则配置主表 | |
34 | 34 | * @author ricard |
35 | 35 | * @date 19.8.26 |
36 | 36 | * |
37 | 37 | */ |
38 | 38 | |
39 | -@Api(tags={"订单分析过滤主表"}) | |
39 | +@Api(tags={"规则配置主表"}) | |
40 | 40 | @Controller |
41 | 41 | @RequestMapping("/config/filterConfigHeader") |
42 | 42 | public class FilterConfigHeaderController extends BaseController { |
... | ... | @@ -53,10 +53,10 @@ public class FilterConfigHeaderController extends BaseController { |
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | - * 查询订单分析结果 | |
56 | + * 查询规则配置主表 | |
57 | 57 | */ |
58 | 58 | @RequiresPermissions("config:filterConfigHeader:list") |
59 | - @Log(title = "配置-订单分析过滤主表", operating="查看订单分析过滤主表", action = BusinessType.GRANT) | |
59 | + @Log(title = "配置-规则配置主表", operating="查看规则配置主表", action = BusinessType.GRANT) | |
60 | 60 | @PostMapping("/list") |
61 | 61 | @ResponseBody |
62 | 62 | public TableDataInfo list(FilterConfigHeader filterConfigHeader, String createdBegin, String createdEnd) |
... | ... | @@ -93,7 +93,7 @@ public class FilterConfigHeaderController extends BaseController { |
93 | 93 | |
94 | 94 | |
95 | 95 | /** |
96 | - * 新增订单分析过滤子表 | |
96 | + * 新增规则配置主表 | |
97 | 97 | */ |
98 | 98 | @GetMapping("/add") |
99 | 99 | public String add() { |
... | ... | @@ -104,7 +104,7 @@ public class FilterConfigHeaderController extends BaseController { |
104 | 104 | * 新增订单分析过滤主表 |
105 | 105 | */ |
106 | 106 | @RequiresPermissions("config:filterConfigHeader:add") |
107 | - @Log(title = "配置-订单分析过滤主表", operating = "新增订单分析过滤主表", action = BusinessType.INSERT) | |
107 | + @Log(title = "配置-规则配置主表", operating = "新增规则配置主表", action = BusinessType.INSERT) | |
108 | 108 | @PostMapping("/add") |
109 | 109 | @ResponseBody |
110 | 110 | public AjaxResult addSave(FilterConfigHeader filterConfigHeader) { |
... | ... | @@ -124,10 +124,10 @@ public class FilterConfigHeaderController extends BaseController { |
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | - * 修改订单分析过滤主表 | |
127 | + * 修改规则配置主表 | |
128 | 128 | */ |
129 | 129 | @RequiresPermissions("config:filterConfigHeader:edit") |
130 | - @Log(title = "通用-订单分析过滤主表", operating = "修改订单分析过滤主表", action = BusinessType.UPDATE) | |
130 | + @Log(title = "配置-规则配置主表", operating = "修改规则配置主表", action = BusinessType.UPDATE) | |
131 | 131 | @PostMapping("/edit") |
132 | 132 | @ResponseBody |
133 | 133 | public AjaxResult editSave(FilterConfigHeader filterConfigHeader) { |
... | ... | @@ -136,10 +136,10 @@ public class FilterConfigHeaderController extends BaseController { |
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | - * 删除订单分析过滤主表 | |
139 | + * 删除规则配置主表 | |
140 | 140 | */ |
141 | 141 | @RequiresPermissions("config:filterConfigHeader:remove") |
142 | - @Log(title = "通用-订单分析过滤主表", operating = "删除订单分析过滤主表", action = BusinessType.DELETE) | |
142 | + @Log(title = "配置-规则配置主表", operating = "删除规则配置主表", action = BusinessType.DELETE) | |
143 | 143 | @PostMapping( "/remove") |
144 | 144 | @ResponseBody |
145 | 145 | public AjaxResult remove(String ids) { |
... | ... |
src/main/java/com/huaheng/pc/config/container/controller/ContainerController.java
... | ... | @@ -71,7 +71,6 @@ public class ContainerController extends BaseController { |
71 | 71 | .eq(StringUtils.isNotEmpty(container.getWarehouseCode()), Container::getWarehouseCode, container.getWarehouseCode()) |
72 | 72 | .eq(StringUtils.isNotEmpty(container.getLocationCode()), Container::getLocationCode, container.getLocationCode()) |
73 | 73 | .eq(Container::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
74 | - .eq(Container::getDeleted,false) | |
75 | 74 | .orderByDesc(Container::getCreated); |
76 | 75 | |
77 | 76 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
... | ... |
src/main/java/com/huaheng/pc/config/container/domain/Container.java
1 | 1 | package com.huaheng.pc.config.container.domain; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.annotation.IdType; | |
4 | -import com.baomidou.mybatisplus.annotation.TableField; | |
5 | -import com.baomidou.mybatisplus.annotation.TableId; | |
6 | -import com.baomidou.mybatisplus.annotation.TableName; | |
3 | +import com.baomidou.mybatisplus.annotation.*; | |
7 | 4 | import com.huaheng.framework.aspectj.lang.annotation.Excel; |
8 | 5 | import io.swagger.annotations.ApiModel; |
9 | 6 | import io.swagger.annotations.ApiModelProperty; |
... | ... | @@ -190,6 +187,7 @@ public class Container implements Serializable { |
190 | 187 | |
191 | 188 | @TableField(value = "deleted") |
192 | 189 | @ApiModelProperty(value = "是否删除") |
190 | + @TableLogic | |
193 | 191 | private Boolean deleted; |
194 | 192 | |
195 | 193 | private static final long serialVersionUID = 1L; |
... | ... |
src/main/java/com/huaheng/pc/config/container/mapper/ContainerMapper.java
... | ... | @@ -2,7 +2,18 @@ package com.huaheng.pc.config.container.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.container.domain.Container; |
5 | +import com.huaheng.pc.config.location.domain.Location; | |
6 | +import org.apache.ibatis.annotations.Param; | |
7 | + | |
8 | +import java.util.List; | |
5 | 9 | |
6 | 10 | public interface ContainerMapper extends BaseMapper<Container> { |
7 | 11 | |
12 | + | |
13 | + List<Location> getEmptyContainerInLocation(@Param("containerCode") String containerCode, @Param("locationCode") String locationCode, @Param("warehouseCode") String warehouseCode); | |
14 | + | |
15 | + void updateLocationCodeAndStatus(@Param("warehouseCode") String warehouseCode, @Param("containerCode") String containerCode, @Param("locationCode") String locationCode, @Param("status") String status); | |
16 | + | |
17 | + | |
18 | + | |
8 | 19 | } |
9 | 20 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/container/service/ContainerService.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.config.container.service; |
3 | 3 | import com.huaheng.framework.web.domain.AjaxResult; |
4 | 4 | import com.huaheng.pc.config.container.domain.Container; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | +import com.huaheng.pc.config.location.domain.Location; | |
6 | 7 | |
7 | 8 | import java.util.List; |
8 | 9 | |
... | ... | @@ -11,4 +12,9 @@ public interface ContainerService extends IService<Container>{ |
11 | 12 | AjaxResult<List<Container>> insertContainer(String type, Integer quantity); |
12 | 13 | |
13 | 14 | String importMaterial(List<Container> containerList, Boolean updateSupport, String operName); |
15 | + | |
16 | + List<Location> getEmptyContainerInLocation(String containerCode, String locationCode, String warehouseCode); | |
17 | + | |
18 | + void updateLocationCodeAndStatus(String containerCode, String locationCode, String status); | |
19 | + | |
14 | 20 | } |
... | ... |
src/main/java/com/huaheng/pc/config/container/service/ContainerServiceImpl.java
... | ... | @@ -9,6 +9,7 @@ import com.huaheng.common.utils.security.ShiroUtils; |
9 | 9 | import com.huaheng.framework.web.domain.AjaxResult; |
10 | 10 | import com.huaheng.pc.config.containerType.service.ContainerTypeService; |
11 | 11 | import com.huaheng.pc.config.container.domain.ContainerStatus; |
12 | +import com.huaheng.pc.config.location.domain.Location; | |
12 | 13 | import org.springframework.stereotype.Service; |
13 | 14 | import javax.annotation.Resource; |
14 | 15 | import java.util.ArrayList; |
... | ... | @@ -42,6 +43,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
42 | 43 | container.setLastUpdatedBy(null); |
43 | 44 | container.setEnable(0); |
44 | 45 | container.setDeleted(false); |
46 | + container.setCompanyCode(ShiroUtils.getCompanyCodeList().get(0)); | |
45 | 47 | container.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
46 | 48 | this.save(container); |
47 | 49 | containerList.add(container); |
... | ... | @@ -55,11 +57,11 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
55 | 57 | LambdaQueryWrapper<Container> lambda = Wrappers.lambdaQuery(); |
56 | 58 | lambda.select(Container::getCode).eq(Container::getContainerType, type) |
57 | 59 | .orderByDesc(Container::getId).last("Limit 1"); |
58 | - String maxCode = containerMapper.selectOne(lambda).getCode(); | |
60 | + Container container = containerMapper.selectOne(lambda); | |
59 | 61 | |
60 | 62 | //如果指定类型的最后的code存在,那么 code = 容器类型 + (排序号 + 1) |
61 | - if (maxCode != null) { | |
62 | - Integer number = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | |
63 | + if (container.getCode() != null) { | |
64 | + Integer number = Integer.valueOf(container.getCode().substring(container.getCode().length() - 5, container.getCode().length())); | |
63 | 65 | return number; |
64 | 66 | } else { |
65 | 67 | return 0; |
... | ... | @@ -108,4 +110,23 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
108 | 110 | } |
109 | 111 | return successMsg.toString(); |
110 | 112 | } |
113 | + | |
114 | + /** | |
115 | + * 已入空容器展示 | |
116 | + * */ | |
117 | + @Override | |
118 | + public List<Location> getEmptyContainerInLocation(String containerCode, String locationCode, String warehouseCode) { | |
119 | + return containerMapper.getEmptyContainerInLocation(containerCode,locationCode,warehouseCode); | |
120 | + } | |
121 | + | |
122 | + /** | |
123 | + * 修改容器库位和状态 | |
124 | + * */ | |
125 | + @Override | |
126 | + public void updateLocationCodeAndStatus(String containerCode, String locationCode, String status) { | |
127 | + if (StringUtils.isNotEmpty(containerCode) || StringUtils.isNotEmpty(locationCode)) | |
128 | + containerMapper.updateLocationCodeAndStatus(ShiroUtils.getWarehouseCode(), containerCode, locationCode, status); | |
129 | + } | |
130 | + | |
131 | + | |
111 | 132 | } |
... | ... |
src/main/java/com/huaheng/pc/config/location/mapper/LocationMapper.java
... | ... | @@ -8,5 +8,7 @@ public interface LocationMapper extends BaseMapper<Location> { |
8 | 8 | |
9 | 9 | void updateStatus(@Param("warehouseCode") String warehouseCode, @Param("code") String code, @Param("status") String status); |
10 | 10 | |
11 | - String position(String locatingRule); | |
11 | + void updateContainerCodeAndStatus(@Param("warehouseCode") String warehouseCode, @Param("locationCode") String locationCode, @Param("containerCode") String containerCode, @Param("status") String status); | |
12 | + | |
13 | + Location position(String locatingRule); | |
12 | 14 | } |
13 | 15 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/location/service/LocationService.java
... | ... | @@ -9,4 +9,7 @@ public interface LocationService extends IService<Location>{ |
9 | 9 | void updateStatus(String locationCode, String status); |
10 | 10 | |
11 | 11 | String position(String locatingRule); |
12 | + | |
13 | + void updateContainerCodeAndStatus(String locationCode, String containerCode, String status); | |
14 | + | |
12 | 15 | } |
... | ... |
src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java
... | ... | @@ -111,6 +111,17 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
111 | 111 | * @return |
112 | 112 | */ |
113 | 113 | public String position(String locatingRule){ |
114 | - return locationMapper.position(locatingRule); | |
114 | + return locationMapper.position(locatingRule).getCode(); | |
115 | 115 | } |
116 | + | |
117 | + /** | |
118 | + * 修改容器和库位状态 | |
119 | + * */ | |
120 | + @Override | |
121 | + public void updateContainerCodeAndStatus(String locationCode, String containerCode, String status) { | |
122 | + if (StringUtils.isNotEmpty(locationCode) || StringUtils.isNotEmpty(containerCode)) | |
123 | + locationMapper.updateContainerCodeAndStatus(ShiroUtils.getWarehouseCode(), locationCode, containerCode, status); | |
124 | + } | |
125 | + | |
126 | + | |
116 | 127 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
23 | 23 | import org.springframework.web.bind.annotation.ResponseBody; |
24 | 24 | |
25 | 25 | import javax.annotation.Resource; |
26 | +import java.util.Collections; | |
26 | 27 | import java.util.List; |
27 | 28 | |
28 | 29 | |
... | ... | @@ -95,6 +96,9 @@ public class CycleCountDetailController extends BaseController { |
95 | 96 | return getDataTable(list); |
96 | 97 | } |
97 | 98 | |
99 | + //空List | |
100 | + //return getDataTable(Collections.emptyList()); | |
101 | + | |
98 | 102 | } |
99 | 103 | |
100 | 104 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
... | ... | @@ -12,6 +12,8 @@ import com.huaheng.framework.web.controller.BaseController; |
12 | 12 | import com.huaheng.framework.web.page.PageDomain; |
13 | 13 | import com.huaheng.framework.web.page.TableDataInfo; |
14 | 14 | import com.huaheng.framework.web.page.TableSupport; |
15 | +import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; | |
16 | +import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; | |
15 | 17 | import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; |
16 | 18 | import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; |
17 | 19 | |
... | ... | @@ -39,6 +41,8 @@ public class CycleCountHeaderController extends BaseController { |
39 | 41 | private CycleCountHeaderService cycleCountHeaderService; |
40 | 42 | @Resource |
41 | 43 | private CycleCountDetailService cycleCountDetailService; |
44 | + @Resource | |
45 | + private AdjustHeaderService adjustHeaderService; | |
42 | 46 | |
43 | 47 | |
44 | 48 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/mapper/InventoryDetailMapper.java
... | ... | @@ -3,5 +3,10 @@ package com.huaheng.pc.inventory.inventoryDetail.mapper; |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
5 | 5 | |
6 | +import java.util.List; | |
7 | + | |
6 | 8 | public interface InventoryDetailMapper extends BaseMapper<InventoryDetail> { |
9 | + | |
10 | + List<InventoryDetail> selectBysql(String sql); | |
11 | + | |
7 | 12 | } |
8 | 13 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
... | ... | @@ -4,11 +4,15 @@ import com.baomidou.mybatisplus.extension.service.IService; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | 5 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
6 | 6 | |
7 | +import java.util.List; | |
8 | + | |
7 | 9 | public interface InventoryDetailService extends IService<InventoryDetail> { |
8 | 10 | |
9 | 11 | |
10 | 12 | AjaxResult detailcreateCheckOutTask (Integer id); |
11 | 13 | |
14 | + List<InventoryDetail> selectBysql(String sql); | |
15 | + | |
12 | 16 | } |
13 | 17 | |
14 | 18 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
... | ... | @@ -102,6 +102,10 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
102 | 102 | return AjaxResult.success("库存明细出库查看任务下发成功!"); |
103 | 103 | } |
104 | 104 | |
105 | + @Override | |
106 | + public List<InventoryDetail> selectBysql(String sql) { | |
107 | + return inventoryDetailMapper.selectBysql(sql); | |
108 | + } | |
105 | 109 | |
106 | 110 | |
107 | 111 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import com.huaheng.common.exception.service.ServiceException; | |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
... | ... | @@ -13,6 +14,8 @@ import com.huaheng.framework.web.domain.AjaxResult; |
13 | 14 | import com.huaheng.framework.web.page.PageDomain; |
14 | 15 | import com.huaheng.framework.web.page.TableDataInfo; |
15 | 16 | import com.huaheng.framework.web.page.TableSupport; |
17 | +import com.huaheng.pc.config.container.service.ContainerService; | |
18 | +import com.huaheng.pc.config.location.domain.Location; | |
16 | 19 | import com.huaheng.pc.config.material.service.MaterialServiceImpl; |
17 | 20 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; |
18 | 21 | import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; |
... | ... | @@ -37,7 +40,8 @@ public class InventoryHeaderController extends BaseController |
37 | 40 | |
38 | 41 | @Resource |
39 | 42 | private InventoryHeaderService inventoryHeaderService; |
40 | - | |
43 | + @Resource | |
44 | + private ContainerService containerService; | |
41 | 45 | |
42 | 46 | @RequiresPermissions("inventory:inventoryHeader:view") |
43 | 47 | @GetMapping() |
... | ... | @@ -95,6 +99,9 @@ public class InventoryHeaderController extends BaseController |
95 | 99 | @PostMapping("/transfer") |
96 | 100 | @ResponseBody |
97 | 101 | public AjaxResult transfer(String sourceLocation, String destinationLocation){ |
102 | + if(StringUtils.isEmpty(sourceLocation) || StringUtils.isEmpty(destinationLocation)){ | |
103 | + throw new ServiceException("源库位和目标库位不能有空值!"); | |
104 | + } | |
98 | 105 | return inventoryHeaderService.transfer(sourceLocation,destinationLocation); |
99 | 106 | } |
100 | 107 | |
... | ... | @@ -108,5 +115,109 @@ public class InventoryHeaderController extends BaseController |
108 | 115 | } |
109 | 116 | return inventoryHeaderService.createCheckOutTask(ids); |
110 | 117 | } |
118 | + | |
119 | + /** | |
120 | + * 空托盘入库页面 | |
121 | + */ | |
122 | + @GetMapping("/emptyIn") | |
123 | + public String emptyIn(){ | |
124 | + return prefix+"/emptyIn"; | |
125 | + } | |
126 | + | |
127 | + /** | |
128 | + * 生成空托盘入库任务 | |
129 | + * @param containerCode | |
130 | + * @param destinationLocation | |
131 | + * @return | |
132 | + */ | |
133 | + //@RequiresPermissions("task:task:emptyIn") | |
134 | + @PostMapping("/emptyIn") | |
135 | + @Log(title = "任务-任务管理", operating = "生成空托盘入库任务", action = BusinessType.INSERT) | |
136 | + @ResponseBody | |
137 | + public AjaxResult emptyIn(String containerCode,String destinationLocation){ | |
138 | + if(StringUtils.isEmpty(containerCode) || StringUtils.isEmpty(destinationLocation)){ | |
139 | + throw new ServiceException("容器和目标库位不能有空值!"); | |
140 | + } | |
141 | + return inventoryHeaderService.createEmptyIn(containerCode, destinationLocation); | |
142 | + } | |
143 | + | |
144 | + /** | |
145 | + * 空托盘出库页面 | |
146 | + */ | |
147 | + @GetMapping("/emptyOut") | |
148 | + public String emptyOut(){ | |
149 | + return prefix+"/emptyOut"; | |
150 | + } | |
151 | + | |
152 | + /** | |
153 | + * 生成空托盘出库任务 | |
154 | + * @param containerCode | |
155 | + * @param sourceLocation | |
156 | + * @return | |
157 | + */ | |
158 | + //@RequiresPermissions("task:task:emptyOut") | |
159 | + @PostMapping("/emptyOut") | |
160 | + @Log(title = "任务-任务管理", operating = "生成空托盘出库任务", action = BusinessType.INSERT) | |
161 | + @ResponseBody | |
162 | + public AjaxResult emptyOut(String containerCode,String sourceLocation){ | |
163 | + if(StringUtils.isEmpty(containerCode) || StringUtils.isEmpty(sourceLocation)){ | |
164 | + throw new ServiceException("容器和源库位不能有空值!"); | |
165 | + } | |
166 | + return inventoryHeaderService.createEmptyOut(containerCode, sourceLocation); | |
167 | + } | |
168 | + | |
169 | + /** | |
170 | + * 空托盘出库查看页面 | |
171 | + */ | |
172 | + @GetMapping("/emptyCheckOut") | |
173 | + public String emptyCheckOut(){ | |
174 | + return prefix+"/emptyCheckOut"; | |
175 | + } | |
176 | + | |
177 | + /** | |
178 | + * 空托盘出库查看任务 | |
179 | + * @param containerCode | |
180 | + * @param location | |
181 | + * @return | |
182 | + */ | |
183 | + //@RequiresPermissions("task:task:emptyInOut") | |
184 | + @PostMapping("/emptyCheckOut") | |
185 | + @Log(title = "任务-任务管理", operating = "生成空托盘出库查看任务", action = BusinessType.INSERT) | |
186 | + @ResponseBody | |
187 | + public AjaxResult emptyCheckOut(String containerCode,String location){ | |
188 | + /*if(StringUtils.isEmpty(containerCode) || StringUtils.isEmpty(location)){ | |
189 | + throw new ServiceException("容器和库位不能有空值!"); | |
190 | + }*/ | |
191 | + return inventoryHeaderService.createEmptyCheckOut(containerCode, location); | |
192 | + } | |
193 | + | |
194 | + /** | |
195 | + * 空托盘显示 | |
196 | + * @return | |
197 | + */ | |
198 | + @GetMapping("/listEmpty") | |
199 | + public String listEmpty(){ | |
200 | + return prefix+"/emptyContainer"; | |
201 | + } | |
202 | + | |
203 | + /** | |
204 | + * 返回空托盘列表 | |
205 | + * @param containerCode | |
206 | + * @param locationCode | |
207 | + * @return | |
208 | + */ | |
209 | + @PostMapping("/listEmptyContainer") | |
210 | + @ResponseBody | |
211 | + public TableDataInfo listEmptyContainer(String containerCode, String locationCode) | |
212 | + { | |
213 | + containerCode = containerCode==null?"":containerCode.trim(); | |
214 | + locationCode = locationCode==null?"":locationCode.trim(); | |
215 | + startPage(); | |
216 | + List<Location> list = containerService.getEmptyContainerInLocation(containerCode,locationCode,ShiroUtils.getWarehouseCode()); | |
217 | + return getDataTable(list); | |
218 | + } | |
219 | + | |
220 | + | |
221 | + | |
111 | 222 | |
112 | 223 | } |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderService.java
... | ... | @@ -17,10 +17,18 @@ public interface InventoryHeaderService extends IService<InventoryHeader> { |
17 | 17 | |
18 | 18 | //移库查询入库组盘 |
19 | 19 | int getUncompleteReceiptContainer(String locationCode,String warehouseCode); |
20 | + | |
20 | 21 | //移库查询出库组盘 |
21 | 22 | int getUncompleteShipmentContainer(String sourceLocation, String warehouseCode); |
22 | 23 | |
23 | 24 | |
25 | + AjaxResult createEmptyIn(String containerCode, String destinationLocation); | |
26 | + | |
27 | + AjaxResult createEmptyOut(String containerCode, String sourceLocation); | |
28 | + | |
29 | + AjaxResult createEmptyCheckOut(String containerCode, String location); | |
30 | + | |
31 | + | |
24 | 32 | } |
25 | 33 | |
26 | 34 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
1 | 1 | package com.huaheng.pc.inventory.inventoryHeader.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import com.huaheng.common.exception.service.ServiceException; | |
6 | +import com.huaheng.common.utils.StringUtils; | |
7 | +import com.huaheng.common.utils.security.ShiroUtils; | |
3 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
9 | +import com.huaheng.pc.config.container.domain.Container; | |
10 | +import com.huaheng.pc.config.container.service.ContainerService; | |
11 | +import com.huaheng.pc.config.location.domain.Location; | |
12 | +import com.huaheng.pc.config.location.service.LocationService; | |
13 | +import com.huaheng.pc.config.warehouse.domain.Warehouse; | |
4 | 14 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; |
15 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail; | |
5 | 16 | import com.huaheng.pc.task.taskDetail.service.TaskDetailService; |
6 | 17 | import com.huaheng.pc.task.taskDetail.service.TaskDetailServiceImpl; |
18 | +import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | |
7 | 19 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
8 | 20 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl; |
9 | 21 | import org.springframework.stereotype.Service; |
... | ... | @@ -12,6 +24,7 @@ import com.huaheng.pc.inventory.inventoryHeader.mapper.InventoryHeaderMapper; |
12 | 24 | import org.springframework.transaction.annotation.Transactional; |
13 | 25 | |
14 | 26 | import javax.annotation.Resource; |
27 | +import java.util.Date; | |
15 | 28 | |
16 | 29 | @Service |
17 | 30 | public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMapper, InventoryHeader> implements InventoryHeaderService { |
... | ... | @@ -20,7 +33,13 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
20 | 33 | @Resource |
21 | 34 | private TaskHeaderService taskHeaderService; |
22 | 35 | @Resource |
36 | + private TaskDetailService taskDetailService; | |
37 | + @Resource | |
23 | 38 | private InventoryHeaderMapper inventoryHeaderMapper; |
39 | + @Resource | |
40 | + private ContainerService containerService; | |
41 | + @Resource | |
42 | + private LocationService locationService; | |
24 | 43 | |
25 | 44 | |
26 | 45 | |
... | ... | @@ -29,7 +48,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
29 | 48 | * */ |
30 | 49 | @Override |
31 | 50 | public AjaxResult transfer(String sourceLocation, String destinationLocation) { |
32 | - //生成移库任务 | |
51 | + //生成移库任务 | |
33 | 52 | taskHeaderService.createTransferTask(sourceLocation,destinationLocation); |
34 | 53 | return AjaxResult.success("移库任务生成成功!"); |
35 | 54 | } |
... | ... | @@ -39,8 +58,8 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
39 | 58 | * */ |
40 | 59 | @Override |
41 | 60 | public AjaxResult createCheckOutTask(String[] ids) { |
42 | - //生成出库查看任务 | |
43 | - taskHeaderService.createCheckOutTask(ids); | |
61 | + //生成出库查看任务 | |
62 | + taskHeaderService.createCheckOutTask(ids); | |
44 | 63 | return AjaxResult.success("出库查看任务正在生成!"); |
45 | 64 | } |
46 | 65 | |
... | ... | @@ -54,7 +73,241 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
54 | 73 | return inventoryHeaderMapper.getUncompleteShipmentContainer(locationCode,warehouseCode); |
55 | 74 | } |
56 | 75 | |
76 | + /** | |
77 | + * 空托入库 | |
78 | + * */ | |
79 | + @Transactional | |
80 | + @Override | |
81 | + public AjaxResult createEmptyIn(String containerCode, String destinationLocation) { | |
82 | + // 校验托盘 | |
83 | + Container container = new Container(); | |
84 | + container.setCode(containerCode); | |
85 | + container.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
86 | + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(container); | |
87 | + container = containerService.getOne(lambdaQueryWrapper); | |
88 | + if(container==null) { | |
89 | + return AjaxResult.error("容器不存在"); | |
90 | + } | |
91 | + if (StringUtils.isNotEmpty(container.getLocationCode())) { | |
92 | + return AjaxResult.error("容器已在库位[" + container.getLocationCode() + "]上"); | |
93 | + } | |
94 | + //库位 | |
95 | + Location temp = new Location(); | |
96 | + temp.setCode(destinationLocation); | |
97 | + temp.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
98 | + LambdaQueryWrapper lambda = Wrappers.lambdaQuery(temp); | |
99 | + Location loc = locationService.getOne(lambda); | |
100 | + if(StringUtils.isNotEmpty(destinationLocation)) { | |
101 | + //校验目标地址 | |
102 | + if (loc == null) { | |
103 | + return AjaxResult.error("目标库位不存在"); | |
104 | + } | |
105 | + if (StringUtils.isNotEmpty(loc.getContainerCode())) { | |
106 | + return AjaxResult.error("目标库位已存在托盘"); | |
107 | + } | |
108 | + if (!loc.getStatus().equals("empty")) { | |
109 | + return AjaxResult.error("目标库位非空闲"); | |
110 | + } | |
111 | + } | |
112 | + | |
113 | + //判断托盘是否已经存在任务 | |
114 | + Integer taskCount = taskHeaderService.UncompleteCount(containerCode); | |
115 | + if (taskCount != null && taskCount.intValue() > 0) { | |
116 | + return AjaxResult.error("容器已存在任务"); | |
117 | + } | |
118 | + | |
119 | + //创建主任务 | |
120 | + TaskHeader taskHeader = new TaskHeader(); | |
121 | + taskHeader.setWarehouseCode(loc.getWarehouseCode()); | |
122 | + taskHeader.setCompanyCode("空容器");//货主 | |
123 | + taskHeader.setInternalTaskType(100); //入库内部类型都给100 | |
124 | + taskHeader.setTaskType(500); | |
125 | + taskHeader.setContainerCode(container.getCode()); | |
126 | + taskHeader.setStatus(1); | |
127 | + taskHeader.setFromLocation(""); | |
128 | + taskHeader.setToLocation(loc.getCode()); | |
129 | + taskHeader.setCreated(new Date()); | |
130 | + taskHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
131 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
132 | + taskHeader.setLastUpdated(new Date()); | |
133 | + if(taskHeaderService.save(taskHeader)){ | |
134 | + //锁定库位状态 | |
135 | + locationService.updateStatus(loc.getContainerCode(),"lock"); | |
136 | + }else{ | |
137 | + throw new ServiceException("空托入库主表生成失败!"); | |
138 | + } | |
139 | + //写入任务细表 | |
140 | + TaskDetail taskDetail = new TaskDetail(); | |
141 | + taskDetail.setTaskId(taskHeader.getId());//主单ID | |
142 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
143 | + taskDetail.setInternalTaskType(taskHeader.getTaskType()); | |
144 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
145 | + taskDetail.setCompanyCode("空容器"); | |
146 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
147 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
148 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
149 | + taskDetail.setCreated(new Date()); | |
150 | + taskDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
151 | + taskDetail.setLastUpdated(new Date()); | |
152 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
153 | + if(taskDetailService.save(taskDetail) == false){ | |
154 | + throw new ServiceException("空托入库任务明细生成失败!"); | |
155 | + } | |
156 | + return AjaxResult.success(taskHeader.getId()); | |
157 | + } | |
158 | + | |
159 | + /** | |
160 | + *空托出库 | |
161 | + * */ | |
162 | + @Transactional | |
163 | + @Override | |
164 | + public AjaxResult createEmptyOut(String containerCode, String sourceLocation) { | |
165 | + // 检查容器 | |
166 | + Container temp3 = new Container(); | |
167 | + temp3.setCode(containerCode); | |
168 | + temp3.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
169 | + LambdaQueryWrapper lambda3 = Wrappers.lambdaQuery(temp3); | |
170 | + Container container = containerService.getOne(lambda3); | |
171 | + if(container==null){ | |
172 | + return AjaxResult.error("托盘不存在"); | |
173 | + } | |
174 | + if (StringUtils.isEmpty(container.getLocationCode())|| !(container.getLocationCode().equals(sourceLocation))) { | |
175 | + return AjaxResult.error("容器不在库位[" + sourceLocation + "]上"); | |
176 | + } | |
177 | + //检查库位 | |
178 | + Location temp4 = new Location(); | |
179 | + temp4.setCode(sourceLocation); | |
180 | + temp4.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
181 | + LambdaQueryWrapper lamda4 = Wrappers.lambdaQuery(temp4); | |
182 | + Location loc = locationService.getOne(lamda4); | |
183 | + if(loc==null){ | |
184 | + return AjaxResult.error("源货位不存在"); | |
185 | + } | |
186 | + if(StringUtils.isEmpty(loc.getContainerCode())){ | |
187 | + return AjaxResult.error("源货位没有托盘"); | |
188 | + } | |
189 | + if(!loc.getStatus().equals("empty")){ | |
190 | + return AjaxResult.error("源货位非空闲"); | |
191 | + } | |
192 | + //判断托盘是否已经存在任务 | |
193 | + Integer taskCount = taskHeaderService.UncompleteCount(containerCode); | |
194 | + if (taskCount != null && taskCount.intValue() > 0) { | |
195 | + return AjaxResult.error("容器已存在任务"); | |
196 | + } | |
197 | + | |
198 | + //生成任务 | |
199 | + TaskHeader taskHeader = new TaskHeader(); | |
200 | + taskHeader.setWarehouseCode(loc.getWarehouseCode()); | |
201 | + taskHeader.setCompanyCode("空容器");//货主 | |
202 | + taskHeader.setInternalTaskType(200); //出库内部类型都给200 | |
203 | + taskHeader.setTaskType(600); | |
204 | + taskHeader.setContainerCode(container.getCode()); | |
205 | + taskHeader.setStatus(1); | |
206 | + taskHeader.setFromLocation(sourceLocation); | |
207 | + taskHeader.setToLocation(""); | |
208 | + taskHeader.setCreated(new Date()); | |
209 | + taskHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
210 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
211 | + taskHeader.setLastUpdated(new Date()); | |
212 | + if(taskHeaderService.save(taskHeader)){ | |
213 | + //锁定库位状态 | |
214 | + locationService.updateStatus(loc.getContainerCode(),"lock"); | |
215 | + }else{ | |
216 | + throw new ServiceException("空托出库主表生成失败!"); | |
217 | + } | |
218 | + //写入任务细表 | |
219 | + TaskDetail taskDetail = new TaskDetail(); | |
220 | + taskDetail.setTaskId(taskHeader.getId());//主单ID | |
221 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
222 | + taskDetail.setInternalTaskType(taskHeader.getTaskType()); | |
223 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
224 | + taskDetail.setCompanyCode("空容器"); | |
225 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
226 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
227 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
228 | + taskDetail.setCreated(new Date()); | |
229 | + taskDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
230 | + taskDetail.setLastUpdated(new Date()); | |
231 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
232 | + if(taskDetailService.save(taskDetail) == false){ | |
233 | + throw new ServiceException("空托出库任务明细生成失败!"); | |
234 | + } | |
235 | + return AjaxResult.success(taskHeader.getId()); | |
236 | + } | |
57 | 237 | |
238 | + /** | |
239 | + *空托出库查看 | |
240 | + * */ | |
241 | + @Transactional | |
242 | + @Override | |
243 | + public AjaxResult createEmptyCheckOut(String containerCode, String location) { | |
244 | + // 检查容器 | |
245 | + Container temp5 = new Container(); | |
246 | + temp5.setCode(containerCode); | |
247 | + temp5.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
248 | + LambdaQueryWrapper lambda5 = Wrappers.lambdaQuery(temp5); | |
249 | + Container container = containerService.getOne(lambda5); | |
250 | + if(container==null){ | |
251 | + return AjaxResult.error("托盘不存在"); | |
252 | + } | |
253 | + if (StringUtils.isEmpty(container.getLocationCode())|| !(container.getLocationCode().equals(location))) { | |
254 | + return AjaxResult.error("容器不在库位[" + location + "]上"); | |
255 | + } | |
256 | + //检查库位 | |
257 | + Location temp6 = new Location(); | |
258 | + temp6.setCode(location); | |
259 | + temp6.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
260 | + LambdaQueryWrapper lamdba6 = Wrappers.lambdaQuery(temp6); | |
261 | + Location loc = locationService.getOne(lamdba6); | |
262 | + if(loc==null){ | |
263 | + return AjaxResult.error("源货位不存在"); | |
264 | + } | |
265 | + if(StringUtils.isEmpty(loc.getContainerCode())){ | |
266 | + return AjaxResult.error("源货位没有托盘"); | |
267 | + } | |
268 | + if(!loc.getStatus().equals("empty")){ | |
269 | + return AjaxResult.error("源货位非空闲"); | |
270 | + } | |
271 | + //创建任务 | |
272 | + TaskHeader taskHeader = new TaskHeader(); | |
273 | + taskHeader.setWarehouseCode(loc.getWarehouseCode()); | |
274 | + taskHeader.setCompanyCode("空容器");//货主 | |
275 | + taskHeader.setInternalTaskType(200); //出库内部类型都给200 | |
276 | + taskHeader.setTaskType(900); | |
277 | + taskHeader.setContainerCode(container.getCode()); | |
278 | + taskHeader.setStatus(1); | |
279 | + taskHeader.setFromLocation(location); | |
280 | + taskHeader.setToLocation(location); | |
281 | + taskHeader.setCreated(new Date()); | |
282 | + taskHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
283 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
284 | + taskHeader.setLastUpdated(new Date()); | |
285 | + if(taskHeaderService.save(taskHeader)){ | |
286 | + //锁定库位状态 | |
287 | + locationService.updateStatus(loc.getContainerCode(),"lock"); | |
288 | + }else{ | |
289 | + throw new ServiceException("空托出库主表生成失败!"); | |
290 | + } | |
291 | + //写入任务细表 | |
292 | + TaskDetail taskDetail = new TaskDetail(); | |
293 | + taskDetail.setTaskId(taskHeader.getId());//主单ID | |
294 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
295 | + taskDetail.setInternalTaskType(taskHeader.getTaskType()); | |
296 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
297 | + taskDetail.setCompanyCode("空容器"); | |
298 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
299 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
300 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
301 | + taskDetail.setCreated(new Date()); | |
302 | + taskDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
303 | + taskDetail.setLastUpdated(new Date()); | |
304 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
305 | + if(taskDetailService.save(taskDetail) == false){ | |
306 | + throw new ServiceException("空托出库任务明细生成失败!"); | |
307 | + } | |
308 | + return AjaxResult.success(taskHeader.getId()); | |
309 | + | |
310 | + } | |
58 | 311 | |
59 | 312 | |
60 | 313 | |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java
... | ... | @@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import com.huaheng.common.support.Convert; | |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
9 | 10 | import com.huaheng.framework.aspectj.lang.constant.BusinessType; |
10 | 11 | import com.huaheng.framework.web.controller.BaseController; |
12 | +import com.huaheng.framework.web.domain.AjaxResult; | |
11 | 13 | import com.huaheng.framework.web.page.PageDomain; |
12 | 14 | import com.huaheng.framework.web.page.TableDataInfo; |
13 | 15 | import com.huaheng.framework.web.page.TableSupport; |
... | ... | @@ -23,6 +25,7 @@ import org.springframework.ui.ModelMap; |
23 | 25 | import org.springframework.web.bind.annotation.*; |
24 | 26 | |
25 | 27 | import javax.annotation.Resource; |
28 | +import java.util.Arrays; | |
26 | 29 | import java.util.List; |
27 | 30 | |
28 | 31 | @Controller |
... | ... | @@ -48,14 +51,14 @@ public class ReceiptContainerDetailController extends BaseController { |
48 | 51 | @ApiOperation(value="查看入库详情", notes="根据头表id获取入库单明细信息", httpMethod = "POST") |
49 | 52 | @RequiresPermissions("receipt:receiptDetail:list") |
50 | 53 | @Log(title = "入库-入库单明细管理", operating = "查看入库单明细", action = BusinessType.GRANT) |
51 | - @PostMapping("/list") | |
54 | + @PostMapping("/list/{id}") | |
52 | 55 | @ResponseBody |
53 | - public TableDataInfo list(@ApiParam(name="receiptDetail",value="入库详情") Integer receiptDetailId) { | |
56 | + public TableDataInfo list(@ApiParam(name="receiptDetail",value="入库详情") @PathVariable("id")Integer receiptDetailId) { | |
54 | 57 | LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
55 | 58 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
56 | 59 | Integer pageNum = pageDomain.getPageNum(); |
57 | 60 | Integer pageSize = pageDomain.getPageSize(); |
58 | - lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptDetailId, receiptDetailId); | |
61 | + lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptDetailId); | |
59 | 62 | |
60 | 63 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
61 | 64 | /*使用分页查询*/ |
... | ... | @@ -67,4 +70,16 @@ public class ReceiptContainerDetailController extends BaseController { |
67 | 70 | return getDataTable(list); |
68 | 71 | } |
69 | 72 | } |
73 | + | |
74 | + @RequiresPermissions("receipt:receiptContainerDetail:remove") | |
75 | + @Log(title = "入库-入库详情列表", operating = "入库详情列表", action = BusinessType.GRANT) | |
76 | + @PostMapping("remove") | |
77 | + public AjaxResult remove(String ids) { | |
78 | + if (StringUtils.isEmpty(ids)){ | |
79 | + return AjaxResult.error("id不能为空"); | |
80 | + } | |
81 | + | |
82 | + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); | |
83 | + return toAjax(receiptContainerDetailService.detailRemove(idList)); | |
84 | + } | |
70 | 85 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailService.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.receipt.receiptContainerDetail.service; |
3 | 3 | import com.huaheng.framework.web.domain.AjaxResult; |
4 | 4 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | +import com.sun.org.apache.xpath.internal.operations.Bool; | |
6 | 7 | |
7 | 8 | import java.util.List; |
8 | 9 | import java.util.Map; |
... | ... | @@ -10,4 +11,6 @@ import java.util.Map; |
10 | 11 | public interface ReceiptContainerDetailService extends IService<ReceiptContainerDetail>{ |
11 | 12 | |
12 | 13 | AjaxResult<List<Map<String, Object>>> getReceiptInfoByBill(String receiptCode); |
14 | + | |
15 | + Boolean detailRemove(List<Integer> idList); | |
13 | 16 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java
... | ... | @@ -3,17 +3,32 @@ package com.huaheng.pc.receipt.receiptContainerDetail.service; |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.exception.service.ServiceException; | |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
8 | 9 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
9 | 10 | import com.huaheng.pc.receipt.receiptContainerDetail.mapper.ReceiptContainerDetailMapper; |
11 | +import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; | |
12 | +import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; | |
13 | +import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; | |
14 | +import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; | |
10 | 15 | import org.springframework.stereotype.Service; |
11 | 16 | |
17 | +import javax.annotation.Resource; | |
12 | 18 | import java.util.List; |
13 | 19 | import java.util.Map; |
14 | 20 | @Service |
15 | 21 | public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContainerDetailMapper, ReceiptContainerDetail> implements ReceiptContainerDetailService{ |
16 | 22 | |
23 | + @Resource | |
24 | + private ReceiptDetailService receiptDetailService; | |
25 | + @Resource | |
26 | + private ReceiptHeaderService receiptHeaderService; | |
27 | + /** | |
28 | + * 根据入库单编码查询入库组盘明细 | |
29 | + * @param receiptCode | |
30 | + * @return | |
31 | + */ | |
17 | 32 | @Override |
18 | 33 | public AjaxResult<List<Map<String, Object>>> getReceiptInfoByBill(String receiptCode) { |
19 | 34 | LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... | @@ -24,5 +39,44 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai |
24 | 39 | return AjaxResult.success(detail); |
25 | 40 | } |
26 | 41 | |
42 | + /** | |
43 | + * 撤销入库组盘明细 | |
44 | + * @param idList | |
45 | + * @return | |
46 | + */ | |
47 | + @Override | |
48 | + public Boolean detailRemove(List<Integer> idList) { | |
49 | + for (Integer id : idList){ | |
50 | + ReceiptContainerDetail receiptContainerDetail = this.getById(id); | |
51 | + //如果已生成任务不允许撤销 | |
52 | + if (receiptContainerDetail.getStatus() < 10){ | |
53 | + //回滚入库单明细收货数量 | |
54 | + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); | |
55 | + receiptDetail.setOpenQty(receiptDetail.getOpenQty() - receiptContainerDetail.getQty()); | |
56 | + if (!receiptDetailService.updateById(receiptDetail)){throw new SecurityException("回滚入库单明细失败");} | |
57 | + | |
58 | + //查询入库头表 | |
59 | + LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); | |
60 | + containerDetailLambda = Wrappers.lambdaQuery(); | |
61 | + containerDetailLambda.eq(ReceiptContainerDetail::getReceiptId, receiptContainerDetail.getReceiptId()); | |
62 | + List<ReceiptContainerDetail> containerDetailList = this.list(containerDetailLambda); | |
63 | + //如果入库组盘没有该入库单的组盘信息,回滚入库单状态 | |
64 | + if (containerDetailList == null){ | |
65 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
66 | + receiptHeader.setId(receiptContainerDetail.getReceiptId()); | |
67 | + receiptHeader.setFirstStatus(200); | |
68 | + receiptHeader.setLastStatus(200); | |
69 | + receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
70 | + | |
71 | + if (!receiptHeaderService.updateById(receiptHeader)){ throw new ServiceException("回滚头表状态失败"); } | |
72 | + } | |
73 | + | |
74 | + } else { | |
75 | + throw new SecurityException("已生成任务,不允许取消"); | |
76 | + } | |
77 | + } | |
78 | + return true; | |
79 | + } | |
80 | + | |
27 | 81 | |
28 | 82 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... | ... | @@ -102,7 +102,7 @@ public class ReceiptContainerHeaderController extends BaseController { |
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | - * 删除入库单 | |
105 | + * 删除入库组盘 | |
106 | 106 | */ |
107 | 107 | @ApiOperation(value="取消", notes="取消入库组盘", httpMethod = "POST") |
108 | 108 | @RequiresPermissions("receipt:receiptContainer:remove") |
... | ... | @@ -114,7 +114,7 @@ public class ReceiptContainerHeaderController extends BaseController { |
114 | 114 | return AjaxResult.error("id为空"); |
115 | 115 | } |
116 | 116 | List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); |
117 | - return toAjax(receiptContainerHeaderService.removeByIds(idList)); | |
117 | + return toAjax(receiptContainerHeaderService.cancelByIds(idList)); | |
118 | 118 | } |
119 | 119 | /** |
120 | 120 | * 生成任务 |
... | ... | @@ -134,14 +134,13 @@ public class ReceiptContainerHeaderController extends BaseController { |
134 | 134 | lambda.select(ReceiptContainerHeader::getId) |
135 | 135 | .lt(ReceiptContainerHeader::getStatus, 10) |
136 | 136 | .le(ReceiptContainerHeader::getId, maxId); |
137 | - List<Object> ContainerIdList = receiptContainerHeaderService.listObjs(lambda); | |
138 | 137 | return taskHeaderService.createReceiptTask(idList); |
139 | 138 | } |
140 | 139 | |
141 | 140 | /** |
142 | 141 | * 定位 |
143 | 142 | */ |
144 | - @RequiresPermissions("receipt:receiptContainer:createTask") | |
143 | + @RequiresPermissions("receipt:receiptContainer:position") | |
145 | 144 | @Log(title = "入库-定位", operating = "定位", action = BusinessType.INSERT) |
146 | 145 | @PostMapping( "/position") |
147 | 146 | @ResponseBody |
... | ... | @@ -151,7 +150,10 @@ public class ReceiptContainerHeaderController extends BaseController { |
151 | 150 | } |
152 | 151 | List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); |
153 | 152 | for (int i = 0; i<idList.size(); i++){ |
154 | - ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getById(idList.get(i)); | |
153 | + LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); | |
154 | + lambda.eq(ReceiptContainerDetail::getReceiptContainerId, idList.get(i)); | |
155 | + List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda); | |
156 | + for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails) | |
155 | 157 | receivingService.position(receiptContainerDetail); |
156 | 158 | } |
157 | 159 | return AjaxResult.success(""); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderService.java
... | ... | @@ -3,6 +3,9 @@ package com.huaheng.pc.receipt.receiptContainerHeader.service; |
3 | 3 | import com.huaheng.framework.web.domain.AjaxResult; |
4 | 4 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
6 | 9 | public interface ReceiptContainerHeaderService extends IService<ReceiptContainerHeader>{ |
7 | 10 | |
8 | 11 | /** |
... | ... | @@ -18,4 +21,6 @@ public interface ReceiptContainerHeaderService extends IService<ReceiptContainer |
18 | 21 | */ |
19 | 22 | AjaxResult saveCountain(String receiptCode, String containerCode, Integer receiptDetailId, Integer taskType, |
20 | 23 | String locationCode, Integer qty, String locatingRule); |
24 | + | |
25 | + Boolean cancelByIds(List<Integer> id); | |
21 | 26 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -114,16 +114,66 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
114 | 114 | receiptDetail = receiptDetailService.getById(receiptDetailId); |
115 | 115 | |
116 | 116 | receiptContainerDetailAdd(receiptContainerHeaders.get(0).getId(), receiptDetail, qty, containerCode); |
117 | - //更新入库详情状态和入库单状态 | |
118 | - ReceiptDetail receiptDetail1 = receiptDetailService.queryflow(receiptDetail); | |
119 | - if (!receiptDetailService.updateById(receiptDetail1)){ | |
120 | - throw new ServiceException("更新入库详情下一流程失败"); | |
117 | + //如果单据数量等于已收数量,更新入库详情状态和入库单状态 | |
118 | + if (receiptDetail.getTotalQty() == receiptDetail.getOpenQty()){ | |
119 | + ReceiptDetail receiptDetail1 = receiptDetailService.queryflow(receiptDetail); | |
120 | + if (!receiptDetailService.updateById(receiptDetail1)){ | |
121 | + throw new ServiceException("更新入库详情下一流程失败"); | |
122 | + } | |
121 | 123 | } |
122 | 124 | receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); |
123 | 125 | return AjaxResult.success("success"); |
124 | 126 | } |
125 | 127 | |
126 | 128 | /** |
129 | + * 批量撤销入库组盘 | |
130 | + * @param ids | |
131 | + * @return | |
132 | + */ | |
133 | + @Override | |
134 | + public Boolean cancelByIds(List<Integer> ids) { | |
135 | + for (Integer id : ids) { | |
136 | + //如果已生成任务则不允许取消组盘 | |
137 | + if (this.getById(id).getStatus() < 10){ | |
138 | + //根据组盘头表id查询组盘明细表 | |
139 | + LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); | |
140 | + containerDetailLambda.eq(ReceiptContainerDetail::getReceiptContainerId, id); | |
141 | + List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(containerDetailLambda); | |
142 | + | |
143 | + //查询入库单明细,减去已收数量,更新单据 | |
144 | + for (ReceiptContainerDetail receiptContainerDetail: receiptContainerDetails){ | |
145 | + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); | |
146 | + receiptDetail.setOpenQty(receiptDetail.getOpenQty()-receiptContainerDetail.getQty()); | |
147 | + if (!receiptDetailService.updateById(receiptDetail)){throw new ServiceException("回滚入库明细失败"); } | |
148 | + | |
149 | + containerDetailLambda = Wrappers.lambdaQuery(); | |
150 | + containerDetailLambda.eq(ReceiptContainerDetail::getReceiptId, receiptContainerDetail.getReceiptId()); | |
151 | + List<ReceiptContainerDetail> containerDetailList = receiptContainerDetailService.list(containerDetailLambda); | |
152 | + //如果入库组盘没有该入库单的组盘信息,回滚入库单状态 | |
153 | + if (containerDetailList == null){ | |
154 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
155 | + receiptHeader.setId(receiptContainerDetail.getReceiptId()); | |
156 | + receiptHeader.setFirstStatus(200); | |
157 | + receiptHeader.setLastStatus(200); | |
158 | + receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
159 | + | |
160 | + if (!receiptHeaderService.updateById(receiptHeader)){ throw new ServiceException("回滚头表状态失败"); } | |
161 | + } | |
162 | + | |
163 | + if (!receiptContainerDetailService.removeById(receiptContainerDetail.getId())){ | |
164 | + throw new ServiceException("删除入库组盘明细表失败,id是"+receiptContainerDetail.getId()); | |
165 | + } | |
166 | + } | |
167 | + //删除入库组盘头表 | |
168 | + this.removeById(id); | |
169 | + } else { | |
170 | + throw new ServiceException("已生成任务不允许取消"); | |
171 | + } | |
172 | + } | |
173 | + return true; | |
174 | + } | |
175 | + | |
176 | + /** | |
127 | 177 | * 检查容器编码合法性 |
128 | 178 | * @param containerCode |
129 | 179 | * @return |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... | ... | @@ -6,6 +6,9 @@ import com.huaheng.common.exception.service.ServiceException; |
6 | 6 | import com.huaheng.common.utils.StringUtils; |
7 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
8 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
9 | +import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; | |
10 | +import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; | |
11 | +import com.huaheng.pc.config.FilterConfigHeader.domain.FilterConfigHeader; | |
9 | 12 | import com.huaheng.pc.config.configValue.domain.ConfigValue; |
10 | 13 | import com.huaheng.pc.config.configValue.service.ConfigValueService; |
11 | 14 | import com.huaheng.pc.config.location.domain.Location; |
... | ... | @@ -50,6 +53,8 @@ public class ReceivingService { |
50 | 53 | private ConfigValueService configValueService; |
51 | 54 | @Resource |
52 | 55 | private ReceiptPreferenceService preferenceService; |
56 | + @Resource | |
57 | + private FilterConfigDetailService filterConfigDetailService; | |
53 | 58 | |
54 | 59 | /** |
55 | 60 | * 获取当前单号详情 |
... | ... | @@ -76,7 +81,7 @@ public class ReceivingService { |
76 | 81 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
77 | 82 | |
78 | 83 | //如果入库组盘表中有目标库位说名已经指定 |
79 | - if (receiptContainerHeader.getToLocation() != null){return true;} | |
84 | + if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){return true;} | |
80 | 85 | String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则 |
81 | 86 | if (StringUtils.isNotEmpty(locatingRule)){ |
82 | 87 | //入库组盘头表中定位规则不为空时执行 |
... | ... | @@ -105,10 +110,21 @@ public class ReceivingService { |
105 | 110 | } |
106 | 111 | } |
107 | 112 | } |
113 | + //通过定位规则查找自定义sql | |
114 | + LambdaQueryWrapper<FilterConfigDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
115 | + lambdaQueryWrapper.eq(FilterConfigDetail::getCode, locatingRule); | |
116 | + FilterConfigDetail filterConfigDetail = filterConfigDetailService.getOne(lambdaQueryWrapper); | |
117 | + | |
108 | 118 | //根据定位规则查询库位编码 |
109 | - String locationCode = locationService.position(locatingRule); | |
119 | + LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); | |
120 | + locationLambda.last(filterConfigDetail.getStatement()); | |
121 | + String locationCode = locationService.getOne(locationLambda).getCode(); | |
110 | 122 | |
111 | - locationService.updateStatus(locationCode, "lock"); | |
123 | + if (StringUtils.isNotEmpty(locationCode)){ | |
124 | + locationService.updateStatus(locationCode, "3"); | |
125 | + } else { | |
126 | + throw new ServiceException("定位失败,请检查定位规则是否正确"); | |
127 | + } | |
112 | 128 | |
113 | 129 | receiptContainerHeader.setToLocation(locationCode); |
114 | 130 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -187,6 +187,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
187 | 187 | //赋值u8仓库 |
188 | 188 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); |
189 | 189 | shipmentContainerHeader.setStatus(0); |
190 | + shipmentContainerHeader.setTaskCreated(0); | |
190 | 191 | shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName()); |
191 | 192 | shipmentContainerHeader.setCreated(null); |
192 | 193 | // Material material=new Material(); |
... | ... | @@ -397,7 +398,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
397 | 398 | if(num==shipmentDetailList.size()){ |
398 | 399 | throw new ServiceException("单据物料在此库区没有库存,无法出库"); |
399 | 400 | } |
400 | - return AjaxResult.success(""); | |
401 | + return AjaxResult.success("成功"); | |
401 | 402 | } |
402 | 403 | |
403 | 404 | /** |
... | ... | @@ -423,10 +424,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
423 | 424 | ShipmentTaskCreateModel shipmentTask = new ShipmentTaskCreateModel(); |
424 | 425 | for (Integer id : idList) { |
425 | 426 | shipmentTask.setShipmentContainerHeaderIds(id); |
426 | -// AjaxResult ajaxResult = taskHeaderService.createTaskFromShipmentContainers(shipmentTask); | |
427 | -// if(ajaxResult.hasErr()){ | |
428 | -// return ajaxResult; | |
429 | -// } | |
427 | + AjaxResult ajaxResult = taskHeaderService.createTaskFromShipmentContainers(shipmentTask); | |
428 | + if(ajaxResult.hasErr()){ | |
429 | + return ajaxResult; | |
430 | + } | |
430 | 431 | } |
431 | 432 | return AjaxResult.success("全部生成完毕"); |
432 | 433 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/controller/ShipmentDetailController.java
... | ... | @@ -67,6 +67,7 @@ public class ShipmentDetailController extends BaseController |
67 | 67 | .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
68 | 68 | .in(ShipmentDetail::getCompanyCode,ShiroUtils.getCompanyCodeList()) |
69 | 69 | .eq(StringUtils.isNotEmpty(shipmentDetail.getShipmentCode()),ShipmentDetail::getShipmentCode,shipmentDetail.getShipmentCode()) |
70 | + .eq(ShipmentDetail::getShipmentId,shipmentDetail.getShipmentId()) | |
70 | 71 | .orderByAsc(ShipmentDetail::getId); |
71 | 72 | |
72 | 73 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
... | ... | @@ -8,11 +8,14 @@ import com.huaheng.common.utils.security.ShiroUtils; |
8 | 8 | import com.huaheng.framework.web.controller.BaseController; |
9 | 9 | import com.huaheng.framework.web.domain.AjaxResult; |
10 | 10 | import com.huaheng.framework.web.page.TableDataInfo; |
11 | +import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; | |
12 | +import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; | |
11 | 13 | import com.huaheng.pc.config.configValue.domain.ConfigValue; |
12 | 14 | import com.huaheng.pc.config.configValue.service.ConfigValueService; |
13 | 15 | import com.huaheng.pc.config.material.domain.Material; |
14 | 16 | import com.huaheng.pc.config.material.service.MaterialServiceImpl; |
15 | 17 | import com.huaheng.pc.config.shipmentPreference.domain.ShipmentPreference; |
18 | +import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService; | |
16 | 19 | import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; |
17 | 20 | import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; |
18 | 21 | import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; |
... | ... | @@ -30,6 +33,7 @@ import org.springframework.stereotype.Controller; |
30 | 33 | import org.springframework.ui.ModelMap; |
31 | 34 | import org.springframework.web.bind.annotation.*; |
32 | 35 | |
36 | +import java.util.ArrayList; | |
33 | 37 | import java.util.List; |
34 | 38 | |
35 | 39 | @Controller |
... | ... | @@ -54,6 +58,10 @@ public class ShippingCombinationController extends BaseController { |
54 | 58 | InventoryDetailService inventoryDetailService; |
55 | 59 | @Autowired |
56 | 60 | ConfigValueService configValueService; |
61 | + @Autowired | |
62 | + FilterConfigDetailService filterConfigDetailService; | |
63 | + @Autowired | |
64 | + ShipmentPreferenceService shipmentPreferenceService; | |
57 | 65 | |
58 | 66 | |
59 | 67 | /** |
... | ... | @@ -89,38 +97,6 @@ public class ShippingCombinationController extends BaseController { |
89 | 97 | } |
90 | 98 | |
91 | 99 | |
92 | - /** | |
93 | - * 获取能出库的库存列表 | |
94 | - * @param code,id | |
95 | - * @return | |
96 | - */ | |
97 | - @PostMapping("/getInventory") | |
98 | - @ResponseBody | |
99 | - public TableDataInfo getInventory(String code, Integer id){ | |
100 | - //找到主单的账套 | |
101 | - LambdaQueryWrapper<ShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
102 | - lambdaQueryWrapper.eq(ShipmentHeader::getCode,code) | |
103 | - .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
104 | - ShipmentHeader shipmentHeader=shipmentHeaderService.getOne(lambdaQueryWrapper); | |
105 | - if(shipmentHeader==null){ | |
106 | - throw new ServiceException("找不到主单"); | |
107 | - } | |
108 | - //找到子单物料 | |
109 | - ShipmentDetail shipmentDetail=new ShipmentDetail(); | |
110 | - shipmentDetail=shipmentDetailService.getById(id); | |
111 | - if(shipmentDetail==null){ | |
112 | - throw new ServiceException("找不到子单"); | |
113 | - } | |
114 | - LambdaQueryWrapper<InventoryDetail> lam = Wrappers.lambdaQuery(); | |
115 | - lam.eq(InventoryDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) | |
116 | - .eq(InventoryDetail::getCompanyCode,shipmentHeader.getCompanyCode()) | |
117 | - .eq(InventoryDetail::getMaterialCode,shipmentDetail.getMaterialCode()); | |
118 | - | |
119 | - List<InventoryDetail> list= inventoryDetailService.list(lam); | |
120 | - return getDataTable(list); | |
121 | - } | |
122 | - | |
123 | - | |
124 | 100 | // /** |
125 | 101 | // * 获取能出库的库存列表 |
126 | 102 | // * @param code,id |
... | ... | @@ -143,42 +119,10 @@ public class ShippingCombinationController extends BaseController { |
143 | 119 | // if(shipmentDetail==null){ |
144 | 120 | // throw new ServiceException("找不到子单"); |
145 | 121 | // } |
146 | -// | |
147 | -// //出库首选项 | |
148 | -// LambdaQueryWrapper<ShipmentPreference> shipmentPreferenceLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
149 | -// | |
150 | -// //出库规则 | |
151 | -// //出库子单的分配规则 | |
152 | -// if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){ | |
153 | -// | |
154 | -// | |
155 | -// } | |
156 | -// | |
157 | -// //物料的分+配规则 | |
158 | -// LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
159 | -// materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
160 | -// .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
161 | -// Material material=materialService.getOne(materialLambdaQueryWrapper); | |
162 | -// if(StringUtils.isNotEmpty(material.getAllocationRule())){ | |
163 | -// | |
164 | -// | |
165 | -// } | |
166 | -// | |
167 | -// //仓库的分配规则 | |
168 | -// LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
169 | -// configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment") | |
170 | -// .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
171 | -// ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper); | |
172 | -// //查找出库首选项 | |
173 | -// | |
174 | -// configValue.getIdentifier(); | |
175 | -// | |
176 | -// | |
177 | -// | |
178 | 122 | // LambdaQueryWrapper<InventoryDetail> lam = Wrappers.lambdaQuery(); |
179 | 123 | // lam.eq(InventoryDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) |
180 | 124 | // .eq(InventoryDetail::getCompanyCode,shipmentHeader.getCompanyCode()) |
181 | -// .eq(InventoryDetail::getMaterialName,shipmentDetail.getMaterialCode()); | |
125 | +// .eq(InventoryDetail::getMaterialCode,shipmentDetail.getMaterialCode()); | |
182 | 126 | // |
183 | 127 | // List<InventoryDetail> list= inventoryDetailService.list(lam); |
184 | 128 | // return getDataTable(list); |
... | ... | @@ -186,6 +130,99 @@ public class ShippingCombinationController extends BaseController { |
186 | 130 | |
187 | 131 | |
188 | 132 | /** |
133 | + * 获取能出库的库存列表 | |
134 | + * @param code,id | |
135 | + * @return | |
136 | + */ | |
137 | + @PostMapping("/getInventory") | |
138 | + @ResponseBody | |
139 | + public TableDataInfo getInventory(String code, Integer id){ | |
140 | + //找到主单 | |
141 | + LambdaQueryWrapper<ShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
142 | + lambdaQueryWrapper.eq(ShipmentHeader::getCode,code) | |
143 | + .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
144 | + ShipmentHeader shipmentHeader=shipmentHeaderService.getOne(lambdaQueryWrapper); | |
145 | + if(shipmentHeader==null){ | |
146 | + throw new ServiceException("找不到主单"); | |
147 | + } | |
148 | + //找到子单 | |
149 | + ShipmentDetail shipmentDetail=new ShipmentDetail(); | |
150 | + shipmentDetail=shipmentDetailService.getById(id); | |
151 | + if(shipmentDetail==null){ | |
152 | + throw new ServiceException("找不到子单"); | |
153 | + } | |
154 | + | |
155 | + //查找分配规则 | |
156 | + List<InventoryDetail> list=new ArrayList<>(); | |
157 | + FilterConfigDetail filterConfigDetail=new FilterConfigDetail(); | |
158 | + LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
159 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
160 | + | |
161 | + //出库子单的分配规则有时,优先出库子单的分配规则 | |
162 | + if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){ | |
163 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentDetail.getAllocationRule()); | |
164 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
165 | + if(filterConfigDetail==null){ | |
166 | + throw new ServiceException("出库子单出库规则配置不存在"); | |
167 | + } | |
168 | + | |
169 | + //根据sql查库存 | |
170 | + try { | |
171 | + list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
172 | + }catch (Exception e){ | |
173 | + throw new ServiceException("sql错误"); | |
174 | + } | |
175 | + return getDataTable(list); | |
176 | + } | |
177 | + | |
178 | + //出库子单的分配规则没有时,优先物料的分配规则 | |
179 | + LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
180 | + materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
181 | + .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
182 | + Material material=materialService.getOne(materialLambdaQueryWrapper); | |
183 | + if(StringUtils.isNotEmpty(material.getAllocationRule())){ | |
184 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,material.getAllocationRule()); | |
185 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
186 | + if(filterConfigDetail==null){ | |
187 | + throw new ServiceException("物料出库规则配置不存在"); | |
188 | + } | |
189 | + | |
190 | + //根据sql查库存 | |
191 | + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
192 | + return getDataTable(list); | |
193 | + } | |
194 | + | |
195 | + //都没有时,默认仓库的分配规则 | |
196 | + LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
197 | + configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment") | |
198 | + .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode()); | |
199 | + ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper); | |
200 | + if(configValue==null){ | |
201 | + throw new ServiceException("仓库的出库配置不存在"); | |
202 | + } | |
203 | + | |
204 | + //查找出库首选项 | |
205 | + LambdaQueryWrapper<ShipmentPreference> slam=Wrappers.lambdaQuery(); | |
206 | + slam.eq(ShipmentPreference::getCode,configValue.getIdentifier()) | |
207 | + .eq(ShipmentPreference::getWarehouseCode,configValue.getWarehouseCode()); | |
208 | + ShipmentPreference shipmentPreference=shipmentPreferenceService.getOne(slam); | |
209 | + if(shipmentPreference==null){ | |
210 | + throw new ServiceException("仓库的出库配置中出库首选项不存在"); | |
211 | + } | |
212 | + //查找分配规则 | |
213 | + filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentPreference.getAllocationRule()); | |
214 | + filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper); | |
215 | + if(filterConfigDetail==null){ | |
216 | + throw new ServiceException("出库首选项中出库规则配置不存在"); | |
217 | + } | |
218 | + | |
219 | + //根据sql查库存 | |
220 | + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement()); | |
221 | + return getDataTable(list); | |
222 | + } | |
223 | + | |
224 | + | |
225 | + /** | |
189 | 226 | * 保存组盘 |
190 | 227 | * @param shipmentCombinationModel |
191 | 228 | * @return |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
... | ... | @@ -18,8 +18,8 @@ public class ShippingCombinationService { |
18 | 18 | |
19 | 19 | |
20 | 20 | public List<InventoryDetail> getInventorys(ShippingSearch search) { |
21 | - // List<InventoryDetail> list = shippingCombinationMapper.getInventorys(search); | |
22 | - return null; | |
21 | + List<InventoryDetail> list = shippingCombinationMapper.getInventorys(search); | |
22 | + return list; | |
23 | 23 | } |
24 | 24 | |
25 | 25 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/mapper/TaskHeaderMapper.java
... | ... | @@ -10,4 +10,7 @@ import java.util.Map; |
10 | 10 | public interface TaskHeaderMapper extends BaseMapper<TaskHeader> { |
11 | 11 | |
12 | 12 | List<Map<String, Object>> getReceiptTask(@Param("taskId") Integer taskId); |
13 | + | |
14 | + Integer UncompleteCount(@Param("containerCode") String containerCode, @Param("warehouseCode") String warehouseCode); | |
15 | + | |
13 | 16 | } |
14 | 17 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -32,11 +32,10 @@ import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainer |
32 | 32 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
33 | 33 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
34 | 34 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
35 | +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; | |
35 | 36 | import com.huaheng.pc.task.taskDetail.domain.TaskDetail; |
36 | 37 | import com.huaheng.pc.task.taskDetail.service.TaskDetailService; |
37 | 38 | import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel; |
38 | - | |
39 | -import org.springframework.beans.factory.annotation.Autowired; | |
40 | 39 | import org.springframework.stereotype.Service; |
41 | 40 | import java.math.BigDecimal; |
42 | 41 | import java.text.SimpleDateFormat; |
... | ... | @@ -44,6 +43,7 @@ import java.util.ArrayList; |
44 | 43 | import java.util.Date; |
45 | 44 | import java.util.List; |
46 | 45 | import java.util.Map; |
46 | +import java.util.*; | |
47 | 47 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
48 | 48 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
49 | 49 | import com.huaheng.pc.task.taskHeader.mapper.TaskHeaderMapper; |
... | ... | @@ -54,32 +54,31 @@ import javax.annotation.Resource; |
54 | 54 | @Service |
55 | 55 | public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHeader> implements TaskHeaderService { |
56 | 56 | |
57 | - @Autowired | |
57 | + | |
58 | + | |
59 | + @Resource | |
58 | 60 | private ShipmentContainerHeaderService shipmentContainerHeaderService; |
59 | - @Autowired | |
61 | + @Resource | |
60 | 62 | private ShipmentContainerDetailService shipmentContainerDetailService; |
61 | - @Autowired | |
63 | + @Resource | |
62 | 64 | private LocationService locationService; |
63 | - @Autowired | |
64 | - private InventoryDetailService inventoryDetailService; | |
65 | - @Autowired | |
65 | + @Resource | |
66 | + private ContainerService containerService; | |
67 | + @Resource | |
66 | 68 | private TaskDetailService taskDetailService; |
67 | - @Autowired | |
69 | + @Resource | |
68 | 70 | private TaskHeaderService taskHeaderService; |
69 | - | |
70 | - @Autowired | |
71 | + @Resource | |
71 | 72 | private InventoryHeaderService inventoryHeaderService; |
72 | - | |
73 | - @Autowired | |
74 | - private InventoryTransactionService inventoryTransactionService; | |
75 | - | |
76 | - @Autowired | |
73 | + @Resource | |
74 | + private InventoryDetailService inventoryDetailService; | |
75 | + @Resource | |
76 | + private InventoryTransactionService inventoryTransactionService; | |
77 | + @Resource | |
77 | 78 | private ReceiptHeaderService receiptHeaderService; |
78 | - | |
79 | 79 | @Resource |
80 | 80 | private ReceiptDetailService receiptDetailService; |
81 | - | |
82 | - @Autowired | |
81 | + @Resource | |
83 | 82 | private ReceiptContainerDetailService receiptContainerDetailService; |
84 | 83 | |
85 | 84 | |
... | ... | @@ -89,12 +88,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
89 | 88 | |
90 | 89 | @Resource |
91 | 90 | private ReceiptContainerHeaderService receiptContainerHeaderService; |
91 | + @Resource | |
92 | + private TaskHeaderMapper taskHeaderMapper; | |
93 | + | |
92 | 94 | |
93 | 95 | |
94 | 96 | |
95 | 97 | |
96 | - @Resource | |
97 | - private TaskHeaderMapper taskHeaderMapper; | |
98 | + | |
99 | + /** | |
100 | + * 查询容器有无任务 | |
101 | + */ | |
102 | + @Override | |
103 | + public Integer UncompleteCount(String ContainerCode) { | |
104 | + return taskHeaderMapper.UncompleteCount(ContainerCode, ShiroUtils.getWarehouseCode()); | |
105 | + } | |
98 | 106 | |
99 | 107 | /** |
100 | 108 | * 生成出库任务 |
... | ... | @@ -134,6 +142,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
134 | 142 | TaskHeader task = new TaskHeader(); |
135 | 143 | //分拣出库 |
136 | 144 | task.setTaskType(400); |
145 | + task.setFromLocation(shipmentContainerHeader.getLocationCode()); | |
137 | 146 | task.setToLocation(shipmentContainerHeader.getLocationCode()); |
138 | 147 | //判断是否整出任务,钱柜和AGV不能整出 |
139 | 148 | if (shipmentContainerHeader.getStatus().intValue() == 300) { |
... | ... | @@ -178,8 +187,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
178 | 187 | taskDetail.setTaskId(task.getId()); |
179 | 188 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
180 | 189 | taskDetail.setCompanyCode(task.getCompanyCode()); |
181 | - taskDetail.setTaskType(2); | |
182 | - taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); | |
190 | + taskDetail.setTaskType(task.getTaskType()); | |
183 | 191 | taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); |
184 | 192 | taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId()); |
185 | 193 | taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode()); |
... | ... | @@ -192,7 +200,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
192 | 200 | taskDetail.setFromLocation(task.getFromLocation()); |
193 | 201 | taskDetail.setToLocation(task.getToLocation()); |
194 | 202 | taskDetail.setStatus(1); |
195 | - taskDetail.setTaskType(2); | |
203 | + taskDetail.setTaskType(task.getTaskType()); | |
196 | 204 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
197 | 205 | taskDetail.setLastUpdated(null); |
198 | 206 | taskDetailService.save(taskDetail); |
... | ... | @@ -208,6 +216,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
208 | 216 | } |
209 | 217 | |
210 | 218 | /** |
219 | + * 下发WCS执行任务 | |
220 | + */ | |
221 | + /** | |
211 | 222 | * |
212 | 223 | * 执行任务 |
213 | 224 | * */ |
... | ... | @@ -305,48 +316,49 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
305 | 316 | //出库任务 |
306 | 317 | // completeShipmentTask(task); |
307 | 318 | } |
308 | - //...其他任务类型暂时不处理 // 700 盘点 800 移库 900 出库查看 | |
319 | + // 700 盘点 900 出库查看,包过空托出库查看 | |
309 | 320 | if (task.getInternalTaskType() == 700 || task.getInternalTaskType() == 900) { |
310 | -// completeCycleCountOrSeeOutTask(task); | |
321 | + completeCycleCountOrSeeOutTask(task); | |
311 | 322 | } |
312 | 323 | if (task.getInternalTaskType() == 800) { |
313 | -// //移库 | |
314 | -// completeTransferTask(task); | |
324 | +// //移库 | |
325 | + completeTransferTask(task); | |
315 | 326 | } |
316 | 327 | if (task.getInternalTaskType() == 500) { |
317 | -// //空托盘入库 | |
318 | -// completeEmptyIn(task); | |
328 | + //空托盘入库 | |
329 | + completeEmptyIn(task); | |
319 | 330 | } |
320 | 331 | if (task.getInternalTaskType() == 600) { |
321 | -// //空托盘出库 | |
322 | -// completeEmptyOut(task); | |
332 | + //空托盘出库 | |
333 | + completeEmptyOut(task); | |
323 | 334 | } |
324 | 335 | } |
325 | 336 | |
337 | + | |
338 | + /** | |
339 | + * | |
340 | + */ | |
326 | 341 | @Override |
327 | - @Transactional | |
328 | 342 | public AjaxResult completeReceiptTask(TaskHeader task) throws Exception { |
329 | - List<Map<String, Object>> taskReceiptContainerDetail =taskHeaderMapper.getReceiptTask(task.getId()); | |
330 | - if (taskReceiptContainerDetail.size()<1){ | |
343 | + List<Map<String, Object>> taskReceiptContainerDetail = taskHeaderMapper.getReceiptTask(task.getId()); | |
344 | + if (taskReceiptContainerDetail.size() < 1) { | |
331 | 345 | return AjaxResult.success("未找到对应任务的入库单号!!!"); |
332 | 346 | } |
333 | 347 | for (Map<String, Object> map : taskReceiptContainerDetail) { |
334 | 348 | //将未完成的任务数量更新到库存表 |
335 | 349 | if (DataUtils.getInteger(map.get("status")) < 100) { |
336 | - LambdaQueryWrapper<InventoryDetail> inventory =Wrappers.lambdaQuery(); | |
337 | - inventory.eq(InventoryDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
338 | - .eq(InventoryDetail::getLocationCode,task.getToLocation()) | |
339 | - .eq(InventoryDetail::getReceiptDetailId,DataUtils.getString(map.get("receiptDetailId"))) | |
340 | - .eq(InventoryDetail::getContainerCode,DataUtils.getString(map.get("containerCode"))); | |
341 | - InventoryDetail detail=inventoryDetailService.getOne(inventory); | |
342 | - if (detail == null) | |
343 | - { | |
350 | + LambdaQueryWrapper<InventoryDetail> inventory = Wrappers.lambdaQuery(); | |
351 | + inventory.eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
352 | + .eq(InventoryDetail::getLocationCode, task.getFromLocation()) | |
353 | + .eq(InventoryDetail::getReceiptDetailId, DataUtils.getString(map.get("receiptDetailId"))) | |
354 | + .eq(InventoryDetail::getContainerCode, DataUtils.getString(map.get("containerCode"))); | |
355 | + InventoryDetail detail = inventoryDetailService.getOne(inventory); | |
356 | + if (detail == null) { | |
344 | 357 | //添加库存单 |
345 | 358 | InventoryHeader header = new InventoryHeader(); |
346 | 359 | header.setWarehouseCode(DataUtils.getString(map.get("warehouseCode")));//仓库 |
347 | 360 | header.setCompanyCode(task.getCompanyCode());//货主 |
348 | 361 | header.setContainerCode(DataUtils.getString(map.get("containerCode")));//容器号 |
349 | - header.setLocationCode(task.getToLocation()); | |
350 | 362 | header.setTotalQty(DataUtils.getInteger(map.get("totalQty")));//总数量 |
351 | 363 | header.setLocking(1); |
352 | 364 | header.setEnable(1); |
... | ... | @@ -382,9 +394,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
382 | 394 | } |
383 | 395 | else |
384 | 396 | { |
397 | + inventoryDetailService.save(detail); | |
398 | + } else { | |
385 | 399 | detail.setQty(detail.getQty().add(DataUtils.getBigDecimal(map.get("qty")))); |
386 | 400 | detail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
387 | 401 | LambdaUpdateWrapper<InventoryDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
402 | + lambdaUpdateWrapper.eq(InventoryDetail::getId, DataUtils.getInteger(map.get("receiptDetailId"))); | |
403 | + inventoryDetailService.update(detail, lambdaUpdateWrapper); | |
388 | 404 | lambdaUpdateWrapper.eq(InventoryDetail::getId,DataUtils.getInteger(map.get("receiptDetailId"))); |
389 | 405 | if (!inventoryDetailService.update(detail, lambdaUpdateWrapper)){ |
390 | 406 | throw new ServiceException("更新入库单明细失败"); |
... | ... | @@ -409,6 +425,22 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
409 | 425 | inventoryTransaction.setTaskQty(DataUtils.getInteger(map.get("qty"))); |
410 | 426 | inventoryTransaction.setCreated(new Date()); |
411 | 427 | inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); |
428 | + inventoryTransactionService.save(inventoryTransaction); | |
429 | + //修改任务明细的状态为完成 | |
430 | + TaskDetail taskDetail = new TaskDetail(); | |
431 | + taskDetail.setStatus(100); | |
432 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
433 | + taskDetail.setAgingDate(new Date()); //入库时间 | |
434 | + LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
435 | + lambdaUpdateWrapper.eq(TaskDetail::getTaskId, DataUtils.getInteger(map.get("taskDetailId"))); | |
436 | + taskDetailService.update(taskDetail, lambdaUpdateWrapper); | |
437 | + //修改入库单的状态 | |
438 | + ReceiptHeader receiptHeader = new ReceiptHeader(); | |
439 | + receiptHeader.setFirstStatus(100); | |
440 | + receiptHeader.setLastStatus(100); | |
441 | + LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
442 | + receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId"))); | |
443 | + receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper); | |
412 | 444 | if (!inventoryTransactionService.save(inventoryTransaction)) |
413 | 445 | throw new ServiceException("新增库存记录失败"); |
414 | 446 | // //修改任务明细的状态为完成 |
... | ... | @@ -427,12 +459,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
427 | 459 | // receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId"))); |
428 | 460 | // receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper); |
429 | 461 | |
430 | - //修改任务主表状态,因为立库任务表单头只对应一个货箱,表单详情的任务会同时完成 | |
462 | + //修改任务主表状态,因为立库任务表单头只对应一个货箱,表单详情的任务会同时完成 | |
431 | 463 | task.setStatus(100); |
432 | 464 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
433 | 465 | task.setLastUpdated(new Date()); |
434 | 466 | LambdaUpdateWrapper<TaskHeader> taskHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
435 | 467 | taskHeaderLambdaUpdateWrapper.eq(TaskHeader::getId, task.getId()); |
468 | + taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper); | |
469 | + //修改库位状态和对应的容器 | |
470 | + Location location = new Location(); | |
436 | 471 | if (!taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper)) |
437 | 472 | throw new ServiceException("更新任务主表失败"); |
438 | 473 | //修改库位状态和对应的容器 |
... | ... | @@ -441,12 +476,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
441 | 476 | location.setStatus("empty"); |
442 | 477 | LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
443 | 478 | locationLambdaUpdateWrapper.eq(Location::getCode, task.getToLocation()); |
479 | + locationService.update(location, locationLambdaUpdateWrapper); | |
480 | + //修改容器状态和对应的库位 | |
481 | + Container container = new Container(); | |
444 | 482 | if (!locationService.update(location, locationLambdaUpdateWrapper)) |
445 | 483 | throw new ServiceException("更新库位失败"); |
446 | 484 | //修改容器状态和对应的库位 |
447 | 485 | Container container =new Container(); |
448 | 486 | container.setLocationCode(task.getToLocation()); |
449 | 487 | container.setStatus("some"); |
488 | + //修改组盘表状态为20 | |
450 | 489 | LambdaUpdateWrapper<Container> containerLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
451 | 490 | containerLambdaUpdateWrapper.eq(Container::getCode,task.getContainerCode()); |
452 | 491 | if (!containerService.update(container, containerLambdaUpdateWrapper)) |
... | ... | @@ -456,8 +495,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
456 | 495 | ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); |
457 | 496 | receiptContainerDetail.setStatus(20); |
458 | 497 | LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
459 | - receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId,DataUtils.getInteger(map.get("receiptId"))); | |
498 | + receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId, DataUtils.getInteger(map.get("receiptId"))); | |
460 | 499 | receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper); |
500 | + } | |
461 | 501 | if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)) |
462 | 502 | throw new ServiceException("更新组盘状态失败"); |
463 | 503 | //修改入库明细 |
... | ... | @@ -471,104 +511,404 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
471 | 511 | return AjaxResult.success("完成入库任务"); |
472 | 512 | } |
473 | 513 | |
474 | - @Override | |
475 | - public AjaxResult createTransferTask(String sourceLocation, String destinationLocation) { | |
476 | - return null; | |
477 | - } | |
478 | - | |
479 | - @Override | |
480 | - public AjaxResult createCheckOutTask(String[] ids) { | |
481 | - return null; | |
482 | - } | |
483 | - | |
484 | - @Override | |
485 | - public AjaxResult completeCycleCountOrSeeOutTask(TaskHeader taskHeader) { | |
486 | - return null; | |
487 | - } | |
488 | - | |
489 | 514 | // @Override |
490 | 515 | // public List<Map<String, Object>> getReceiptTask(Integer taskId) { |
491 | 516 | // return taskHeaderMapper.getReceiptTask(taskId) ; |
492 | 517 | // } |
493 | 518 | |
494 | 519 | /** |
520 | + * 生成 | |
495 | 521 | * 立库移库 |
496 | - * */ | |
522 | + */ | |
497 | 523 | @Transactional |
498 | - public AjaxResult createTransferTask(String sourceLocation, String destinationLocation, String companyCode) { | |
499 | - /* Location temp1 = new Location(); | |
524 | + public AjaxResult createTransferTask(String sourceLocation, String destinationLocation) { | |
525 | + | |
526 | + //源库位校验 | |
527 | + Location temp1 = new Location(); | |
500 | 528 | temp1.setCode(sourceLocation); |
501 | - temp1.setWarehouseId(ShiroUtils.getWarehouseId()); | |
502 | - Location loc1 = locationService.selectFirstEntity(temp1); | |
503 | - if(loc1==null){ | |
504 | - return AjaxResult.error("源库位:"+sourceLocation+"未找到"); | |
529 | + temp1.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
530 | + LambdaQueryWrapper<Location> lambda1 = Wrappers.lambdaQuery(); | |
531 | + Location loc1 = locationService.getOne(lambda1); | |
532 | + if (loc1 == null) { | |
533 | + return AjaxResult.error("源库位:" + sourceLocation + "未找到"); | |
505 | 534 | } |
506 | - if(!loc1.getStatus().equals("empty")){ | |
507 | - return AjaxResult.error("源库位:"+sourceLocation+"状态非空闲"); | |
535 | + if (!loc1.getStatus().equals("empty")) { | |
536 | + return AjaxResult.error("源库位:" + sourceLocation + "状态非空闲"); | |
508 | 537 | } |
509 | - if(StringUtils.isEmpty(loc1.getContainerCode())){ | |
510 | - return AjaxResult.error("源库位:"+sourceLocation+"不存在托盘"); | |
538 | + if (StringUtils.isEmpty(loc1.getContainerCode())) { | |
539 | + return AjaxResult.error("源库位:" + sourceLocation + "不存在托盘"); | |
511 | 540 | } |
512 | 541 | //这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库 |
513 | 542 | //校验入库组盘 |
514 | - int count1 = inventoryService.getUncompleteReceiptContainer(sourceLocation,ShiroUtils.getWarehouseId()); | |
515 | - if(count1>0){ | |
516 | - return AjaxResult.error("源库位:"+sourceLocation+"存在入库组盘,不能移库"); | |
543 | + int count1 = inventoryHeaderService.getUncompleteReceiptContainer(sourceLocation, ShiroUtils.getWarehouseCode()); | |
544 | + if (count1 > 0) { | |
545 | + return AjaxResult.error("源库位:" + sourceLocation + "存在入库组盘,不能移库"); | |
517 | 546 | } |
518 | - int count2 = inventoryService.getUncompleteShipmentContainer(sourceLocation,ShiroUtils.getWarehouseId()); | |
519 | - if(count2>0){ | |
520 | - return AjaxResult.error("源库位:"+sourceLocation+"存在出库组盘,不能移库"); | |
547 | + int count2 = inventoryHeaderService.getUncompleteShipmentContainer(sourceLocation, ShiroUtils.getWarehouseCode()); | |
548 | + if (count2 > 0) { | |
549 | + return AjaxResult.error("源库位:" + sourceLocation + "存在出库组盘,不能移库"); | |
521 | 550 | } |
522 | - | |
551 | + //目的库位校验 | |
523 | 552 | Location temp2 = new Location(); |
524 | - temp2.setWarehouseId(ShiroUtils.getWarehouseId()); | |
553 | + temp2.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
525 | 554 | temp2.setCode(destinationLocation); |
526 | - Location loc2 = locationService.selectFirstEntity(temp2); | |
527 | - if(loc2 == null){ | |
528 | - return AjaxResult.error("目标库位:"+destinationLocation+"未找到"); | |
529 | - } | |
530 | - if(!loc2.getStatus().equals("empty")){ | |
531 | - return AjaxResult.error("目标库位:"+destinationLocation+"状态非空闲"); | |
555 | + LambdaQueryWrapper<Location> lambdaQueryWrapper2 = Wrappers.lambdaQuery(temp2); | |
556 | + Location loc2 = locationService.getOne(lambdaQueryWrapper2); | |
557 | + if (loc2 == null) { | |
558 | + return AjaxResult.error("目标库位:" + destinationLocation + "未找到"); | |
532 | 559 | } |
533 | - if(StringUtils.isNotEmpty(loc2.getContainerCode())){ | |
534 | - return AjaxResult.error("目标库位:"+destinationLocation+"已存在托盘"); | |
560 | + if (!loc2.getStatus().equals("empty")) { | |
561 | + return AjaxResult.error("目标库位:" + destinationLocation + "状态非空闲"); | |
535 | 562 | } |
536 | - int count3 = inventoryService.getUncompleteReceiptContainer(destinationLocation,ShiroUtils.getWarehouseId()); | |
537 | - if(count3>0){ | |
538 | - return AjaxResult.error("目标库位:"+sourceLocation+"存在入库组盘,不能移库"); | |
563 | + if (StringUtils.isNotEmpty(loc2.getContainerCode())) { | |
564 | + return AjaxResult.error("目标库位:" + destinationLocation + "已存在托盘"); | |
539 | 565 | } |
540 | - //hack:这里暂时写死第五层不能往其他四层移库 | |
541 | - if(loc1.getLayer()==5){ | |
542 | - if(loc2.getLayer()<4){ | |
543 | - return AjaxResult.error("高货位不能往底货位移库"); | |
544 | - } | |
566 | + int count3 = inventoryHeaderService.getUncompleteReceiptContainer(destinationLocation, ShiroUtils.getWarehouseCode()); | |
567 | + if (count3 > 0) { | |
568 | + return AjaxResult.error("目标库位:" + sourceLocation + "存在入库组盘,不能移库"); | |
545 | 569 | } |
546 | - Task task = new Task(); | |
547 | - task.setWarehouseId(ShiroUtils.getWarehouseId()); | |
548 | - task.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
549 | - task.setCompanyId(ShiroUtils.getCompanyIdList().get(0));//获取第一个货主 | |
550 | - task.setCompanyCode(ShiroUtils.getCompanyCodeList().get(0)); | |
551 | - //这里默认一个0 | |
552 | - task.setPriority(0); | |
553 | - task.setType((short)800); | |
554 | - //对移库来说,这个没啥用 | |
555 | - task.setStation(null); | |
556 | - task.setContainerCode(loc1.getContainerCode()); | |
557 | - task.setFirstStatus((short)1); | |
558 | - task.setLastStatus((short)1); | |
559 | - task.setBeginTime(new Date()); | |
560 | - task.setSourceLocation(sourceLocation); | |
561 | - task.setDestinationLocation(destinationLocation); | |
562 | - task.setCreated(new Date()); | |
563 | - task.setCreatedBy(ShiroUtils.getLoginName()); | |
564 | - insert(task); | |
570 | + //写入任务主表和明细表 | |
571 | + TaskHeader taskHeader = new TaskHeader(); | |
572 | + taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
573 | + taskHeader.setCompanyCode(ShiroUtils.getCompanyCodeList().get(0));//获取第一个货主 | |
574 | + taskHeader.setInternalTaskType(500); | |
575 | + taskHeader.setTaskType(800); | |
576 | + taskHeader.setContainerCode(loc1.getContainerCode()); | |
577 | + taskHeader.setStatus(1); | |
578 | + taskHeader.setFromLocation(sourceLocation); | |
579 | + taskHeader.setToLocation(destinationLocation); | |
580 | + taskHeader.setCreated(new Date()); | |
581 | + taskHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
582 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
583 | + taskHeader.setLastUpdated(new Date()); | |
584 | + taskHeaderMapper.insert(taskHeader); | |
585 | + | |
586 | + //写入明细表 | |
587 | + TaskDetail taskDetail = new TaskDetail(); | |
588 | + taskDetail.setTaskId(taskHeader.getId());//主单ID | |
589 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
590 | + taskDetail.setInternalTaskType(taskHeader.getTaskType()); | |
591 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
592 | + taskDetail.setCompanyCode(taskDetail.getCompanyCode()); | |
593 | + taskDetail.setFromLocation(sourceLocation); | |
594 | + taskDetail.setToLocation(destinationLocation); | |
595 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
596 | + taskDetail.setCreated(new Date()); | |
597 | + taskDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
598 | + taskDetail.setLastUpdated(new Date()); | |
599 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
600 | + taskDetailService.save(taskDetail); | |
601 | + | |
565 | 602 | //更新货位状态为预定 |
566 | 603 | loc1.setStatus("lock"); |
567 | 604 | loc2.setStatus("lock"); |
568 | - locationService.updateByModel(loc1); | |
569 | - locationService.updateByModel(loc2); | |
570 | - return AjaxResult.success(task.getId());*/ | |
571 | - return null; | |
605 | + locationService.saveOrUpdate(loc1); | |
606 | + locationService.saveOrUpdate(loc2); | |
607 | + return AjaxResult.success(taskHeader.getId()); | |
608 | + | |
609 | + } | |
610 | + | |
611 | + /** | |
612 | + * 完成移库任务 | |
613 | + * | |
614 | + * @param task | |
615 | + */ | |
616 | + private void completeTransferTask(TaskHeader task) { | |
617 | + //找到任务明细 | |
618 | + TaskDetail taskDetail = new TaskDetail(); | |
619 | + taskDetail.setTaskId(task.getId()); | |
620 | + taskDetail.setWarehouseCode(task.getWarehouseCode()); | |
621 | + taskDetail.setCompanyCode(task.getCompanyCode()); | |
622 | + taskDetail.setContainerCode(task.getContainerCode()); | |
623 | + LambdaQueryWrapper<TaskDetail> taskDetailLW = Wrappers.lambdaQuery(taskDetail); | |
624 | + taskDetail = taskDetailService.getOne(taskDetailLW); | |
625 | + //更新库存主表和明细的库位,更改更新用户和时间 | |
626 | + InventoryHeader inventoryHeader = new InventoryHeader(); | |
627 | + //主表 | |
628 | + inventoryHeader.setWarehouseCode(taskDetail.getWarehouseCode()); | |
629 | + inventoryHeader.setCompanyCode(taskDetail.getCompanyCode()); | |
630 | + inventoryHeader.setContainerCode(taskDetail.getContainerCode()); | |
631 | + inventoryHeader.setLocationCode(taskDetail.getFromLocation());//通过源库位查找库存 | |
632 | + LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(inventoryHeader); | |
633 | + inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
634 | + inventoryHeader.setLocationCode(taskDetail.getToLocation());//把目的库位写入库存 | |
635 | + inventoryHeader.setLastUpdated(new Date()); | |
636 | + inventoryHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
637 | + inventoryHeaderService.saveOrUpdate(inventoryHeader);//修改主表库位 | |
638 | + | |
639 | + //明细表 | |
640 | + List<InventoryDetail> inventoryDetails = new ArrayList<>(); | |
641 | + InventoryDetail inventoryDetail = new InventoryDetail(); | |
642 | + inventoryDetail.setWarehouseCode(inventoryHeader.getWarehouseCode()); | |
643 | + inventoryDetail.setCompanyCode(inventoryHeader.getCompanyCode()); | |
644 | + inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); | |
645 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(inventoryDetail); | |
646 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
647 | + /*同时写入库存交易表*/ | |
648 | + List<InventoryTransaction> inventoryTransactionList = new ArrayList<>(); | |
649 | + for (InventoryDetail item : inventoryDetailList) { | |
650 | + item.setLocationCode(inventoryHeader.getLocationCode());//修改明细表库位 | |
651 | + item.setLastUpdated(new Date()); | |
652 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
653 | + inventoryDetails.add(item); | |
654 | + /*----------*/ | |
655 | + InventoryTransaction inventoryTransaction = new InventoryTransaction(); | |
656 | + inventoryTransaction.setWarehouseCode(task.getWarehouseCode()); | |
657 | + inventoryTransaction.setLocationCode(taskDetail.getToLocation()); | |
658 | + inventoryTransaction.setContainerCode(taskDetail.getContainerCode()); | |
659 | + inventoryTransaction.setTransactionType(50); | |
660 | + inventoryTransaction.setMaterialCode(item.getMaterialCode()); | |
661 | + inventoryTransaction.setManufactureDate(item.getManufactureDate()); | |
662 | + inventoryTransaction.setMaterialName(item.getMaterialName()); | |
663 | + inventoryTransaction.setMaterialSpec(item.getMaterialSpec()); | |
664 | + inventoryTransaction.setMaterialUnit(item.getMaterialUnit()); | |
665 | + inventoryTransaction.setTaskQty(0); | |
666 | + inventoryTransaction.setInventorySts(item.getInventorySts()); | |
667 | + //inventoryTransaction.setReferCode(); | |
668 | + //inventoryTransaction.setQcCheck(); | |
669 | + inventoryTransaction.setReferDetailId(item.getId().toString()); | |
670 | + inventoryTransaction.setBatch(item.getBatch()); | |
671 | + inventoryTransaction.setLot(item.getLot()); | |
672 | + inventoryTransaction.setProjectNo(item.getProjectNo()); | |
673 | + inventoryTransaction.setWeight(item.getWeight()); | |
674 | + inventoryTransaction.setManufactureDate(item.getManufactureDate()); | |
675 | + inventoryTransaction.setExpirationDate(item.getExpirationDate()); | |
676 | + inventoryTransaction.setAgingDate(item.getCreated()); | |
677 | + inventoryTransaction.setAttributeId(item.getAttributeId()); | |
678 | + inventoryTransaction.setAttribute1(item.getAttribute1()); | |
679 | + inventoryTransaction.setAttribute2(item.getAttribute2()); | |
680 | + inventoryTransaction.setAttribute3(item.getAttribute3()); | |
681 | + inventoryTransaction.setCreated(new Date()); | |
682 | + inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName()); | |
683 | + //inventoryTransaction.setLockCode(); | |
684 | + inventoryTransaction.setBillCode(item.getInventoryHeaderId().toString()); | |
685 | + inventoryTransaction.setBillDetailId(item.getId()); | |
686 | + inventoryTransaction.setSupplierCode(item.getSupplierCode()); | |
687 | + inventoryDetailList.add(inventoryDetail); | |
688 | + } | |
689 | + if (inventoryDetailService.saveOrUpdateBatch(inventoryDetails)) { | |
690 | + //更新库存明细成功后,写入库存交易 | |
691 | + inventoryTransactionService.saveBatch(inventoryTransactionList); | |
692 | + } else { | |
693 | + throw new ServiceException("库存明细更新错误!"); | |
694 | + } | |
695 | + | |
696 | + //更新托盘、库位状态 | |
697 | + Location temp1 = new Location(); //源库位 | |
698 | + temp1.setCode(taskDetail.getFromLocation()); | |
699 | + temp1.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
700 | + LambdaQueryWrapper<Location> lambdaQueryWrapper1 = Wrappers.lambdaQuery(temp1); | |
701 | + Location loc1 = locationService.getOne(lambdaQueryWrapper1); | |
702 | + | |
703 | + Location temp2 = new Location();//目的库位 | |
704 | + temp2.setCode(taskDetail.getToLocation()); | |
705 | + temp2.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
706 | + LambdaQueryWrapper<Location> lambdaQueryWrapper2 = Wrappers.lambdaQuery(temp2); | |
707 | + Location loc2 = locationService.getOne(lambdaQueryWrapper2); | |
708 | + loc2.setContainerCode(loc1.getContainerCode()); | |
709 | + loc2.setStatus("empty"); | |
710 | + loc1.setContainerCode(""); | |
711 | + loc1.setStatus("empty"); | |
712 | + locationService.saveOrUpdate(loc1); | |
713 | + locationService.saveOrUpdate(loc2); | |
714 | + //更新taskHeader状态 | |
715 | + task.setStatus(100); | |
716 | + task.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
717 | + task.setLastUpdated(new Date()); | |
718 | + taskHeaderService.saveOrUpdate(task); | |
719 | + //更新taskDetail状态 | |
720 | + taskDetail.setStatus(100); | |
721 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
722 | + taskDetail.setLastUpdated(new Date()); | |
723 | + taskDetailService.saveOrUpdate(taskDetail); | |
724 | + | |
725 | + } | |
726 | + | |
727 | + /** | |
728 | + * 生成 | |
729 | + * 出库查看 | |
730 | + * 任务 | |
731 | + */ | |
732 | + @Override | |
733 | + @Transactional | |
734 | + public AjaxResult createCheckOutTask(String[] ids) { | |
735 | + | |
736 | + for (String id : ids) { | |
737 | + InventoryHeader inventoryHeader = inventoryHeaderService.getById(Integer.parseInt(id)); | |
738 | + //检查库位容器 | |
739 | + Location temp = new Location(); | |
740 | + temp.setCode(inventoryHeader.getLocationCode()); | |
741 | + temp.setWarehouseCode(inventoryHeader.getWarehouseCode()); | |
742 | + LambdaQueryWrapper<Location> lambdaQueryWrapper = Wrappers.lambdaQuery(temp); | |
743 | + Location loc = locationService.getOne(lambdaQueryWrapper); | |
744 | + if (loc == null) { | |
745 | + throw new ServiceException("库存没有库位!"); | |
746 | + } | |
747 | + if (!loc.getStatus().equals("empty")) { | |
748 | + throw new ServiceException(inventoryHeader.getLocationCode() + "状态非空闲,操作失败"); | |
749 | + } | |
750 | + if (StringUtils.isEmpty(loc.getContainerCode())) { | |
751 | + throw new ServiceException(inventoryHeader.getLocationCode() + "没有容器,操作失败"); | |
752 | + } | |
753 | + //通过库存头,找到库存明细 | |
754 | + InventoryDetail inventoryDetail = new InventoryDetail(); | |
755 | + inventoryDetail.setWarehouseCode(inventoryHeader.getWarehouseCode()); | |
756 | + inventoryDetail.setCompanyCode(inventoryHeader.getCompanyCode()); | |
757 | + inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); | |
758 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(inventoryDetail); | |
759 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
760 | + | |
761 | + //写入任务主表 | |
762 | + TaskHeader taskHeader = new TaskHeader(); | |
763 | + taskHeader.setWarehouseCode(inventoryHeader.getWarehouseCode()); | |
764 | + taskHeader.setCompanyCode(inventoryHeader.getCompanyCode());//货主 | |
765 | + taskHeader.setInternalTaskType(200); | |
766 | + taskHeader.setTaskType(900); | |
767 | + taskHeader.setContainerCode(inventoryHeader.getContainerCode()); | |
768 | + taskHeader.setStatus(1); | |
769 | + taskHeader.setFromLocation(inventoryHeader.getLocationCode()); | |
770 | + taskHeader.setToLocation(inventoryHeader.getLocationCode()); | |
771 | + taskHeader.setCreated(new Date()); | |
772 | + taskHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
773 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
774 | + taskHeader.setLastUpdated(new Date()); | |
775 | + taskHeaderMapper.insert(taskHeader); | |
776 | + //分拆库存明细,并写入任务细表 | |
777 | + List<TaskDetail> taskDetails = new ArrayList<>(); | |
778 | + for (InventoryDetail item : inventoryDetailList) { | |
779 | + | |
780 | + TaskDetail taskDetail = new TaskDetail(); | |
781 | + taskDetail.setTaskId(taskHeader.getId());//主单ID | |
782 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
783 | + taskDetail.setInternalTaskType(taskHeader.getTaskType()); | |
784 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
785 | + taskDetail.setCompanyCode(item.getCompanyCode()); | |
786 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
787 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
788 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
789 | + taskDetail.setCreated(new Date()); | |
790 | + taskDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
791 | + taskDetail.setLastUpdated(new Date()); | |
792 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
793 | + taskDetails.add(taskDetail); | |
794 | + } | |
795 | + if (taskDetailService.saveBatch(taskDetails)) { | |
796 | + //锁定库位状态 | |
797 | + locationService.updateStatus(loc.getContainerCode(), "lock"); | |
798 | + } else { | |
799 | + throw new ServiceException("出库查看任务明细生成失败!"); | |
800 | + } | |
801 | + | |
802 | + } | |
803 | + return AjaxResult.success("出库查看任务生成成功!"); | |
804 | + } | |
805 | + | |
806 | + /** | |
807 | + * 完成 | |
808 | + * 盘点,出库查看 | |
809 | + * 更新状态即可 | |
810 | + */ | |
811 | + @Transactional | |
812 | + @Override | |
813 | + public AjaxResult completeCycleCountOrSeeOutTask(TaskHeader taskHeader) { | |
814 | + taskHeader.setStatus(100); | |
815 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 | |
816 | + taskHeader.setLastUpdated(new Date()); //更新时间 | |
817 | + //task更新明细单总的状态 | |
818 | + TaskDetail taskDetail = new TaskDetail(); | |
819 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
820 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
821 | + taskDetail.setTaskId(taskHeader.getId()); | |
822 | + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); | |
823 | + List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 | |
824 | + for (TaskDetail item : taskDetailList) { | |
825 | + item.setStatus(100); | |
826 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 | |
827 | + item.setLastUpdated(new Date()); //更新时间 | |
828 | + taskDetailList.add(item); | |
829 | + } | |
830 | + if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || taskHeaderService.saveOrUpdate(taskHeader) == false) { | |
831 | + throw new ServiceException("任务单据状态更新失败!"); | |
832 | + } | |
833 | + //盘点完成时,修改盘点详细中的状态为100,容器恢复为空 | |
834 | + if (taskHeader.getTaskType() == 700) { | |
835 | + /*CyclecountDetail cyclecountDetai = cyclecountDetailService.selectEntityById( | |
836 | + task.getAllocationHeadId()); | |
837 | + cyclecountDetai.setStatus(40); | |
838 | + cyclecountDetailService.updateByModel(cyclecountDetai); | |
839 | + containerService.updateStatus(task.getContainerCode(),"empty");*/ | |
840 | + } | |
841 | + //释放库位状态 | |
842 | + locationService.updateStatus(taskHeader.getFromLocation(), "empty"); | |
843 | + return AjaxResult.success("完成出库查看任务"); | |
844 | + } | |
845 | + | |
846 | + /** | |
847 | + * 完成空托盘入库任务 | |
848 | + * @param taskHeader | |
849 | + */ | |
850 | + @Transactional | |
851 | + public void completeEmptyIn(TaskHeader taskHeader) { | |
852 | + | |
853 | + //解锁容器,更新库位 | |
854 | + containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(),taskHeader.getToLocation(),"empty"); | |
855 | + //解锁库位,更新容器 | |
856 | + locationService.updateContainerCodeAndStatus(taskHeader.getToLocation(),taskHeader.getContainerCode(),"empty"); | |
857 | + //完成任务,修改主单和明细状态 | |
858 | + taskHeader.setStatus(100); | |
859 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
860 | + taskHeader.setLastUpdated(new Date()); | |
861 | + //taskHeaderService.saveOrUpdate(taskHeader); | |
862 | + //taskDetail更新明细单总的状态 | |
863 | + TaskDetail taskDetail = new TaskDetail(); | |
864 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
865 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
866 | + taskDetail.setTaskId(taskHeader.getId()); | |
867 | + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); | |
868 | + List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 | |
869 | + for (TaskDetail item : taskDetailList) { | |
870 | + item.setStatus(100); | |
871 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 | |
872 | + item.setLastUpdated(new Date()); //更新时间 | |
873 | + taskDetailList.add(item); | |
874 | + } | |
875 | + if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || taskHeaderService.saveOrUpdate(taskHeader) == false) { | |
876 | + throw new ServiceException("任务单据状态更新失败!"); | |
877 | + } | |
878 | + | |
879 | + } | |
880 | + | |
881 | + /** | |
882 | + * 完成空托盘出库任务 | |
883 | + * @param taskHeader | |
884 | + */ | |
885 | + @Transactional | |
886 | + public void completeEmptyOut(TaskHeader taskHeader) { | |
887 | + //更新货位 | |
888 | + locationService.updateContainerCodeAndStatus(taskHeader.getFromLocation(), "", "empty"); | |
889 | + //更新容器信息 | |
890 | + containerService.updateLocationCodeAndStatus(taskHeader.getContainerCode(), "", "empty"); | |
891 | + | |
892 | + taskHeader.setStatus(100); | |
893 | + taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
894 | + taskHeader.setLastUpdated(new Date()); | |
895 | + //taskHeaderService.saveOrUpdate(taskHeader); | |
896 | + //taskDetail更新明细单总的状态 | |
897 | + TaskDetail taskDetail = new TaskDetail(); | |
898 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
899 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
900 | + taskDetail.setTaskId(taskHeader.getId()); | |
901 | + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); | |
902 | + List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 | |
903 | + for (TaskDetail item : taskDetailList) { | |
904 | + item.setStatus(100); | |
905 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 | |
906 | + item.setLastUpdated(new Date()); //更新时间 | |
907 | + taskDetailList.add(item); | |
908 | + } | |
909 | + if (taskDetailService.saveOrUpdateBatch(taskDetailList) == false || taskHeaderService.saveOrUpdate(taskHeader) == false) { | |
910 | + throw new ServiceException("任务单据状态更新失败!"); | |
911 | + } | |
572 | 912 | } |
573 | 913 | |
574 | 914 | /** |
... | ... | @@ -577,12 +917,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
577 | 917 | * @return |
578 | 918 | */ |
579 | 919 | @Override |
920 | + @Transactional | |
580 | 921 | public AjaxResult createReceiptTask(List<Integer> ids) { |
581 | - for (Integer id : ids) { | |
922 | + for (Integer id : ids) { | |
582 | 923 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(id); |
583 | 924 | if (receiptContainerHeader == null) |
584 | 925 | throw new ServiceException("任务不存在!"); |
585 | - if (receiptContainerHeader.getWarehouseCode() != ShiroUtils.getWarehouseCode()) | |
926 | + if (!receiptContainerHeader.getWarehouseCode().equals(ShiroUtils.getWarehouseCode())) | |
586 | 927 | throw new ServiceException("任务不在当前仓库!"); |
587 | 928 | LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); |
588 | 929 | containerDetailLambda.eq(ReceiptContainerDetail::getReceiptId, id); |
... | ... | @@ -591,11 +932,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
591 | 932 | throw new ServiceException("没有组盘明细,请先组盘!"); |
592 | 933 | if (receiptContainerHeader.getStatus() == 0) { |
593 | 934 | if (receiptContainerHeader.getStatus().intValue() < 10) { |
594 | - receiptContainerHeader.setStatus((short)10); | |
935 | + receiptContainerHeader.setStatus((short) 10); | |
595 | 936 | receiptContainerHeaderService.updateById(receiptContainerHeader); |
596 | 937 | } |
597 | 938 | //添加任务主表 |
598 | 939 | TaskHeader task = new TaskHeader(); |
940 | + task.setInternalTaskType(100); | |
599 | 941 | task.setWarehouseCode(receiptContainerHeader.getWarehouseCode()); |
600 | 942 | task.setCompanyCode(receiptContainerHeader.getCompanyCode()); |
601 | 943 | task.setFromLocation(receiptContainerHeader.getFromLocation()); |
... | ... | @@ -605,42 +947,56 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
605 | 947 | task.setContainerCode(receiptContainerHeader.getContainerCode()); |
606 | 948 | task.setCreated(new Date()); |
607 | 949 | task.setCreatedBy(ShiroUtils.getLoginName()); |
608 | - this.save(task); | |
609 | - //添加任务明细表 | |
610 | - for(ReceiptContainerDetail item : list) { | |
611 | - TaskDetail taskDetail = new TaskDetail(); | |
612 | - taskDetail.setTaskId(task.getId()); | |
613 | - taskDetail.setWarehouseCode(task.getWarehouseCode()); | |
614 | - taskDetail.setCompanyCode(task.getCompanyCode()); | |
615 | - taskDetail.setCompanyCode(task.getCompanyCode()); | |
616 | - taskDetail.setMaterialCode(item.getMaterialCode()); | |
617 | - taskDetail.setMaterialName(item.getMaterialName()); | |
618 | - taskDetail.setBillCode(item.getReceiptCode()); | |
619 | - taskDetail.setBillDetailId(item.getReceiptDetailId()); | |
620 | - taskDetail.setBillCode(item.getReceiptCode()); | |
621 | - taskDetail.setQty(BigDecimal.valueOf(item.getQty())); | |
622 | - taskDetail.setContainerCode(task.getContainerCode()); | |
623 | - taskDetail.setFromLocation(task.getFromLocation()); | |
624 | - taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
625 | - taskDetail.setBatch(item.getBatch()); | |
626 | - taskDetailService.save(taskDetail); | |
627 | - | |
628 | - ReceiptDetail receiptDetail = receiptDetailService.getById(item.getReceiptDetailId()); | |
629 | - if ("300".equals(receiptDetail.getProcessStamp())){ | |
630 | - ReceiptDetail detail = receiptDetailService.queryflow(receiptDetail); | |
631 | - if (!receiptDetailService.updateById(detail)){ | |
632 | - throw new ServiceException("更新入库单详情失败"); | |
950 | + if (this.save(task)){ | |
951 | + //添加任务明细表 | |
952 | + for(ReceiptContainerDetail item : list) { | |
953 | + TaskDetail taskDetail = new TaskDetail(); | |
954 | + taskDetail.setTaskId(task.getId()); | |
955 | + taskDetail.setTaskType(Integer.valueOf(receiptContainerHeaderService.getById(item.getReceiptId()).getTaskType())); | |
956 | + taskDetail.setInternalTaskType(100); | |
957 | + taskDetail.setWarehouseCode(task.getWarehouseCode()); | |
958 | + taskDetail.setCompanyCode(task.getCompanyCode()); | |
959 | + taskDetail.setCompanyCode(task.getCompanyCode()); | |
960 | + taskDetail.setMaterialCode(item.getMaterialCode()); | |
961 | + taskDetail.setMaterialName(item.getMaterialName()); | |
962 | + taskDetail.setBillCode(item.getReceiptCode()); | |
963 | + taskDetail.setBillDetailId(item.getReceiptDetailId()); | |
964 | + taskDetail.setBillCode(item.getReceiptCode()); | |
965 | + taskDetail.setQty(BigDecimal.valueOf(item.getQty())); | |
966 | + taskDetail.setContainerCode(task.getContainerCode()); | |
967 | + taskDetail.setFromLocation(task.getFromLocation()); | |
968 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
969 | + taskDetail.setBatch(item.getBatch()); | |
970 | + if (!taskDetailService.save(taskDetail)){ | |
971 | + throw new ServiceException("生成任务明细失败"); | |
633 | 972 | } |
634 | - receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
635 | - } | |
636 | - } | |
637 | 973 | |
974 | + //更新入库组盘明细状态 | |
975 | + item.setStatus(10); | |
976 | + receiptContainerDetailService.updateById(item); | |
638 | 977 | |
978 | + ReceiptDetail receiptDetail = receiptDetailService.getById(item.getReceiptDetailId()); | |
979 | + if ("300".equals(receiptDetail.getProcessStamp())){ | |
980 | + ReceiptDetail detail = receiptDetailService.queryflow(receiptDetail); | |
981 | + if (!receiptDetailService.updateById(detail)){ | |
982 | + throw new ServiceException("更新入库单详情失败"); | |
983 | + } | |
984 | + receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
985 | + } | |
986 | + } | |
987 | + } else { | |
988 | + throw new ServiceException("生成任务头表失败"); | |
989 | + } | |
639 | 990 | } |
640 | 991 | } |
641 | - return AjaxResult.success("生成任务成功!"); | |
992 | + return AjaxResult.success("生成上架任务成功!"); | |
642 | 993 | } |
643 | 994 | |
995 | + | |
996 | + | |
997 | + | |
998 | + | |
999 | + | |
644 | 1000 | /** |
645 | 1001 | * |
646 | 1002 | * 完成出库任务 |
... | ... |
src/main/resources/mybatis/config/ContainerMapper.xml
... | ... | @@ -33,4 +33,23 @@ |
33 | 33 | lastUpdated, lastUpdatedBy, `status`, `enable`, printNum, version, userDef1, userDef2, |
34 | 34 | userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp |
35 | 35 | </sql> |
36 | + | |
37 | + <select id="getEmptyContainerInLocation" resultType="com.huaheng.pc.config.location.domain.Location"> | |
38 | + SELECT * FROM location t | |
39 | + <where> | |
40 | + t.zoneCode = 'LK' AND t.warehouseCode = #{warehouseCode} AND t.status='empty' AND t.containerCode !='' AND t.containerCode is not NULL | |
41 | + AND t.`code` NOT in (SELECT b.locationCode FROM inventory_header b WHERE b.warehouseCode = #{warehouseCode} ) | |
42 | + <if test="containerCode != null and containerCode !=''"> | |
43 | + and t.containerCode = #{containerCode} | |
44 | + </if> | |
45 | + <if test="locationCode != null and locationCode !=''"> | |
46 | + and t.`code` = #{locationCode} | |
47 | + </if> | |
48 | + </where> | |
49 | + </select> | |
50 | + | |
51 | + <update id="updateLocationCodeAndStatus"> | |
52 | + UPDATE container set `status`=#{status}, locationCode=#{locationCode} WHERE warehouseCode=#{warehouseCode} AND `code`=#{containerCode} | |
53 | + </update> | |
54 | + | |
36 | 55 | </mapper> |
37 | 56 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/LocationMapper.xml
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | <result column="iLayer" jdbcType="INTEGER" property="iLayer" /> |
15 | 15 | <result column="iGrid" jdbcType="INTEGER" property="iGrid" /> |
16 | 16 | <result column="name" jdbcType="VARCHAR" property="name" /> |
17 | - <result column="enable" jdbcType="INTEGER" property="enable" /> | |
18 | 17 | <result column="lastCycleCountDate" jdbcType="TIMESTAMP" property="lastCycleCountDate" /> |
19 | 18 | <result column="created" jdbcType="TIMESTAMP" property="created" /> |
20 | 19 | <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> |
... | ... | @@ -42,7 +41,12 @@ |
42 | 41 | <update id="updateStatus"> |
43 | 42 | UPDATE location set `status`=#{status} WHERE warehouseCode=#{warehouseCode} AND `code`=#{code} |
44 | 43 | </update> |
45 | - <select id="position" resultType="java.lang.String"> | |
46 | - select location.code from location where #{locatingRule} | |
44 | + <select id="position" resultMap="BaseResultMap"> | |
45 | + select code from location where #{locatingRule} | |
47 | 46 | </select> |
47 | + | |
48 | + <update id="updateContainerCodeAndStatus"> | |
49 | + UPDATE location set `status`=#{status},containerCode=#{containerCode} WHERE warehouseCode=#{warehouseCode} AND `code`=#{locationCode} | |
50 | + </update> | |
51 | + | |
48 | 52 | </mapper> |
49 | 53 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/inventory/InventoryDetailMapper.xml
... | ... | @@ -54,4 +54,9 @@ |
54 | 54 | lastCycleCountDate, created, createdBy, lastUpdated, lastUpdatedBy, userDef1, userDef2, |
55 | 55 | userDef3, processStamp, receiptCode, receiptDetailId |
56 | 56 | </sql> |
57 | + | |
58 | + | |
59 | + <select id="selectBysql" parameterType="String" resultType="com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail"> | |
60 | + ${value} | |
61 | + </select> | |
57 | 62 | </mapper> |
58 | 63 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/shipment/ShipmentCombinationMapper.xml
... | ... | @@ -20,31 +20,26 @@ |
20 | 20 | </sql> |
21 | 21 | |
22 | 22 | <select id="getInventorys" resultType="com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail"> |
23 | - SELECT i.id, i.warehouseId, i.warehouseCode, i.locationId, i.locationCode, i.containerCode, | |
24 | - i.sourceCode, i.sourceLine, i.companyId, i.companyCode, i.materialId, i.materialCode, | |
25 | - i.receiptId, i.receiptCode, i.receiptDetailId, i.batch, i.lot, i.project, i.manufactureDate, | |
26 | - i.expirationDate, i.status, i.qty, i.taskQty, i.costPrice, i.listPrice, i.netPrice, i.created, | |
27 | - i.createdBy, i.lastUpdated, i.lastUpdatedBy, i.userDef1, i.userDef2, i.userDef3, i.deleted, | |
28 | - m.name materialName, m.userDef1 materialOldCode ,i.zoneCode | |
29 | - FROM inventory i | |
30 | - INNER JOIN material m ON i.materialCode = m.code | |
23 | + SELECT i.id, i.warehouseCode, i.locationCode, i.containerCode, | |
24 | + i.companyCode, i.materialCode,i.materialName,i.materialSpec,i.materialUnit, | |
25 | + i.receiptCode, i.receiptDetailId, i.batch, i.lot, i.projectNo, | |
26 | + i.qty, i.taskQty, i.created,i.inventorySts, | |
27 | + i.createdBy, i.lastUpdated, i.lastUpdatedBy, i.userDef1, i.userDef2, i.userDef3 | |
28 | + FROM inventory_detail i | |
29 | + INNER JOIN location l ON i.locationCode = l.code | |
31 | 30 | AND i.companyCode=#{companyCode} |
32 | 31 | AND i.warehouseCode=#{warehouseCode} |
33 | - AND m.warehouseCode=#{warehouseCode} | |
34 | 32 | AND i.qty > i.taskQty |
35 | - AND i.materialCode=#{materialCode} | |
36 | - | |
37 | - INNER JOIN location l ON i.locationCode = l.code | |
38 | 33 | AND l.warehouseCode=#{warehouseCode} |
39 | 34 | LEFT JOIN shipment_container_header s ON i.locationCode = s.locationCode |
40 | 35 | AND s.status=0 |
41 | 36 | AND s.warehouseCode=#{warehouseCode} |
42 | 37 | <where> |
43 | - <if test="project != null and project != ''"> | |
44 | - AND i.project = #{project} | |
38 | + <if test="project!= null and project!= ''"> | |
39 | + AND i.projectNo = #{project} | |
45 | 40 | </if> |
46 | - <if test="inventoryStatus != null and inventoryStatus != '' "> | |
47 | - AND i.status = #{inventoryStatus} | |
41 | + <if test="inventorySts != null and inventorySts != '' "> | |
42 | + AND i.inventorySts = #{inventorySts} | |
48 | 43 | </if> |
49 | 44 | <if test="locationCode != null and locationCode != '' "> |
50 | 45 | AND i.locationCode = #{locationCode} |
... | ... |
src/main/resources/mybatis/shipment/ShipmentContainerDetailMapper.xml
... | ... | @@ -21,12 +21,10 @@ |
21 | 21 | <result column="itemLength" jdbcType="DECIMAL" property="itemLength" /> |
22 | 22 | <result column="itemWidth" jdbcType="DECIMAL" property="itemWidth" /> |
23 | 23 | <result column="itemHeight" jdbcType="DECIMAL" property="itemHeight" /> |
24 | - <result column="itemValue" jdbcType="DECIMAL" property="itemValue" /> | |
25 | 24 | <result column="qty" jdbcType="INTEGER" property="qty" /> |
26 | 25 | <result column="waveId" jdbcType="INTEGER" property="waveId" /> |
27 | 26 | <result column="taskCreated" jdbcType="INTEGER" property="taskCreated" /> |
28 | 27 | <result column="attributeId" jdbcType="INTEGER" property="attributeId" /> |
29 | - <result column="originalPickLoc" jdbcType="VARCHAR" property="originalPickLoc" /> | |
30 | 28 | <result column="attribute1" jdbcType="VARCHAR" property="attribute1" /> |
31 | 29 | <result column="attribute2" jdbcType="VARCHAR" property="attribute2" /> |
32 | 30 | <result column="attribute3" jdbcType="VARCHAR" property="attribute3" /> |
... | ... | @@ -39,8 +37,6 @@ |
39 | 37 | <result column="agingDate" jdbcType="DATE" property="agingDate" /> |
40 | 38 | <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" /> |
41 | 39 | <result column="packingClass" jdbcType="VARCHAR" property="packingClass" /> |
42 | - <result column="transContCode" jdbcType="VARCHAR" property="transContCode" /> | |
43 | - <result column="scannedQty" jdbcType="INTEGER" property="scannedQty" /> | |
44 | 40 | <result column="created" jdbcType="TIMESTAMP" property="created" /> |
45 | 41 | <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> |
46 | 42 | <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> |
... | ... | @@ -49,22 +45,17 @@ |
49 | 45 | <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> |
50 | 46 | <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> |
51 | 47 | <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> |
52 | - <result column="userDef4" jdbcType="VARCHAR" property="userDef4" /> | |
53 | - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" /> | |
54 | - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> | |
55 | - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> | |
56 | - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> | |
57 | 48 | <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> |
58 | 49 | </resultMap> |
59 | 50 | <sql id="Base_Column_List"> |
60 | 51 | <!--@mbg.generated--> |
61 | 52 | id, containerCode, shippingContainerId, shipmentCode, warehouseCode, shipmentId, |
62 | 53 | shipmentDetailId, companyCode, materialCode, materialName, materialSpec, materialUnit, |
63 | - `enable`, itemWeight, itemVolume, itemLength, itemWidth, itemHeight, itemValue, qty, | |
54 | + `enable`, itemWeight, itemVolume, itemLength, itemWidth, itemHeight, qty, | |
64 | 55 | waveId, taskCreated, attributeId, originalPickLoc, attribute1, attribute2, attribute3, |
65 | 56 | attribute4, batch, lot, projectNo, manufactureDate, expirationDate, agingDate, inventorySts, |
66 | - packingClass, transContCode, scannedQty, created, createdBy, lastUpdated, lastUpdatedBy, | |
67 | - version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, | |
57 | + packingClass, created, createdBy, lastUpdated, lastUpdatedBy, | |
58 | + version, userDef1, userDef2, userDef3, | |
68 | 59 | processStamp |
69 | 60 | </sql> |
70 | 61 | |
... | ... | @@ -74,14 +65,14 @@ |
74 | 65 | <if test="condition.id != null"> |
75 | 66 | AND id = #{condition.id} |
76 | 67 | </if> |
77 | - <if test="condition.headerId != null"> | |
78 | - AND headerId = #{condition.headerId} | |
68 | + <if test="condition.shippingContainerId != null"> | |
69 | + AND shippingContainerId = #{condition.shippingContainerId} | |
79 | 70 | </if> |
80 | 71 | <if test="condition.shipmentCode != null"> |
81 | 72 | AND shipmentCode = #{condition.shipmentCode} |
82 | 73 | </if> |
83 | - <if test="condition.shipmentHeaderId != null"> | |
84 | - AND shipmentHeaderId = #{condition.shipmentHeaderId} | |
74 | + <if test="condition.shipmentId != null"> | |
75 | + AND shipmentId = #{condition.shipmentId} | |
85 | 76 | </if> |
86 | 77 | <if test="condition.shipmentDetailId != null"> |
87 | 78 | AND shipmentDetailId = #{condition.shipmentDetailId} |
... | ... | @@ -104,8 +95,8 @@ |
104 | 95 | <if test="condition.createdBy != null"> |
105 | 96 | AND createdBy = #{condition.createdBy} |
106 | 97 | </if> |
107 | - <if test="condition.project != null"> | |
108 | - AND project = #{condition.project} | |
98 | + <if test="condition.projectNo != null"> | |
99 | + AND projectNo = #{condition.projectNo} | |
109 | 100 | </if> |
110 | 101 | </where> |
111 | 102 | </select> |
... | ... |
src/main/resources/mybatis/task/TaskHeaderMapper.xml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 | <mapper namespace="com.huaheng.pc.task.taskHeader.mapper.TaskHeaderMapper"> |
4 | - <resultMap id="BaseResultMap" type="com.huaheng.pc.task.taskHeader.domain.TaskHeader"> | |
5 | - <!--@mbg.generated--> | |
6 | - <id column="id" jdbcType="INTEGER" property="id" /> | |
7 | - <result column="code" jdbcType="VARCHAR" property="code" /> | |
8 | - <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> | |
9 | - <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> | |
10 | - <result column="taskType" jdbcType="VARCHAR" property="taskType" /> | |
11 | - <result column="internalTaskType" jdbcType="VARCHAR" property="internalTaskType" /> | |
12 | - <result column="referenceId" jdbcType="INTEGER" property="referenceId" /> | |
13 | - <result column="referenceCode" jdbcType="VARCHAR" property="referenceCode" /> | |
14 | - <result column="assignedUser" jdbcType="VARCHAR" property="assignedUser" /> | |
15 | - <result column="confirmedBy" jdbcType="VARCHAR" property="confirmedBy" /> | |
16 | - <result column="waveId" jdbcType="INTEGER" property="waveId" /> | |
17 | - <result column="pickingCartCode" jdbcType="VARCHAR" property="pickingCartCode" /> | |
18 | - <result column="pickingCartPos" jdbcType="VARCHAR" property="pickingCartPos" /> | |
19 | - <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> | |
20 | - <result column="startPickDateTime" jdbcType="TIMESTAMP" property="startPickDateTime" /> | |
21 | - <result column="endPickDateTime" jdbcType="TIMESTAMP" property="endPickDateTime" /> | |
22 | - <result column="rebatchLoc" jdbcType="VARCHAR" property="rebatchLoc" /> | |
23 | - <result column="finishRebatch" jdbcType="INTEGER" property="finishRebatch" /> | |
24 | - <result column="rebatchGroupCode" jdbcType="VARCHAR" property="rebatchGroupCode" /> | |
25 | - <result column="allowRebatch" jdbcType="INTEGER" property="allowRebatch" /> | |
26 | - <result column="taskProcessType" jdbcType="VARCHAR" property="taskProcessType" /> | |
27 | - <result column="rebinBench" jdbcType="VARCHAR" property="rebinBench" /> | |
28 | - <result column="rebined" jdbcType="INTEGER" property="rebined" /> | |
29 | - <result column="startRebinDateTime" jdbcType="TIMESTAMP" property="startRebinDateTime" /> | |
30 | - <result column="endRebinDateTime" jdbcType="TIMESTAMP" property="endRebinDateTime" /> | |
31 | - <result column="rebinedBy" jdbcType="VARCHAR" property="rebinedBy" /> | |
32 | - <result column="exceptionCode" jdbcType="VARCHAR" property="exceptionCode" /> | |
33 | - <result column="exceptionHandledBy" jdbcType="VARCHAR" property="exceptionHandledBy" /> | |
34 | - <result column="created" jdbcType="TIMESTAMP" property="created" /> | |
35 | - <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> | |
36 | - <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> | |
37 | - <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> | |
38 | - <result column="version" jdbcType="INTEGER" property="version" /> | |
39 | - <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> | |
40 | - <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> | |
41 | - <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> | |
42 | - <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> | |
43 | - </resultMap> | |
44 | -<select id="getReceiptTask" resultType="java.util.Map"> | |
4 | + <resultMap id="BaseResultMap" type="com.huaheng.pc.task.taskHeader.domain.TaskHeader"> | |
5 | + <!--@mbg.generated--> | |
6 | + <id column="id" jdbcType="INTEGER" property="id"/> | |
7 | + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode"/> | |
8 | + <result column="companyCode" jdbcType="VARCHAR" property="companyCode"/> | |
9 | + <result column="taskType" jdbcType="VARCHAR" property="taskType"/> | |
10 | + <result column="internalTaskType" jdbcType="VARCHAR" property="internalTaskType"/> | |
11 | + <result column="referenceId" jdbcType="INTEGER" property="referenceId"/> | |
12 | + <result column="referenceCode" jdbcType="VARCHAR" property="referenceCode"/> | |
13 | + <result column="assignedUser" jdbcType="VARCHAR" property="assignedUser"/> | |
14 | + <result column="confirmedBy" jdbcType="VARCHAR" property="confirmedBy"/> | |
15 | + <result column="waveId" jdbcType="INTEGER" property="waveId"/> | |
16 | + <result column="pickingCartCode" jdbcType="VARCHAR" property="pickingCartCode"/> | |
17 | + <result column="pickingCartPos" jdbcType="VARCHAR" property="pickingCartPos"/> | |
18 | + <result column="fromLocation" jdbcType="VARCHAR" property="fromLocation"/> | |
19 | + <result column="toLocation" jdbcType="VARCHAR" property="toLocation"/> | |
20 | + <result column="containerCode" jdbcType="VARCHAR" property="containerCode"/> | |
21 | + <result column="startPickDateTime" jdbcType="TIMESTAMP" property="startPickDateTime"/> | |
22 | + <result column="endPickDateTime" jdbcType="TIMESTAMP" property="endPickDateTime"/> | |
23 | + <result column="rebatchLoc" jdbcType="VARCHAR" property="rebatchLoc"/> | |
24 | + <result column="finishRebatch" jdbcType="INTEGER" property="finishRebatch"/> | |
25 | + <result column="rebatchGroupCode" jdbcType="VARCHAR" property="rebatchGroupCode"/> | |
26 | + <result column="allowRebatch" jdbcType="INTEGER" property="allowRebatch"/> | |
27 | + <result column="taskProcessType" jdbcType="VARCHAR" property="taskProcessType"/> | |
28 | + <result column="rebinBench" jdbcType="VARCHAR" property="rebinBench"/> | |
29 | + <result column="rebined" jdbcType="INTEGER" property="rebined"/> | |
30 | + <result column="startRebinDateTime" jdbcType="TIMESTAMP" property="startRebinDateTime"/> | |
31 | + <result column="endRebinDateTime" jdbcType="TIMESTAMP" property="endRebinDateTime"/> | |
32 | + <result column="rebinedBy" jdbcType="VARCHAR" property="rebinedBy"/> | |
33 | + <result column="exceptionCode" jdbcType="VARCHAR" property="exceptionCode"/> | |
34 | + <result column="exceptionHandledBy" jdbcType="VARCHAR" property="exceptionHandledBy"/> | |
35 | + <result column="created" jdbcType="TIMESTAMP" property="created"/> | |
36 | + <result column="createdBy" jdbcType="VARCHAR" property="createdBy"/> | |
37 | + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated"/> | |
38 | + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy"/> | |
39 | + <result column="version" jdbcType="INTEGER" property="version"/> | |
40 | + <result column="userDef1" jdbcType="VARCHAR" property="userDef1"/> | |
41 | + <result column="userDef2" jdbcType="VARCHAR" property="userDef2"/> | |
42 | + <result column="userDef3" jdbcType="VARCHAR" property="userDef3"/> | |
43 | + <result column="processStamp" jdbcType="VARCHAR" property="processStamp"/> | |
44 | + </resultMap> | |
45 | + <select id="getReceiptTask" resultType="java.util.Map"> | |
45 | 46 | SELECT rd.id receiptDetailId,rd.receiptId,td.taskId, td.warehouseCode, td.id taskDetailId, td.status, |
46 | 47 | td.containerCode, td.qty, td.materialCode,rd.totalQty,td.materialSpec, |
47 | 48 | rd.receiptCode,td.inventorySts, |
... | ... | @@ -49,16 +50,25 @@ |
49 | 50 | rd.manufactureDate, rd.expirationDate |
50 | 51 | FROM task_detail td |
51 | 52 | INNER JOIN receipt_detail rd ON rd.id = td.billDetailId AND td.taskId = #{taskId,jdbcType=INTEGER} |
52 | -</select> | |
53 | + </select> | |
54 | + | |
55 | + <select id="UncompleteCount" resultType="java.lang.Integer"> | |
56 | + SELECT COUNT(*) AS count FROM task_header WHERE status < 10 AND containerCode = #{containerCode} AND warehouseCode=#{warehouseCode} | |
57 | + </select> | |
58 | + | |
59 | + | |
60 | + | |
61 | + | |
62 | + <sql id="Base_Column_List"> | |
63 | + <!--@mbg.generated--> | |
64 | + id, warehouseCode, companyCode, taskType, internalTaskType, referenceId, referenceCode, fromLocation, | |
65 | + assignedUser, confirmedBy, waveId, pickingCartCode, pickingCartPos, containerCode, toLocation, | |
66 | + startPickDateTime, endPickDateTime, rebatchLoc, finishRebatch, rebatchGroupCode, | |
67 | + allowRebatch, taskProcessType, rebinBench, rebined, startRebinDateTime, endRebinDateTime, | |
68 | + rebinedBy, exceptionCode, exceptionHandledBy, created, createdBy, lastUpdated, lastUpdatedBy, | |
69 | + version, userDef1, userDef2, userDef3, | |
70 | + processStamp | |
71 | + </sql> | |
72 | + | |
53 | 73 | |
54 | - <sql id="Base_Column_List"> | |
55 | - <!--@mbg.generated--> | |
56 | - id, code, warehouseCode, companyCode, taskType, internalTaskType, referenceId, referenceCode, | |
57 | - assignedUser, confirmedBy, waveId, pickingCartCode, pickingCartPos, containerCode, | |
58 | - startPickDateTime, endPickDateTime, rebatchLoc, finishRebatch, rebatchGroupCode, | |
59 | - allowRebatch, taskProcessType, rebinBench, rebined, startRebinDateTime, endRebinDateTime, | |
60 | - rebinedBy, exceptionCode, exceptionHandledBy, created, createdBy, lastUpdated, lastUpdatedBy, | |
61 | - version, userDef1, userDef2, userDef3, | |
62 | - processStamp | |
63 | - </sql> | |
64 | 74 | </mapper> |
65 | 75 | \ No newline at end of file |
... | ... |
src/main/resources/templates/config/container/add.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <label class="col-sm-3 control-label">容器类型:</label> |
10 | 10 | <div class="col-sm-8"> |
11 | 11 | <select id="type" class="form-control m-b" th:with="containerType=${@containerType.getCode()}"> |
12 | - <option th:each="item : ${containerType}" th:text="${item['name']}" th:value="${item['prefix']}"></option> | |
12 | + <option th:each="item : ${containerType}" th:text="${item['name']}" th:value="${item['code']}"></option> | |
13 | 13 | </select> |
14 | 14 | </div> |
15 | 15 | </div> |
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | type : "POST", |
44 | 44 | url : prefix + "/add", |
45 | 45 | data : { |
46 | - "type": $("#type option:selected").val(), | |
46 | + "containerType": $("#type option:selected").val(), | |
47 | 47 | "quantity": $("input[name='quantity']").val(), |
48 | 48 | }, |
49 | 49 | async : false, |
... | ... |
src/main/resources/templates/inventory/adjustDetail/adjustDetail.html
... | ... | @@ -306,10 +306,13 @@ |
306 | 306 | let url = location.search; //获取url中"?"符后的字串 |
307 | 307 | if (url.indexOf("?") != -1) { //判断是否有参数 |
308 | 308 | let str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串 |
309 | + let strs = url.substr(1).split("="); | |
310 | + $("#adjustCode").val(strs[1]); | |
309 | 311 | options.queryParams=function(params) { |
312 | + | |
310 | 313 | return { |
311 | 314 | // 传递参数查询参数 |
312 | - adjustCode: adjustCode, | |
315 | + adjustCode: strs[1], | |
313 | 316 | pageSize: params.limit, |
314 | 317 | pageNum: params.offset / params.limit + 1, |
315 | 318 | searchValue: params.search, |
... | ... |
src/main/resources/templates/inventory/adjustDetail/addAdjust.html renamed to src/main/resources/templates/inventory/adjustHeader/addAdjust.html
src/main/resources/templates/inventory/adjustDetail/adjustEdit.html renamed to src/main/resources/templates/inventory/adjustHeader/adjustEdit.html
src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
... | ... | @@ -185,9 +185,9 @@ |
185 | 185 | })); |
186 | 186 | }); |
187 | 187 | |
188 | - function detail(id, code) { | |
188 | + function detail(id,code) { | |
189 | 189 | let url = ctx + "inventory/adjustDetail"; |
190 | - if (id || code) { | |
190 | + if (code) { | |
191 | 191 | url = ctx + "inventory/adjustDetail?adjustCode=" + code; |
192 | 192 | } |
193 | 193 | $("#tabDetail").children().remove(); |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
... | ... | @@ -317,19 +317,19 @@ |
317 | 317 | align: 'center', |
318 | 318 | formatter: function (value, row, index) { |
319 | 319 | var actions = []; |
320 | - if(row.isCreateTask !== "未生成"){ | |
321 | - actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> '); | |
322 | - } | |
323 | - if (row.isCreateTask !== "已生成") { | |
324 | - actions.push('<a class="btn btn-primary btn-xs ' + createTaskFalg + '" href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> '); | |
325 | - } | |
326 | - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); | |
320 | + | |
321 | + actions.push('<a class="btn btn-success btn-xs " href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> '); | |
322 | + | |
323 | + actions.push('<a class="btn btn-primary btn-xs " href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> '); | |
324 | + | |
325 | + actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); | |
327 | 326 | return actions.join(''); |
328 | 327 | } |
329 | 328 | }] |
330 | 329 | },url = location.search; //获取url中"?"符后的字串 |
331 | 330 | if (url.indexOf("?") != -1) { //判断是否有参数 |
332 | 331 | let strs = url.substr(1).split("="); |
332 | + $("#cycleCountHeadId").val(strs[1]); | |
333 | 333 | options.queryParams=function(params) { |
334 | 334 | return { |
335 | 335 | // 传递参数查询参数 |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
... | ... | @@ -262,12 +262,12 @@ |
262 | 262 | align: 'center', |
263 | 263 | formatter: function (value, row, index) { |
264 | 264 | var actions = []; |
265 | - actions.push('<a class="btn btn-success btn-xs ' + reportFlag + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); | |
266 | - if (row.status == 30) { | |
267 | - actions.push('<a class="btn btn-warning btn-xs' + addAdjust + ' " href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成差异单</a> '); | |
268 | - } | |
269 | - actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
270 | - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); | |
265 | + actions.push('<a class="btn btn-success btn-xs " href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); | |
266 | + | |
267 | + actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成差异单</a> '); | |
268 | + | |
269 | + actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
270 | + actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); | |
271 | 271 | //actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.code + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>'); |
272 | 272 | return actions.join(''); |
273 | 273 | } |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyCheckOut.html
0 → 100644
1 | +<!DOCTYPE HTML> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> | |
3 | +<meta charset="utf-8"> | |
4 | +<head th:include="include :: header"></head> | |
5 | +<body class="white-bg"> | |
6 | +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> | |
7 | + <form class="form-horizontal m" id="form-task-emptyInOut"> | |
8 | + <div class="form-group"> | |
9 | + <label class="col-sm-3 control-label">容器编码:</label> | |
10 | + <div class="col-sm-8"> | |
11 | + <input id="containerCode" name="containerCode" class="form-control" type="text"> | |
12 | + </div> | |
13 | + </div> | |
14 | + <div class="form-group"> | |
15 | + <label class="col-sm-3 control-label">源库位编码:</label> | |
16 | + <div class="col-sm-8"> | |
17 | + <input id="location" name="location" class="form-control" type="text"> | |
18 | + </div> | |
19 | + </div> | |
20 | + <div class="form-group"> | |
21 | + <div class="form-control-static col-sm-offset-9"> | |
22 | + <input type="button" class="btn-success btn" onclick="selectEmptyInOut()" value="选取" /> | |
23 | + <button type="submit" class="btn btn-primary">提交</button> | |
24 | + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> | |
25 | + </div> | |
26 | + </div> | |
27 | + </form> | |
28 | +</div> | |
29 | +<div th:include="include::footer"></div> | |
30 | +<script type="text/javascript"> | |
31 | + var prefix = ctx + "inventory/inventoryHeader" | |
32 | + $("#form-task-emptyCheckOut").validate({ | |
33 | + rules:{ | |
34 | + containerCode:{ | |
35 | + required:true, | |
36 | + }, | |
37 | + location:{ | |
38 | + required:true, | |
39 | + }, | |
40 | + }, | |
41 | + submitHandler: function(form) { | |
42 | + $.operate.save(prefix + "/emptyCheckOut", $('#form-task-emptyInOut').serialize()); | |
43 | + } | |
44 | + }); | |
45 | + | |
46 | + function selectEmptyInOut() { | |
47 | + $.modal.open("空托盘选取",prefix+"/listEmpty",780); | |
48 | + } | |
49 | +</script> | |
50 | +</body> | |
51 | +</html> | |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyContainer.html
0 → 100644
1 | +<!DOCTYPE HTML> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> | |
3 | +<meta charset="utf-8"> | |
4 | +<head th:include="include :: header"></head> | |
5 | +<body class="gray-bg"> | |
6 | +<div class="container-div"> | |
7 | + <row> | |
8 | + <div class="col-sm-12 select-info"> | |
9 | + <form id="location-form"> | |
10 | + <div class="select-list"> | |
11 | + <ul> | |
12 | + <li> | |
13 | + 容器编码:<input type="text" name="containerCode"/> | |
14 | + </li> | |
15 | + <li> | |
16 | + 库位编码:<input type="text" name="locationCode"/> | |
17 | + </li> | |
18 | + <li> | |
19 | + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> | |
20 | + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="general:location:export"><i class="fa fa-download"></i> 导出</a>--> | |
21 | + </li> | |
22 | + </ul> | |
23 | + </div> | |
24 | + </form> | |
25 | + </div> | |
26 | + | |
27 | + <div class="col-sm-12 select-info"> | |
28 | + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> | |
29 | + </div> | |
30 | + </row> | |
31 | +</div> | |
32 | +<div th:include="include :: footer"></div> | |
33 | +<script th:inline="javascript"> | |
34 | + var prefix = ctx + "inventory/inventoryHeader"; | |
35 | + var editFlag = [[${@permission.hasPermi('general:location:edit')}]]; | |
36 | + var removeFlag = [[${@permission.hasPermi('general:location:remove')}]]; | |
37 | + var datas = [[${@dict.getType('sys_normal_disable')}]]; | |
38 | + var locationTypes = [[${@locationType.getLocationPrefix()}]]; | |
39 | + var locationStatus = [[${@dict.getType('locationStatus')}]]; | |
40 | + | |
41 | + $(function() { | |
42 | + var options = { | |
43 | + url: prefix + "/listEmptyContainer", | |
44 | + createUrl: prefix + "/add", | |
45 | + updateUrl: prefix + "/edit/{id}", | |
46 | + removeUrl: prefix + "/remove", | |
47 | + modalName: "库位", | |
48 | + search: false, | |
49 | + columns: [ | |
50 | + { | |
51 | + title: '操作', | |
52 | + align: 'center', | |
53 | + formatter: function(value, row, index) { | |
54 | + var actions = []; | |
55 | + actions.push('<a class="btn btn-success btn-xs" href="#" onclick="select(\'' + row.containerCode + '\',\''+row.code+'\',\''+row.status+'\')"><i class="fa fa-edit"></i>选取</a> '); | |
56 | + // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); | |
57 | + return actions.join(''); | |
58 | + } | |
59 | + }, | |
60 | + { | |
61 | + field : 'id', | |
62 | + title : 'id' | |
63 | + }, | |
64 | + { | |
65 | + field : 'code', | |
66 | + title : '库位' | |
67 | + }, | |
68 | + // { | |
69 | + // field : 'warehouseId', | |
70 | + // title : '仓库Id' | |
71 | + // }, | |
72 | + // { | |
73 | + // field : 'warehouseCode', | |
74 | + // title : '仓库编码' | |
75 | + // }, | |
76 | + { | |
77 | + field : 'row', | |
78 | + title : '行' | |
79 | + }, | |
80 | + { | |
81 | + field : 'line', | |
82 | + title : '列' | |
83 | + }, | |
84 | + { | |
85 | + field : 'layer', | |
86 | + title : '层' | |
87 | + }, | |
88 | + { | |
89 | + field : 'grid', | |
90 | + title : '格' | |
91 | + }, | |
92 | + { | |
93 | + field : 'type', | |
94 | + title : '库位类型' , | |
95 | + align: 'center', | |
96 | + formatter: function(value, row, index) { | |
97 | + return $.table.selectPrefixToName(locationTypes, value); | |
98 | + } | |
99 | + }, | |
100 | + // { | |
101 | + // field : 'containerId', | |
102 | + // title : '容器id号' , | |
103 | + // visible:false | |
104 | + // }, | |
105 | + { | |
106 | + field : 'containerCode', | |
107 | + title : '容器编码' | |
108 | + }, | |
109 | + { | |
110 | + field : 'zoneId', | |
111 | + title : '区域id' , | |
112 | + visible:false | |
113 | + }, | |
114 | + { | |
115 | + field : 'zoneCode', | |
116 | + title : '区域编码' | |
117 | + }, | |
118 | + { | |
119 | + field : 'status', | |
120 | + title : '状态' , | |
121 | + align: 'center', | |
122 | + formatter: function(value, row, index) { | |
123 | + return $.table.selectDictLabel(locationStatus, value); | |
124 | + } | |
125 | + }, | |
126 | + { | |
127 | + field : 'lastCycleCountDate', | |
128 | + title : '上次盘点日期' , | |
129 | + visible:false | |
130 | + }, | |
131 | + { | |
132 | + field : 'created', | |
133 | + title : '创建时间' | |
134 | + }, | |
135 | + { | |
136 | + field : 'createdBy', | |
137 | + title : '创建用户' | |
138 | + }, | |
139 | + { | |
140 | + field : 'lastUpdated', | |
141 | + title : '创建时间' | |
142 | + }, | |
143 | + { | |
144 | + field : 'lastUpdatedBy', | |
145 | + title : '更新用户' | |
146 | + }, | |
147 | + { | |
148 | + field : 'enable', | |
149 | + title : '是否有效' , | |
150 | + align: 'center', | |
151 | + formatter: function(value, row, index) { | |
152 | + return $.table.selectDictLabel(datas, value); | |
153 | + } | |
154 | + }, | |
155 | + // { | |
156 | + // field : 'deleted', | |
157 | + // title : '是否删除' | |
158 | + // }, | |
159 | + /*{ | |
160 | + field : 'userDef1', | |
161 | + title : '自定义字段1' , | |
162 | + visible:false | |
163 | + }, | |
164 | + { | |
165 | + field : 'userDef2', | |
166 | + title : '自定义字段2' , | |
167 | + visible:false | |
168 | + }, | |
169 | + { | |
170 | + field : 'userDef3', | |
171 | + title : '自定义字段3' , | |
172 | + visible:false | |
173 | + }, | |
174 | + { | |
175 | + field : 'userDef4', | |
176 | + title : '自定义字段4' , | |
177 | + visible:false | |
178 | + }, | |
179 | + { | |
180 | + field : 'userDef5', | |
181 | + title : '自定义字段5' , | |
182 | + visible:false | |
183 | + }*/ | |
184 | + ] | |
185 | + }; | |
186 | + $.table.init(options); | |
187 | + }); | |
188 | + function select(containerCode,code,status) { | |
189 | + if(status!="empty"){ | |
190 | + $.modal.alertError("所选库位非空闲"); | |
191 | + return; | |
192 | + } | |
193 | + parent.$('#containerCode').val(containerCode); | |
194 | + parent.$('#sourceLocation').val(code); | |
195 | + $.modal.close(); | |
196 | + } | |
197 | +</script> | |
198 | +</body> | |
199 | +</html> | |
0 | 200 | \ No newline at end of file |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyIn.html
0 → 100644
1 | +<!DOCTYPE HTML> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> | |
3 | +<meta charset="utf-8"> | |
4 | +<head th:include="include :: header"></head> | |
5 | +<body class="white-bg"> | |
6 | +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> | |
7 | + <form class="form-horizontal m" id="form-task-emptyIn"> | |
8 | + <div class="form-group"> | |
9 | + <label class="col-sm-3 control-label">容器编号:</label> | |
10 | + <div class="col-sm-8"> | |
11 | + <input id="containerCode" name="containerCode" class="form-control" type="text" > | |
12 | + </div> | |
13 | + </div> | |
14 | + <div class="form-group"> | |
15 | + <label class="col-sm-3 control-label">目的库位:</label> | |
16 | + <div class="col-sm-8"> | |
17 | + <input id="destinationLocation" name="destinationLocation" class="form-control" type="text" > | |
18 | + </div> | |
19 | + </div> | |
20 | + <div class="form-group"> | |
21 | + <div class="form-control-static col-sm-offset-9"> | |
22 | + <button type="submit" class="btn btn-primary">提交</button> | |
23 | + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> | |
24 | + </div> | |
25 | + </div> | |
26 | + </form> | |
27 | +</div> | |
28 | +<div th:include="include::footer"></div> | |
29 | +<script type="text/javascript"> | |
30 | + var prefix = ctx + "inventory/inventoryHeader" | |
31 | + $("#form-task-emptyIn").validate({ | |
32 | + rules:{ | |
33 | + containerCode:{ | |
34 | + required:true, | |
35 | + }, | |
36 | + destinationLocation:{ | |
37 | + required:true, | |
38 | + }, | |
39 | + }, | |
40 | + submitHandler: function(form) { | |
41 | + $.operate.save(prefix + "/emptyIn", $('#form-task-emptyIn').serialize()); | |
42 | + } | |
43 | + }); | |
44 | +</script> | |
45 | +</body> | |
46 | +</html> | |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyOut.html
0 → 100644
1 | +<!DOCTYPE HTML> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> | |
3 | +<meta charset="utf-8"> | |
4 | +<head th:include="include :: header"></head> | |
5 | +<body class="white-bg"> | |
6 | +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> | |
7 | + <form class="form-horizontal m" id="form-task-emptyOut"> | |
8 | + <div class="form-group"> | |
9 | + <label class="col-sm-3 control-label">容器编号:</label> | |
10 | + <div class="col-sm-8"> | |
11 | + <input id="containerCode" name="containerCode" class="form-control" type="text"> | |
12 | + </div> | |
13 | + </div> | |
14 | + <div class="form-group"> | |
15 | + <label class="col-sm-3 control-label">源库位:</label> | |
16 | + <div class="col-sm-8"> | |
17 | + <input id="sourceLocation" name="sourceLocation" class="form-control" type="text"> | |
18 | + </div> | |
19 | + </div> | |
20 | + <div class="form-group"> | |
21 | + <div class="form-control-static col-sm-offset-9"> | |
22 | + <input type="button" class="btn-success btn" onclick="selectEmptyOut()" value="选取" /> | |
23 | + <button type="submit" class="btn btn-primary">提交</button> | |
24 | + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> | |
25 | + </div> | |
26 | + </div> | |
27 | + </form> | |
28 | +</div> | |
29 | +<div th:include="include::footer"></div> | |
30 | +<script type="text/javascript"> | |
31 | + var prefix = ctx + "inventory/inventoryHeader" | |
32 | + $("#form-task-emptyOut").validate({ | |
33 | + rules:{ | |
34 | + containerCode:{ | |
35 | + required:true, | |
36 | + }, | |
37 | + sourceLocation:{ | |
38 | + required:true, | |
39 | + }, | |
40 | + }, | |
41 | + submitHandler: function(form) { | |
42 | + $.operate.save(prefix + "/emptyOut", $('#form-task-emptyOut').serialize()); | |
43 | + } | |
44 | + }); | |
45 | + | |
46 | + function selectEmptyOut() { | |
47 | + $.modal.open("空托盘选取",prefix+"/listEmpty",780); | |
48 | + } | |
49 | +</script> | |
50 | +</body> | |
51 | +</html> | |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
... | ... | @@ -59,6 +59,15 @@ |
59 | 59 | <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()"> |
60 | 60 | <i class="fa fa-eye"></i> 出库查看 |
61 | 61 | </a> |
62 | + <a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()" shiro:hasPermission="task:task:emptyIn"> | |
63 | + <i class="fa fa-level-down"></i> 空托入库 | |
64 | + </a> | |
65 | + <a class="btn btn-outline btn-default btn-rounded" onclick="emptyCheckOut()" > | |
66 | + <i class="fa fa fa-eye"></i> 空托出库查看 | |
67 | + </a> | |
68 | + <a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()" shiro:hasPermission="task:task:emptyOut"> | |
69 | + <i class="fa fa-level-up"></i> 空托出库 | |
70 | + </a> | |
62 | 71 | </div> |
63 | 72 | <div class="col-sm-12 select-info"> |
64 | 73 | <table id="bootstrap-table" data-mobile-responsive="true" |
... | ... | @@ -286,6 +295,20 @@ |
286 | 295 | $.modal.open("立库移库", url); |
287 | 296 | } |
288 | 297 | |
298 | + function emptyIn() { | |
299 | + $.modal.open("空托盘入库",prefix+"/emptyIn") | |
300 | + } | |
301 | + | |
302 | + function emptyOut() { | |
303 | + $.modal.open("空托盘出库",prefix+"/emptyOut") | |
304 | + } | |
305 | + | |
306 | + function emptyCheckOut() { | |
307 | + $.modal.open("空托盘出库查看",prefix+"/emptyCheckOut") | |
308 | + } | |
309 | + | |
310 | + | |
311 | + | |
289 | 312 | |
290 | 313 | </script> |
291 | 314 | </body> |
... | ... |
src/main/resources/templates/receipt/receiptContainerDetail/receiptContainerDetail.html
src/main/resources/templates/receipt/receiptContainerHeader/receiptContainerHeader.html
... | ... | @@ -144,7 +144,7 @@ |
144 | 144 | formatter: function(value, row, index) { |
145 | 145 | var actions = []; |
146 | 146 | actions.push('<a class="btn btn-info btn-xs " href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>明细</a> '); |
147 | - if (row.toLocation != null){ | |
147 | + if (row.toLocation == null || row.toLocation == ""){ | |
148 | 148 | actions.push('<a class="btn btn-success btn-xs ' + createTaskFlag + '" href="#" onclick="position(\'' + row.id + '\')"><i class="fa fa-edit"></i>定位</a> '); |
149 | 149 | } else { |
150 | 150 | actions.push('<a class="btn btn-success btn-xs ' + createTaskFlag + '" href="#" onclick="createTask(\'' + row.id + '\')"><i class="fa fa-edit"></i>生成任务</a> '); |
... | ... | @@ -275,7 +275,7 @@ |
275 | 275 | |
276 | 276 | /*入库单列表-详细*/ |
277 | 277 | function detail(headerId) { |
278 | - var url = detailPrefix + "/list/"; | |
278 | + var url = detailPrefix + "/list/"+headerId; | |
279 | 279 | // createMenuItem(url, "入库组盘明细"); |
280 | 280 | S_headerId=headerId; |
281 | 281 | createtable(url, S_headerId); |
... | ... | @@ -337,7 +337,7 @@ |
337 | 337 | } |
338 | 338 | |
339 | 339 | function position(id){ |
340 | - var url = prefix + "/position"; | |
340 | + var url = prefix + "/position/"; | |
341 | 341 | var data = { "ids" : id }; |
342 | 342 | $.operate.post(url, data); |
343 | 343 | } |
... | ... |
src/main/resources/templates/receipt/receiving/add.html
... | ... | @@ -70,7 +70,9 @@ |
70 | 70 | <div class="form-group"> |
71 | 71 | <label class="col-sm-3 control-label">定位规则:</label> |
72 | 72 | <div class="col-sm-8"> |
73 | - <input id="locatingRule" name="locatingRule" class="form-control" type="text"> | |
73 | + <select id="locatingRule" name="locatingRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail()}"> | |
74 | + <option th:each="item : ${list}" th:text="${item['description']}" th:value="${item['code']}"></option> | |
75 | + </select> | |
74 | 76 | </div> |
75 | 77 | </div> |
76 | 78 | <div class="form-group"> |
... | ... |
src/main/resources/templates/shipment/shipmentContainerDetail/shipmentContainerDetail.html
src/main/resources/templates/shipment/shipmentContainerHeader/shipmentContainerHeader.html
... | ... | @@ -71,6 +71,11 @@ |
71 | 71 | |
72 | 72 | </div> |
73 | 73 | <div class="tab-pane fade" id="tabDetail"> |
74 | + <div class="btn-group hidden-xs" id="toolbar1" role="group"> | |
75 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="detailBatRemove()" > | |
76 | + <i class="fa fa-trash-o"></i> 删除 | |
77 | + </a> | |
78 | + </div> | |
74 | 79 | <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table> |
75 | 80 | </div> |
76 | 81 | </div> |
... | ... | @@ -129,20 +134,20 @@ |
129 | 134 | title : '仓库编号' , |
130 | 135 | visible:false |
131 | 136 | }, |
132 | - { | |
133 | - field : 'taskType', | |
134 | - title : '下发任务类型' , | |
135 | - formatter: function(value, row, index) { | |
136 | - return $.table.selectDictLabel(shipmentTaskType, value); | |
137 | - },sortable:true | |
138 | - }, | |
139 | - { | |
140 | - field : 'taskTypeReal', | |
141 | - title : '实际任务类型' , | |
142 | - formatter: function(value, row, index) { | |
143 | - return $.table.selectDictLabel(shipmentTaskType, value); | |
144 | - },sortable:true | |
145 | - }, | |
137 | + // { | |
138 | + // field : 'taskType', | |
139 | + // title : '下发任务类型' , | |
140 | + // formatter: function(value, row, index) { | |
141 | + // return $.table.selectDictLabel(shipmentTaskType, value); | |
142 | + // },sortable:true | |
143 | + // }, | |
144 | + // { | |
145 | + // field : 'taskTypeReal', | |
146 | + // title : '实际任务类型' , | |
147 | + // formatter: function(value, row, index) { | |
148 | + // return $.table.selectDictLabel(shipmentTaskType, value); | |
149 | + // },sortable:true | |
150 | + // }, | |
146 | 151 | { |
147 | 152 | field : 'status', |
148 | 153 | title : '容器任务状态' , |
... | ... | @@ -426,6 +431,24 @@ |
426 | 431 | |
427 | 432 | } |
428 | 433 | |
434 | + function detailBatRemove() { | |
435 | + var rows=$("#bootstrap-table1").bootstrapTable('getSelections'); | |
436 | + if (rows.length == 0) { | |
437 | + $.modal.alertWarning("请至少选择一条记录"); | |
438 | + return; | |
439 | + } | |
440 | + $.modal.confirm("确认要撤销选中的" + rows.length + "条组盘吗?", function() { | |
441 | + var url = detailPrefix + "/remove"; | |
442 | + var ids = ""; | |
443 | + for(var i=0; i<rows.length; i++) { | |
444 | + ids = ids + rows[i].id + "," | |
445 | + } | |
446 | + var data = { "ids": ids.substring(0, ids.length-1) }; | |
447 | + $.operate.post(url, data); | |
448 | + // submit(url, "post", "json", data); | |
449 | + }); | |
450 | + } | |
451 | + | |
429 | 452 | |
430 | 453 | |
431 | 454 | </script> |
... | ... |
src/main/resources/templates/shipment/shipmentDetail/add.html
... | ... | @@ -34,8 +34,9 @@ |
34 | 34 | <div class="form-group"> |
35 | 35 | <label class="col-sm-3 control-label">分配规则:</label> |
36 | 36 | <div class="col-sm-8"> |
37 | - <select id="allocationRule" class="form-control" th:with="allocationRule=${@shipmentPreference.list()}"> | |
38 | - <option th:each="allocationRules:${allocationRule}" th:text="${allocationRules['code']}" th:value="${allocationRules['name']}"></option> | |
37 | + <select id="allocationRule" class="form-control" th:with="allocationRule=${@FilterConfigDetailService.list()}"> | |
38 | + <option value=" " checked></option> | |
39 | + <option th:each="allocationRules:${allocationRule}" th:text="${allocationRules['description']}" th:value="${allocationRules['code']}"></option> | |
39 | 40 | </select> |
40 | 41 | </div> |
41 | 42 | </div> |
... | ... | @@ -101,12 +102,6 @@ |
101 | 102 | <input id="shipQty" name="shipQty" class="form-control" type="text" onkeyup=" this.value=this.value.replace(/^\s+|\s+$/g,'')"> |
102 | 103 | </div> |
103 | 104 | </div> |
104 | - <div class="form-group"> | |
105 | - <label class="col-sm-3 control-label">物料单价:</label> | |
106 | - <div class="col-sm-8"> | |
107 | - <input id="price" name="price" class="form-control" type="text"> | |
108 | - </div> | |
109 | - </div> | |
110 | 105 | <div class="form-group"> |
111 | 106 | <div class="form-control-static col-sm-offset-9"> |
112 | 107 | <button type="submit" class="btn btn-primary">提交</button> |
... | ... | @@ -159,6 +154,7 @@ |
159 | 154 | "batch": $("input[name='batch']").val(), |
160 | 155 | "lot": $("input[name='lot']").val(), |
161 | 156 | "projectNo": $("input[name='project']").val(), |
157 | + "allocationRule": $("#allocationRule option:selected").val(), | |
162 | 158 | "manufactureDate": $("input[name='manufactureDate']").val(), |
163 | 159 | "expirationDate": $("input[name='expirationDate']").val(), |
164 | 160 | "agingDate": $("input[name='agingDate']").val(), |
... | ... |
src/main/resources/templates/shipment/shipmentDetail/edit.html
... | ... | @@ -19,12 +19,6 @@ |
19 | 19 | </div> |
20 | 20 | </div> |
21 | 21 | <div class="form-group"> |
22 | - <label class="col-sm-3 control-label">上游系统行号:</label> | |
23 | - <div class="col-sm-8"> | |
24 | - <input id="sourceLine" name="sourceLine" th:field="*{sourceLine}" class="form-control" type="text" readonly="readonly"> | |
25 | - </div> | |
26 | - </div> | |
27 | - <div class="form-group"> | |
28 | 22 | <label class="col-sm-3 control-label">存货编码:</label> |
29 | 23 | <div class="col-sm-8"> |
30 | 24 | <input id="materialCode" name="materialCode" th:field="*{materialCode}" class="form-control" type="text" readonly="readonly"> |
... | ... | @@ -51,7 +45,16 @@ |
51 | 45 | <div class="form-group"> |
52 | 46 | <label class="col-sm-3 control-label">项目号:</label> |
53 | 47 | <div class="col-sm-8"> |
54 | - <input id="project" name="project" th:field="*{project}" class="form-control" type="text"> | |
48 | + <input id="project" name="projectNo" th:field="*{projectNo}" class="form-control" type="text"> | |
49 | + </div> | |
50 | + </div> | |
51 | + <div class="form-group"> | |
52 | + <label class="col-sm-3 control-label">分配规则:</label> | |
53 | + <div class="col-sm-8"> | |
54 | + <select id="allocationRule" class="form-control" th:with="allocationRule=${@FilterConfigDetailService.list()}" th:field="*{allocationRule}"> | |
55 | + <option value=" " checked></option> | |
56 | + <option th:each="allocationRules:${allocationRule}" th:text="${allocationRules['description']}" th:value="${allocationRules['code']}"></option> | |
57 | + </select> | |
55 | 58 | </div> |
56 | 59 | </div> |
57 | 60 | <div class="form-group"> |
... | ... | @@ -75,27 +78,21 @@ |
75 | 78 | <div class="form-group"> |
76 | 79 | <label class="col-sm-3 control-label">库存状态:</label> |
77 | 80 | <div class="col-sm-8"> |
78 | - <select id="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}" th:field="*{inventoryStatus}"> | |
81 | + <select id="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}" th:field="*{inventorySts}"> | |
79 | 82 | <option th:each="dict : ${inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> |
80 | 83 | </select> |
81 | 84 | </div> |
82 | 85 | </div> |
83 | - <div class="form-group"> | |
86 | + <div class="form-group"> | |
84 | 87 | <label class="col-sm-3 control-label">发货数量:</label> |
85 | 88 | <div class="col-sm-8"> |
86 | - <input id="qty" name="qty" th:field="*{qty}" class="form-control" type="text"> | |
89 | + <input id="qty" name="shipQty" th:field="*{shipQty}" class="form-control" type="text"> | |
87 | 90 | </div> |
88 | 91 | </div> |
89 | 92 | <div class="form-group"> |
90 | 93 | <label class="col-sm-3 control-label">已出数量:</label> |
91 | 94 | <div class="col-sm-8"> |
92 | - <input id="qtyCompleted" name="qtyCompleted" th:field="*{qtyCompleted}" class="form-control" type="text" readonly="readonly"> | |
93 | - </div> | |
94 | - </div> | |
95 | - <div class="form-group"> | |
96 | - <label class="col-sm-3 control-label">物料单价:</label> | |
97 | - <div class="col-sm-8"> | |
98 | - <input id="price" name="price" th:field="*{price}" class="form-control" type="number"> | |
95 | + <input id="requestQty" name="requestQty" th:field="*{requestQty}" class="form-control" type="text" readonly="readonly"> | |
99 | 96 | </div> |
100 | 97 | </div> |
101 | 98 | <div class="form-group"> |
... | ... | @@ -187,18 +184,15 @@ |
187 | 184 | "id":$("#id").val(), |
188 | 185 | "shipmentId": $("input[name='shipmentId']").val(), |
189 | 186 | "shipmentCode": $("input[name='shipmentCode']").val(), |
190 | - "sourceLine": $("input[name='sourceLine']").val(), | |
191 | - "materialId": $("input[name='materialId']").val(), | |
192 | 187 | "materialCode": $("input[name='materialCode']").val(), |
193 | 188 | "batch": $("input[name='batch']").val(), |
194 | 189 | "lot": $("input[name='lot']").val(), |
195 | - "project": $("input[name='project']").val(), | |
190 | + "projectNo": $("input[name='projectNo']").val(), | |
191 | + "allocationRule": $("#allocationRule option:selected").val(), | |
196 | 192 | "manufactureDate": $("input[name='manufactureDate']").val(), |
197 | 193 | "expirationDate": $("input[name='expirationDate']").val(), |
198 | - "agingDate": $("input[name='agingDate']").val(), | |
199 | - "inventoryStatus": $("#inventoryStatus option:selected").val(), | |
200 | - "qty": $("input[name='qty']").val(), | |
201 | - "price": $("input[name='price']").val(), | |
194 | + "inventorySts": $("#inventoryStatus option:selected").val(), | |
195 | + "shipQty": $("input[name='shipQty']").val(), | |
202 | 196 | "userDef1": $("input[name='userDef1']").val(), |
203 | 197 | "userDef2": $("input[name='userDef2']").val(), |
204 | 198 | "userDef3": $("input[name='userDef3']").val(), |
... | ... |