Commit 528cd7f18b1bcd8e4fb90df120495a6242932466
1 parent
b632ea94
出库后台修改
Showing
26 changed files
with
1126 additions
and
260 deletions
src/main/java/com/huaheng/pc/general/location/domain/Location.java
src/main/java/com/huaheng/pc/inventory/inventoryDetail/domain/InventoryDetail.java
... | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; |
5 | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
6 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import java.io.Serializable; |
8 | +import java.math.BigDecimal; | |
8 | 9 | import java.util.Date; |
9 | 10 | import lombok.Data; |
10 | 11 | |
... | ... | @@ -69,19 +70,19 @@ public class InventoryDetail implements Serializable { |
69 | 70 | * 在库数量 |
70 | 71 | */ |
71 | 72 | @TableField(value = "qty") |
72 | - private Integer qty; | |
73 | + private BigDecimal qty; | |
73 | 74 | |
74 | 75 | /** |
75 | 76 | * 任务数量 |
76 | 77 | */ |
77 | 78 | @TableField(value = "taskQty") |
78 | - private Integer taskQty; | |
79 | + private BigDecimal taskQty; | |
79 | 80 | |
80 | 81 | /** |
81 | 82 | * 冻结数量 |
82 | 83 | */ |
83 | 84 | @TableField(value = "lockedQty") |
84 | - private Integer lockedQty; | |
85 | + private BigDecimal lockedQty; | |
85 | 86 | |
86 | 87 | /** |
87 | 88 | * 库存状态 |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/domain/ShipmentContainerDetail.java
... | ... | @@ -151,7 +151,7 @@ public class ShipmentContainerDetail implements Serializable { |
151 | 151 | */ |
152 | 152 | @TableField(value = "qty") |
153 | 153 | @ApiModelProperty(value="数量") |
154 | - private Integer qty; | |
154 | + private BigDecimal qty; | |
155 | 155 | |
156 | 156 | /** |
157 | 157 | * 波次号 |
... | ... | @@ -823,21 +823,11 @@ public class ShipmentContainerDetail implements Serializable { |
823 | 823 | this.itemValue = itemValue; |
824 | 824 | } |
825 | 825 | |
826 | - /** | |
827 | - * 获取数量 | |
828 | - * | |
829 | - * @return qty - 数量 | |
830 | - */ | |
831 | - public Integer getQty() { | |
826 | + public BigDecimal getQty() { | |
832 | 827 | return qty; |
833 | 828 | } |
834 | 829 | |
835 | - /** | |
836 | - * 设置数量 | |
837 | - * | |
838 | - * @param qty 数量 | |
839 | - */ | |
840 | - public void setQty(Integer qty) { | |
830 | + public void setQty(BigDecimal qty) { | |
841 | 831 | this.qty = qty; |
842 | 832 | } |
843 | 833 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/domain/ShipmentCombinationModel.java
0 → 100644
1 | +package com.huaheng.pc.shipment.shipmentContainerHeader.domain; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | + | |
5 | +/** | |
6 | + * 用于出库组盘,前端给后端传递数据 | |
7 | + */ | |
8 | +public class ShipmentCombinationModel { | |
9 | + | |
10 | + //组盘时的出库明细Id | |
11 | + private int shipmentDetailId; | |
12 | + //组盘时选择的库存 | |
13 | + private int inventoryDetailId; | |
14 | + //组盘数量 | |
15 | + private BigDecimal shipQty; | |
16 | + //组盘类型 | |
17 | + private Short type; | |
18 | + //是否自动生成任务 | |
19 | + private boolean auto=false; | |
20 | + //自动生成时,选择的任务类型 | |
21 | + private int taskType; | |
22 | + /** 货主code */ | |
23 | + private String companyCode; | |
24 | + | |
25 | + public int getTaskType() { | |
26 | + return taskType; | |
27 | + } | |
28 | + | |
29 | + public void setTaskType(int taskType) { | |
30 | + this.taskType = taskType; | |
31 | + } | |
32 | + | |
33 | + public int getShipmentDetailId() { | |
34 | + return shipmentDetailId; | |
35 | + } | |
36 | + | |
37 | + public void setShipmentDetailId(int shipmentDetailId) { | |
38 | + this.shipmentDetailId = shipmentDetailId; | |
39 | + } | |
40 | + | |
41 | + public Short getType() { | |
42 | + return type; | |
43 | + } | |
44 | + | |
45 | + public void setType(Short type) { | |
46 | + this.type = type; | |
47 | + } | |
48 | + | |
49 | + public boolean isAuto() { | |
50 | + return auto; | |
51 | + } | |
52 | + | |
53 | + public void setAuto(boolean auto) { | |
54 | + this.auto = auto; | |
55 | + } | |
56 | + | |
57 | + public String getCompanyCode() { | |
58 | + return companyCode; | |
59 | + } | |
60 | + | |
61 | + public void setCompanyCode(String companyCode) { | |
62 | + this.companyCode = companyCode; | |
63 | + } | |
64 | + | |
65 | + public int getInventoryDetailId() { | |
66 | + return inventoryDetailId; | |
67 | + } | |
68 | + | |
69 | + public void setInventoryDetailId(int inventoryDetailId) { | |
70 | + this.inventoryDetailId = inventoryDetailId; | |
71 | + } | |
72 | + | |
73 | + public BigDecimal getShipQty() { | |
74 | + return shipQty; | |
75 | + } | |
76 | + | |
77 | + public void setShipQty(BigDecimal shipQty) { | |
78 | + this.shipQty = shipQty; | |
79 | + } | |
80 | +} | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/domain/ShipmentContainerHeader.java
... | ... | @@ -116,7 +116,7 @@ public class ShipmentContainerHeader implements Serializable { |
116 | 116 | */ |
117 | 117 | @TableField(value = "totalQty") |
118 | 118 | @ApiModelProperty(value="数量") |
119 | - private Integer totalQty; | |
119 | + private BigDecimal totalQty; | |
120 | 120 | |
121 | 121 | /** |
122 | 122 | * 快递单号 |
... | ... | @@ -742,21 +742,11 @@ public class ShipmentContainerHeader implements Serializable { |
742 | 742 | this.companyCode = companyCode; |
743 | 743 | } |
744 | 744 | |
745 | - /** | |
746 | - * 获取数量 | |
747 | - * | |
748 | - * @return totalQty - 数量 | |
749 | - */ | |
750 | - public Integer getTotalQty() { | |
745 | + public BigDecimal getTotalQty() { | |
751 | 746 | return totalQty; |
752 | 747 | } |
753 | 748 | |
754 | - /** | |
755 | - * 设置数量 | |
756 | - * | |
757 | - * @param totalQty 数量 | |
758 | - */ | |
759 | - public void setTotalQty(Integer totalQty) { | |
749 | + public void setTotalQty(BigDecimal totalQty) { | |
760 | 750 | this.totalQty = totalQty; |
761 | 751 | } |
762 | 752 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/mapper/ShipmentContainerHeaderMapper.java
... | ... | @@ -2,6 +2,12 @@ package com.huaheng.pc.shipment.shipmentContainerHeader.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.Map; | |
5 | 8 | |
6 | 9 | public interface ShipmentContainerHeaderMapper extends BaseMapper<ShipmentContainerHeader> { |
10 | + | |
11 | + Map<String,Integer> getShipmentContainerMaxAndMinStatusByShipmentID(@Param("shipmentId") int shipmentId); | |
12 | + | |
7 | 13 | } |
8 | 14 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderService.java
1 | 1 | package com.huaheng.pc.shipment.shipmentContainerHeader.service; |
2 | 2 | |
3 | +import com.huaheng.framework.web.domain.AjaxResult; | |
4 | +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | |
3 | 5 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
4 | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
7 | +import org.apache.ibatis.annotations.Param; | |
8 | + | |
9 | +import java.util.Map; | |
10 | + | |
5 | 11 | public interface ShipmentContainerHeaderService extends IService<ShipmentContainerHeader>{ |
6 | 12 | |
13 | + Map<String,Integer> getShipmentContainerMaxAndMinStatusByShipmentID(@Param("shipmentId") int shipmentId); | |
14 | + | |
15 | + | |
16 | + //出库保存组盘 | |
17 | + AjaxResult combination(ShipmentCombinationModel shipmentCombination); | |
18 | + | |
7 | 19 | |
8 | 20 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
1 | 1 | package com.huaheng.pc.shipment.shipmentContainerHeader.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.security.ShiroUtils; | |
7 | +import com.huaheng.framework.web.domain.AjaxResult; | |
8 | +import com.huaheng.pc.general.location.domain.Location; | |
9 | +import com.huaheng.pc.general.location.service.LocationService; | |
10 | +import com.huaheng.pc.general.material.domain.Material; | |
11 | +import com.huaheng.pc.general.material.service.MaterialService; | |
12 | +import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | |
13 | +import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; | |
14 | +import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; | |
15 | +import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; | |
16 | +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | |
17 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
18 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
19 | +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; | |
20 | +import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | |
21 | +import org.springframework.beans.factory.annotation.Autowired; | |
3 | 22 | import org.springframework.stereotype.Service; |
4 | 23 | import javax.annotation.Resource; |
24 | +import java.math.BigDecimal; | |
5 | 25 | import java.util.List; |
26 | +import java.util.Map; | |
27 | + | |
6 | 28 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | 29 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
8 | 30 | import com.huaheng.pc.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapper; |
9 | 31 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
32 | +import org.springframework.transaction.annotation.Transactional; | |
33 | + | |
10 | 34 | @Service |
11 | 35 | public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentContainerHeaderMapper, ShipmentContainerHeader> implements ShipmentContainerHeaderService{ |
12 | 36 | |
37 | + @Autowired | |
38 | + private ShipmentDetailService shipmentDetailService; | |
39 | + @Autowired | |
40 | + private InventoryDetailService inventoryDetailService; | |
41 | + @Autowired | |
42 | + private LocationService locationService; | |
43 | + @Autowired | |
44 | + private ShipmentHeaderService shipmentHeaderService; | |
45 | + @Resource | |
46 | + private ShipmentContainerHeaderMapper shipmentContainerHeaderMapper; | |
47 | + @Autowired | |
48 | + private ShipmentContainerDetailService shipmentContainerDetailService; | |
49 | + @Autowired | |
50 | + private MaterialService materialService; | |
51 | + | |
52 | + | |
53 | + @Override | |
54 | + public Map<String, Integer> getShipmentContainerMaxAndMinStatusByShipmentID(int shipmentId) { | |
55 | + return shipmentContainerHeaderMapper.getShipmentContainerMaxAndMinStatusByShipmentID(shipmentId); | |
56 | + } | |
57 | + | |
58 | + | |
59 | + | |
60 | + /** | |
61 | + * 出库组盘单条保存 | |
62 | + * @param shipmentCombinationModel | |
63 | + * @return | |
64 | + */ | |
65 | + @Transactional | |
66 | + @Override | |
67 | + public AjaxResult combination(ShipmentCombinationModel shipmentCombinationModel) { | |
68 | + | |
69 | + //校验 | |
70 | + if(shipmentCombinationModel.getShipQty().compareTo(new BigDecimal("0")) <= 0){ | |
71 | + return AjaxResult.error("出库数量必须大于0"); | |
72 | + } | |
73 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentCombinationModel.getShipmentDetailId()); | |
74 | + if(shipmentDetail==null){ | |
75 | + return AjaxResult.error("出库明细未找到"); | |
76 | + } | |
77 | + InventoryDetail inventoryDetail = inventoryDetailService.getById((shipmentCombinationModel.getInventoryDetailId())); | |
78 | + if(inventoryDetail==null){ | |
79 | + return AjaxResult.error("库存未找到"); | |
80 | + } | |
81 | + //校验数量是否超出 | |
82 | + if((shipmentDetail.getShipQty().subtract(shipmentDetail.getRequestQty())).compareTo(shipmentCombinationModel.getShipQty())<0){ | |
83 | + return AjaxResult.error("录入数量超出明细待出数量"); | |
84 | + } | |
85 | + //校验库存可用数量 | |
86 | + if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).subtract(inventoryDetail.getLockedQty()).compareTo(shipmentCombinationModel.getShipQty())<0){ | |
87 | + return AjaxResult.error("录入数量超出可出数量"); | |
88 | + } | |
89 | + if(!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())){ | |
90 | + return AjaxResult.error("配盘物料不一致"); | |
91 | + } | |
92 | + //库位 | |
93 | + LambdaQueryWrapper<Location> lambdaQueryWrapper= Wrappers.lambdaQuery(); | |
94 | + lambdaQueryWrapper.eq(Location::getWarehouseCode,inventoryDetail.getWarehouseCode()) | |
95 | + .eq(Location::getCode,inventoryDetail.getLocationCode()); | |
96 | + Location location = locationService.getOne(lambdaQueryWrapper); | |
97 | + if (location == null) | |
98 | + return AjaxResult.error("库位 "+ inventoryDetail.getLocationCode() +" 不存在"); | |
99 | + if (location.getStatus().equals("lock")) { | |
100 | + //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
101 | + LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
102 | + lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
103 | + .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
104 | + .eq(ShipmentContainerHeader::getTaskCreated,0); | |
105 | + ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
106 | + if (shipmentContainerHeader == null) { | |
107 | + return AjaxResult.error("库位已经锁定不能使用"); | |
108 | + } | |
109 | + } | |
110 | + | |
111 | + //更新库存分配数 | |
112 | + inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty())); | |
113 | + inventoryDetailService.saveOrUpdate(inventoryDetail); | |
114 | + //获取库位,然后锁定 | |
115 | + location.setStatus("lock"); | |
116 | + locationService.saveOrUpdate(location); | |
117 | + //更新单据明细的已出库数量 | |
118 | + shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty())); | |
119 | + int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()); | |
120 | + if(i > 0){ | |
121 | + shipmentDetail.setStatus(200); | |
122 | + }else if(i == 0){ | |
123 | + shipmentDetail.setStatus(300); | |
124 | + }else if(i < 0){ | |
125 | + throw new ServiceException("出库数量不能大于单据数量!"); | |
126 | + } | |
127 | + shipmentDetailService.saveOrUpdate(shipmentDetail); | |
128 | + | |
129 | + //自动判定出库任务状态,根据库存数量减去预定库存相等就是整盘出--预计任务状态 | |
130 | + BigDecimal inventoryQty = inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()); | |
131 | + if(inventoryQty.compareTo(new BigDecimal(0)) <= 0) { | |
132 | + shipmentCombinationModel.setTaskType(300); | |
133 | + } else { | |
134 | + shipmentCombinationModel.setTaskType(400); | |
135 | + } | |
136 | + | |
137 | + //增加出库组盘头 | |
138 | + ShipmentContainerHeader shipmentContainerHeader = ShipmentContainerHeaderAdd(location, shipmentDetail, shipmentCombinationModel); | |
139 | + //增加出库组盘明细 | |
140 | + ShipmentContainerDetail shipmentContainerDetail = ShipmentContainerDetailAdd(shipmentDetail, shipmentContainerHeader, shipmentCombinationModel); | |
141 | + //更新单据状态 | |
142 | + shipmentHeaderService.updateShipmentStatus(shipmentDetail.getShipmentId()); | |
143 | + | |
144 | + return AjaxResult.success("成功"); | |
145 | + } | |
146 | + | |
147 | + /** | |
148 | + * 在组盘表中查找任务状态小于20的容器,如果状态为0就合并出库明细,状态大于0就提示不能组盘。如果找不到就新增一条组盘表头 | |
149 | + * @param location | |
150 | + * @param shipmentCombination | |
151 | + * @return | |
152 | + */ | |
153 | + private ShipmentContainerHeader ShipmentContainerHeaderAdd(Location location, | |
154 | + ShipmentDetail shipmentDetail, | |
155 | + ShipmentCombinationModel shipmentCombination) { | |
156 | + LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery(); | |
157 | + lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
158 | + .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
159 | + .eq(ShipmentContainerHeader::getTaskCreated,1) | |
160 | + .eq(ShipmentContainerHeader::getEnable,10); | |
161 | + ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); | |
162 | + if(shipmentContainerHeader != null) { | |
163 | + throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;"); | |
164 | + } | |
165 | + else { | |
166 | + LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
167 | + lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
168 | + .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
169 | + .eq(ShipmentContainerHeader::getTaskCreated,0) | |
170 | + .eq(ShipmentContainerHeader::getEnable,0); | |
171 | + shipmentContainerHeader = this.getOne(lam); | |
172 | + if (shipmentContainerHeader == null) { | |
173 | + shipmentContainerHeader = new ShipmentContainerHeader(); | |
174 | + shipmentContainerHeader.setContainerCode(location.getContainerCode()); | |
175 | + shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
176 | + //赋值u8仓库 | |
177 | + shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); | |
178 | + shipmentContainerHeader.setEnable(0); | |
179 | + shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName()); | |
180 | + shipmentContainerHeader.setCreated(null); | |
181 | +// Material material=new Material(); | |
182 | +// material.setCode(shipmentDetail.getMaterialCode()); | |
183 | +// shipmentContainerHeader.setZoneCode(materialService.selectFirstEntity(material).getZoneCode()); | |
184 | + this.save(shipmentContainerHeader); | |
185 | + } | |
186 | + } | |
187 | + return shipmentContainerHeader; | |
188 | + } | |
189 | + | |
190 | + /** | |
191 | + * 查询 容器编码、库存Id、出库明细Id 一致的组盘明细,如果存在则增加组盘数量,如果不存在就新增一条组盘明细 | |
192 | + * @param shipmentDetail | |
193 | + * @param shipmentContainerHeader | |
194 | + * @param shipmentCombinationModel | |
195 | + * @return | |
196 | + */ | |
197 | + private ShipmentContainerDetail ShipmentContainerDetailAdd(ShipmentDetail shipmentDetail, | |
198 | + ShipmentContainerHeader shipmentContainerHeader, | |
199 | + ShipmentCombinationModel shipmentCombinationModel) { | |
200 | + LambdaQueryWrapper<ShipmentContainerDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); | |
201 | + lambdaQueryWrapper.eq(ShipmentContainerDetail::getShippingContainerId,shipmentContainerHeader.getId()) | |
202 | + .eq(ShipmentContainerDetail::getShipmentDetailId,shipmentCombinationModel.getShipmentDetailId()) | |
203 | + .eq(ShipmentContainerDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
204 | + ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getOne(lambdaQueryWrapper); | |
205 | + if(shipmentContainerDetail != null) { | |
206 | + shipmentContainerDetail.setQty(shipmentContainerDetail.getQty().add(shipmentCombinationModel.getShipQty())); | |
207 | + shipmentContainerDetailService.saveOrUpdate(shipmentContainerDetail); | |
208 | + } | |
209 | + else { | |
210 | + //构建明细 | |
211 | + | |
212 | + LambdaQueryWrapper<Material> lam=Wrappers.lambdaQuery(); | |
213 | + lam.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
214 | + .eq(Material::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
215 | + Material material = materialService.getOne(lam); | |
216 | + if (material == null) | |
217 | + throw new ServiceException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料("+ shipmentDetail.getMaterialCode() +")不存在!"); | |
218 | + shipmentContainerDetail = new ShipmentContainerDetail(); | |
219 | + shipmentContainerDetail.setShippingContainerId(shipmentContainerHeader.getId()); | |
220 | + shipmentContainerDetail.setShipmentCode(shipmentDetail.getShipmentCode()); | |
221 | + shipmentContainerDetail.setShipmentId(shipmentDetail.getShipmentId()); | |
222 | + shipmentContainerDetail.setShipmentDetailId(shipmentCombinationModel.getShipmentDetailId()); | |
223 | + shipmentContainerDetail.setMaterialCode(material.getCode()); | |
224 | + shipmentContainerDetail.setMaterialName(material.getName()); | |
225 | + shipmentContainerDetail.setQty(shipmentCombinationModel.getShipQty()); | |
226 | + shipmentContainerDetail.setCreated(null); | |
227 | + shipmentContainerDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
228 | + shipmentContainerDetailService.save(shipmentContainerDetail); | |
229 | + } | |
230 | + return shipmentContainerDetail; | |
231 | + } | |
232 | + | |
13 | 233 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/controller/ShipmentDetailController.java
0 → 100644
1 | +package com.huaheng.pc.shipment.shipmentDetail.controller; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | +import com.huaheng.common.support.Convert; | |
8 | +import com.huaheng.common.utils.StringUtils; | |
9 | +import com.huaheng.common.utils.security.ShiroUtils; | |
10 | +import com.huaheng.framework.aspectj.lang.annotation.Log; | |
11 | +import com.huaheng.framework.aspectj.lang.constant.BusinessType; | |
12 | +import com.huaheng.framework.web.controller.BaseController; | |
13 | +import com.huaheng.framework.web.domain.AjaxResult; | |
14 | +import com.huaheng.framework.web.page.PageDomain; | |
15 | +import com.huaheng.framework.web.page.TableDataInfo; | |
16 | +import com.huaheng.framework.web.page.TableSupport; | |
17 | +import com.huaheng.pc.config.zone.domain.Zone; | |
18 | +import com.huaheng.pc.general.material.domain.Material; | |
19 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
20 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
21 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | |
22 | +import org.springframework.beans.factory.annotation.Autowired; | |
23 | +import org.springframework.stereotype.Controller; | |
24 | +import org.springframework.ui.ModelMap; | |
25 | +import org.springframework.web.bind.annotation.*; | |
26 | + | |
27 | +import java.util.List; | |
28 | + | |
29 | +/** | |
30 | + * 出库明细 信息操作处理 | |
31 | + * | |
32 | + * @author huaheng | |
33 | + * @date 2018-08-19 | |
34 | + */ | |
35 | +@Controller | |
36 | +@RequestMapping("/shipment/shipmentDetail") | |
37 | +public class ShipmentDetailController extends BaseController | |
38 | +{ | |
39 | + private String prefix = "shipment/shipmentDetail"; | |
40 | + | |
41 | + @Autowired | |
42 | + private ShipmentDetailService shipmentDetailService; | |
43 | + | |
44 | + | |
45 | + @RequiresPermissions("shipment:bill:view") | |
46 | + @GetMapping("/{shipmentId}/{shipmentCode}") | |
47 | + public String shipmentDetail(@PathVariable("shipmentId") String shipmentId, @PathVariable("shipmentCode") String shipmentCode,@PathVariable("inventoryStatus") String inventoryStatus, ModelMap mmap) | |
48 | + { | |
49 | + mmap.put("receiptId", shipmentId); | |
50 | + mmap.put("shipmentCode", shipmentCode); | |
51 | + mmap.put("inventoryStatus",inventoryStatus); | |
52 | + return prefix + "/shipmentDetail"; | |
53 | + } | |
54 | + | |
55 | + /** | |
56 | + * 查询出库明细列表 | |
57 | + */ | |
58 | + @RequiresPermissions("shipment:bill:list") | |
59 | + @Log(title = "出库-出库单", operating= "查看出库明细", action = BusinessType.GRANT) | |
60 | + @PostMapping("/list") | |
61 | + @ResponseBody | |
62 | + public TableDataInfo list(ShipmentDetail shipmentDetail) | |
63 | + { | |
64 | + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
65 | + PageDomain pageDomain = TableSupport.buildPageRequest(); | |
66 | + Integer pageNum = pageDomain.getPageNum(); | |
67 | + Integer pageSize = pageDomain.getPageSize(); | |
68 | + | |
69 | + lambdaQueryWrapper | |
70 | + .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
71 | + .eq(ShipmentDetail::getEnable,true) | |
72 | + .eq(StringUtils.isNotEmpty(shipmentDetail.getShipmentCode()),ShipmentDetail::getShipmentCode,shipmentDetail.getShipmentCode()) | |
73 | + .orderByAsc(ShipmentDetail::getId); | |
74 | + | |
75 | + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ | |
76 | + /** | |
77 | + * 使用分页查询 | |
78 | + */ | |
79 | + Page<ShipmentDetail> page = new Page<>(pageNum, pageSize); | |
80 | + IPage<ShipmentDetail> iPage = shipmentDetailService.page(page, lambdaQueryWrapper); | |
81 | + return getMpDataTable(iPage.getRecords(),iPage.getTotal()); | |
82 | + } else { | |
83 | + List<ShipmentDetail> list = shipmentDetailService.list(lambdaQueryWrapper); | |
84 | + return getDataTable(list); | |
85 | + } | |
86 | + } | |
87 | + | |
88 | + /** | |
89 | + * 新增出库明细 | |
90 | + */ | |
91 | + @GetMapping("/add") | |
92 | + public String add(String shipmentId, String shipmentCode,String companyId, String companyCode, String sourceCode, ModelMap mmap) | |
93 | + { | |
94 | + mmap.put("shipmentId", shipmentId); | |
95 | + mmap.put("shipmentCode", shipmentCode); | |
96 | + mmap.put("companyCode", companyCode); | |
97 | + mmap.put("sourceCode", sourceCode); | |
98 | + return prefix + "/add"; | |
99 | + } | |
100 | + | |
101 | + /** | |
102 | + * 新增保存出库明细 | |
103 | + */ | |
104 | + @RequiresPermissions("shipment:bill:add") | |
105 | + @Log(title = "出库-出库单", operating= "新增出库明细", action = BusinessType.INSERT) | |
106 | + @PostMapping("/add") | |
107 | + @ResponseBody | |
108 | + public AjaxResult addSave(ShipmentDetail shipmentDetail) | |
109 | + { | |
110 | + return shipmentDetailService.insertDetail(shipmentDetail); | |
111 | + } | |
112 | + | |
113 | + /** | |
114 | + * 修改出库明细 | |
115 | + */ | |
116 | + @GetMapping("/edit/{id}") | |
117 | + public String edit(@PathVariable("id") Integer id, ModelMap mmap) | |
118 | + { | |
119 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(id); | |
120 | + mmap.put("shipmentDetail", shipmentDetail); | |
121 | + return prefix + "/edit"; | |
122 | + } | |
123 | + | |
124 | + /** | |
125 | + * 修改保存出库明细 | |
126 | + */ | |
127 | + @RequiresPermissions("shipment:bill:edit") | |
128 | + @Log(title = "出库-出库单", operating= "修改出库明细", action = BusinessType.UPDATE) | |
129 | + @PostMapping("/edit") | |
130 | + @ResponseBody | |
131 | + public AjaxResult editSave(ShipmentDetail shipmentDetail) | |
132 | + { | |
133 | + if(shipmentDetailService.saveOrUpdate(shipmentDetail)==false){ | |
134 | + return AjaxResult.error("出库明细修改失败"); | |
135 | + }else { | |
136 | + return AjaxResult.success("出库明细修改成功"); | |
137 | + } | |
138 | + } | |
139 | + | |
140 | + /** | |
141 | + * 删除出库明细 | |
142 | + */ | |
143 | + @RequiresPermissions("shipment:bill:remove") | |
144 | + @Log(title = "出库-出库单", operating= "删除出库明细", action = BusinessType.DELETE) | |
145 | + @PostMapping( "/remove") | |
146 | + @ResponseBody | |
147 | + public AjaxResult remove(String ids) | |
148 | + { | |
149 | + AjaxResult result = shipmentDetailService.deleteDetail(ids); | |
150 | + return result; | |
151 | + } | |
152 | + | |
153 | + | |
154 | + | |
155 | +} | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/domain/ShipmentDetail.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.shipment.shipmentDetail.domain.ShipmentDetail") |
... | ... | @@ -101,14 +102,14 @@ public class ShipmentDetail implements Serializable { |
101 | 102 | */ |
102 | 103 | @TableField(value = "shipQty") |
103 | 104 | @ApiModelProperty(value="发货数量") |
104 | - private Integer shipQty; | |
105 | + private BigDecimal shipQty; | |
105 | 106 | |
106 | 107 | /** |
107 | 108 | * 请求数量 |
108 | 109 | */ |
109 | 110 | @TableField(value = "requestQty") |
110 | 111 | @ApiModelProperty(value="请求数量") |
111 | - private Integer requestQty; | |
112 | + private BigDecimal requestQty; | |
112 | 113 | |
113 | 114 | /** |
114 | 115 | * 分配规则 |
... | ... | @@ -225,9 +226,9 @@ public class ShipmentDetail implements Serializable { |
225 | 226 | /** |
226 | 227 | * 状态 |
227 | 228 | */ |
228 | - @TableField(value = "enable") | |
229 | + @TableField(value = "status") | |
229 | 230 | @ApiModelProperty(value="状态") |
230 | - private Integer enable; | |
231 | + private Integer status; | |
231 | 232 | |
232 | 233 | /** |
233 | 234 | * 波次号 |
... | ... | @@ -642,39 +643,19 @@ public class ShipmentDetail implements Serializable { |
642 | 643 | this.materialUnit = materialUnit; |
643 | 644 | } |
644 | 645 | |
645 | - /** | |
646 | - * 获取发货数量 | |
647 | - * | |
648 | - * @return shipQty - 发货数量 | |
649 | - */ | |
650 | - public Integer getShipQty() { | |
646 | + public BigDecimal getShipQty() { | |
651 | 647 | return shipQty; |
652 | 648 | } |
653 | 649 | |
654 | - /** | |
655 | - * 设置发货数量 | |
656 | - * | |
657 | - * @param shipQty 发货数量 | |
658 | - */ | |
659 | - public void setShipQty(Integer shipQty) { | |
650 | + public void setShipQty(BigDecimal shipQty) { | |
660 | 651 | this.shipQty = shipQty; |
661 | 652 | } |
662 | 653 | |
663 | - /** | |
664 | - * 获取请求数量 | |
665 | - * | |
666 | - * @return requestQty - 请求数量 | |
667 | - */ | |
668 | - public Integer getRequestQty() { | |
654 | + public BigDecimal getRequestQty() { | |
669 | 655 | return requestQty; |
670 | 656 | } |
671 | 657 | |
672 | - /** | |
673 | - * 设置请求数量 | |
674 | - * | |
675 | - * @param requestQty 请求数量 | |
676 | - */ | |
677 | - public void setRequestQty(Integer requestQty) { | |
658 | + public void setRequestQty(BigDecimal requestQty) { | |
678 | 659 | this.requestQty = requestQty; |
679 | 660 | } |
680 | 661 | |
... | ... | @@ -966,22 +947,12 @@ public class ShipmentDetail implements Serializable { |
966 | 947 | this.packingClass = packingClass; |
967 | 948 | } |
968 | 949 | |
969 | - /** | |
970 | - * 获取状态 | |
971 | - * | |
972 | - * @return enable - 状态 | |
973 | - */ | |
974 | - public Integer getEnable() { | |
975 | - return enable; | |
950 | + public Integer getStatus() { | |
951 | + return status; | |
976 | 952 | } |
977 | 953 | |
978 | - /** | |
979 | - * 设置状态 | |
980 | - * | |
981 | - * @param enable 状态 | |
982 | - */ | |
983 | - public void setEnable(Integer enable) { | |
984 | - this.enable = enable; | |
954 | + public void setStatus(Integer status) { | |
955 | + this.status = status; | |
985 | 956 | } |
986 | 957 | |
987 | 958 | /** |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/mapper/ShipmentDetailMapper.java
... | ... | @@ -3,5 +3,18 @@ package com.huaheng.pc.shipment.shipmentDetail.mapper; |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
5 | 5 | |
6 | +import java.util.List; | |
7 | +import java.util.Map; | |
8 | + | |
6 | 9 | public interface ShipmentDetailMapper extends BaseMapper<ShipmentDetail> { |
10 | + | |
11 | + List<Map<String,Integer>> SelectFirstStatus(String ids); | |
12 | + | |
13 | + Integer batchDelete(String[] ids); | |
14 | + | |
15 | + Map<String,String> StatisticalByReceiptId(Integer headerId); | |
16 | + | |
17 | + Integer countUnCompleted(Integer shipmentId); | |
18 | + | |
19 | + | |
7 | 20 | } |
8 | 21 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java
1 | 1 | package com.huaheng.pc.shipment.shipmentDetail.service; |
2 | 2 | |
3 | +import com.huaheng.framework.web.domain.AjaxResult; | |
3 | 4 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
4 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | 6 | public interface ShipmentDetailService extends IService<ShipmentDetail>{ |
6 | 7 | |
8 | + /** | |
9 | + * 新增出库明细 | |
10 | + * | |
11 | + * @param shipmentDetail | |
12 | + * @return | |
13 | + */ | |
14 | + AjaxResult insertDetail(ShipmentDetail shipmentDetail); | |
15 | + | |
16 | + AjaxResult deleteDetail(String id); | |
17 | + | |
18 | + Integer countUnCompleted(Integer shipmentId); | |
19 | + | |
7 | 20 | |
8 | 21 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java
1 | 1 | package com.huaheng.pc.shipment.shipmentDetail.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.utils.DataUtils; | |
6 | +import com.huaheng.common.utils.StringUtils; | |
7 | +import com.huaheng.common.utils.security.ShiroUtils; | |
8 | +import com.huaheng.framework.web.domain.AjaxResult; | |
9 | +import com.huaheng.pc.general.material.domain.Material; | |
10 | +import com.huaheng.pc.general.material.service.MaterialService; | |
11 | +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; | |
12 | +import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | |
13 | +import org.springframework.beans.factory.annotation.Autowired; | |
3 | 14 | import org.springframework.stereotype.Service; |
4 | 15 | import javax.annotation.Resource; |
5 | 16 | import java.util.List; |
17 | +import java.util.Map; | |
18 | + | |
6 | 19 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | 20 | import com.huaheng.pc.shipment.shipmentDetail.mapper.ShipmentDetailMapper; |
8 | 21 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
9 | 22 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; |
23 | +import org.springframework.transaction.annotation.Transactional; | |
24 | + | |
10 | 25 | @Service |
11 | 26 | public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, ShipmentDetail> implements ShipmentDetailService{ |
12 | 27 | |
28 | + @Autowired | |
29 | + private ShipmentHeaderService shipmentHeaderService; | |
30 | + | |
31 | + @Autowired | |
32 | + private MaterialService materialService; | |
33 | + @Resource | |
34 | + private ShipmentDetailMapper shipmentDetailMapper; | |
35 | + | |
36 | + /** | |
37 | + * 新增出库明细 | |
38 | + * | |
39 | + * @param shipmentDetail | |
40 | + * @return | |
41 | + */ | |
42 | + @Override | |
43 | + public AjaxResult insertDetail(ShipmentDetail shipmentDetail) { | |
44 | + //查看主单是否存在 | |
45 | + LambdaQueryWrapper<ShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
46 | + lambdaQueryWrapper.eq(ShipmentHeader::getId,shipmentDetail.getShipmentId()) | |
47 | + .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
48 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(lambdaQueryWrapper); | |
49 | + if (shipmentHeader == null) { | |
50 | + return AjaxResult.error("找不到主单据"); | |
51 | + } | |
52 | + if (shipmentHeader.getFirstStatus() > 100) { | |
53 | + //表示已经加入了波次 | |
54 | + return AjaxResult.error("主单据状态不允许新增明细"); | |
55 | + } | |
56 | + | |
57 | + //查找物料 | |
58 | + LambdaQueryWrapper<Material> lam = Wrappers.lambdaQuery(); | |
59 | + lam.eq(Material::getCode,shipmentDetail.getMaterialCode()) | |
60 | + .eq(Material::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
61 | + Material material = materialService.getOne(lam); | |
62 | + if (material == null) { | |
63 | + return AjaxResult.error("物料未找到"); | |
64 | + } | |
65 | + if (StringUtils.isNotEmpty(material.getCompanyCode()) && | |
66 | + ShiroUtils.getCompanyCodeList().contains(material.getCompanyCode()) == false) | |
67 | + { | |
68 | + return AjaxResult.error("物料不属于当前货主!"); | |
69 | + } | |
70 | + shipmentDetail.setId(null); | |
71 | + shipmentDetail.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
72 | + shipmentDetail.setMaterialCode(material.getCode()); | |
73 | + shipmentDetail.setMaterialName(material.getName()); | |
74 | + shipmentDetail.setReferCode(shipmentHeader.getReferCode()); | |
75 | + shipmentDetail.setReferId(shipmentHeader.getReferId()); | |
76 | + shipmentDetail.setMaterialSpec(material.getSpec()); | |
77 | + shipmentDetail.setMaterialUnit(material.getUnit()); | |
78 | + shipmentDetail.setCreated(null); | |
79 | + shipmentDetail.setCreatedBy(ShiroUtils.getLoginName()); | |
80 | + shipmentDetail.setLastUpdated(null); | |
81 | + shipmentDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
82 | + if (this.save(shipmentDetail)==true){ | |
83 | + //更新单据总行数与总数量 | |
84 | + shipmentHeader.setTotalLines(shipmentHeader.getTotalLines() + 1); | |
85 | + shipmentHeader.setTotalQty(shipmentHeader.getTotalQty().add(shipmentDetail.getShipQty())); | |
86 | + shipmentHeaderService.saveOrUpdate(shipmentHeader); | |
87 | + return AjaxResult.success("新增单据明细成功"); | |
88 | + } | |
89 | + else | |
90 | + return AjaxResult.error("新增单据明细失败"); | |
91 | + } | |
92 | + | |
93 | + | |
94 | + /** | |
95 | + * 删除出库单据明细 | |
96 | + * | |
97 | + * @param id | |
98 | + * @return | |
99 | + */ | |
100 | + @Override | |
101 | + @Transactional | |
102 | + public AjaxResult deleteDetail(String id) { | |
103 | + if (StringUtils.isEmpty(id)) | |
104 | + return AjaxResult.error("id不能为空"); | |
105 | + String[] ids = id.split(","); | |
106 | + List<Map<String,Integer>> list = shipmentDetailMapper.SelectFirstStatus(id); | |
107 | + if (list.size() < 1) { | |
108 | + return AjaxResult.error("找不到主单据!"); | |
109 | + } | |
110 | + if (list.size() > 1) { | |
111 | + return AjaxResult.error("有多个主单据,不能一起删除!"); | |
112 | + } | |
113 | + if (list.get(0).get("firstStatus") > 100) { | |
114 | + return AjaxResult.error("单据状进入订单池,不允许删除明细"); | |
115 | + } | |
116 | + Integer result = shipmentDetailMapper.batchDelete(ids); | |
117 | + if (result > 0) { | |
118 | + Integer headerId=list.get(0).get("id"); | |
119 | + Map<String,String> map= shipmentDetailMapper.StatisticalByReceiptId(headerId); | |
120 | + if(DataUtils.getInteger(map.get("totalLines")) <= 0) { | |
121 | + shipmentHeaderService.removeById(headerId); | |
122 | + } | |
123 | + else { | |
124 | + //更新表头的总行数和总数量统计 | |
125 | + ShipmentHeader shipmentHeader = new ShipmentHeader(); | |
126 | + shipmentHeader.setId(headerId); | |
127 | + shipmentHeader.setTotalLines(DataUtils.getInteger(map.get("totalLines"))); | |
128 | + shipmentHeader.setTotalQty(DataUtils.getBigDecimal(map.get("totalQty"))); | |
129 | + shipmentHeaderService.saveOrUpdate(shipmentHeader); | |
130 | + } | |
131 | + return AjaxResult.success("删除单据明细成功"); | |
132 | + } | |
133 | + else | |
134 | + return AjaxResult.error("删除单据明细失败"); | |
135 | + } | |
136 | + | |
137 | + @Override | |
138 | + public Integer countUnCompleted(Integer shipmentId) { | |
139 | + return shipmentDetailMapper.countUnCompleted(shipmentId); | |
140 | + } | |
13 | 141 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -4,15 +4,19 @@ 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; |
12 | 13 | import com.huaheng.framework.web.domain.AjaxResult; |
14 | +import com.huaheng.framework.web.domain.RetCode; | |
13 | 15 | import com.huaheng.framework.web.page.PageDomain; |
14 | 16 | import com.huaheng.framework.web.page.TableDataInfo; |
15 | 17 | import com.huaheng.framework.web.page.TableSupport; |
18 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
19 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
16 | 20 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
17 | 21 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
18 | 22 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
... | ... | @@ -38,6 +42,8 @@ public class ShipmentHeaderController extends BaseController |
38 | 42 | |
39 | 43 | @Autowired |
40 | 44 | private ShipmentHeaderService shipmentHeaderService; |
45 | + @Autowired | |
46 | + private ShipmentDetailService shipmentDetailService; | |
41 | 47 | |
42 | 48 | |
43 | 49 | @RequiresPermissions("shipment:bill:view") |
... | ... | @@ -64,6 +70,7 @@ public class ShipmentHeaderController extends BaseController |
64 | 70 | lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),ShipmentHeader::getCreated, createdBegin) |
65 | 71 | .le(StringUtils.isNotEmpty(createdEnd), ShipmentHeader::getCreated, createdEnd) |
66 | 72 | .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
73 | + .eq(ShipmentHeader::getDeleted,false) | |
67 | 74 | .eq(StringUtils.isNotEmpty(shipmentHeader.getCode()),ShipmentHeader::getCode,shipmentHeader.getCode()) |
68 | 75 | .eq(StringUtils.isNotEmpty(shipmentHeader.getShipmentType()),ShipmentHeader::getShipmentType,shipmentHeader.getShipmentType()) |
69 | 76 | .eq(StringUtils.isNotEmpty(shipmentHeader.getReferCode()), ShipmentHeader::getReferCode, shipmentHeader.getReferCode()) |
... | ... | @@ -107,108 +114,88 @@ public class ShipmentHeaderController extends BaseController |
107 | 114 | return ajaxResult; |
108 | 115 | } |
109 | 116 | |
110 | -// /** | |
111 | -// * 修改出库单主 | |
112 | -// */ | |
113 | -// @GetMapping("/edit/{id}") | |
114 | -// public String edit(@PathVariable("id") Integer id, ModelMap mmap) | |
115 | -// { | |
116 | -// ShipmentHeader shipmentHeader = shipmentHeaderService.selectEntityById(id); | |
117 | -// mmap.put("shipmentHeader", shipmentHeader); | |
118 | -// return prefix + "/edit"; | |
119 | -// } | |
120 | -// | |
121 | -// /** | |
122 | -// * 修改保存出库单主 | |
123 | -// */ | |
124 | -// @RequiresPermissions("shipment:bill:edit") | |
125 | -// @Log(title = "出库-出库单", operating="修改出库主单", action = BusinessType.UPDATE) | |
126 | -// @PostMapping("/edit") | |
127 | -// @ResponseBody | |
128 | -// public AjaxResult editSave(ShipmentHeader shipmentHeader) | |
129 | -// { | |
130 | -// ShipmentHeader temp = shipmentHeaderService.selectEntityById(shipmentHeader.getId()); | |
131 | -// if(temp.getFirstStatus()>100){ | |
132 | -// return AjaxResult.error("已经超过订单池状态,不能修改"); | |
133 | -// } | |
134 | -// temp.setCompanyCode(shipmentHeader.getCompanyCode()); | |
135 | -// temp.setCompanyId(shipmentHeader.getCompanyId()); | |
136 | -// temp.setSourceCode(shipmentHeader.getSourceCode()); | |
137 | -// temp.setSourcePlatform(shipmentHeader.getSourcePlatform()); | |
138 | -// temp.setShipTo(shipmentHeader.getShipTo()); | |
139 | -// temp.setPriority(shipmentHeader.getPriority()); | |
140 | -// temp.setStation(shipmentHeader.getStation()); | |
141 | -// temp.setRemark(shipmentHeader.getRemark()); | |
142 | -// temp.setUploadremark(shipmentHeader.getUploadremark()); | |
143 | -// temp.setAppointmentTime(shipmentHeader.getAppointmentTime()); | |
144 | -// temp.setEnable(shipmentHeader.getEnable()); | |
145 | -// temp.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
146 | -// temp.setUserDef1(shipmentHeader.getUserDef1()); | |
147 | -// temp.setUserDef2(shipmentHeader.getUserDef2()); | |
148 | -// temp.setUserDef3(shipmentHeader.getUserDef3()); | |
149 | -// return toAjax(shipmentHeaderService.updateByModel(temp)); | |
150 | -// } | |
151 | -// | |
152 | -// /** | |
153 | -// * 删除出库单主 | |
154 | -// */ | |
155 | -// @RequiresPermissions("shipment:bill:remove") | |
156 | -// @Log(title = "出库-出库单", operating="删除出库主单", action = BusinessType.DELETE) | |
157 | -// @PostMapping( "/remove") | |
158 | -// @ResponseBody | |
159 | -// public AjaxResult remove(String ids) { | |
160 | -// if (StringUtils.isEmpty(ids)) | |
161 | -// return AjaxResult.error("id不能为空"); | |
162 | -// for (Integer id : Convert.toIntArray(ids)) | |
163 | -// { | |
164 | -// AjaxResult result = shipmentHeaderService.deleteHeaderAndDetail(id); | |
165 | -// if (result.code != RetCode.SUCCESS.getValue()) | |
166 | -// return result; | |
167 | -// } | |
168 | -// return AjaxResult.success("删除成功!"); | |
169 | -// } | |
170 | -// | |
171 | -// /** | |
172 | -// * 出库单报表打印 | |
173 | -// * @return | |
174 | -// */ | |
175 | -// @RequiresPermissions("shipment:bill:report") | |
176 | -// @Log(title = "出库-出库单", operating="打印出库单报表", action = BusinessType.OTHER) | |
177 | -// @GetMapping("/report/{id}") | |
178 | -// public String report(@PathVariable("id") Integer id, ModelMap mmap) | |
179 | -// { | |
180 | -// ShipmentHeader shipmentHeader = shipmentHeaderService.selectEntityById(id); | |
181 | -// mmap.put("shipmentHeader", shipmentHeader); | |
182 | -// | |
183 | -// ShipmentDetail shipmentDetail = new ShipmentDetail(); | |
184 | -// shipmentDetail.setShipmentId(id); | |
185 | -// List<ShipmentDetail> details = shipmentDetailService.getShipmentDetailListByLike(shipmentDetail); | |
186 | -// mmap.put("details", details); | |
187 | -// | |
188 | -// return prefix + "/report"; | |
189 | -// } | |
190 | -// | |
191 | -// /** | |
192 | -// * 手动组盘 | |
193 | -// */ | |
194 | -// @RequiresPermissions("shipment:bill:view") | |
195 | -// @Log(title = "出库-出库单", operating = "手动组盘", action = BusinessType.OTHER) | |
196 | -// @PostMapping( "/shipping") | |
197 | -// @ResponseBody | |
198 | -// public AjaxResult receive(String code, String ids) | |
199 | -// { | |
200 | -// AjaxResult ajaxResult=new AjaxResult(); | |
201 | -// if(StringUtils.isEmpty(ids)){ | |
202 | -// ajaxResult = shipmentHeaderService.shippings(code); | |
203 | -// }else { | |
204 | -// ajaxResult = shipmentHeaderService.shipping(code, ids.split(",")); | |
205 | -// } | |
206 | -// return ajaxResult; | |
207 | -// } | |
208 | -// | |
209 | -// @PostMapping("/getShipmentHeader") | |
210 | -// @ResponseBody | |
211 | -// public AjaxResult<ShipmentHeader> getShipmentHeader(int id){ | |
212 | -// return AjaxResult.success(shipmentHeaderService.selectEntityById(id)); | |
213 | -// } | |
117 | + /** | |
118 | + * 修改出库单主 | |
119 | + */ | |
120 | + @GetMapping("/edit/{id}") | |
121 | + public String edit(@PathVariable("id") Integer id, ModelMap mmap) | |
122 | + { | |
123 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); | |
124 | + mmap.put("shipmentHeader", shipmentHeader); | |
125 | + return prefix + "/edit"; | |
126 | + } | |
127 | + | |
128 | + /** | |
129 | + * 修改保存出库单主 | |
130 | + */ | |
131 | + @RequiresPermissions("shipment:bill:edit") | |
132 | + @Log(title = "出库-出库单", operating="修改出库主单", action = BusinessType.UPDATE) | |
133 | + @PostMapping("/edit") | |
134 | + @ResponseBody | |
135 | + public AjaxResult editSave(ShipmentHeader shipmentHeader) | |
136 | + { | |
137 | + ShipmentHeader temp = shipmentHeaderService.getById(shipmentHeader.getId()); | |
138 | + if(temp.getFirstStatus()>100){ | |
139 | + return AjaxResult.error("已经超过订单池状态,不能修改"); | |
140 | + } | |
141 | + temp.setCompanyCode(shipmentHeader.getCompanyCode()); | |
142 | + temp.setReferCode(shipmentHeader.getReferCode()); | |
143 | + temp.setReferPlatform(shipmentHeader.getReferPlatform()); | |
144 | + temp.setCustomerCode(shipmentHeader.getCustomerCode()); | |
145 | + temp.setPriority(shipmentHeader.getPriority()); | |
146 | + temp.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
147 | + return toAjax(shipmentHeaderService.saveOrUpdate(temp)); | |
148 | + } | |
149 | + | |
150 | + /** | |
151 | + * 删除出库单主 | |
152 | + */ | |
153 | + @RequiresPermissions("shipment:bill:remove") | |
154 | + @Log(title = "出库-出库单", operating="删除出库主单", action = BusinessType.DELETE) | |
155 | + @PostMapping( "/remove") | |
156 | + @ResponseBody | |
157 | + public AjaxResult remove(String ids) { | |
158 | + if (StringUtils.isEmpty(ids)) | |
159 | + return AjaxResult.error("id不能为空"); | |
160 | + for (Integer id : Convert.toIntArray(ids)) | |
161 | + { | |
162 | + ShipmentHeader shipmentHeader=new ShipmentHeader(); | |
163 | + shipmentHeader.setId(id); | |
164 | + shipmentHeader.setDeleted(true); | |
165 | + boolean result=shipmentHeaderService.updateById(shipmentHeader); | |
166 | + if(result==false){ | |
167 | + return AjaxResult.error("删除失败"); | |
168 | + } | |
169 | + } | |
170 | + return AjaxResult.success("删除成功!"); | |
171 | + } | |
172 | + | |
173 | + /** | |
174 | + * 出库单报表打印 | |
175 | + * @return | |
176 | + */ | |
177 | + @RequiresPermissions("shipment:bill:report") | |
178 | + @Log(title = "出库-出库单", operating="打印出库单报表", action = BusinessType.OTHER) | |
179 | + @GetMapping("/report/{id}") | |
180 | + public String report(@PathVariable("id") Integer id, ModelMap mmap) | |
181 | + { | |
182 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); | |
183 | + mmap.put("shipmentHeader", shipmentHeader); | |
184 | + | |
185 | + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
186 | + lambdaQueryWrapper.eq(ShipmentDetail::getShipmentId,id) | |
187 | + .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
188 | + List<ShipmentDetail> details = shipmentDetailService.list(lambdaQueryWrapper); | |
189 | + mmap.put("details", details); | |
190 | + | |
191 | + return prefix + "/report"; | |
192 | + } | |
193 | + | |
194 | + @PostMapping("/getShipmentHeader") | |
195 | + @ResponseBody | |
196 | + public AjaxResult<ShipmentHeader> getShipmentHeader(int id){ | |
197 | + return AjaxResult.success(shipmentHeaderService.getById(id)); | |
198 | + } | |
199 | + | |
200 | + | |
214 | 201 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/domain/ShipmentHeader.java
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... | ... | @@ -2,6 +2,8 @@ package com.huaheng.pc.shipment.shipmentHeader.service; |
2 | 2 | |
3 | 3 | import com.huaheng.common.utils.security.ShiroUtils; |
4 | 4 | import com.huaheng.framework.web.domain.AjaxResult; |
5 | +import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; | |
6 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | |
5 | 7 | import com.huaheng.pc.system.dict.service.IDictDataService; |
6 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
7 | 9 | import org.springframework.stereotype.Service; |
... | ... | @@ -9,6 +11,8 @@ import javax.annotation.Resource; |
9 | 11 | import java.text.SimpleDateFormat; |
10 | 12 | import java.util.Date; |
11 | 13 | import java.util.List; |
14 | +import java.util.Map; | |
15 | + | |
12 | 16 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | 17 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
14 | 18 | import com.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderMapper; |
... | ... | @@ -20,6 +24,10 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
20 | 24 | private IDictDataService dictDataService; |
21 | 25 | @Resource |
22 | 26 | private ShipmentHeaderMapper shipmentHeaderMapper; |
27 | + @Autowired | |
28 | + private ShipmentDetailService shipmentDetailService; | |
29 | + @Autowired | |
30 | + private ShipmentContainerHeaderService shipmentContainerHeaderService; | |
23 | 31 | |
24 | 32 | |
25 | 33 | //新增出库主单 |
... | ... | @@ -62,4 +70,56 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
62 | 70 | } |
63 | 71 | return code; |
64 | 72 | } |
73 | + | |
74 | + /** | |
75 | + * 根据Id更新这个单据的首尾状态 | |
76 | + * @param shipmentId | |
77 | + * @return | |
78 | + */ | |
79 | + @Override | |
80 | + public AjaxResult updateShipmentStatus(int shipmentId) { | |
81 | + //获取这个单 | |
82 | + ShipmentHeader shipmentHeader = this.getById(shipmentId); | |
83 | + if(shipmentHeader==null){ | |
84 | + return AjaxResult.error("单据未找到,Id:"+shipmentId); | |
85 | + } | |
86 | + //查询是否有生成出库货箱,如果有,则返回出库货箱的最高与最低状态 | |
87 | + Map<String,Integer> map = shipmentContainerHeaderService.getShipmentContainerMaxAndMinStatusByShipmentID(shipmentId); | |
88 | + if(map==null){ | |
89 | + //说明没有货箱,则直接首位均为新建 | |
90 | + shipmentHeader.setFirstStatus(0); | |
91 | + shipmentHeader.setLastStatus(0); | |
92 | + this.saveOrUpdate(shipmentHeader); | |
93 | + }else { | |
94 | + int firstStatus = map.get("maxStatus"); | |
95 | + int lastStatus = map.get("minStatus"); | |
96 | + if(firstStatus<20){ | |
97 | + shipmentHeader.setFirstStatus(200); | |
98 | + } | |
99 | + if(firstStatus==20){ | |
100 | + shipmentHeader.setFirstStatus(300); | |
101 | + } | |
102 | + if(firstStatus==30){ | |
103 | + shipmentHeader.setFirstStatus(500); | |
104 | + } | |
105 | + if(lastStatus<20){ | |
106 | + shipmentHeader.setLastStatus(200); | |
107 | + } | |
108 | + if(lastStatus==20){ | |
109 | + shipmentHeader.setLastStatus(300); | |
110 | + } | |
111 | + if(lastStatus==30){ | |
112 | + shipmentHeader.setLastStatus(500); | |
113 | + } | |
114 | + //是否存在未配盘的数量,如果是,则尾状态为新建 | |
115 | + Integer UnCompleted = shipmentDetailService.countUnCompleted(shipmentId); | |
116 | + if(UnCompleted != null && UnCompleted.intValue() > 0){ | |
117 | + shipmentHeader.setLastStatus(0); | |
118 | + } | |
119 | + this.saveOrUpdate(shipmentHeader); | |
120 | + } | |
121 | + | |
122 | + return AjaxResult.success(""); | |
123 | + | |
124 | + } | |
65 | 125 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
0 → 100644
1 | +package com.huaheng.pc.shipment.shippingCombination.controller; | |
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; | |
8 | +import com.huaheng.framework.web.controller.BaseController; | |
9 | +import com.huaheng.framework.web.domain.AjaxResult; | |
10 | +import com.huaheng.framework.web.page.TableDataInfo; | |
11 | +import com.huaheng.pc.general.material.service.MaterialServiceImpl; | |
12 | +import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | |
13 | +import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; | |
14 | +import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; | |
15 | +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | |
16 | +import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; | |
17 | +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | |
18 | +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailServiceImpl; | |
19 | +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; | |
20 | +import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | |
21 | +import com.huaheng.pc.shipment.shippingCombination.service.ShippingCombinationService; | |
22 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | |
23 | +import org.springframework.beans.factory.annotation.Autowired; | |
24 | +import org.springframework.stereotype.Controller; | |
25 | +import org.springframework.ui.ModelMap; | |
26 | +import org.springframework.web.bind.annotation.*; | |
27 | + | |
28 | +import java.util.List; | |
29 | + | |
30 | +@Controller | |
31 | +@RequestMapping("/shipment/shippingCombination") | |
32 | +public class ShippingCombinationController extends BaseController { | |
33 | + | |
34 | + private String prefix = "shipment/shippingCombination"; | |
35 | + | |
36 | + @Autowired | |
37 | + MaterialServiceImpl materialService; | |
38 | + @Autowired | |
39 | + ShipmentDetailServiceImpl shipmentDetailService; | |
40 | + @Autowired | |
41 | + ShippingCombinationService shippingCombinationService; | |
42 | + @Autowired | |
43 | + ShipmentContainerHeaderService shipmentContainerHeaderService; | |
44 | + @Autowired | |
45 | + ShipmentContainerDetailService shipmentContainerDetailService; | |
46 | + @Autowired | |
47 | + ShipmentHeaderService shipmentHeaderService; | |
48 | + @Autowired | |
49 | + InventoryDetailService inventoryDetailService; | |
50 | + | |
51 | + | |
52 | + /** | |
53 | + * 打开出库组盘页面 | |
54 | + * @param shipmentCode | |
55 | + * @param map | |
56 | + * @return | |
57 | + */ | |
58 | + @RequiresPermissions("shipment:shippingCombination:view") | |
59 | + @GetMapping() | |
60 | + public String ShippingCombination(String shipmentCode, ModelMap map){ | |
61 | + map.put("code", shipmentCode); | |
62 | + return prefix+"/shippingCombination"; | |
63 | + } | |
64 | + | |
65 | + /** | |
66 | + * 获取单据列表 | |
67 | + * @param code | |
68 | + * @return | |
69 | + */ | |
70 | + @GetMapping("/listShipmentDetail") | |
71 | + @ResponseBody | |
72 | + public AjaxResult listShipmentDetail(String code){ | |
73 | + if(StringUtils.isEmpty(code)){ | |
74 | + return null; | |
75 | + } | |
76 | + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
77 | + lambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode,code) | |
78 | + .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
79 | + List<ShipmentDetail> shipmentDetails =shipmentDetailService.list(lambdaQueryWrapper) ; | |
80 | + return AjaxResult.success(shipmentDetails); | |
81 | + } | |
82 | + | |
83 | + | |
84 | + /** | |
85 | + * 获取能出库的库存列表 | |
86 | + * @param code,id | |
87 | + * @return | |
88 | + */ | |
89 | + @PostMapping("/getInventory") | |
90 | + @ResponseBody | |
91 | + public TableDataInfo getInventory(String code, Integer id){ | |
92 | + //找到主单的账套和u8仓库 | |
93 | + LambdaQueryWrapper<ShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
94 | + lambdaQueryWrapper.eq(ShipmentHeader::getCode,code) | |
95 | + .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()); | |
96 | + ShipmentHeader shipmentHeader=shipmentHeaderService.getOne(lambdaQueryWrapper); | |
97 | + if(shipmentHeader==null){ | |
98 | + throw new ServiceException("找不到主单"); | |
99 | + } | |
100 | + //找到子单物料 | |
101 | + ShipmentDetail shipmentDetail=new ShipmentDetail(); | |
102 | + shipmentDetail=shipmentDetailService.getById(id); | |
103 | + if(shipmentDetail==null){ | |
104 | + throw new ServiceException("找不到子单"); | |
105 | + } | |
106 | + LambdaQueryWrapper<InventoryDetail> lam = Wrappers.lambdaQuery(); | |
107 | + lam.eq(InventoryDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) | |
108 | + .eq(InventoryDetail::getCompanyCode,shipmentHeader.getCompanyCode()) | |
109 | + .eq(InventoryDetail::getMaterialName,shipmentDetail.getMaterialCode()); | |
110 | + | |
111 | + List<InventoryDetail> list= inventoryDetailService.list(lam); | |
112 | + return getDataTable(list); | |
113 | + } | |
114 | + | |
115 | + | |
116 | + /** | |
117 | + * 保存组盘 | |
118 | + * @param shipmentCombinationModel | |
119 | + * @return | |
120 | + */ | |
121 | + @RequiresPermissions("shipment:shippingCombination:combination") | |
122 | + @PostMapping("/Addcombination") | |
123 | + @ResponseBody | |
124 | + public AjaxResult Addcombination(ShipmentCombinationModel shipmentCombinationModel){ | |
125 | + AjaxResult ajaxResult = shipmentContainerHeaderService.combination(shipmentCombinationModel); | |
126 | + return ajaxResult; | |
127 | + } | |
128 | + | |
129 | +// /** | |
130 | +// * 自动组盘 | |
131 | +// * @param shipmentCode | |
132 | +// * @return | |
133 | +// */ | |
134 | +// @RequiresPermissions("shipment:shippingCombination:combination") | |
135 | +// @PostMapping("/autoCombination") | |
136 | +// @ResponseBody | |
137 | +// public AjaxResult autoCombination(String shipmentCode){ | |
138 | +// AjaxResult ajaxResult = shipmentContainerHeaderService.autoCombination(shipmentCode); | |
139 | +// return ajaxResult; | |
140 | +// } | |
141 | + | |
142 | + | |
143 | + | |
144 | +// /** 取消组盘 | |
145 | +// * | |
146 | +// * @param shipmentContainerDetailIds | |
147 | +// * @return | |
148 | +// */ | |
149 | +// @RequiresPermissions("shipment:shippingCombination:remove") | |
150 | +// @PostMapping("/cancelCombination") | |
151 | +// @ResponseBody | |
152 | +// public AjaxResult cancelCombination(@RequestBody List<Integer> shipmentContainerDetailIds){ | |
153 | +// return shipmentContainerHeaderService.cancelCombinationDetail(shipmentContainerDetailIds); | |
154 | +// } | |
155 | + | |
156 | + | |
157 | +} | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/domain/ShippingSearch.java
0 → 100644
1 | +package com.huaheng.pc.shipment.shippingCombination.domain; | |
2 | + | |
3 | +import com.huaheng.framework.web.domain.BaseEntity; | |
4 | + | |
5 | +/** | |
6 | + * 组盘实体层 | |
7 | + * @author ricard | |
8 | + * @date 2019.8.14 | |
9 | + */ | |
10 | +public class ShippingSearch extends BaseEntity { | |
11 | + | |
12 | + private String warehouseCode; | |
13 | + private String companyCode; | |
14 | + private String materialCode; | |
15 | + private String locationCode; | |
16 | + private String containerCode; | |
17 | + private String inventorySts; //物料状态; | |
18 | + private String project; //项目号 | |
19 | + private String code;//单号 | |
20 | + | |
21 | + | |
22 | + | |
23 | + public String getCode() { | |
24 | + return code; | |
25 | + } | |
26 | + | |
27 | + public void setCode(String code) { | |
28 | + this.code = code; | |
29 | + } | |
30 | + | |
31 | + public String getProject() { | |
32 | + return project; | |
33 | + } | |
34 | + | |
35 | + public void setProject(String project) { | |
36 | + this.project = project; | |
37 | + } | |
38 | + | |
39 | + public String getWarehouseCode() { | |
40 | + return warehouseCode; | |
41 | + } | |
42 | + | |
43 | + public void setWarehouseCode(String warehouseCode) { | |
44 | + this.warehouseCode = warehouseCode; | |
45 | + } | |
46 | + | |
47 | + public String getCompanyCode() { | |
48 | + return companyCode; | |
49 | + } | |
50 | + | |
51 | + public void setCompanyCode(String companyCode) { | |
52 | + this.companyCode = companyCode; | |
53 | + } | |
54 | + | |
55 | + public String getMaterialCode() { | |
56 | + return materialCode; | |
57 | + } | |
58 | + | |
59 | + public void setMaterialCode(String materialCode) { | |
60 | + this.materialCode = materialCode; | |
61 | + } | |
62 | + | |
63 | + public String getLocationCode() { | |
64 | + return locationCode; | |
65 | + } | |
66 | + | |
67 | + public void setLocationCode(String locationCode) { | |
68 | + this.locationCode = locationCode; | |
69 | + } | |
70 | + | |
71 | + public String getContainerCode() { | |
72 | + return containerCode; | |
73 | + } | |
74 | + | |
75 | + public void setContainerCode(String containerCode) { | |
76 | + this.containerCode = containerCode; | |
77 | + } | |
78 | + | |
79 | + public String getInventorySts() { | |
80 | + return inventorySts; | |
81 | + } | |
82 | + | |
83 | + public void setInventorySts(String inventorySts) { | |
84 | + this.inventorySts = inventorySts; | |
85 | + } | |
86 | +} | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shippingCombination/mapper/ShippingCombinationMapper.java
0 → 100644
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
0 → 100644
src/main/resources/mybatis/shipment/ShipmentContainerHeaderMapper.xml
... | ... | @@ -68,4 +68,10 @@ |
68 | 68 | userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, carrierCode, scaledBy, |
69 | 69 | scaledAt, storeCode, picUrls, pidIds, actualShipDateTime, systemCreated |
70 | 70 | </sql> |
71 | + | |
72 | + <select id="getShipmentContainerMaxAndMinStatusByShipmentID" resultType="java.util.Map"> | |
73 | + SELECT MAX(`status`) maxStatus , MIN(`status`) minStatus from shipment_container_header t join shipment_container_detail b on t.id = b.headerId | |
74 | + WHERE b.shipmentHeaderId = #{shipmentId} | |
75 | + </select> | |
76 | + | |
71 | 77 | </mapper> |
72 | 78 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" /> |
34 | 34 | <result column="dockLoc" jdbcType="VARCHAR" property="dockLoc" /> |
35 | 35 | <result column="packingClass" jdbcType="VARCHAR" property="packingClass" /> |
36 | - <result column="enable" jdbcType="INTEGER" property="enable" /> | |
36 | + <result column="status" jdbcType="INTEGER" property="status" /> | |
37 | 37 | <result column="waveId" jdbcType="INTEGER" property="waveId" /> |
38 | 38 | <result column="created" jdbcType="TIMESTAMP" property="created" /> |
39 | 39 | <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> |
... | ... | @@ -59,4 +59,30 @@ |
59 | 59 | packingClass, `enable`, waveId, created, createdBy, lastUpdated, lastUpdatedBy, version, |
60 | 60 | userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp |
61 | 61 | </sql> |
62 | + | |
63 | + | |
64 | + <select id="SelectFirstStatus" resultType="java.util.Map"> | |
65 | + SELECT h.id, h.firstStatus | |
66 | + FROM shipment_header h | |
67 | + INNER JOIN shipment_detail d ON h.id = d.shipmentId AND d.id IN (#{ids}) | |
68 | + GROUP BY h.id,firstStatus | |
69 | + </select> | |
70 | + | |
71 | + <delete id="batchDelete"> | |
72 | + DELETE FROM shipment_detail WHERE id IN | |
73 | + <foreach item="idItem" collection="array" open="(" separator="," close=")"> | |
74 | + #{idItem} | |
75 | + </foreach> | |
76 | + </delete> | |
77 | + | |
78 | + <select id="StatisticalByReceiptId" resultType="java.util.Map"> | |
79 | + SELECT count(*) as 'totalLines',sum(shipQty) as 'totalQty' | |
80 | + FROM shipment_detail | |
81 | + WHERE shipmentId=#{headerId} | |
82 | + </select> | |
83 | + | |
84 | + <select id="countUnCompleted" resultType="java.lang.Integer"> | |
85 | + SELECT COUNT(*) FROM shipment_detail WHERE shipmentId=#{shipmentId} AND shipQty>requestQty | |
86 | + </select> | |
87 | + | |
62 | 88 | </mapper> |
63 | 89 | \ No newline at end of file |
... | ... |
src/main/resources/templates/shipment/shipmentDetail/add.html
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | <div class="form-group"> |
23 | 23 | <label class="col-sm-3 control-label">上游系统行号:</label> |
24 | 24 | <div class="col-sm-8"> |
25 | - <input id="sourceLine" name="sourceLine" class="form-control" type="text" onkeyup=" this.value=this.value.replace(/^\s+|\s+$/g,'')"> | |
25 | + <input id="referLineNum" name="referLineNum" class="form-control" type="text" onkeyup=" this.value=this.value.replace(/^\s+|\s+$/g,'')"> | |
26 | 26 | </div> |
27 | 27 | </div> |
28 | 28 | <div class="form-group"> |
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | <div class="form-group"> |
47 | 47 | <label class="col-sm-3 control-label">项目号:</label> |
48 | 48 | <div class="col-sm-8"> |
49 | - <input id="project" name="project" class="form-control" type="text"> | |
49 | + <input id="projectNo" name="project" class="form-control" type="text"> | |
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 | <div class="form-group"> |
... | ... | @@ -78,7 +78,7 @@ |
78 | 78 | <div class="form-group"> |
79 | 79 | <label class="col-sm-3 control-label">发货数量:</label> |
80 | 80 | <div class="col-sm-8"> |
81 | - <input id="qty" name="qty" class="form-control" type="text" onkeyup=" this.value=this.value.replace(/^\s+|\s+$/g,'')"> | |
81 | + <input id="shipQty" name="shipQty" class="form-control" type="text" onkeyup=" this.value=this.value.replace(/^\s+|\s+$/g,'')"> | |
82 | 82 | </div> |
83 | 83 | </div> |
84 | 84 | <div class="form-group"> |
... | ... | @@ -133,18 +133,17 @@ |
133 | 133 | data : { |
134 | 134 | "shipmentId": $("input[name='shipmentId']").val(), |
135 | 135 | "shipmentCode": $("input[name='shipmentCode']").val(), |
136 | - "companyId": $("input[name='companyId']").val(), | |
137 | 136 | "companyCode": $("input[name='companyCode']").val(), |
138 | - "sourceLine": $("input[name='sourceLine']").val(), | |
137 | + "referLineNum": $("input[name='referLineNum']").val(), | |
139 | 138 | "materialCode": $("input[name='materialCode']").val(), |
140 | 139 | "batch": $("input[name='batch']").val(), |
141 | 140 | "lot": $("input[name='lot']").val(), |
142 | - "project": $("input[name='project']").val(), | |
141 | + "projectNo": $("input[name='project']").val(), | |
143 | 142 | "manufactureDate": $("input[name='manufactureDate']").val(), |
144 | 143 | "expirationDate": $("input[name='expirationDate']").val(), |
145 | 144 | "agingDate": $("input[name='agingDate']").val(), |
146 | - "inventoryStatus": $("#inventoryStatus option:selected").val(), | |
147 | - "qty": $("input[name='qty']").val(), | |
145 | + "inventorySts": $("#inventoryStatus option:selected").val(), | |
146 | + "shipQty": $("input[name='shipQty']").val(), | |
148 | 147 | "price": $("input[name='price']").val(), |
149 | 148 | "userDef1": $("input[name='userDef1']").val(), |
150 | 149 | "userDef2": $("input[name='userDef2']").val(), |
... | ... |
src/main/resources/templates/shipment/shipmentHeader/edit.html
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | <div class="form-group"> |
16 | 16 | <label class="col-sm-3 control-label">货主:</label> |
17 | 17 | <div class="col-sm-8"> |
18 | - <select id="companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.selectCompanyByCurrentUserId()}" th:field="*{companyId}" readonly="readonly" disabled="disabled"> | |
18 | + <select id="companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.selectCompanyByCurrentUserId()}" th:field="*{companyCode}" readonly="readonly" disabled="disabled"> | |
19 | 19 | <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr="code = ${item['code']}"></option> |
20 | 20 | </select> |
21 | 21 | </div> |
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | <div class="form-group"> |
36 | 36 | <label class="col-sm-3 control-label">出库单类型:</label> |
37 | 37 | <div class="col-sm-8"> |
38 | - <select id="shipmentType" class="form-control" th:with="shipmentType=${@dict.getType('shipmentType')}" th:field="*{type}" readonly="readonly" disabled="disabled"> | |
38 | + <select id="shipmentType" class="form-control" th:with="shipmentType=${@dict.getType('shipmentType')}" th:field="*{shipmentType}" readonly="readonly" disabled="disabled"> | |
39 | 39 | <option th:each="dict : ${shipmentType}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" ></option> |
40 | 40 | </select> |
41 | 41 | </div> |
... | ... |
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... | ... | @@ -110,8 +110,8 @@ |
110 | 110 | <li>仓库编码:<input type="text" name="shipmentWarehouseCode" id="shipmentWarehouseCode"></li> |
111 | 111 | <input type="hidden" name="shipmentCompanyId" id="shipmentCompanyId"> |
112 | 112 | <li>货主:<input type="text" name="shipmentCompanyCode" id="shipmentCompanyCode"></li> |
113 | - <li>上游系统单号:<input type="text" name="shipmentSourceCode" id="shipmentSourceCode"></li> | |
114 | - <li>上游平台:<input type="text" name="shipmentSourcePlatform" id="shipmentSourcePlatform"></li> | |
113 | + <li>erp订单号:<input type="text" name="shipmentSourceCode" id="shipmentSourceCode"></li> | |
114 | + <li>订单平台:<input type="text" name="shipmentSourcePlatform" id="shipmentSourcePlatform"></li> | |
115 | 115 | <li>出库单类型:<input type="text" name="shipmentType" id = "shipmentType"></li> |
116 | 116 | <li>总数量:<input type="text" name="shipmentTotalQty" id="shipmentTotalQty"></li> |
117 | 117 | <li>总行数:<input type="text" name="shipmentTotalLines" id="shipmentTotalLines"></li> |
... | ... | @@ -124,7 +124,6 @@ |
124 | 124 | <div class="select-list"> |
125 | 125 | <ul> |
126 | 126 | <li>客户编码:<input type="text" name="shipmentShipTo" id="shipmentShipTo"></li> |
127 | - <li>发货预约时间:<input type="text" name="shipmentAppointmentTime" id="shipmentAppointmentTime"></li> | |
128 | 127 | </ul> |
129 | 128 | </div> |
130 | 129 | </div> |
... | ... | @@ -132,7 +131,6 @@ |
132 | 131 | <div class="select-list"> |
133 | 132 | <ul> |
134 | 133 | <li>优先级:<input type="text" name="shipmentPriority" id="shipmentPriority"></li> |
135 | - <li>发货站台:<input type="text" name="shipmentStation" id="shipmentStation"></li> | |
136 | 134 | <li></li> |
137 | 135 | </ul> |
138 | 136 | </div> |
... | ... | @@ -140,7 +138,6 @@ |
140 | 138 | <div class="tab-pane fade" id="tabOther"> |
141 | 139 | <div class="select-list"> |
142 | 140 | <ul> |
143 | - <li>备注:<input type="text" name="shipmentRemark" id="shipmentRemark"></li> | |
144 | 141 | <li>扩展属性1:<input type="text" name="shipmentUserDef1" id="shipmentUserDef1"></li> |
145 | 142 | <li>扩展属性2:<input type="text" name="shipmentUserDef2" id="shipmentUserDef2"></li> |
146 | 143 | <li>扩展属性3:<input type="text" name="shipmentUserDef3" id="shipmentUserDef3"></li> |
... | ... | @@ -151,14 +148,10 @@ |
151 | 148 | <div class="tab-pane fade" id="tabSystem"> |
152 | 149 | <div class="select-list"> |
153 | 150 | <ul> |
154 | - <li>上传备注:<input type="text" name="shipmentUploadremark" id="shipmentUploadremark"></li> | |
155 | - <li>上传时间:<input type="text" name="shipmentUploadTime" id="shipmentUploadTime"></li> | |
156 | - <li>上传状态:<input type="text" name="shipmentUploadStatus" id="shipmentUploadStatus"></li> | |
157 | 151 | <li>创建时间:<input type="text" name="shipmentCreated" id="shipmentCreated"></li> |
158 | 152 | <li>创建用户:<input type="text" name="shipmentCreatedBy" id="shipmentCreatedBy"></li> |
159 | 153 | <li>最后修改时间:<input type="text" name="shipmentLastUpdated" id="shipmentLastUpdated"></li> |
160 | 154 | <li>更新用户:<input type="text" name=" shipmentLastUpdatedBy" id="shipmentLastUpdatedBy"></li> |
161 | - <li>是否有效:<input type="text" name="shipmentEnable" id="shipmentEnable"></li> | |
162 | 155 | <li>是否删除:<input type="text" name="shipmentDeleted" id="shipmentDeleted"></li> |
163 | 156 | </ul> |
164 | 157 | </div> |
... | ... | @@ -371,15 +364,6 @@ |
371 | 364 | title: '明细id' |
372 | 365 | }, |
373 | 366 | { |
374 | - field: 'zoneCode', | |
375 | - title: '库区' | |
376 | - }, | |
377 | - | |
378 | - /* { | |
379 | - field: 'shipmentId', | |
380 | - title: '出库单Id' | |
381 | - },*/ | |
382 | - { | |
383 | 367 | field: 'materialCode', |
384 | 368 | title: '存货编码' |
385 | 369 | }, |
... | ... | @@ -388,7 +372,7 @@ |
388 | 372 | title: '物料名称' |
389 | 373 | }, |
390 | 374 | { |
391 | - field: 'specification', | |
375 | + field: 'materialSpec', | |
392 | 376 | title: '物料规格' |
393 | 377 | }, |
394 | 378 | { |
... | ... | @@ -402,7 +386,7 @@ |
402 | 386 | visible:false |
403 | 387 | }, |
404 | 388 | { |
405 | - field: 'project', | |
389 | + field: 'projectNo', | |
406 | 390 | title: '项目号' |
407 | 391 | }, |
408 | 392 | /*{ |
... | ... | @@ -429,18 +413,18 @@ |
429 | 413 | visible:false |
430 | 414 | }, |
431 | 415 | { |
432 | - field: 'inventoryStatus', | |
416 | + field: 'inventorySts', | |
433 | 417 | title: '库存状态', |
434 | 418 | formatter: function(value, row, index) { |
435 | 419 | return $.table.selectDictLabel(inventoryStatus, value); |
436 | 420 | }, |
437 | 421 | }, |
438 | 422 | { |
439 | - field: 'qty', | |
423 | + field: 'shipQty', | |
440 | 424 | title: '发货数量' |
441 | 425 | }, |
442 | 426 | { |
443 | - field: 'qtyCompleted', | |
427 | + field: 'requestQty', | |
444 | 428 | title: '已出数量' |
445 | 429 | }, |
446 | 430 | { |
... | ... | @@ -448,6 +432,10 @@ |
448 | 432 | title : '库存数量' |
449 | 433 | }, |
450 | 434 | { |
435 | + field : 'materialUnit', | |
436 | + title : '物料单位' | |
437 | + }, | |
438 | + { | |
451 | 439 | field : 'status', |
452 | 440 | title : '明细状态', |
453 | 441 | align: 'center', |
... | ... | @@ -456,11 +444,6 @@ |
456 | 444 | } |
457 | 445 | }, |
458 | 446 | { |
459 | - field: 'price', | |
460 | - title: '物料单价', | |
461 | - visible:false | |
462 | - }, | |
463 | - { | |
464 | 447 | field: 'created', |
465 | 448 | title: '创建时间', |
466 | 449 | }, |
... | ... | @@ -481,7 +464,6 @@ |
481 | 464 | align: 'center', |
482 | 465 | formatter: function (value, row, index) { |
483 | 466 | var actions = []; |
484 | - actions.push('<a style="background-color: #f59e00;border: #f59e00" class="btn btn-default btn-xs ' + rossDoccking + '" href="#" onclick="Doccking(\''+ row.id + '\')"><i class="fa fa-send"></i>越库</a> '); | |
485 | 467 | actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
486 | 468 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); |
487 | 469 | return actions.join(''); |
... | ... | @@ -491,13 +473,6 @@ |
491 | 473 | ); |
492 | 474 | |
493 | 475 | |
494 | - /* 越库 */ | |
495 | - function Doccking(id) { | |
496 | - // var url = rossDocckingUrl.replace("{id}", id); | |
497 | - let url=rossDocckingUrl; | |
498 | - var data = { "id": id }; | |
499 | - submit(url, "post", "json", data); | |
500 | - } | |
501 | 476 | |
502 | 477 | function submit(url, type, dataType, data,content) { |
503 | 478 | $.modal.loading("正在处理中,请稍后..."); |
... | ... | @@ -568,35 +543,22 @@ |
568 | 543 | success:function (value) { |
569 | 544 | $('#shipmentId').val(value.data.id); |
570 | 545 | $('#shipmentCode').val(value.data.code); |
571 | - $('#shipmentWarehouseId').val(value.data.warehouseId); | |
572 | 546 | $('#shipmentWarehouseCode').val(value.data.warehouseCode); |
573 | - $('#shipmentCompanyId').val(value.data.companyId); | |
574 | 547 | $('#shipmentCompanyCode').val(value.data.companyCode); |
575 | - $('#shipmentSourceCode').val(value.data.sourceCode); | |
576 | - $('#shipmentSourcePlatform').val(value.data.sourcePlatform); | |
577 | - $('#shipmentType').val(shipmentTypes.filter(function(a){return a.dictValue==value.data.type})[0].dictLabel); | |
578 | - $('#shipmentShipTo').val(value.data.shipTo); | |
548 | + $('#shipmentSourceCode').val(value.data.referCode); | |
549 | + $('#shipmentSourcePlatform').val(value.data.referPlatform); | |
550 | + $('#shipmentType').val(shipmentTypes.filter(function(a){return a.dictValue==value.data.shipmentType})[0].dictLabel); | |
551 | + $('#shipmentShipTo').val(value.data.customerCode); | |
579 | 552 | $('#shipmentPriority').val(value.data.priority); |
580 | - $('#shipmentStation').val(value.data.station); | |
581 | 553 | $('#shipmentTotalQty').val(value.data.totalQty); |
582 | 554 | $('#shipmentTotalLines').val(value.data.totalLines); |
583 | - $('#shipmentRemark').val(value.data.remark); | |
584 | - $('#shipmentUploadremark').val(value.data.uploadremark); | |
585 | - $('#shipmentUploadTime').val(value.data.uploadTime); | |
586 | - $('#shipmentAppointmentTime').val(value.data.appointmentTime); | |
587 | 555 | $('#shipmentFirstStatus').val(shipmentHeaderStatus.filter(function(a){return a.dictValue==value.data.firstStatus})[0].dictLabel); |
588 | 556 | $('#shipmentLastStatus').val(shipmentHeaderStatus.filter(function(a){return a.dictValue==value.data.lastStatus})[0].dictLabel); |
589 | - $('#shipmentUploadStatus').val(uploadStatus.filter(function (a) {return a.dictValue==value.data.uploadStatus})[0].dictLabel); | |
590 | 557 | $('#shipmentCreated').val(value.data.created); |
591 | 558 | $('#shipmentCreatedBy').val(value.data.createdBy); |
592 | 559 | $('#shipmentLastUpdated').val(value.data.lastUpdated); |
593 | 560 | $('#shipmentLastUpdatedBy').val(value.data.lastUpdatedBy); |
594 | 561 | //$('#shipmentEnable').val(value.data.enable); |
595 | - if(value.data.enable==true){ | |
596 | - $('#shipmentEnable').val('是') | |
597 | - }else{ | |
598 | - $('#shipmentEnable').val('否') | |
599 | - }; | |
600 | 562 | //$('#shipmentDeleted').val(value.data.deleted); |
601 | 563 | if(value.data.deleted==false){ |
602 | 564 | $('#shipmentDeleted').val('否') |
... | ... | @@ -688,33 +650,18 @@ |
688 | 650 | /* 出库组盘 */ |
689 | 651 | function Toshipping(auto) { |
690 | 652 | let storage=window.localStorage; |
691 | - if (auto) { | |
692 | - $(".auto-shipment").attr("disabled",true).css("pointer-events","none"); | |
653 | + storage.shipmentCode=shipmentCode; | |
654 | + let url = ctx + "shipment/shippingCombination"; | |
655 | + if(auto){ | |
693 | 656 | storage.auto = auto; |
694 | - let url = ctx + "shipment/shippingCombination"; | |
695 | 657 | createMenuItem(url, "出库自动组盘"); |
696 | - storage.shipmentCode=shipmentCode; | |
697 | 658 | parent.$('.tabReload').click(); |
698 | - $(".auto-shipment").attr("disabled",false).css("pointer-events","auto"); | |
699 | 659 | } |
700 | - else { | |
701 | - var rows=$("#bootstrap-table-detail").bootstrapTable('getSelections'); | |
702 | - if (rows.length == 0) { | |
703 | - $.modal.alertWarning("请至少选择一条记录"); | |
704 | - return; | |
705 | - } | |
706 | - let data = { "ids": rows.map(function(v){return v.id;}).join(',') }; | |
707 | - $(".to-receive").attr("disabled",true).css("pointer-events","none"); | |
708 | - let url = ctx + "shipment/shippingCombination"; | |
660 | + else{ | |
709 | 661 | createMenuItem(url, "出库组盘"); |
710 | - storage.shipids=data.ids; | |
711 | - storage.shipmentCode=shipmentCode; | |
712 | 662 | parent.$('.tabReload').click(); |
713 | - $(".to-receive").attr("disabled",false).css("pointer-events","auto"); | |
714 | 663 | } |
715 | - | |
716 | 664 | } |
717 | - | |
718 | 665 | /* 点击明细面板 */ |
719 | 666 | $("#myTab li:eq(1)").click(function () { |
720 | 667 | if (shipmentId == '') { |
... | ... |