Commit 430bdfe401dd275415f97a2564de746f0b24401e
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
26 changed files
with
663 additions
and
157 deletions
src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
... | ... | @@ -14,7 +14,6 @@ import com.huaheng.framework.web.page.TableDataInfo; |
14 | 14 | import com.huaheng.framework.web.page.TableSupport; |
15 | 15 | import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; |
16 | 16 | import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService; |
17 | - | |
18 | 17 | import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; |
19 | 18 | import org.springframework.stereotype.Controller; |
20 | 19 | import org.springframework.web.bind.annotation.GetMapping; |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java
... | ... | @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import io.swagger.annotations.ApiModel; |
8 | 8 | import io.swagger.annotations.ApiModelProperty; |
9 | 9 | import java.io.Serializable; |
10 | +import java.math.BigDecimal; | |
10 | 11 | import java.util.Date; |
11 | 12 | import lombok.Data; |
12 | 13 | |
... | ... | @@ -142,21 +143,21 @@ public class AdjustDetail implements Serializable { |
142 | 143 | */ |
143 | 144 | @TableField(value = "fromQty") |
144 | 145 | @ApiModelProperty(value="调整前的数量") |
145 | - private Integer fromQty; | |
146 | + private BigDecimal fromQty; | |
146 | 147 | |
147 | 148 | /** |
148 | 149 | * 调整后的数量 |
149 | 150 | */ |
150 | 151 | @TableField(value = "toQty") |
151 | 152 | @ApiModelProperty(value="调整后的数量 ") |
152 | - private Integer toQty; | |
153 | + private BigDecimal toQty; | |
153 | 154 | |
154 | 155 | /** |
155 | 156 | * 调整变动数量 |
156 | 157 | */ |
157 | 158 | @TableField(value = "gapQty") |
158 | 159 | @ApiModelProperty(value="调整变动数量 ") |
159 | - private Integer gapQty; | |
160 | + private BigDecimal gapQty; | |
160 | 161 | |
161 | 162 | /** |
162 | 163 | * 状态 -0-待调整 1-已调整 2-未批准 3-已批准 |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java
1 | 1 | package com.huaheng.pc.inventory.adjustDetail.service; |
2 | 2 | |
3 | -import org.springframework.stereotype.Service; | |
4 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
5 | 4 | import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; |
6 | -import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper; | |
7 | -@Service | |
8 | -public class AdjustDetailService extends ServiceImpl<AdjustDetailMapper, AdjustDetail> { | |
5 | + | |
6 | + | |
7 | + | |
8 | +public interface AdjustDetailService extends IService<AdjustDetail> { | |
9 | + | |
10 | + | |
9 | 11 | |
10 | 12 | } |
13 | + | |
14 | + | |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
0 → 100644
1 | +package com.huaheng.pc.inventory.adjustDetail.service; | |
2 | + | |
3 | +import org.springframework.stereotype.Service; | |
4 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | +import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; | |
6 | +import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper; | |
7 | +@Service | |
8 | +public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, AdjustDetail> implements AdjustDetailService { | |
9 | + | |
10 | +} | |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
... | ... | @@ -13,8 +13,10 @@ 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 | 15 | import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService; |
16 | +import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailServiceImpl; | |
16 | 17 | import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; |
17 | 18 | import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; |
19 | +import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl; | |
18 | 20 | import org.springframework.stereotype.Controller; |
19 | 21 | import org.springframework.web.bind.annotation.GetMapping; |
20 | 22 | import org.springframework.web.bind.annotation.PostMapping; |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/mapper/AdjustHeaderMapper.java
... | ... | @@ -4,4 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; |
5 | 5 | |
6 | 6 | public interface AdjustHeaderMapper extends BaseMapper<AdjustHeader> { |
7 | + | |
8 | + | |
9 | + String getLastCode(); | |
10 | + | |
11 | + | |
12 | + | |
7 | 13 | } |
8 | 14 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
1 | 1 | package com.huaheng.pc.inventory.adjustHeader.service; |
2 | 2 | |
3 | -import org.springframework.stereotype.Service; | |
4 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
5 | 4 | import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; |
6 | -import com.huaheng.pc.inventory.adjustHeader.mapper.AdjustHeaderMapper; | |
7 | -@Service | |
8 | -public class AdjustHeaderService extends ServiceImpl<AdjustHeaderMapper, AdjustHeader> { | |
5 | +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; | |
6 | + | |
7 | + | |
8 | +public interface AdjustHeaderService extends IService<AdjustHeader> { | |
9 | + | |
10 | + | |
11 | + String createCode(); | |
12 | + | |
13 | + | |
14 | + | |
9 | 15 | |
10 | 16 | } |
17 | + | |
18 | + | |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
0 → 100644
1 | +package com.huaheng.pc.inventory.adjustHeader.service; | |
2 | + | |
3 | +import org.springframework.stereotype.Service; | |
4 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | +import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; | |
6 | +import com.huaheng.pc.inventory.adjustHeader.mapper.AdjustHeaderMapper; | |
7 | + | |
8 | +import javax.annotation.Resource; | |
9 | +import java.text.SimpleDateFormat; | |
10 | +import java.util.Date; | |
11 | + | |
12 | +@Service | |
13 | +public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, AdjustHeader> implements AdjustHeaderService { | |
14 | + | |
15 | + | |
16 | + @Resource | |
17 | + private AdjustHeaderMapper adjustHeaderMapper; | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | + | |
23 | + | |
24 | + //生成差异单号 | |
25 | + @Override | |
26 | + public String createCode() { | |
27 | + String code; | |
28 | + Date now = new Date(); | |
29 | + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); | |
30 | + String maxCode = adjustHeaderMapper.getLastCode();; | |
31 | + //如果指定类型的最后的code存在,并且日期一致。那么 code = 单类型 + 年月日 + (排序号 + 1) | |
32 | + if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) | |
33 | + { | |
34 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | |
35 | + code = "CY" + df.format(now) + String.format("%05d", Count + 1); | |
36 | + } | |
37 | + else | |
38 | + { | |
39 | + code = "CY" + df.format(now) + "00001"; | |
40 | + } | |
41 | + return code; | |
42 | + } | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + | |
49 | +} | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... | ... | @@ -14,8 +14,9 @@ import com.huaheng.framework.web.page.TableDataInfo; |
14 | 14 | import com.huaheng.framework.web.page.TableSupport; |
15 | 15 | import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; |
16 | 16 | import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; |
17 | -import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; | |
17 | +import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailServiceImpl; | |
18 | 18 | import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService; |
19 | +import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderServiceImpl; | |
19 | 20 | import org.springframework.stereotype.Controller; |
20 | 21 | import org.springframework.web.bind.annotation.GetMapping; |
21 | 22 | import org.springframework.web.bind.annotation.PostMapping; |
... | ... | @@ -23,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestMapping; |
23 | 24 | import org.springframework.web.bind.annotation.ResponseBody; |
24 | 25 | |
25 | 26 | import javax.annotation.Resource; |
26 | -import java.util.Collections; | |
27 | 27 | import java.util.List; |
28 | 28 | |
29 | 29 | |
... | ... | @@ -57,7 +57,7 @@ public class CycleCountDetailController extends BaseController { |
57 | 57 | @PostMapping("/list") |
58 | 58 | @Log(title = "库存-盘点",operating = "查看盘点明细", action = BusinessType.GRANT) |
59 | 59 | @ResponseBody |
60 | - public TableDataInfo list(CycleCountDetail cycleCountDetail, String createdBegin, String createdEnd) { | |
60 | + public TableDataInfo list(CycleCountDetail cycleCountDetail, String createdBegin, String createdEnd) throws IllegalAccessException { | |
61 | 61 | |
62 | 62 | LambdaQueryWrapper<CycleCountDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
63 | 63 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
... | ... | @@ -92,7 +92,7 @@ public class CycleCountDetailController extends BaseController { |
92 | 92 | IPage<CycleCountDetail> iPage = cycleCountDetailService.page(page, lambdaQueryWrapper); |
93 | 93 | return getMpDataTable(iPage.getRecords(), iPage.getTotal()); |
94 | 94 | } else { |
95 | - List<CycleCountDetail> list = cycleCountDetailService.list(lambdaQueryWrapper); | |
95 | + List<CycleCountDetail> list = cycleCountDetailService.list(lambdaQueryWrapper); | |
96 | 96 | return getDataTable(list); |
97 | 97 | } |
98 | 98 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java
... | ... | @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import io.swagger.annotations.ApiModel; |
8 | 8 | import io.swagger.annotations.ApiModelProperty; |
9 | 9 | import java.io.Serializable; |
10 | +import java.math.BigDecimal; | |
10 | 11 | import java.util.Date; |
11 | 12 | |
12 | 13 | @ApiModel(value="com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail") |
... | ... | @@ -122,21 +123,21 @@ public class CycleCountDetail implements Serializable { |
122 | 123 | */ |
123 | 124 | @TableField(value = "systemQty") |
124 | 125 | @ApiModelProperty(value="系统数量") |
125 | - private Long systemQty; | |
126 | + private BigDecimal systemQty; | |
126 | 127 | |
127 | 128 | /** |
128 | 129 | * 实盘数量 |
129 | 130 | */ |
130 | 131 | @TableField(value = "countedQty") |
131 | 132 | @ApiModelProperty(value="实盘数量") |
132 | - private Long countedQty; | |
133 | + private BigDecimal countedQty; | |
133 | 134 | |
134 | 135 | /** |
135 | 136 | * 差异数量 |
136 | 137 | */ |
137 | 138 | @TableField(value = "gapQty") |
138 | 139 | @ApiModelProperty(value="差异数量") |
139 | - private Long gapQty; | |
140 | + private BigDecimal gapQty; | |
140 | 141 | |
141 | 142 | /** |
142 | 143 | * 失败原因 |
... | ... | @@ -562,52 +563,27 @@ public class CycleCountDetail implements Serializable { |
562 | 563 | this.inventorySts = inventorySts; |
563 | 564 | } |
564 | 565 | |
565 | - /** | |
566 | - * 获取系统数量 | |
567 | - * | |
568 | - * @return systemQty - 系统数量 | |
569 | - */ | |
570 | - public Long getSystemQty() { | |
566 | + public BigDecimal getSystemQty() { | |
571 | 567 | return systemQty; |
572 | 568 | } |
573 | 569 | |
574 | - /** | |
575 | - * 设置系统数量 | |
576 | - * | |
577 | - * @param systemQty 系统数量 | |
578 | - */ | |
579 | - public void setSystemQty(Long systemQty) { | |
570 | + public void setSystemQty(BigDecimal systemQty) { | |
580 | 571 | this.systemQty = systemQty; |
581 | 572 | } |
582 | 573 | |
583 | - /** | |
584 | - * 获取实盘数量 | |
585 | - * | |
586 | - * @return countedQty - 实盘数量 | |
587 | - */ | |
588 | - public Long getCountedQty() { | |
574 | + public BigDecimal getCountedQty() { | |
589 | 575 | return countedQty; |
590 | 576 | } |
591 | 577 | |
592 | - /** | |
593 | - * 设置实盘数量 | |
594 | - * | |
595 | - * @param countedQty 实盘数量 | |
596 | - */ | |
597 | - public void setCountedQty(Long countedQty) { | |
578 | + public void setCountedQty(BigDecimal countedQty) { | |
598 | 579 | this.countedQty = countedQty; |
599 | 580 | } |
600 | 581 | |
601 | - /** | |
602 | - * 获取调整数量 | |
603 | - * | |
604 | - * @return gapQty- 调整数量 | |
605 | - */ | |
606 | - public Long getGapQty() { | |
582 | + public BigDecimal getGapQty() { | |
607 | 583 | return gapQty; |
608 | 584 | } |
609 | 585 | |
610 | - public void setGapQty(Long gapQty) { | |
586 | + public void setGapQty(BigDecimal gapQty) { | |
611 | 587 | this.gapQty = gapQty; |
612 | 588 | } |
613 | 589 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java
1 | 1 | package com.huaheng.pc.inventory.cycleCountDetail.service; |
2 | 2 | |
3 | -import org.springframework.stereotype.Service; | |
4 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | -import com.huaheng.pc.inventory.cycleCountDetail.mapper.CycleCountDetailMapper; | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
6 | 4 | import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; |
7 | -@Service | |
8 | -public class CycleCountDetailService extends ServiceImpl<CycleCountDetailMapper, CycleCountDetail> { | |
5 | +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; | |
6 | + | |
7 | + | |
8 | +public interface CycleCountDetailService extends IService<CycleCountDetail> { | |
9 | + | |
10 | + | |
9 | 11 | |
10 | 12 | } |
13 | + | |
14 | + | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
0 → 100644
1 | +package com.huaheng.pc.inventory.cycleCountDetail.service; | |
2 | + | |
3 | +import org.springframework.stereotype.Service; | |
4 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | +import com.huaheng.pc.inventory.cycleCountDetail.mapper.CycleCountDetailMapper; | |
6 | +import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; | |
7 | +@Service | |
8 | +public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMapper, CycleCountDetail> implements CycleCountDetailService { | |
9 | + | |
10 | + | |
11 | + | |
12 | + | |
13 | + | |
14 | + | |
15 | +} | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
... | ... | @@ -4,29 +4,32 @@ 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.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
10 | 11 | import com.huaheng.framework.aspectj.lang.constant.BusinessType; |
11 | 12 | import com.huaheng.framework.web.controller.BaseController; |
13 | +import com.huaheng.framework.web.domain.AjaxResult; | |
12 | 14 | import com.huaheng.framework.web.page.PageDomain; |
13 | 15 | import com.huaheng.framework.web.page.TableDataInfo; |
14 | 16 | import com.huaheng.framework.web.page.TableSupport; |
15 | -import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; | |
16 | 17 | import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; |
18 | +import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl; | |
19 | +import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; | |
17 | 20 | import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; |
21 | +import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailServiceImpl; | |
18 | 22 | import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; |
19 | 23 | |
20 | 24 | import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService; |
21 | -import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | |
25 | +import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderServiceImpl; | |
22 | 26 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
23 | 27 | import org.springframework.stereotype.Controller; |
24 | -import org.springframework.web.bind.annotation.GetMapping; | |
25 | -import org.springframework.web.bind.annotation.PostMapping; | |
26 | -import org.springframework.web.bind.annotation.RequestMapping; | |
27 | -import org.springframework.web.bind.annotation.ResponseBody; | |
28 | +import org.springframework.ui.ModelMap; | |
29 | +import org.springframework.web.bind.annotation.*; | |
28 | 30 | |
29 | 31 | import javax.annotation.Resource; |
32 | +import java.util.Date; | |
30 | 33 | import java.util.List; |
31 | 34 | |
32 | 35 | /** |
... | ... | @@ -92,11 +95,114 @@ public class CycleCountHeaderController extends BaseController { |
92 | 95 | } |
93 | 96 | |
94 | 97 | } |
98 | + /** | |
99 | + * 新增盘点单主 | |
100 | + */ | |
101 | + @GetMapping("/add") | |
102 | + public String add() | |
103 | + { | |
104 | + return prefix + "/add"; | |
105 | + } | |
95 | 106 | |
107 | + /** | |
108 | + * 新增保存盘点单主 | |
109 | + */ | |
110 | + //@RequiresPermissions("inventory:cycleCount:add") | |
111 | + @Log(title = "库存-盘点",operating = "新增盘点主单", action = BusinessType.INSERT) | |
112 | + @PostMapping("/add") | |
113 | + @ResponseBody | |
114 | + public AjaxResult addSave(CycleCountHeader cycleCountHeader) | |
115 | + { | |
96 | 116 | |
117 | + cycleCountHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
118 | + //cycleCountHeader.setCompanyCode(cycleCountHeader.getCompanyCode()); | |
119 | + //cycleCountHeader.setRound(cycleCountHeader.getRound());//盘点轮次 | |
120 | + cycleCountHeader.setCreated(new Date()); | |
121 | + cycleCountHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
122 | + cycleCountHeader.setMasterCode(cycleCountHeaderService.createCode()); | |
123 | + return toAjax(cycleCountHeaderService.save(cycleCountHeader)); | |
124 | + } | |
97 | 125 | |
126 | + /** | |
127 | + * 修改盘点单主 | |
128 | + */ | |
129 | + @GetMapping("/edit/{id}") | |
130 | + public String edit(@PathVariable("id") Integer id, ModelMap mmap) | |
131 | + { | |
132 | + CycleCountHeader cyclecountHeader = cycleCountHeaderService.getById(id); | |
133 | + mmap.put("cyclecountHeader", cyclecountHeader); | |
134 | + return prefix + "/edit"; | |
135 | + } | |
98 | 136 | |
137 | + /** | |
138 | + * 修改保存盘点单主 | |
139 | + */ | |
140 | + //@RequiresPermissions("inventory:cycleCount:edit") | |
141 | + @Log(title = "库存-盘点",operating = "修改盘点主单", action = BusinessType.UPDATE) | |
142 | + @PostMapping("/edit") | |
143 | + @ResponseBody | |
144 | + public AjaxResult editSave(CycleCountHeader cycleCountHeader) | |
145 | + { | |
146 | + cycleCountHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
147 | + cycleCountHeader.setLastUpdated(new Date()); | |
148 | + return toAjax(cycleCountHeaderService.saveOrUpdate(cycleCountHeader)); | |
149 | + } | |
99 | 150 | |
151 | + /** | |
152 | + * 删除盘点单主 | |
153 | + */ | |
154 | + //@RequiresPermissions("inventory:cycleCount:remove") | |
155 | + @Log(title = "库存-盘点",operating = "删除盘点主单", action = BusinessType.DELETE) | |
156 | + @PostMapping( "/remove") | |
157 | + @ResponseBody | |
158 | + public AjaxResult remove(String ids) | |
159 | + { | |
160 | + if (StringUtils.isEmpty(ids)) | |
161 | + return AjaxResult.error("id不能为空"); | |
162 | + for (Integer id : Convert.toIntArray(ids)) | |
163 | + { | |
164 | + AjaxResult result = cycleCountHeaderService.delete(id); | |
165 | + if(result.code!=200){ | |
166 | + return result; | |
167 | + } | |
168 | + } | |
169 | + return AjaxResult.success("删除成功!"); | |
170 | + } | |
171 | + | |
172 | + /** | |
173 | + * | |
174 | + * 生成差异调整单 | |
175 | + * */ | |
176 | + //@RequiresPermissions("inventory:cyclecountHead:addAdjust") | |
177 | + @Log(title = "库存-盘点", operating = "新增盘点差异调整单", action = BusinessType.INSERT) | |
178 | + @PostMapping("/goAdjust") | |
179 | + @ResponseBody | |
180 | + public AjaxResult goAdjust(int id) | |
181 | + { | |
182 | + return (cycleCountHeaderService.insertByAdjust(id)); | |
183 | + } | |
184 | + | |
185 | + | |
186 | + /** | |
187 | + * 盘点单报表打印 | |
188 | + * @return | |
189 | + */ | |
190 | + //@RequiresPermissions("inventory:cycleCount:report") | |
191 | + @GetMapping("/report/{id}") | |
192 | + public String report(@PathVariable("id") Integer id, ModelMap mmap) | |
193 | + { | |
194 | + CycleCountHeader cyclecountHeader = cycleCountHeaderService.getById(id); | |
195 | + mmap.put("cyclecountHeader", cyclecountHeader); | |
196 | + | |
197 | + CycleCountDetail condition = new CycleCountDetail(); | |
198 | + condition.setCycleCountHeadId(id); | |
199 | + condition.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
200 | + LambdaQueryWrapper lambda = Wrappers.lambdaQuery(condition); | |
201 | + List<CycleCountDetail> details = cycleCountDetailService.list(lambda); | |
202 | + mmap.put("details", details); | |
203 | + | |
204 | + return prefix + "/report"; | |
205 | + } | |
100 | 206 | |
101 | 207 | |
102 | 208 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/domain/CycleCountHeader.java
... | ... | @@ -59,7 +59,7 @@ public class CycleCountHeader implements Serializable { |
59 | 59 | */ |
60 | 60 | @TableField(value = "countType") |
61 | 61 | @ApiModelProperty(value="盘点类型") |
62 | - private Integer countType; | |
62 | + private String countType; | |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * 盘点状态 |
... | ... | @@ -342,21 +342,11 @@ public class CycleCountHeader implements Serializable { |
342 | 342 | this.companyCode = companyCode; |
343 | 343 | } |
344 | 344 | |
345 | - /** | |
346 | - * 获取盘点类型 | |
347 | - * | |
348 | - * @return countType - 盘点类型 | |
349 | - */ | |
350 | - public Integer getCountType() { | |
345 | + public String getCountType() { | |
351 | 346 | return countType; |
352 | 347 | } |
353 | 348 | |
354 | - /** | |
355 | - * 设置盘点类型 | |
356 | - * | |
357 | - * @param countType 盘点类型 | |
358 | - */ | |
359 | - public void setCountType(Integer countType) { | |
349 | + public void setCountType(String countType) { | |
360 | 350 | this.countType = countType; |
361 | 351 | } |
362 | 352 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/mapper/CycleCountHeaderMapper.java
... | ... | @@ -4,4 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; |
5 | 5 | |
6 | 6 | public interface CycleCountHeaderMapper extends BaseMapper<CycleCountHeader> { |
7 | + | |
8 | + String getLastCode(); | |
9 | + | |
10 | + | |
11 | + | |
7 | 12 | } |
8 | 13 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderService.java
1 | 1 | package com.huaheng.pc.inventory.cycleCountHeader.service; |
2 | 2 | |
3 | -import org.springframework.stereotype.Service; | |
4 | -import javax.annotation.Resource; | |
5 | -import java.util.List; | |
6 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
4 | +import com.huaheng.framework.web.domain.AjaxResult; | |
7 | 5 | import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; |
8 | -import com.huaheng.pc.inventory.cycleCountHeader.mapper.CycleCountHeaderMapper; | |
9 | -@Service | |
10 | -public class CycleCountHeaderService extends ServiceImpl<CycleCountHeaderMapper, CycleCountHeader> { | |
6 | + | |
7 | + | |
8 | +public interface CycleCountHeaderService extends IService<CycleCountHeader> { | |
9 | + | |
10 | + | |
11 | + String createCode(); | |
12 | + //生成调整单 | |
13 | + AjaxResult insertByAdjust(Integer headId); | |
14 | + | |
15 | + AjaxResult delete(Integer id); | |
16 | + | |
17 | + | |
18 | + | |
19 | + | |
11 | 20 | |
12 | 21 | } |
22 | + | |
23 | + | |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
0 → 100644
1 | +package com.huaheng.pc.inventory.cycleCountHeader.service; | |
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.security.ShiroUtils; | |
7 | +import com.huaheng.framework.web.domain.AjaxResult; | |
8 | +import com.huaheng.pc.config.warehouse.domain.Warehouse; | |
9 | +import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail; | |
10 | +import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService; | |
11 | +import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader; | |
12 | +import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService; | |
13 | +import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail; | |
14 | +import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService; | |
15 | +import org.springframework.stereotype.Service; | |
16 | +import javax.annotation.Resource; | |
17 | +import java.math.BigDecimal; | |
18 | +import java.security.SecureRandomSpi; | |
19 | +import java.text.SimpleDateFormat; | |
20 | +import java.util.ArrayList; | |
21 | +import java.util.Date; | |
22 | +import java.util.List; | |
23 | +import java.util.WeakHashMap; | |
24 | + | |
25 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
26 | +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader; | |
27 | +import com.huaheng.pc.inventory.cycleCountHeader.mapper.CycleCountHeaderMapper; | |
28 | +import org.springframework.transaction.annotation.Transactional; | |
29 | + | |
30 | +@Service | |
31 | +public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMapper, CycleCountHeader> implements CycleCountHeaderService { | |
32 | + | |
33 | + | |
34 | + @Resource | |
35 | + private CycleCountHeaderMapper cycleCountHeaderMapper; | |
36 | + @Resource | |
37 | + private CycleCountDetailService cycleCountDetailService; | |
38 | + @Resource | |
39 | + private AdjustHeaderService adjustHeaderService; | |
40 | + @Resource | |
41 | + private AdjustDetailService adjustDetailService; | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + | |
49 | + | |
50 | + /** | |
51 | + * 生成盘点单主Code | |
52 | + * @return | |
53 | + */ | |
54 | + @Override | |
55 | + public String createCode() { | |
56 | + String code; | |
57 | + Date now = new Date(); | |
58 | + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); | |
59 | + String maxCode = cycleCountHeaderMapper.getLastCode();; | |
60 | + //如果指定类型的最后的code存在,并且日期一致。那么 code = 单类型 + 年月日 + (排序号 + 1) | |
61 | + if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) | |
62 | + { | |
63 | + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5)); | |
64 | + code = "PD" + df.format(now) + String.format("%05d", Count + 1); | |
65 | + } | |
66 | + else | |
67 | + { | |
68 | + code = "PD" + df.format(now) + "00001"; | |
69 | + } | |
70 | + return code; | |
71 | + } | |
72 | + | |
73 | + /** | |
74 | + * 删除单据 | |
75 | + * @param id | |
76 | + * @return | |
77 | + */ | |
78 | + @Override | |
79 | + public AjaxResult delete(Integer id) { | |
80 | + | |
81 | + CycleCountHeader cyclecountHeader = this.getById(id); | |
82 | + if(cyclecountHeader==null){ | |
83 | + return AjaxResult.error("id为"+id.toString()+"的盘点单不存在出,操作中止"); | |
84 | + } | |
85 | + if(cyclecountHeader.getStatusCyc() > 0){ | |
86 | + return AjaxResult.error("盘点单:"+cyclecountHeader.getMasterCode()+"非新建状态,无法删除,操作中止"); | |
87 | + } | |
88 | + //批量删除子单据 | |
89 | + CycleCountDetail temp = new CycleCountDetail(); | |
90 | + temp.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
91 | + temp.setCycleCountHeadId(cyclecountHeader.getId()); | |
92 | + LambdaQueryWrapper lm = Wrappers.lambdaQuery(temp); | |
93 | + cycleCountDetailService.remove(lm); | |
94 | + cycleCountHeaderMapper.deleteById(id); | |
95 | + return AjaxResult.success("盘点主单和明细删除成功"); | |
96 | + | |
97 | + } | |
98 | + | |
99 | + /** | |
100 | + * 新增盘点差异调整单 | |
101 | + * */ | |
102 | + @Transactional | |
103 | + public AjaxResult insertByAdjust(Integer id) { | |
104 | + | |
105 | + /*获取盘点主单ID生成差异调整单,根据主单ID获取明细条目,再根据明细条目差异数量是否为0生成差异调整详单*/ | |
106 | + //1 根据盘点单ID生成差异调整主单,2 下一步根据盘点主单ID查询盘点明细的条目数据, | |
107 | + //3 for循环明细条目,同时依据差异数据是否为0来决定是否生成差异单,同步写入调整单详细。 | |
108 | + | |
109 | + //查询该条盘点单头 id | |
110 | + CycleCountHeader cyclecountHeader = cycleCountHeaderMapper.selectById(id); | |
111 | + | |
112 | + if(cyclecountHeader.getStatusCyc() >= 35){ | |
113 | + //查询是否已生成差异单 | |
114 | + throw new ServiceException("该条盘点单无法生成调整单,请检查状态!"); | |
115 | + } | |
116 | + | |
117 | + AdjustHeader adjustHeader = new AdjustHeader(); | |
118 | + adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());//仓库 | |
119 | + adjustHeader.setCode(adjustHeaderService.createCode());//生成差异单号 | |
120 | + adjustHeader.setProblemType("盘点调整"); | |
121 | + adjustHeader.setCycleCountCode(cyclecountHeader.getMasterCode()); | |
122 | + adjustHeader.setCompanyCode(cyclecountHeader.getCompanyCode()); | |
123 | + adjustHeader.setCreated(new Date()); | |
124 | + adjustHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
125 | + //adjustHeader.setStatus(10);//新建未上传 | |
126 | + //先创建调整单头 | |
127 | + adjustHeaderService.save(adjustHeader); | |
128 | + | |
129 | + //根据盘点单查询明细并写入调整单 | |
130 | + CycleCountDetail cycleCountDetail = new CycleCountDetail(); | |
131 | + cycleCountDetail.setCycleCountHeadId(id); | |
132 | + cycleCountDetail.setWarehouseCode(cyclecountHeader.getWarehouseCode()); | |
133 | + LambdaQueryWrapper lam = Wrappers.lambdaQuery(cycleCountDetail); | |
134 | + List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(lam); | |
135 | + //找到刚刚生成的调整主单 | |
136 | + //AdjustHeader adjust = adjustHeaderService.getById(adjustHeader.getId()); | |
137 | + //循环明细条目,查找符合条件的数据写入调整单明细 | |
138 | + AdjustDetail adjustDetail = new AdjustDetail(); | |
139 | + for(CycleCountDetail item:cycleCountDetailList){ | |
140 | + //BigDecimal的比较 .compareTo(BigDecimal.ZERO) != 0 | |
141 | + if(item.getGapQty().compareTo(BigDecimal.ZERO) != 0){ | |
142 | + //比较差异数量不为0的就生成差异单 | |
143 | + adjustDetail.setAdjustCode(adjustHeader.getCode()); | |
144 | + adjustDetail.setWarehouseCode(adjustHeader.getWarehouseCode()); | |
145 | + adjustDetail.setCompanyCode(adjustHeader.getCompanyCode()); | |
146 | + adjustDetail.setLocationCode(item.getLocationCode()); | |
147 | + adjustDetail.setContainerCode(item.getContainerCode()); | |
148 | + adjustDetail.setCycleCountCode(cyclecountHeader.getMasterCode()); | |
149 | + adjustDetail.setMaterialCode(item.getMaterialCode()); | |
150 | + adjustDetail.setMaterialName(item.getMaterialName()); | |
151 | + adjustDetail.setMaterialSpec(item.getMaterialSpec()); | |
152 | + adjustDetail.setMaterialUnit(item.getMaterialUnit()); | |
153 | + adjustDetail.setCycleDetailId(item.getId()); | |
154 | + adjustDetail.setProblemType("盘点调整"); | |
155 | + adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性 | |
156 | + adjustDetail.setFromInventorySts(item.getInventorySts()); | |
157 | + adjustDetail.setFromQty(item.getSystemQty());//调整前数量 | |
158 | + adjustDetail.setToQty(null);//调整后数量 | |
159 | + adjustDetail.setGapQty(item.getGapQty());//调整数量 | |
160 | + adjustDetail.setCreated(new Date()); | |
161 | + adjustDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
162 | + //adjustDetail.setStatus(0);//状态 | |
163 | + | |
164 | + adjustDetailService.save(adjustDetail); | |
165 | + } | |
166 | + | |
167 | + } | |
168 | + | |
169 | + //修改盘点主单状态为已生成差异单 | |
170 | + | |
171 | + cyclecountHeader.setStatusCyc(35); | |
172 | + this.saveOrUpdate(cyclecountHeader); | |
173 | + | |
174 | + return AjaxResult.success("差异调整及明细单生成完毕!"); | |
175 | + } | |
176 | + | |
177 | + | |
178 | + | |
179 | + | |
180 | + | |
181 | + | |
182 | + | |
183 | + | |
184 | +} | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -21,7 +21,10 @@ import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
21 | 21 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
22 | 22 | import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; |
23 | 23 | import com.huaheng.pc.shipment.shippingCombination.service.ShippingCombinationService; |
24 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail; | |
25 | +import com.huaheng.pc.task.taskDetail.service.TaskDetailService; | |
24 | 26 | import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel; |
27 | +import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | |
25 | 28 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
26 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
27 | 30 | import org.springframework.stereotype.Service; |
... | ... | @@ -58,6 +61,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
58 | 61 | private ShippingCombinationService shippingCombinationService; |
59 | 62 | @Autowired |
60 | 63 | private TaskHeaderService taskHeaderService; |
64 | + @Autowired | |
65 | + private TaskDetailService taskDetailService; | |
61 | 66 | |
62 | 67 | |
63 | 68 | @Override |
... | ... | @@ -106,24 +111,26 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
106 | 111 | Location location = locationService.getOne(lambdaQueryWrapper); |
107 | 112 | if (location == null) |
108 | 113 | throw new ServiceException("库位 "+ inventoryDetail.getLocationCode() +" 不存在"); |
109 | - if (location.getStatus().equals("lock")) { | |
110 | - //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
111 | - LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
112 | - lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
113 | - .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
114 | - .eq(ShipmentContainerHeader::getTaskCreated,0); | |
115 | - ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
116 | - if (shipmentContainerHeader == null) { | |
117 | - throw new ServiceException("库位已经锁定不能使用"); | |
118 | - } | |
119 | - } | |
114 | +// if (location.getStatus().equals("lock")) { | |
115 | +// //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
116 | +// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
117 | +// lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
118 | +// .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
119 | +// .eq(ShipmentContainerHeader::getTaskCreated,0); | |
120 | +// ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
121 | +// if (shipmentContainerHeader == null) { | |
122 | +// throw new ServiceException("库位已经锁定不能使用"); | |
123 | +// } | |
124 | +// } | |
120 | 125 | |
121 | 126 | //更新库存分配数 |
122 | 127 | inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty())); |
123 | 128 | inventoryDetailService.saveOrUpdate(inventoryDetail); |
124 | 129 | //获取库位,然后锁定 |
125 | - location.setStatus("lock"); | |
126 | - locationService.saveOrUpdate(location); | |
130 | + if(location.getStatus().equals("empty")) { | |
131 | + location.setStatus("lock"); | |
132 | + locationService.saveOrUpdate(location); | |
133 | + } | |
127 | 134 | //更新单据明细的已出库数量 |
128 | 135 | shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty())); |
129 | 136 | int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()); |
... | ... | @@ -166,20 +173,19 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
166 | 173 | LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery(); |
167 | 174 | lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) |
168 | 175 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
169 | - .eq(ShipmentContainerHeader::getTaskCreated,1) | |
170 | - .eq(ShipmentContainerHeader::getStatus,10); | |
176 | + .le(ShipmentContainerHeader::getStatus,20); | |
171 | 177 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); |
172 | 178 | if(shipmentContainerHeader != null) { |
173 | - throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;"); | |
179 | + return shipmentContainerHeader; | |
174 | 180 | } |
175 | 181 | else { |
176 | - LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
177 | - lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
178 | - .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
179 | - .eq(ShipmentContainerHeader::getTaskCreated,0) | |
180 | - .eq(ShipmentContainerHeader::getStatus,0); | |
181 | - shipmentContainerHeader = this.getOne(lam); | |
182 | - if (shipmentContainerHeader == null) { | |
182 | +// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
183 | +// lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
184 | +// .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
185 | +// .eq(ShipmentContainerHeader::getTaskCreated,0) | |
186 | +// .eq(ShipmentContainerHeader::getStatus,0); | |
187 | +// shipmentContainerHeader = this.getOne(lam); | |
188 | +// if (shipmentContainerHeader == null) { | |
183 | 189 | shipmentContainerHeader = new ShipmentContainerHeader(); |
184 | 190 | shipmentContainerHeader.setContainerCode(location.getContainerCode()); |
185 | 191 | shipmentContainerHeader.setLocationCode(location.getCode()); |
... | ... | @@ -194,9 +200,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
194 | 200 | // material.setCode(shipmentDetail.getMaterialCode()); |
195 | 201 | // shipmentContainerHeader.setZoneCode(materialService.selectFirstEntity(material).getZoneCode()); |
196 | 202 | this.save(shipmentContainerHeader); |
203 | + return shipmentContainerHeader; | |
197 | 204 | } |
198 | - } | |
199 | - return shipmentContainerHeader; | |
205 | +// } | |
200 | 206 | } |
201 | 207 | |
202 | 208 | /** |
... | ... | @@ -246,6 +252,45 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
246 | 252 | shipmentContainerDetail.setCreatedBy(ShiroUtils.getLoginName()); |
247 | 253 | shipmentContainerDetailService.save(shipmentContainerDetail); |
248 | 254 | } |
255 | + | |
256 | + // | |
257 | + if(shipmentContainerHeader.getStatus()<=10){ | |
258 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery(); | |
259 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode()) | |
260 | + .eq(TaskHeader::getInternalTaskType,200) | |
261 | + .eq(TaskHeader::getAllocationHeadId,shipmentContainerHeader.getId()); | |
262 | + TaskHeader taskHeader=taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); | |
263 | + if(taskHeader==null){ | |
264 | + throw new ServiceException("找不到相应的任务头"); | |
265 | + } | |
266 | + TaskDetail taskDetail = new TaskDetail(); | |
267 | + taskDetail.setTaskId(taskHeader.getId()); | |
268 | + taskDetail.setInternalTaskType(taskHeader.getInternalTaskType()); | |
269 | + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
270 | + taskDetail.setCompanyCode(taskHeader.getCompanyCode()); | |
271 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
272 | + taskDetail.setAllocationId(shipmentContainerDetail.getId()); | |
273 | + taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); | |
274 | + taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId()); | |
275 | + taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode()); | |
276 | + taskDetail.setMaterialName(shipmentContainerDetail.getMaterialName()); | |
277 | + taskDetail.setMaterialSpec(shipmentContainerDetail.getMaterialSpec()); | |
278 | + taskDetail.setMaterialUnit(shipmentContainerDetail.getMaterialUnit()); | |
279 | + taskDetail.setFromInventoryId(shipmentContainerDetail.getInventoryId()); | |
280 | + taskDetail.setQty(shipmentContainerDetail.getQty()); | |
281 | + taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
282 | + taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
283 | + taskDetail.setToLocation(taskHeader.getToLocation()); | |
284 | + if(shipmentContainerHeader.getStatus()==10) { | |
285 | + taskDetail.setStatus(0); | |
286 | + }else { | |
287 | + taskDetail.setStatus(10); | |
288 | + } | |
289 | + taskDetail.setTaskType(taskHeader.getTaskType()); | |
290 | + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
291 | + taskDetail.setLastUpdated(null); | |
292 | + taskDetailService.save(taskDetail); | |
293 | + } | |
249 | 294 | return shipmentContainerDetail; |
250 | 295 | } |
251 | 296 | |
... | ... |
src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java
... | ... | @@ -43,6 +43,13 @@ public class TaskHeader implements Serializable { |
43 | 43 | private Integer taskType; |
44 | 44 | |
45 | 45 | /** |
46 | + * 入库或出库组盘头ID | |
47 | + */ | |
48 | + @TableField(value = "allocationHeadId") | |
49 | + @ApiModelProperty(value="入库或出库组盘头ID") | |
50 | + private Integer allocationHeadId; | |
51 | + | |
52 | + /** | |
46 | 53 | * 内部类型 |
47 | 54 | */ |
48 | 55 | @TableField(value = "internalTaskType") |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -172,12 +172,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
172 | 172 | task.setToLocation(""); |
173 | 173 | } |
174 | 174 | } |
175 | + task.setInternalTaskType(200); | |
176 | + task.setAllocationHeadId(shipmentContainerHeader.getId()); | |
175 | 177 | task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); |
176 | 178 | task.setCompanyCode(shipmentContainerHeader.getCompanyCode()); |
177 | - task.setInternalTaskType(null); | |
178 | 179 | task.setAssignedUser(ShiroUtils.getLoginName()); |
179 | 180 | task.setConfirmedBy(ShiroUtils.getLoginName()); |
180 | - task.setStatus(1); | |
181 | + task.setStatus(0); | |
181 | 182 | task.setContainerCode(shipmentContainerHeader.getContainerCode()); |
182 | 183 | task.setCreatedBy(ShiroUtils.getLoginName()); |
183 | 184 | task.setCreated(new Date()); |
... | ... | @@ -188,9 +189,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
188 | 189 | for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetails) { |
189 | 190 | TaskDetail taskDetail = new TaskDetail(); |
190 | 191 | taskDetail.setTaskId(task.getId()); |
192 | + taskDetail.setInternalTaskType(task.getInternalTaskType()); | |
191 | 193 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
192 | 194 | taskDetail.setCompanyCode(task.getCompanyCode()); |
193 | 195 | taskDetail.setTaskType(task.getTaskType()); |
196 | + taskDetail.setAllocationId(shipmentContainerDetail.getId()); | |
194 | 197 | taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode()); |
195 | 198 | taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId()); |
196 | 199 | taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode()); |
... | ... | @@ -202,7 +205,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
202 | 205 | taskDetail.setContainerCode(task.getContainerCode()); |
203 | 206 | taskDetail.setFromLocation(task.getFromLocation()); |
204 | 207 | taskDetail.setToLocation(task.getToLocation()); |
205 | - taskDetail.setStatus(1); | |
208 | + taskDetail.setStatus(0); | |
206 | 209 | taskDetail.setTaskType(task.getTaskType()); |
207 | 210 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
208 | 211 | taskDetail.setLastUpdated(null); |
... | ... |
src/main/resources/mybatis/inventory/AdjustHeaderMapper.xml
... | ... | @@ -25,4 +25,12 @@ |
25 | 25 | id, code, warehouseCode, companyCode, problemType, cycleCountCode, checkCode, |
26 | 26 | referCode, referReason, createdBy, created, version, userDef1, userDef2, userDef3, processStamp |
27 | 27 | </sql> |
28 | + | |
29 | + <select id="getLastCode" resultType="java.lang.String"> | |
30 | + SELECT code FROM adjust_header ORDER BY id DESC LIMIT 1 | |
31 | + </select> | |
32 | + | |
33 | + | |
34 | + | |
35 | + | |
28 | 36 | </mapper> |
29 | 37 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/inventory/CycleCountHeaderMapper.xml
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <result column="masterCode" jdbcType="VARCHAR" property="masterCode" /> |
10 | 10 | <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> |
11 | 11 | <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> |
12 | - <result column="countType" jdbcType="INTEGER" property="countType" /> | |
12 | + <result column="countType" jdbcType="VARCHAR" property="countType" /> | |
13 | 13 | <result column="statusCyc" jdbcType="INTEGER" property="statusCyc" /> |
14 | 14 | <result column="countAttribute" jdbcType="INTEGER" property="countAttribute" /> |
15 | 15 | <result column="remark" jdbcType="VARCHAR" property="remark" /> |
... | ... | @@ -41,4 +41,11 @@ |
41 | 41 | releasedAt, closedBy, closedAt, created, createdBy, lastUpdated, lastUpdatedBy, version, |
42 | 42 | userDef1, userDef2, userDef3, verifyBy, sourceCode, uploadTime, uploadStatus |
43 | 43 | </sql> |
44 | + | |
45 | + <select id="getLastCode" resultType="java.lang.String"> | |
46 | + SELECT masterCode FROM cycle_count_header ORDER BY id DESC LIMIT 1 | |
47 | + </select> | |
48 | + | |
49 | + | |
50 | + | |
44 | 51 | </mapper> |
45 | 52 | \ No newline at end of file |
... | ... |
src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
... | ... | @@ -116,7 +116,7 @@ |
116 | 116 | var prefix = ctx + "inventory/cycleCountDetail"; |
117 | 117 | var prefix_head = ctx + "inventory/cycleCountHeader"; |
118 | 118 | var remove_url= prefix + "/remove"; |
119 | - var datas = [[${@dict.getType('cyclecountStatus')}]]; | |
119 | + var cyclecountStatus = [[${@dict.getType('cyclecountStatus')}]]; | |
120 | 120 | var inventoryStatus=[[${@dict.getType('inventoryStatus')}]]; |
121 | 121 | var created ; |
122 | 122 | |
... | ... | @@ -287,9 +287,9 @@ |
287 | 287 | field: 'enableStatus', |
288 | 288 | title: '盘点明细状态', |
289 | 289 | formatter: function(value, row, index) { |
290 | - return $.table.selectDictLabel(datas, value); | |
290 | + return $.table.selectDictLabel(cyclecountStatus, value); | |
291 | 291 | }, |
292 | - sortable:true | |
292 | + visible: true | |
293 | 293 | }, |
294 | 294 | { |
295 | 295 | field: 'processStamp', |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/add.html
... | ... | @@ -4,34 +4,82 @@ |
4 | 4 | <head th:include="include :: header"></head> |
5 | 5 | <body class="white-bg"> |
6 | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | - <form class="form-horizontal m" id="form-cyclecountHeader-add"> | |
7 | + <form class="form-horizontal m" id="form-cycleCountHeader-add"> | |
8 | 8 | <div class="form-group"> |
9 | 9 | <label class="col-sm-3 control-label">盘点类型:</label> |
10 | 10 | <div class="col-sm-8"> |
11 | - <select name="type" id="type" class="form-control m-b" th:with="firstStatus=${@dict.getType('cyclecountType')}"> | |
11 | + <select name="countType" id="countType" class="form-control m-b" th:with="firstStatus=${@dict.getType('cyclecountType')}"> | |
12 | 12 | <option th:each="e : ${firstStatus}" th:text="${e['dictLabel']}" |
13 | 13 | th:value="${e['dictValue']}"></option> |
14 | 14 | </select> |
15 | 15 | </div> |
16 | 16 | </div> |
17 | 17 | <div class="form-group"> |
18 | - <label class="col-sm-3 control-label">货主:</label> | |
19 | - <div class="col-sm-8"> | |
20 | - <select id="company" name="company" class="form-control m-b" th:with="list=${@company.selectCompanyByCurrentUserId()}"> | |
21 | - <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option> | |
22 | - </select> | |
23 | - </div> | |
18 | + <label class="col-sm-3 control-label">原始盘点内部号:</label> | |
19 | + <div class="col-sm-8"> | |
20 | + <input id="countOrderId" name="countOrderId" class="form-control" type="text"> | |
21 | + </div> | |
24 | 22 | </div> |
25 | 23 | <div class="form-group"> |
26 | - <label class="col-sm-3 control-label">备注:</label> | |
24 | + <label class="col-sm-3 control-label">盘点轮次:</label> | |
27 | 25 | <div class="col-sm-8"> |
28 | - <input id="userDef1" name="remark" class="form-control" type="text"> | |
26 | + <input id="round" name="round" class="form-control" type="text"> | |
29 | 27 | </div> |
30 | 28 | <!--th:checked="true" 状态按钮默认为启用 $("input[name='enable']").is(':checked')--> |
31 | 29 | <!--<div>--> |
32 | 30 | <!--<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">--> |
33 | 31 | <!--</div>--> |
34 | 32 | </div> |
33 | + <div class="form-group"> | |
34 | + <label class="col-sm-3 control-label">货主:</label> | |
35 | + <div class="col-sm-8"> | |
36 | + <input id="companyCode" name="companyCode" class="form-control" type="text"> | |
37 | + </div> | |
38 | + </div> | |
39 | + <div class="form-group"> | |
40 | + <label class="col-sm-3 control-label">总货位数:</label> | |
41 | + <div class="col-sm-8"> | |
42 | + <input id="totalLocs" name="totalLocs" class="form-control" type="text"> | |
43 | + </div> | |
44 | + </div> | |
45 | + <div class="form-group"> | |
46 | + <label class="col-sm-3 control-label">总物料数:</label> | |
47 | + <div class="col-sm-8"> | |
48 | + <input id="totalItems" name="totalItems" 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 | + <input id="zoneCode" name="zoneCode" class="form-control" type="text"> | |
55 | + </div> | |
56 | + </div> | |
57 | + <div class="form-group"> | |
58 | + <label class="col-sm-3 control-label">库位条件(模糊):</label> | |
59 | + <div class="col-sm-8"> | |
60 | + <input id="locationFilter" name="locationFilter" class="form-control" type="text"> | |
61 | + </div> | |
62 | + </div> | |
63 | + <div class="form-group"> | |
64 | + <label class="col-sm-3 control-label">源盘点单号:</label> | |
65 | + <div class="col-sm-8"> | |
66 | + <input id="sourceCode" name="sourceCode" class="form-control" type="text"> | |
67 | + </div> | |
68 | + </div> | |
69 | + | |
70 | + <!--<div class="form-group"> | |
71 | + <label class="col-sm-3 control-label">原始盘点内部号:</label> | |
72 | + <div class="col-sm-8"> | |
73 | + <input id="countOrderId" name="remark" class="form-control" type="text"> | |
74 | + </div> | |
75 | + </div>--> | |
76 | + <div class="form-group"> | |
77 | + <label class="col-sm-3 control-label">备注:</label> | |
78 | + <div class="col-sm-8"> | |
79 | + <input id="remark" name="remark" class="form-control" type="text"> | |
80 | + </div> | |
81 | + </div> | |
82 | + | |
35 | 83 | <div class="form-group"> |
36 | 84 | <div class="form-control-static col-sm-offset-9"> |
37 | 85 | <button type="submit" class="btn btn-primary">提交</button> |
... | ... | @@ -42,21 +90,32 @@ |
42 | 90 | </div> |
43 | 91 | <div th:include="include::footer"></div> |
44 | 92 | <script type="text/javascript"> |
45 | - var prefix = ctx + "inventory/cyclecountHeader" | |
46 | - $("#form-cyclecountHeader-add").validate({ | |
93 | + var prefix = ctx + "inventory/cycleCountHeader" | |
94 | + $("#form-cycleCountHeader-add").validate({ | |
47 | 95 | rules:{ |
48 | - // code:{ | |
49 | - // required:true, | |
50 | - // }, | |
51 | - type:{ | |
96 | + companyCode:{ | |
97 | + required:true, | |
98 | + }, | |
99 | + /*countType:{ | |
52 | 100 | required:true |
53 | - } | |
101 | + },*/ | |
102 | + totalLocs:{ | |
103 | + required:false, | |
104 | + digits:true, | |
105 | + min:0 | |
106 | + }, | |
107 | + totalItems:{ | |
108 | + required:false, | |
109 | + digits:true, | |
110 | + min:0 | |
111 | + }, | |
112 | + | |
54 | 113 | }, |
55 | 114 | submitHandler: function(form) { |
56 | - var tableValue = $("#form-cyclecountHeader-add").serialize(); | |
57 | - tableValue = formValueReplace(tableValue, "enable", true); | |
58 | - tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val()); | |
59 | - tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code")); | |
115 | + var tableValue = $("#form-cycleCountHeader-add").serialize(); | |
116 | + // tableValue = formValueReplace(tableValue, "enable", true); | |
117 | + // tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val()); | |
118 | + // tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code")); | |
60 | 119 | $.operate.save(prefix + "/add", tableValue); |
61 | 120 | } |
62 | 121 | }); |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
... | ... | @@ -96,8 +96,8 @@ |
96 | 96 | var prefix = ctx + "inventory/cycleCountHeader"; |
97 | 97 | var datas = [[${@dict.getType('sys_normal_disable')}]]; |
98 | 98 | var types = [[${@dict.getType('cyclecountType')}]]; |
99 | - var status2 = [[${@dict.getType('cyclecountStatus')}]]; | |
100 | - | |
99 | + var cyclecountStatus = [[${@dict.getType('cyclecountStatus')}]]; | |
100 | + var ifs = [[${@dict.getType('false_and_true')}]]; | |
101 | 101 | $(function () { |
102 | 102 | var options = { |
103 | 103 | url: prefix + "/list", |
... | ... | @@ -161,19 +161,23 @@ |
161 | 161 | }, |
162 | 162 | { |
163 | 163 | field: 'releasedBy', |
164 | - title: '释放人' | |
164 | + title: '释放人', | |
165 | + visible: false | |
165 | 166 | }, |
166 | 167 | { |
167 | 168 | field: 'releasedAt', |
168 | - title: '释放时间' | |
169 | + title: '释放时间', | |
170 | + visible: false | |
169 | 171 | }, |
170 | 172 | { |
171 | 173 | field: 'closedBy', |
172 | - title: '关闭人' | |
174 | + title: '关闭人', | |
175 | + visible: false | |
173 | 176 | }, |
174 | 177 | { |
175 | 178 | field: 'closedAt', |
176 | - title: '关闭时间' | |
179 | + title: '关闭时间', | |
180 | + visible: false | |
177 | 181 | }, |
178 | 182 | { |
179 | 183 | field: 'countType', |
... | ... | @@ -185,25 +189,29 @@ |
185 | 189 | sortable: true |
186 | 190 | }, |
187 | 191 | { |
188 | - field: 'verifyBy', | |
189 | - title: '审核人' | |
190 | - }, | |
191 | - { | |
192 | 192 | field: 'statusCyc', |
193 | - title: '盘点状态', | |
194 | - align: 'center', | |
195 | - formatter: function (value, row, index) { | |
196 | - return $.table.selectDictLabel(status2, value); | |
193 | + title: '盘点主单状态', | |
194 | + formatter: function(value, row, index) { | |
195 | + return $.table.selectDictLabel(cyclecountStatus, value); | |
197 | 196 | }, |
198 | - sortable: true | |
197 | + visible: true | |
198 | + }, | |
199 | + { | |
200 | + field: 'verifyBy', | |
201 | + title: '审核人' | |
199 | 202 | }, |
200 | 203 | { |
201 | 204 | field: 'uploadTime', |
202 | - title: '上传时间' | |
205 | + title: '上传时间', | |
206 | + visible: false | |
203 | 207 | }, |
204 | 208 | { |
205 | 209 | field: 'uploadStatus', |
206 | - title: '上传状态' | |
210 | + title: '上传状态', | |
211 | + align: 'center', | |
212 | + formatter: function (value, row, index) { | |
213 | + return $.table.selectDictLabel(ifs, value); | |
214 | + } | |
207 | 215 | }, |
208 | 216 | { |
209 | 217 | field: 'version', |
... | ... | @@ -266,10 +274,9 @@ |
266 | 274 | |
267 | 275 | actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成差异单</a> '); |
268 | 276 | |
269 | - actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
277 | + //actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
270 | 278 | actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); |
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 | - return actions.join(''); | |
279 | + return actions.join(''); | |
273 | 280 | } |
274 | 281 | }] |
275 | 282 | }; |
... | ... |