Commit 760f4b7fb2f740b1fe54189363a616721c79512d
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
Showing
17 changed files
with
416 additions
and
60 deletions
src/main/java/com/huaheng/pc/general/location/mapper/LocationMapper.java
@@ -2,6 +2,10 @@ package com.huaheng.pc.general.location.mapper; | @@ -2,6 +2,10 @@ package com.huaheng.pc.general.location.mapper; | ||
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | import com.huaheng.pc.general.location.domain.Location; | 4 | import com.huaheng.pc.general.location.domain.Location; |
5 | +import org.apache.ibatis.annotations.Param; | ||
5 | 6 | ||
6 | public interface LocationMapper extends BaseMapper<Location> { | 7 | public interface LocationMapper extends BaseMapper<Location> { |
8 | + | ||
9 | + void updateStatus(@Param("warehouseCode") String warehouseCode, @Param("code") String code, @Param("status") String status); | ||
10 | + | ||
7 | } | 11 | } |
8 | \ No newline at end of file | 12 | \ No newline at end of file |
src/main/java/com/huaheng/pc/general/location/service/LocationService.java
@@ -6,4 +6,6 @@ public interface LocationService extends IService<Location>{ | @@ -6,4 +6,6 @@ public interface LocationService extends IService<Location>{ | ||
6 | 6 | ||
7 | boolean insertLocation(Location location); | 7 | boolean insertLocation(Location location); |
8 | 8 | ||
9 | + void updateStatus(String locationCode, String status); | ||
10 | + | ||
9 | } | 11 | } |
src/main/java/com/huaheng/pc/general/location/service/LocationServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | import com.huaheng.common.exception.service.ServiceException; | 6 | import com.huaheng.common.exception.service.ServiceException; |
7 | +import com.huaheng.common.utils.StringUtils; | ||
7 | import com.huaheng.common.utils.security.ShiroUtils; | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
8 | import com.huaheng.pc.config.locationType.domain.LocationType; | 9 | import com.huaheng.pc.config.locationType.domain.LocationType; |
9 | import com.huaheng.pc.config.locationType.service.LocationTypeService; | 10 | import com.huaheng.pc.config.locationType.service.LocationTypeService; |
@@ -29,6 +30,8 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -29,6 +30,8 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
29 | private LocationTypeService locationTypeService; | 30 | private LocationTypeService locationTypeService; |
30 | @Resource | 31 | @Resource |
31 | private ZoneService zoneService; | 32 | private ZoneService zoneService; |
33 | + @Resource | ||
34 | + private LocationMapper locationMapper; | ||
32 | 35 | ||
33 | @Override | 36 | @Override |
34 | public boolean insertLocation(Location location) { | 37 | public boolean insertLocation(Location location) { |
@@ -94,4 +97,11 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -94,4 +97,11 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
94 | Boolean result = locationService.saveBatch(locations); | 97 | Boolean result = locationService.saveBatch(locations); |
95 | return result; | 98 | return result; |
96 | } | 99 | } |
100 | + | ||
101 | + @Override | ||
102 | + public void updateStatus(String locationCode, String status) { | ||
103 | + if (StringUtils.isNotEmpty(locationCode)) { | ||
104 | + locationMapper.updateStatus(ShiroUtils.getWarehouseCode(), locationCode, status); | ||
105 | + } | ||
106 | + } | ||
97 | } | 107 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/domain/ShipmentContainerDetail.java
@@ -28,6 +28,20 @@ public class ShipmentContainerDetail implements Serializable { | @@ -28,6 +28,20 @@ public class ShipmentContainerDetail implements Serializable { | ||
28 | private String containerCode; | 28 | private String containerCode; |
29 | 29 | ||
30 | /** | 30 | /** |
31 | + * 库位 | ||
32 | + */ | ||
33 | + @TableField(value = "locationCode") | ||
34 | + @ApiModelProperty(value="库位") | ||
35 | + private String locationCode; | ||
36 | + | ||
37 | + /** | ||
38 | + * 库存Id | ||
39 | + */ | ||
40 | + @TableField(value = "inventoryId") | ||
41 | + @ApiModelProperty(value="库存Id") | ||
42 | + private String inventoryId; | ||
43 | + | ||
44 | + /** | ||
31 | * 出库箱头内部号 | 45 | * 出库箱头内部号 |
32 | */ | 46 | */ |
33 | @TableField(value = "shippingContainerId") | 47 | @TableField(value = "shippingContainerId") |
@@ -381,6 +395,10 @@ public class ShipmentContainerDetail implements Serializable { | @@ -381,6 +395,10 @@ public class ShipmentContainerDetail implements Serializable { | ||
381 | 395 | ||
382 | public static final String COL_CONTAINERCODE = "containerCode"; | 396 | public static final String COL_CONTAINERCODE = "containerCode"; |
383 | 397 | ||
398 | + public static final String COL_LOCATIONCODE = "locationCode"; | ||
399 | + | ||
400 | + public static final String COL_INVENTORYID= "inventoryId"; | ||
401 | + | ||
384 | public static final String COL_SHIPPINGCONTAINERID = "shippingContainerId"; | 402 | public static final String COL_SHIPPINGCONTAINERID = "shippingContainerId"; |
385 | 403 | ||
386 | public static final String COL_SHIPMENTCODE = "shipmentCode"; | 404 | public static final String COL_SHIPMENTCODE = "shipmentCode"; |
@@ -517,6 +535,23 @@ public class ShipmentContainerDetail implements Serializable { | @@ -517,6 +535,23 @@ public class ShipmentContainerDetail implements Serializable { | ||
517 | this.containerCode = containerCode; | 535 | this.containerCode = containerCode; |
518 | } | 536 | } |
519 | 537 | ||
538 | + | ||
539 | + public String getLocationCode() { | ||
540 | + return locationCode; | ||
541 | + } | ||
542 | + | ||
543 | + public void setLocationCode(String locationCode) { | ||
544 | + this.locationCode = locationCode; | ||
545 | + } | ||
546 | + | ||
547 | + public String getInventoryId() { | ||
548 | + return inventoryId; | ||
549 | + } | ||
550 | + | ||
551 | + public void setInventoryId(String inventoryId) { | ||
552 | + this.inventoryId = inventoryId; | ||
553 | + } | ||
554 | + | ||
520 | /** | 555 | /** |
521 | * 获取出库箱头内部号 | 556 | * 获取出库箱头内部号 |
522 | * | 557 | * |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/mapper/ShipmentContainerDetailMapper.java
@@ -2,6 +2,13 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.mapper; | @@ -2,6 +2,13 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.mapper; | ||
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; | 4 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; |
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | +import java.util.Map; | ||
5 | 9 | ||
6 | public interface ShipmentContainerDetailMapper extends BaseMapper<ShipmentContainerDetail> { | 10 | public interface ShipmentContainerDetailMapper extends BaseMapper<ShipmentContainerDetail> { |
11 | + | ||
12 | + List<Map<String, Object>> selectListMapByEqual(@Param("columns") String columns, @Param("condition") ShipmentContainerDetail condition); | ||
13 | + | ||
7 | } | 14 | } |
8 | \ No newline at end of file | 15 | \ No newline at end of file |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/service/ShipmentContainerDetailService.java
@@ -2,7 +2,12 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | @@ -2,7 +2,12 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | ||
2 | 2 | ||
3 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; | 3 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | + | ||
6 | +import java.util.List; | ||
7 | +import java.util.Map; | ||
8 | + | ||
5 | public interface ShipmentContainerDetailService extends IService<ShipmentContainerDetail>{ | 9 | public interface ShipmentContainerDetailService extends IService<ShipmentContainerDetail>{ |
6 | 10 | ||
11 | + List<Map<String, Object>> selectListMapByEqual(String columnList, ShipmentContainerDetail condition); | ||
7 | 12 | ||
8 | } | 13 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/service/ShipmentContainerDetailServiceImpl.java
@@ -3,11 +3,19 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | @@ -3,11 +3,19 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | ||
3 | import org.springframework.stereotype.Service; | 3 | import org.springframework.stereotype.Service; |
4 | import javax.annotation.Resource; | 4 | import javax.annotation.Resource; |
5 | import java.util.List; | 5 | import java.util.List; |
6 | +import java.util.Map; | ||
7 | + | ||
6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | import com.huaheng.pc.shipment.shipmentContainerDetail.mapper.ShipmentContainerDetailMapper; | 9 | import com.huaheng.pc.shipment.shipmentContainerDetail.mapper.ShipmentContainerDetailMapper; |
8 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; | 10 | import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; |
9 | -import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; | ||
10 | @Service | 11 | @Service |
11 | public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentContainerDetailMapper, ShipmentContainerDetail> implements ShipmentContainerDetailService{ | 12 | public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentContainerDetailMapper, ShipmentContainerDetail> implements ShipmentContainerDetailService{ |
12 | 13 | ||
14 | + @Resource | ||
15 | + private ShipmentContainerDetailMapper shipmentContainerDetailMapper; | ||
16 | + | ||
17 | + @Override | ||
18 | + public List<Map<String, Object>> selectListMapByEqual(String columns, ShipmentContainerDetail condition) { | ||
19 | + return shipmentContainerDetailMapper.selectListMapByEqual(columns, condition); | ||
20 | + } | ||
13 | } | 21 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/domain/ShipmentContainerHeader.java
@@ -27,6 +27,14 @@ public class ShipmentContainerHeader implements Serializable { | @@ -27,6 +27,14 @@ public class ShipmentContainerHeader implements Serializable { | ||
27 | @ApiModelProperty(value="出库箱号") | 27 | @ApiModelProperty(value="出库箱号") |
28 | private String containerCode; | 28 | private String containerCode; |
29 | 29 | ||
30 | + | ||
31 | + /** | ||
32 | + * 库位 | ||
33 | + */ | ||
34 | + @TableField(value = "locationCode") | ||
35 | + @ApiModelProperty(value="库位") | ||
36 | + private String locationCode; | ||
37 | + | ||
30 | /** | 38 | /** |
31 | * 仓库 | 39 | * 仓库 |
32 | */ | 40 | */ |
@@ -44,9 +52,9 @@ public class ShipmentContainerHeader implements Serializable { | @@ -44,9 +52,9 @@ public class ShipmentContainerHeader implements Serializable { | ||
44 | /** | 52 | /** |
45 | * 状态 | 53 | * 状态 |
46 | */ | 54 | */ |
47 | - @TableField(value = "enable") | 55 | + @TableField(value = "status") |
48 | @ApiModelProperty(value="状态") | 56 | @ApiModelProperty(value="状态") |
49 | - private Integer enable; | 57 | + private Integer status; |
50 | 58 | ||
51 | /** | 59 | /** |
52 | * 父 | 60 | * 父 |
@@ -386,6 +394,9 @@ public class ShipmentContainerHeader implements Serializable { | @@ -386,6 +394,9 @@ public class ShipmentContainerHeader implements Serializable { | ||
386 | 394 | ||
387 | public static final String COL_CONTAINERCODE = "containerCode"; | 395 | public static final String COL_CONTAINERCODE = "containerCode"; |
388 | 396 | ||
397 | + public static final String COL_LOCATIONCODE = "locationCode"; | ||
398 | + | ||
399 | + | ||
389 | public static final String COL_WAREHOUSECODE = "warehouseCode"; | 400 | public static final String COL_WAREHOUSECODE = "warehouseCode"; |
390 | 401 | ||
391 | public static final String COL_CONTAINERTYPE = "containerType"; | 402 | public static final String COL_CONTAINERTYPE = "containerType"; |
@@ -526,6 +537,14 @@ public class ShipmentContainerHeader implements Serializable { | @@ -526,6 +537,14 @@ public class ShipmentContainerHeader implements Serializable { | ||
526 | this.containerCode = containerCode; | 537 | this.containerCode = containerCode; |
527 | } | 538 | } |
528 | 539 | ||
540 | + public String getLocationCode() { | ||
541 | + return locationCode; | ||
542 | + } | ||
543 | + | ||
544 | + public void setLocationCode(String locationCode) { | ||
545 | + this.locationCode = locationCode; | ||
546 | + } | ||
547 | + | ||
529 | /** | 548 | /** |
530 | * 获取仓库 | 549 | * 获取仓库 |
531 | * | 550 | * |
@@ -562,22 +581,12 @@ public class ShipmentContainerHeader implements Serializable { | @@ -562,22 +581,12 @@ public class ShipmentContainerHeader implements Serializable { | ||
562 | this.containerType = containerType; | 581 | this.containerType = containerType; |
563 | } | 582 | } |
564 | 583 | ||
565 | - /** | ||
566 | - * 获取状态 | ||
567 | - * | ||
568 | - * @return enable - 状态 | ||
569 | - */ | ||
570 | - public Integer getEnable() { | ||
571 | - return enable; | 584 | + public Integer getStatus() { |
585 | + return status; | ||
572 | } | 586 | } |
573 | 587 | ||
574 | - /** | ||
575 | - * 设置状态 | ||
576 | - * | ||
577 | - * @param enable 状态 | ||
578 | - */ | ||
579 | - public void setEnable(Integer enable) { | ||
580 | - this.enable = enable; | 588 | + public void setStatus(Integer status) { |
589 | + this.status = status; | ||
581 | } | 590 | } |
582 | 591 | ||
583 | /** | 592 | /** |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderService.java
1 | package com.huaheng.pc.shipment.shipmentContainerHeader.service; | 1 | package com.huaheng.pc.shipment.shipmentContainerHeader.service; |
2 | 2 | ||
3 | import com.huaheng.framework.web.domain.AjaxResult; | 3 | import com.huaheng.framework.web.domain.AjaxResult; |
4 | +import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail; | ||
4 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | 5 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; |
5 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; | 6 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
6 | import com.baomidou.mybatisplus.extension.service.IService; | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
7 | import org.apache.ibatis.annotations.Param; | 8 | import org.apache.ibatis.annotations.Param; |
8 | 9 | ||
10 | +import java.util.List; | ||
9 | import java.util.Map; | 11 | import java.util.Map; |
10 | 12 | ||
11 | public interface ShipmentContainerHeaderService extends IService<ShipmentContainerHeader>{ | 13 | public interface ShipmentContainerHeaderService extends IService<ShipmentContainerHeader>{ |
@@ -14,7 +16,14 @@ public interface ShipmentContainerHeaderService extends IService<ShipmentContain | @@ -14,7 +16,14 @@ public interface ShipmentContainerHeaderService extends IService<ShipmentContain | ||
14 | 16 | ||
15 | 17 | ||
16 | //出库保存组盘 | 18 | //出库保存组盘 |
17 | - AjaxResult combination(ShipmentCombinationModel shipmentCombination); | 19 | + ShipmentContainerHeader combination(ShipmentCombinationModel shipmentCombination); |
20 | + | ||
21 | + //取消组盘 | ||
22 | + AjaxResult cancelCombinationDetail(List<Integer> detailIds) ; | ||
23 | + | ||
24 | + AjaxResult cancelCombinationDetailInner(List<ShipmentContainerDetail> shipmentContainerDetails) ; | ||
25 | + | ||
26 | + AjaxResult autoCombination(String shipmentCode); | ||
18 | 27 | ||
19 | 28 | ||
20 | } | 29 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
@@ -18,10 +18,13 @@ import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | @@ -18,10 +18,13 @@ import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | ||
18 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; | 18 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; |
19 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; | 19 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
20 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; | 20 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
21 | +import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; | ||
22 | +import com.huaheng.pc.shipment.shippingCombination.service.ShippingCombinationService; | ||
21 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
22 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
23 | import javax.annotation.Resource; | 25 | import javax.annotation.Resource; |
24 | import java.math.BigDecimal; | 26 | import java.math.BigDecimal; |
27 | +import java.util.ArrayList; | ||
25 | import java.util.List; | 28 | import java.util.List; |
26 | import java.util.Map; | 29 | import java.util.Map; |
27 | 30 | ||
@@ -48,6 +51,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -48,6 +51,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
48 | private ShipmentContainerDetailService shipmentContainerDetailService; | 51 | private ShipmentContainerDetailService shipmentContainerDetailService; |
49 | @Autowired | 52 | @Autowired |
50 | private MaterialService materialService; | 53 | private MaterialService materialService; |
54 | + @Autowired | ||
55 | + private ShippingCombinationService shippingCombinationService; | ||
51 | 56 | ||
52 | 57 | ||
53 | @Override | 58 | @Override |
@@ -64,30 +69,30 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -64,30 +69,30 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
64 | */ | 69 | */ |
65 | @Transactional | 70 | @Transactional |
66 | @Override | 71 | @Override |
67 | - public AjaxResult combination(ShipmentCombinationModel shipmentCombinationModel) { | 72 | + public ShipmentContainerHeader combination(ShipmentCombinationModel shipmentCombinationModel) { |
68 | 73 | ||
69 | //校验 | 74 | //校验 |
70 | if(shipmentCombinationModel.getShipQty().compareTo(new BigDecimal("0")) <= 0){ | 75 | if(shipmentCombinationModel.getShipQty().compareTo(new BigDecimal("0")) <= 0){ |
71 | - return AjaxResult.error("出库数量必须大于0"); | 76 | + throw new ServiceException("出库数量必须大于0"); |
72 | } | 77 | } |
73 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentCombinationModel.getShipmentDetailId()); | 78 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentCombinationModel.getShipmentDetailId()); |
74 | if(shipmentDetail==null){ | 79 | if(shipmentDetail==null){ |
75 | - return AjaxResult.error("出库明细未找到"); | 80 | + throw new ServiceException("出库明细未找到"); |
76 | } | 81 | } |
77 | InventoryDetail inventoryDetail = inventoryDetailService.getById((shipmentCombinationModel.getInventoryDetailId())); | 82 | InventoryDetail inventoryDetail = inventoryDetailService.getById((shipmentCombinationModel.getInventoryDetailId())); |
78 | if(inventoryDetail==null){ | 83 | if(inventoryDetail==null){ |
79 | - return AjaxResult.error("库存未找到"); | 84 | + throw new ServiceException("库存未找到"); |
80 | } | 85 | } |
81 | //校验数量是否超出 | 86 | //校验数量是否超出 |
82 | if((shipmentDetail.getShipQty().subtract(shipmentDetail.getRequestQty())).compareTo(shipmentCombinationModel.getShipQty())<0){ | 87 | if((shipmentDetail.getShipQty().subtract(shipmentDetail.getRequestQty())).compareTo(shipmentCombinationModel.getShipQty())<0){ |
83 | - return AjaxResult.error("录入数量超出明细待出数量"); | 88 | + throw new ServiceException("录入数量超出明细待出数量"); |
84 | } | 89 | } |
85 | //校验库存可用数量 | 90 | //校验库存可用数量 |
86 | if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).subtract(inventoryDetail.getLockedQty()).compareTo(shipmentCombinationModel.getShipQty())<0){ | 91 | if(inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()).subtract(inventoryDetail.getLockedQty()).compareTo(shipmentCombinationModel.getShipQty())<0){ |
87 | - return AjaxResult.error("录入数量超出可出数量"); | 92 | + throw new ServiceException("录入数量超出可出数量"); |
88 | } | 93 | } |
89 | if(!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())){ | 94 | if(!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())){ |
90 | - return AjaxResult.error("配盘物料不一致"); | 95 | + throw new ServiceException("配盘物料不一致"); |
91 | } | 96 | } |
92 | //库位 | 97 | //库位 |
93 | LambdaQueryWrapper<Location> lambdaQueryWrapper= Wrappers.lambdaQuery(); | 98 | LambdaQueryWrapper<Location> lambdaQueryWrapper= Wrappers.lambdaQuery(); |
@@ -95,7 +100,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -95,7 +100,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
95 | .eq(Location::getCode,inventoryDetail.getLocationCode()); | 100 | .eq(Location::getCode,inventoryDetail.getLocationCode()); |
96 | Location location = locationService.getOne(lambdaQueryWrapper); | 101 | Location location = locationService.getOne(lambdaQueryWrapper); |
97 | if (location == null) | 102 | if (location == null) |
98 | - return AjaxResult.error("库位 "+ inventoryDetail.getLocationCode() +" 不存在"); | 103 | + throw new ServiceException("库位 "+ inventoryDetail.getLocationCode() +" 不存在"); |
99 | if (location.getStatus().equals("lock")) { | 104 | if (location.getStatus().equals("lock")) { |
100 | //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | 105 | //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 |
101 | LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | 106 | LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); |
@@ -104,7 +109,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -104,7 +109,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
104 | .eq(ShipmentContainerHeader::getTaskCreated,0); | 109 | .eq(ShipmentContainerHeader::getTaskCreated,0); |
105 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | 110 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); |
106 | if (shipmentContainerHeader == null) { | 111 | if (shipmentContainerHeader == null) { |
107 | - return AjaxResult.error("库位已经锁定不能使用"); | 112 | + throw new ServiceException("库位已经锁定不能使用"); |
108 | } | 113 | } |
109 | } | 114 | } |
110 | 115 | ||
@@ -141,7 +146,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -141,7 +146,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
141 | //更新单据状态 | 146 | //更新单据状态 |
142 | shipmentHeaderService.updateShipmentStatus(shipmentDetail.getShipmentId()); | 147 | shipmentHeaderService.updateShipmentStatus(shipmentDetail.getShipmentId()); |
143 | 148 | ||
144 | - return AjaxResult.success("成功"); | 149 | + return shipmentContainerHeader; |
145 | } | 150 | } |
146 | 151 | ||
147 | /** | 152 | /** |
@@ -157,7 +162,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -157,7 +162,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
157 | lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | 162 | lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) |
158 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | 163 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
159 | .eq(ShipmentContainerHeader::getTaskCreated,1) | 164 | .eq(ShipmentContainerHeader::getTaskCreated,1) |
160 | - .eq(ShipmentContainerHeader::getEnable,10); | 165 | + .eq(ShipmentContainerHeader::getStatus,10); |
161 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); | 166 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); |
162 | if(shipmentContainerHeader != null) { | 167 | if(shipmentContainerHeader != null) { |
163 | throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;"); | 168 | throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;"); |
@@ -167,7 +172,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -167,7 +172,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
167 | lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | 172 | lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) |
168 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | 173 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
169 | .eq(ShipmentContainerHeader::getTaskCreated,0) | 174 | .eq(ShipmentContainerHeader::getTaskCreated,0) |
170 | - .eq(ShipmentContainerHeader::getEnable,0); | 175 | + .eq(ShipmentContainerHeader::getStatus,0); |
171 | shipmentContainerHeader = this.getOne(lam); | 176 | shipmentContainerHeader = this.getOne(lam); |
172 | if (shipmentContainerHeader == null) { | 177 | if (shipmentContainerHeader == null) { |
173 | shipmentContainerHeader = new ShipmentContainerHeader(); | 178 | shipmentContainerHeader = new ShipmentContainerHeader(); |
@@ -175,7 +180,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -175,7 +180,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
175 | shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); | 180 | shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
176 | //赋值u8仓库 | 181 | //赋值u8仓库 |
177 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); | 182 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); |
178 | - shipmentContainerHeader.setEnable(0); | 183 | + shipmentContainerHeader.setStatus(0); |
179 | shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName()); | 184 | shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName()); |
180 | shipmentContainerHeader.setCreated(null); | 185 | shipmentContainerHeader.setCreated(null); |
181 | // Material material=new Material(); | 186 | // Material material=new Material(); |
@@ -230,4 +235,132 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -230,4 +235,132 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
230 | return shipmentContainerDetail; | 235 | return shipmentContainerDetail; |
231 | } | 236 | } |
232 | 237 | ||
238 | + | ||
239 | + /** | ||
240 | + * 取消组盘的一组明细 | ||
241 | + * @param detailIds | ||
242 | + * @return | ||
243 | + */ | ||
244 | + @Override | ||
245 | + public AjaxResult cancelCombinationDetail(List<Integer> detailIds) { | ||
246 | + List<ShipmentContainerDetail> shipmentContainerDetails = new ArrayList<>(); | ||
247 | + for(int detailId:detailIds){ | ||
248 | + ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(detailId); | ||
249 | + shipmentContainerDetails.add(shipmentContainerDetail); | ||
250 | + } | ||
251 | + return cancelCombinationDetailInner(shipmentContainerDetails); | ||
252 | + } | ||
253 | + | ||
254 | + /** | ||
255 | + * 取消组盘的一组明细 | ||
256 | + * @param shipmentContainerDetails | ||
257 | + * @return | ||
258 | + */ | ||
259 | + @Override | ||
260 | + @Transactional | ||
261 | + public AjaxResult cancelCombinationDetailInner(List<ShipmentContainerDetail> shipmentContainerDetails) { | ||
262 | + for(ShipmentContainerDetail shipmentContainerDetail:shipmentContainerDetails){ | ||
263 | + //获取头 | ||
264 | + ShipmentContainerHeader shipmentContainerHeader = this.getById(shipmentContainerDetail.getShippingContainerId()); | ||
265 | + if(shipmentContainerHeader.getStatus()>9){ | ||
266 | + return AjaxResult.error("容器"+shipmentContainerHeader.getContainerCode()+"非新建状态,不允许取消明细"); | ||
267 | + } | ||
268 | + //恢复占用库存 | ||
269 | + InventoryDetail inventoryDetail = inventoryDetailService.getById(shipmentContainerDetail.getInventoryId()); | ||
270 | + inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(shipmentContainerDetail.getQty())); | ||
271 | + inventoryDetailService.saveOrUpdate(inventoryDetail); | ||
272 | + //恢复单据发货数量 | ||
273 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); | ||
274 | + shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().subtract(shipmentContainerDetail.getQty())); | ||
275 | + if(shipmentDetail.getRequestQty().compareTo(BigDecimal.ZERO) != 0 ){ | ||
276 | + shipmentDetail.setStatus(200);//明细状态恢复,如果删除后还有以出数量就是波次 | ||
277 | + }else{ | ||
278 | + shipmentDetail.setStatus(0 );//明细状态 | ||
279 | + } | ||
280 | + shipmentDetailService.saveOrUpdate(shipmentDetail); | ||
281 | + //删除这个配盘明细 | ||
282 | + shipmentContainerDetailService.removeById(shipmentContainerDetail.getId()); | ||
283 | + | ||
284 | + //查询头表下还有没有明细,如果没有,则删了这个头表 | ||
285 | + ShipmentContainerDetail condition = new ShipmentContainerDetail(); | ||
286 | + condition.setShippingContainerId(shipmentContainerDetail.getShippingContainerId()); | ||
287 | + List<Map<String, Object>> list= shipmentContainerDetailService.selectListMapByEqual("id", condition); | ||
288 | + if(list==null||list.size() == 0){ | ||
289 | + this.removeById(shipmentContainerHeader.getId()); | ||
290 | + locationService.updateStatus(shipmentContainerHeader.getLocationCode(),"empty"); | ||
291 | + } | ||
292 | + //更新单据状态 | ||
293 | + shipmentHeaderService.updateShipmentStatus(shipmentDetail.getShipmentId()); | ||
294 | + } | ||
295 | + return AjaxResult.success(""); | ||
296 | + } | ||
297 | + | ||
298 | + | ||
299 | + /** | ||
300 | + * 出库自动组盘 | ||
301 | + * @param shipmentCode | ||
302 | + * @return | ||
303 | + */ | ||
304 | + @Override | ||
305 | + @Transactional | ||
306 | + public AjaxResult autoCombination(String shipmentCode) { | ||
307 | + int num=0; | ||
308 | + AjaxResult ajaxResult=new AjaxResult(); | ||
309 | + | ||
310 | + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); | ||
311 | + lambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode,shipmentCode) | ||
312 | + .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); | ||
313 | + List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(lambdaQueryWrapper); | ||
314 | + if(shipmentDetailList.size()<1 || shipmentDetailList==null){ | ||
315 | + return AjaxResult.error("找不到子单链"); | ||
316 | + } | ||
317 | + for (ShipmentDetail item : shipmentDetailList) { | ||
318 | + //获取需要出库数量 | ||
319 | + BigDecimal shipmentQty = item.getShipQty().subtract(item.getRequestQty()); | ||
320 | + //判断是否还有需要出库的物料,如果没有就跳过该物料 | ||
321 | + if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) { | ||
322 | + continue; | ||
323 | + } | ||
324 | + // 根据 仓库编码、货主编码、存货编码,物料状态,项目号来查找可以出库的物料 | ||
325 | + ShippingSearch search = new ShippingSearch(); | ||
326 | + search.setWarehouseCode(ShiroUtils.getWarehouseCode()); | ||
327 | + search.setCompanyCode(item.getCompanyCode()); | ||
328 | + search.setMaterialCode(item.getMaterialCode()); | ||
329 | + search.setInventorySts(item.getInventorySts()); //物料状态 | ||
330 | + | ||
331 | + List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(search); | ||
332 | + if (inventoryList.size() < 1) { | ||
333 | + num = num + 1; | ||
334 | + } else { | ||
335 | + for (InventoryDetail inventory : inventoryList) { | ||
336 | + //判断是否组盘完毕,完毕就退出内循环 | ||
337 | + if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) { | ||
338 | + break; | ||
339 | + } | ||
340 | + | ||
341 | + BigDecimal inventoryQty = inventory.getQty().subtract(inventory.getTaskQty()); | ||
342 | + ShipmentCombinationModel shipmentCombination = new ShipmentCombinationModel(); | ||
343 | + shipmentCombination.setInventoryDetailId(inventory.getId()); | ||
344 | + shipmentCombination.setShipmentDetailId(item.getId()); | ||
345 | + shipmentCombination.setType((short) 300); | ||
346 | + List<Integer> list=new ArrayList<>(); | ||
347 | + //如果库存数 >= 待出库数,组盘数就是待出库数并且结束组盘,否则组盘数就是库存数 | ||
348 | + if (inventoryQty.compareTo(shipmentQty) > -1) { | ||
349 | + shipmentCombination.setShipQty(shipmentQty); | ||
350 | + ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination); | ||
351 | + } else { | ||
352 | + shipmentCombination.setShipQty(inventoryQty); | ||
353 | + ShipmentContainerHeader shipmentContainerHeader=this.combination(shipmentCombination); | ||
354 | + list.add(shipmentContainerHeader.getId()); | ||
355 | + } | ||
356 | + shipmentQty = shipmentQty.subtract(shipmentCombination.getShipQty()); | ||
357 | + } | ||
358 | + } | ||
359 | + } | ||
360 | + if(num==shipmentDetailList.size()){ | ||
361 | + throw new ServiceException("单据物料在此库区没有库存,无法出库"); | ||
362 | + } | ||
363 | + return AjaxResult.success(""); | ||
364 | + } | ||
365 | + | ||
233 | } | 366 | } |
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
@@ -13,6 +13,7 @@ import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | @@ -13,6 +13,7 @@ import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | ||
13 | import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; | 13 | import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; |
14 | import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; | 14 | import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService; |
15 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; | 15 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel; |
16 | +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; | ||
16 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; | 17 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
17 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; | 18 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
18 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailServiceImpl; | 19 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailServiceImpl; |
@@ -122,36 +123,36 @@ public class ShippingCombinationController extends BaseController { | @@ -122,36 +123,36 @@ public class ShippingCombinationController extends BaseController { | ||
122 | @PostMapping("/Addcombination") | 123 | @PostMapping("/Addcombination") |
123 | @ResponseBody | 124 | @ResponseBody |
124 | public AjaxResult Addcombination(ShipmentCombinationModel shipmentCombinationModel){ | 125 | public AjaxResult Addcombination(ShipmentCombinationModel shipmentCombinationModel){ |
125 | - AjaxResult ajaxResult = shipmentContainerHeaderService.combination(shipmentCombinationModel); | ||
126 | - return ajaxResult; | 126 | + ShipmentContainerHeader shipmentContainerHeader= shipmentContainerHeaderService.combination(shipmentCombinationModel); |
127 | + return AjaxResult.success(shipmentContainerHeader.getId()); | ||
127 | } | 128 | } |
128 | 129 | ||
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 | -// } | 130 | + /** |
131 | + * 自动组盘 | ||
132 | + * @param shipmentCode | ||
133 | + * @return | ||
134 | + */ | ||
135 | + @RequiresPermissions("shipment:shippingCombination:combination") | ||
136 | + @PostMapping("/autoCombination") | ||
137 | + @ResponseBody | ||
138 | + public AjaxResult autoCombination(String shipmentCode){ | ||
139 | + AjaxResult ajaxResult = shipmentContainerHeaderService.autoCombination(shipmentCode); | ||
140 | + return ajaxResult; | ||
141 | + } | ||
142 | + | ||
143 | + | ||
144 | + | ||
145 | + /** 取消组盘 | ||
146 | + * | ||
147 | + * @param shipmentContainerDetailIds | ||
148 | + * @return | ||
149 | + */ | ||
150 | + @RequiresPermissions("shipment:shippingCombination:remove") | ||
151 | + @PostMapping("/cancelCombination") | ||
152 | + @ResponseBody | ||
153 | + public AjaxResult cancelCombination(@RequestBody List<Integer> shipmentContainerDetailIds){ | ||
154 | + return shipmentContainerHeaderService.cancelCombinationDetail(shipmentContainerDetailIds); | ||
155 | + } | ||
155 | 156 | ||
156 | 157 | ||
157 | } | 158 | } |
src/main/java/com/huaheng/pc/shipment/shippingCombination/mapper/ShippingCombinationMapper.java
1 | package com.huaheng.pc.shipment.shippingCombination.mapper; | 1 | package com.huaheng.pc.shipment.shippingCombination.mapper; |
2 | 2 | ||
3 | 3 | ||
4 | +import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | ||
5 | +import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
4 | public interface ShippingCombinationMapper { | 9 | public interface ShippingCombinationMapper { |
5 | 10 | ||
11 | + List<InventoryDetail> getInventorys(ShippingSearch search); | ||
12 | + | ||
6 | } | 13 | } |
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
1 | package com.huaheng.pc.shipment.shippingCombination.service; | 1 | package com.huaheng.pc.shipment.shippingCombination.service; |
2 | 2 | ||
3 | 3 | ||
4 | +import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; | ||
5 | +import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch; | ||
6 | +import com.huaheng.pc.shipment.shippingCombination.mapper.ShippingCombinationMapper; | ||
4 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
5 | 8 | ||
9 | +import javax.annotation.Resource; | ||
10 | +import java.util.List; | ||
11 | + | ||
6 | 12 | ||
7 | @Service | 13 | @Service |
8 | public class ShippingCombinationService { | 14 | public class ShippingCombinationService { |
9 | 15 | ||
16 | + @Resource | ||
17 | + private ShippingCombinationMapper shippingCombinationMapper; | ||
18 | + | ||
19 | + | ||
20 | + public List<InventoryDetail> getInventorys(ShippingSearch search) { | ||
21 | + List<InventoryDetail> list = shippingCombinationMapper.getInventorys(search); | ||
22 | + return list; | ||
23 | + } | ||
24 | + | ||
10 | } | 25 | } |
src/main/resources/mybatis/general/LocationMapper.xml
@@ -38,4 +38,8 @@ | @@ -38,4 +38,8 @@ | ||
38 | version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, | 38 | version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, |
39 | systemCreated | 39 | systemCreated |
40 | </sql> | 40 | </sql> |
41 | + | ||
42 | + <update id="updateStatus"> | ||
43 | + UPDATE location set `status`=#{status} WHERE warehouseCode=#{warehouseCode} AND `code`=#{code} | ||
44 | + </update> | ||
41 | </mapper> | 45 | </mapper> |
42 | \ No newline at end of file | 46 | \ No newline at end of file |
src/main/resources/mybatis/shipment/ShipmentCombinationMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.huaheng.pc.shipment.shippingCombination.mapper.ShippingCombinationMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch"> | ||
5 | + <!--@mbg.generated--> | ||
6 | + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> | ||
7 | + <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> | ||
8 | + <result column="code" jdbcType="VARCHAR" property="code" /> | ||
9 | + <result column="materialCode" jdbcType="VARCHAR" property="materialCode" /> | ||
10 | + <result column="locationCode" jdbcType="VARCHAR" property="locationCode" /> | ||
11 | + <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> | ||
12 | + <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" /> | ||
13 | + <result column="project" jdbcType="VARCHAR" property="project" /> | ||
14 | + <result column="code" jdbcType="VARCHAR" property="code" /> | ||
15 | + </resultMap> | ||
16 | + <sql id="Base_Column_List"> | ||
17 | + <!--@mbg.generated--> | ||
18 | + warehouseCode, companyCode, code, materialCode, locationCode, `containerCode`, inventorySts, | ||
19 | + project | ||
20 | + </sql> | ||
21 | + | ||
22 | + <select id="getInventorys" resultType="com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail"> | ||
23 | + SELECT i.id, i.warehouseId, i.warehouseCode, i.locationId, i.locationCode, i.containerCode, | ||
24 | + i.sourceCode, i.sourceLine, i.companyId, i.companyCode, i.materialId, i.materialCode, | ||
25 | + i.receiptId, i.receiptCode, i.receiptDetailId, i.batch, i.lot, i.project, i.manufactureDate, | ||
26 | + i.expirationDate, i.status, i.qty, i.taskQty, i.costPrice, i.listPrice, i.netPrice, i.created, | ||
27 | + i.createdBy, i.lastUpdated, i.lastUpdatedBy, i.userDef1, i.userDef2, i.userDef3, i.deleted, | ||
28 | + m.name materialName, m.userDef1 materialOldCode ,i.zoneCode | ||
29 | + FROM inventory i | ||
30 | + INNER JOIN material m ON i.materialCode = m.code | ||
31 | + AND i.companyCode=#{companyCode} | ||
32 | + AND i.warehouseCode=#{warehouseCode} | ||
33 | + AND m.warehouseCode=#{warehouseCode} | ||
34 | + AND i.qty > i.taskQty | ||
35 | + AND i.materialCode=#{materialCode} | ||
36 | + | ||
37 | + INNER JOIN location l ON i.locationCode = l.code | ||
38 | + AND l.warehouseCode=#{warehouseCode} | ||
39 | + LEFT JOIN shipment_container_header s ON i.locationCode = s.locationCode | ||
40 | + AND s.status=0 | ||
41 | + AND s.warehouseCode=#{warehouseCode} | ||
42 | + <where> | ||
43 | + <if test="project != null and project != ''"> | ||
44 | + AND i.project = #{project} | ||
45 | + </if> | ||
46 | + <if test="inventoryStatus != null and inventoryStatus != '' "> | ||
47 | + AND i.status = #{inventoryStatus} | ||
48 | + </if> | ||
49 | + <if test="locationCode != null and locationCode != '' "> | ||
50 | + AND i.locationCode = #{locationCode} | ||
51 | + </if> | ||
52 | + <if test="containerCode != null and containerCode != '' "> | ||
53 | + AND i.containerCode = #{containerCode} | ||
54 | + </if> | ||
55 | + <if test="params != null and params.createdBegin != null and params.createdBegin != ''"> | ||
56 | + AND i.created >= #{params.createdBegin} | ||
57 | + </if> | ||
58 | + <if test="params != null and params.createdEnd != null and params.createdEnd != ''"> | ||
59 | + AND i.created <= #{params.createdEnd} | ||
60 | + </if> | ||
61 | + AND l.status='empty' OR (l.status='lock' AND s.id IS NOT NULL) | ||
62 | + </where> | ||
63 | + </select> | ||
64 | +</mapper> | ||
0 | \ No newline at end of file | 65 | \ No newline at end of file |
src/main/resources/mybatis/shipment/ShipmentContainerDetailMapper.xml
@@ -67,4 +67,47 @@ | @@ -67,4 +67,47 @@ | ||
67 | version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, | 67 | version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, |
68 | processStamp | 68 | processStamp |
69 | </sql> | 69 | </sql> |
70 | + | ||
71 | + <select id="selectListMapByEqual" resultType="java.util.HashMap"> | ||
72 | + SELECT ${columns} FROM shipment_container_detail | ||
73 | + <where> | ||
74 | + <if test="condition.id != null"> | ||
75 | + AND id = #{condition.id} | ||
76 | + </if> | ||
77 | + <if test="condition.headerId != null"> | ||
78 | + AND headerId = #{condition.headerId} | ||
79 | + </if> | ||
80 | + <if test="condition.shipmentCode != null"> | ||
81 | + AND shipmentCode = #{condition.shipmentCode} | ||
82 | + </if> | ||
83 | + <if test="condition.shipmentHeaderId != null"> | ||
84 | + AND shipmentHeaderId = #{condition.shipmentHeaderId} | ||
85 | + </if> | ||
86 | + <if test="condition.shipmentDetailId != null"> | ||
87 | + AND shipmentDetailId = #{condition.shipmentDetailId} | ||
88 | + </if> | ||
89 | + <if test="condition.materialCode != null"> | ||
90 | + AND materialCode = #{condition.materialCode} | ||
91 | + </if> | ||
92 | + <if test="condition.materialName != null"> | ||
93 | + AND materialName = #{condition.materialName} | ||
94 | + </if> | ||
95 | + <if test="condition.qty != null"> | ||
96 | + AND qty = #{condition.qty} | ||
97 | + </if> | ||
98 | + <if test="condition.inventoryId != null"> | ||
99 | + AND inventoryId = #{condition.inventoryId} | ||
100 | + </if> | ||
101 | + <if test="condition.created != null"> | ||
102 | + AND created = #{condition.created} | ||
103 | + </if> | ||
104 | + <if test="condition.createdBy != null"> | ||
105 | + AND createdBy = #{condition.createdBy} | ||
106 | + </if> | ||
107 | + <if test="condition.project != null"> | ||
108 | + AND project = #{condition.project} | ||
109 | + </if> | ||
110 | + </where> | ||
111 | + </select> | ||
112 | + | ||
70 | </mapper> | 113 | </mapper> |
71 | \ No newline at end of file | 114 | \ No newline at end of file |
src/main/resources/mybatis/shipment/ShipmentContainerHeaderMapper.xml
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> | 7 | <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> |
8 | <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> | 8 | <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> |
9 | <result column="containerType" jdbcType="VARCHAR" property="containerType" /> | 9 | <result column="containerType" jdbcType="VARCHAR" property="containerType" /> |
10 | - <result column="enable" jdbcType="INTEGER" property="enable" /> | 10 | + <result column="enable" jdbcType="INTEGER" property="status" /> |
11 | <result column="parent" jdbcType="INTEGER" property="parent" /> | 11 | <result column="parent" jdbcType="INTEGER" property="parent" /> |
12 | <result column="totalWeight" jdbcType="DECIMAL" property="totalWeight" /> | 12 | <result column="totalWeight" jdbcType="DECIMAL" property="totalWeight" /> |
13 | <result column="totalVolume" jdbcType="DECIMAL" property="totalVolume" /> | 13 | <result column="totalVolume" jdbcType="DECIMAL" property="totalVolume" /> |