Commit 55dcc237d7b4b31e25621ba72c1729248f69ad43
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms4 into develop
# Conflicts: # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
Showing
3 changed files
with
41 additions
and
23 deletions
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -125,21 +125,11 @@ |
125 | 125 | <a-button type="primary" icon="import">导入</a-button> |
126 | 126 | </a-upload> |
127 | 127 | <a-button v-has="'shipmentHeader:print'" @click="batchPrint()" type="primary">打印</a-button> |
128 | -<!-- <!– 高级查询区域 –>--> | |
129 | -<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"--> | |
130 | -<!-- @handleSuperQuery="handleSuperQuery"></j-super-query>--> | |
131 | 128 | <j-super-query :fieldList="superFieldList" v-has="'shipmentHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/> |
132 | - | |
133 | 129 | </div> |
134 | 130 | |
135 | 131 | <!-- table区域-begin --> |
136 | 132 | <div> |
137 | -<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | |
138 | -<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a--> | |
139 | -<!-- style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | |
140 | -<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | |
141 | -<!-- </div>--> | |
142 | - | |
143 | 133 | <a-table |
144 | 134 | ref="table" |
145 | 135 | size="middle" |
... | ... | @@ -221,19 +211,24 @@ |
221 | 211 | <a v-show="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a> |
222 | 212 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) |
223 | 213 | || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button><a-divider type="vertical"/></a> |
224 | - <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) | |
225 | - || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipment(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button><a-divider type="vertical"/></a> | |
226 | - <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) | |
227 | - || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentAdvice(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">预配盘出库</a-button></a> | |
228 | - <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null)"> | |
229 | - <a class="ant-dropdown-link"><a-divider type="vertical"/>更多 <a-icon type="down"/></a> | |
214 | + <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') | |
215 | + || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null) | |
216 | + || (record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800) | |
217 | + || (flowOff == '0' && record.lastStatus <= 200)"> | |
218 | + <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
230 | 219 | <a-menu slot="overlay"> |
231 | - <a-menu-item v-if="record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1'"> | |
232 | - <a @click="openProcess(record)" type="primary">审核进度</a> | |
233 | - </a-menu-item> | |
234 | - <a-menu-item v-has="'shipmentHeader:edit'" v-if="record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null"> | |
220 | + <a-menu-item v-if="record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1'"> | |
221 | + <a @click="openProcess(record)" type="primary">审核进度</a> | |
222 | + </a-menu-item> | |
223 | + <a-menu-item v-if="(record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800) || (flowOff == '0' && record.lastStatus <= 200)" v-has="'shipmentHeader:autoShipment'"> | |
224 | + <a @click="autoShipment(record)" type="primary">自动出库</a> | |
225 | + </a-menu-item> | |
226 | + <a-menu-item v-if="(record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800) || (flowOff == '0' && record.lastStatus <= 200)" v-has="'shipmentHeader:autoShipment'"> | |
227 | + <a @click="autoShipmentAdvice(record)" type="primary">预配盘出库</a> | |
228 | + </a-menu-item> | |
229 | + <a-menu-item v-has="'shipmentHeader:edit'" v-if="record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null"> | |
235 | 230 | <a @click="handleEdit(record)">编辑</a> |
236 | - </a-menu-item> | |
231 | + </a-menu-item> | |
237 | 232 | <a-menu-item v-has="'shipmentHeader:delete'" v-if="record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null"> |
238 | 233 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
239 | 234 | <a>删除</a> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -48,7 +48,9 @@ import org.springframework.web.servlet.ModelAndView; |
48 | 48 | |
49 | 49 | import com.alibaba.fastjson.JSON; |
50 | 50 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
51 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
51 | 52 | import com.baomidou.mybatisplus.core.metadata.IPage; |
53 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
52 | 54 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
53 | 55 | |
54 | 56 | import cn.monitor4all.logRecord.annotation.OperationLog; |
... | ... | @@ -155,7 +157,9 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
155 | 157 | @ApiOperation(value = "出库单-通过id删除", notes = "出库单-通过id删除") |
156 | 158 | @DeleteMapping(value = "/delete") |
157 | 159 | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
158 | - shipmentHeaderService.delMain(id, "删除出库单"); | |
160 | + if (!shipmentHeaderService.delMain(id, "删除出库单")) { | |
161 | + return Result.error("删除失败!"); | |
162 | + } | |
159 | 163 | return Result.OK("删除成功!"); |
160 | 164 | } |
161 | 165 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -121,13 +121,29 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
121 | 121 | private IShipmentContainerAdviceService shipmentContainerAdviceService; |
122 | 122 | |
123 | 123 | @Override |
124 | - @Transactional | |
124 | + @Transactional(rollbackFor = Exception.class) | |
125 | 125 | public boolean delMain(String id, String reason) { |
126 | 126 | ShipmentHeader shipmentHeader = getById(id); |
127 | + if (shipmentHeader == null) { | |
128 | + throw new JeecgBootException("获取出库单信息失败!"); | |
129 | + } | |
127 | 130 | if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.SHIPMENT_HEADER_BUILD |
128 | 131 | && shipmentHeader.getFirstStatus().intValue() <= QuantityConstant.SHIPMENT_HEADER_COMPLETED) { |
129 | 132 | throw new JeecgBootException("不能删除非新建状态单据"); |
130 | 133 | } |
134 | + LambdaUpdateWrapper<ShipmentHeader> shipmentHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
135 | + shipmentHeaderLambdaUpdateWrapper.eq(ShipmentHeader::getMergeShipmentCode, shipmentHeader.getCode()); | |
136 | + shipmentHeaderLambdaUpdateWrapper.set(ShipmentHeader::getFirstStatus, QuantityConstant.SHIPMENT_HEADER_BUILD).set(ShipmentHeader::getLastStatus, | |
137 | + QuantityConstant.SHIPMENT_HEADER_BUILD); | |
138 | + if (!shipmentHeaderService.update(shipmentHeaderLambdaUpdateWrapper)) { | |
139 | + throw new JeecgBootException("更新出库单主表失败"); | |
140 | + } | |
141 | + LambdaUpdateWrapper<ShipmentDetail> shipmentDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
142 | + shipmentDetailLambdaUpdateWrapper.eq(ShipmentDetail::getMergeShipmentCode, shipmentHeader.getCode()); | |
143 | + shipmentDetailLambdaUpdateWrapper.set(ShipmentDetail::getStatus, QuantityConstant.SHIPMENT_HEADER_BUILD); | |
144 | + if (!shipmentDetailService.update(shipmentDetailLambdaUpdateWrapper)) { | |
145 | + throw new JeecgBootException("更新出库单主表失败"); | |
146 | + } | |
131 | 147 | shipmentHeaderHistoryService.saveById(id, reason); |
132 | 148 | shipmentDetailMapper.deleteByMainId(id.toString()); |
133 | 149 | shipmentHeaderMapper.deleteById(id); |
... | ... | @@ -317,6 +333,9 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
317 | 333 | if (mergeShipmentHeaderList.stream().map(ShipmentHeader::getCustomerCode).distinct().count() > 1) { |
318 | 334 | return Result.error("客户信息不一致!"); |
319 | 335 | } |
336 | + if (mergeShipmentHeaderList.stream().map(ShipmentHeader::getZoneCode).distinct().count() > 1) { | |
337 | + return Result.error("库区信息不一致!"); | |
338 | + } | |
320 | 339 | // 查询出库单详情 |
321 | 340 | LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
322 | 341 | shipmentDetailLambdaQueryWrapper.in(ShipmentDetail::getShipmentCode, shipmentHeaderList.stream().map(ShipmentHeader::getCode).collect(Collectors.toList())); |
... | ... |