Commit 4518a02ddeedf090d8734bf9819c6f6976e64811

Authored by 谭毅彬
2 parents 2ad5752d 60baf7e4

Merge branch 'develop4' of http://172.16.29.40:8010/wms/wms4.git into develop4

ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue
... ... @@ -59,7 +59,7 @@
59 59 </a-card>
60 60 </a-col>
61 61 </a-row>
62   - <InventoryDetailList></InventoryDetailList>
  62 + <InventoryDetailSelectList></InventoryDetailSelectList>
63 63 </j-modal>
64 64 </template>
65 65  
... ... @@ -72,12 +72,13 @@ import JSelectBizQueryItem from &#39;./JSelectBizQueryItem&#39;
72 72 import {cloneDeep} from 'lodash'
73 73 import {stockTakeTask} from "../../../api/api";
74 74 import Utils from './util.js';
75   -import InventoryDetailList from "../../../views/system/inventory/InventoryDetailList";
  75 +import InventoryDetailSelectList from "../../../views/system/inventory/InventoryDetailSelectList";
  76 +
76 77  
77 78 export default {
78 79 name: 'JSelectBizComponentModal',
79 80 mixins: [JeecgListMixin],
80   - components: {Ellipsis, JSelectBizQueryItem,InventoryDetailList},
  81 + components: {Ellipsis, JSelectBizQueryItem,InventoryDetailSelectList},
81 82 props: {
82 83 value: {
83 84 type: Array,
... ... @@ -242,6 +243,7 @@ export default {
242 243 this.selectedTable.dataSource = val.map(key => {
243 244 for (let data of this.dataSource) {
244 245 if (data[this.rowKey] === key) {
  246 + Utils.$emit('methodA',data[this.valueKey]);
245 247 pushIfNotExist(this.innerValue, data[this.valueKey])
246 248 return data
247 249 }
... ... @@ -264,6 +266,7 @@ export default {
264 266 /** 关闭弹窗 */
265 267 close() {
266 268 this.$emit('update:visible', false)
  269 + this.handleDeleteSelected(this.selectedTable.dataSource,0);
267 270 },
268 271  
269 272 valueWatchHandler(val) {
... ... @@ -348,9 +351,11 @@ export default {
348 351 {
349 352 alert("至少选择一项")
350 353 }
  354 + this.handleDeleteSelected(this.selectedTable.dataSource,0);
351 355 },
352 356 /** 删除已选择的 */
353 357 handleDeleteSelected(record, index) {
  358 + Utils.$emit('methodA',10);
354 359 this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
355 360 //update--begin--autor:wangshuai-----date:20200722------for:JSelectBizComponent组件切换页数值问题------
356 361 this.selectedTable.dataSource.splice(this.selectedTable.dataSource.indexOf(record), 1)
... ...
ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue
... ... @@ -29,7 +29,7 @@ export default {
29 29 },
30 30 data() {
31 31 return {
32   - url: {list: '/inventory/inventoryHeader/list'},
  32 + url: {list: '/inventory/inventoryHeader/freeList'},
33 33 columns: [
34 34 {title: 'ID', align: 'center', width: '20%',widthRight: '70%', dataIndex: 'id'},
35 35 {title: '容器号', align: 'center', width: '25%', dataIndex: 'containerCode'},
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailSelectList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false" :class="'cust-erp-sub-tab'">
  3 + <!-- 操作按钮区域 -->
  4 + <div class="table-operator" v-if="mainId">
  5 + <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
  6 + <a-button type="primary" icon="download" @click="handleExportXls('库存详情')">导出</a-button>
  7 + <a-upload
  8 + name="file"
  9 + :showUploadList="false"
  10 + :multiple="false"
  11 + :headers="tokenHeader"
  12 + :action="importExcelUrl"
  13 + @change="handleImportExcel">
  14 + <a-button type="primary" icon="import">导入</a-button>
  15 + </a-upload>
  16 +
  17 + </div>
  18 +
  19 + <!-- table区域-begin -->
  20 + <div>
  21 + <a-table
  22 + ref="table"
  23 + size="middle"
  24 + bordered
  25 + rowKey="id"
  26 + :scroll="{x:true}"
  27 + :columns="columns"
  28 + :dataSource="dataSource"
  29 + :pagination="ipagination"
  30 + :loading="loading"
  31 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  32 + @change="handleTableChange">
  33 +
  34 + <span slot="companyCode" slot-scope="companyCode">
  35 + <a-tag :key="companyCode" color=blue>
  36 + {{ solutionCompany(companyCode) }}
  37 + </a-tag>
  38 + </span>
  39 +
  40 + <template slot="htmlSlot" slot-scope="text">
  41 + <div v-html="text"></div>
  42 + </template>
  43 + <template slot="imgSlot" slot-scope="text">
  44 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  45 + <img v-else :src="getImgView(text)" height="25px" alt=""
  46 + style="max-width:80px;font-size: 12px;font-style: italic;"/>
  47 + </template>
  48 + <template slot="fileSlot" slot-scope="text">
  49 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  50 + <a-button
  51 + v-else
  52 + :ghost="true"
  53 + type="primary"
  54 + icon="download"
  55 + size="small"
  56 + @click="downloadFile(text)">
  57 + 下载
  58 + </a-button>
  59 + </template>
  60 +
  61 +
  62 + </a-table>
  63 + </div>
  64 + <inventoryDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></inventoryDetail-modal>
  65 + </a-card>
  66 +</template>
  67 +
  68 +<script>
  69 +
  70 +import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  71 +import InventoryDetailModal from './modules/InventoryDetailModal'
  72 +import {getCompanyList} from '@/api/api'
  73 +import {getAction} from '@/api/manage'
  74 +import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util";
  75 +
  76 +export default {
  77 + name: "InventoryDetailSelectList",
  78 + mixins: [JeecgListMixin],
  79 + components: {InventoryDetailModal},
  80 + props: {
  81 + mainId: {
  82 + type: String,
  83 + default: '',
  84 + required: false
  85 + }
  86 + },
  87 + watch: {
  88 + mainId: {
  89 + immediate: true,
  90 + handler(val) {
  91 + if (!this.mainId) {
  92 + this.clearList()
  93 + } else {
  94 + this.queryParam['inventoryHeaderId'] = val
  95 + this.loadData(1);
  96 + }
  97 + }
  98 + }
  99 + },
  100 + data() {
  101 + return {
  102 + description: '库存表管理页面',
  103 + disableMixinCreated: true,
  104 + companyList: [],
  105 + // 表头
  106 + columns: [
  107 + {
  108 + title: '容器编码',
  109 + align: "center",
  110 + dataIndex: 'containerCode'
  111 + },
  112 + {
  113 + title: '库位编码',
  114 + align: "center",
  115 + dataIndex: 'locationCode'
  116 + },
  117 + {
  118 + title: '物料编码',
  119 + align: "center",
  120 + dataIndex: 'materialCode'
  121 + },
  122 + {
  123 + title: '物料名称',
  124 + align: "center",
  125 + dataIndex: 'materialName'
  126 + },
  127 + {
  128 + title: '物料规格',
  129 + align: "center",
  130 + dataIndex: 'materialSpec'
  131 + },
  132 + {
  133 + title: '物料单位',
  134 + align: "center",
  135 + dataIndex: 'materialUnit'
  136 + },
  137 + {
  138 + title: '数量',
  139 + align: "center",
  140 + dataIndex: 'qty'
  141 + },
  142 + {
  143 + title: '库存状态',
  144 + align: "center",
  145 + dataIndex: 'inventoryStatus_dictText',
  146 + },
  147 + {
  148 + title: '批次',
  149 + align: "center",
  150 + dataIndex: 'batch'
  151 + },
  152 + {
  153 + title: '入库日期',
  154 + align: "center",
  155 + dataIndex: 'receiptDate'
  156 + },
  157 + ],
  158 + url: {
  159 + list: "/inventory/inventoryHeader/listInventoryDetailByMainId",
  160 + delete: "/inventory/inventoryHeader/deleteInventoryDetail",
  161 + deleteBatch: "/inventory/inventoryHeader/deleteBatchInventoryDetail",
  162 + exportXlsUrl: "/inventory/inventoryHeader/exportInventoryDetail",
  163 + importUrl: "/inventory/inventoryHeader/importInventoryDetail",
  164 + },
  165 + dictOptions: {
  166 + containerStatus: [],
  167 + }
  168 + }
  169 + },
  170 + created() {
  171 + this.loadFrom();
  172 + },
  173 + mounted() {
  174 + let _this = this;
  175 + Utils.$on('methodA',(data)=> {
  176 + _this.methodA(data);
  177 + })
  178 + // var _this = this;
  179 + // setInterval(function () {
  180 + // if(_this.isLoad) {
  181 + // _this.loadDataList();
  182 + // }
  183 + // },1000)
  184 + },
  185 + computed: {
  186 + importExcelUrl() {
  187 + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
  188 + }
  189 + },
  190 + methods: {
  191 +
  192 + methodA(data) {
  193 + var _this = this;
  194 + _this.loadDatas(data);
  195 + },
  196 +
  197 + loadDatas(record) {
  198 + this.loading = true
  199 + this.dataSource = []
  200 + getAction(this.url.list, {
  201 + inventoryHeaderId: record
  202 + }).then((res) => {
  203 + if (res.success) {
  204 + this.dataSource = res.result.records
  205 + }
  206 + }).finally(() => {
  207 + this.loading = false
  208 + })
  209 + },
  210 + loadFrom() {
  211 + getCompanyList().then((res) => {
  212 + if (res.success) {
  213 + this.companyList = res.result
  214 + }
  215 + });
  216 + },
  217 + solutionCompany(value) {
  218 + var actions = []
  219 + Object.keys(this.companyList).some((key) => {
  220 + if (this.companyList[key].code == ('' + value)) {
  221 + actions.push(this.companyList[key].name)
  222 + return true
  223 + }
  224 + })
  225 + return actions.join('')
  226 + },
  227 + clearList() {
  228 + this.dataSource = []
  229 + this.selectedRowKeys = []
  230 + this.ipagination.current = 1
  231 + }
  232 +
  233 + }
  234 +}
  235 +</script>
  236 +<style scoped>
  237 +@import '~@assets/less/common.less'
  238 +</style>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
... ... @@ -21,6 +21,8 @@ public interface IContainerService extends IService&lt;Container&gt; {
21 21  
22 22 boolean updateStatus(String containerCode, String status, String wareohuseCode);
23 23  
  24 + boolean restoreContainer(String containerCode, String wareohuseCode);
  25 +
24 26 boolean updateLocationCodeAndStatus(String containerCode, String locationCode, String status, String warehouseCode);
25 27  
26 28 // 创建零时容器
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... ... @@ -72,12 +72,25 @@ public class ContainerServiceImpl extends ServiceImpl&lt;ContainerMapper, Container
72 72 if (container == null) {
73 73 return false;
74 74 }
  75 + container.setLastStatus(container.getStatus());
75 76 container.setStatus(status);
76 77 boolean result = this.updateById(container);
77 78 return result;
78 79 }
79 80  
80 81 @Override
  82 + public boolean restoreContainer(String containerCode, String wareohuseCode) {
  83 + Container container = this.getContainerByCode(containerCode, wareohuseCode);
  84 + if (container == null) {
  85 + return false;
  86 + }
  87 + container.setLastStatus(container.getStatus());
  88 + container.setStatus(container.getLastStatus());
  89 + boolean result = this.updateById(container);
  90 + return result;
  91 + }
  92 +
  93 + @Override
81 94 public boolean updateLocationCodeAndStatus(String containerCode, String locationCode, String status, String warehouseCode) {
82 95 Container container = getContainerByCode(containerCode, warehouseCode);
83 96 if (container == null) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
... ... @@ -12,6 +12,7 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
12 12 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
13 13 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
14 14 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
  15 +import org.jeecg.utils.constant.QuantityConstant;
15 16 import org.springframework.beans.factory.annotation.Autowired;
16 17 import org.springframework.web.bind.annotation.*;
17 18 import javax.servlet.http.HttpServletRequest;
... ... @@ -252,6 +253,29 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
252 253 }
253 254  
254 255 /**
  256 + * 有货非锁定列表查询
  257 + * @param inventoryHeader
  258 + * @param pageNo
  259 + * @param pageSize
  260 + * @param req
  261 + * @return
  262 + */
  263 + // @AutoLog(value = "库存表-分页列表查询")
  264 + @ApiOperation(value = "库存表-有货非锁定列表查询", notes = "库存表-有货非锁定列表查询")
  265 + @GetMapping(value = "/freeList")
  266 + public Result<IPage<InventoryHeader>> freeList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  267 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  268 +
  269 +
  270 +
  271 + QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap());
  272 + queryWrapper.eq("container_status", QuantityConstant.STATUS_CONTAINER_SOME);
  273 + Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize);
  274 + IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper);
  275 + return Result.OK(pageList);
  276 + }
  277 +
  278 + /**
255 279 * 导入
256 280 * @return
257 281 */
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... ... @@ -4,6 +4,8 @@ import com.aliyun.oss.ServiceException;
4 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import org.jeecg.common.api.vo.Result;
  7 +import org.jeecg.modules.wms.config.container.entity.Container;
  8 +import org.jeecg.modules.wms.config.container.service.impl.ContainerServiceImpl;
7 9 import org.jeecg.modules.wms.config.location.entity.Location;
8 10 import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
9 11 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
... ... @@ -32,6 +34,7 @@ import java.math.BigDecimal;
32 34 import java.util.Date;
33 35 import java.util.List;
34 36 import java.util.Collection;
  37 +import java.util.stream.Stream;
35 38  
36 39 /**
37 40 * @Description: 盘点明细表
... ... @@ -58,6 +61,8 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
58 61 private TaskDetailServiceImpl taskDetailService;
59 62 @Resource
60 63 private CycleCountHeaderServiceImpl cycleCountHeaderService;
  64 + @Resource
  65 + private ContainerServiceImpl containerServiceImpl;
61 66  
62 67  
63 68 @Override
... ... @@ -119,21 +124,20 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
119 124 inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId,taskId);
120 125 List<InventoryDetail> inventoryDetails = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
121 126  
122   -// LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
123   -// locationLambdaQueryWrapper.eq(Location::getCode, inventoryDetails.get(0).getLocationCode())
124   -// .eq(Location::getWarehouseCode, inventoryDetails.get(0).getWarehouseCode())
125   -// .ne(Location::getStatus, QuantityConstant.STATUS_LOCATION_LOCK);
126   -// Location location = locationService.getOne(locationLambdaQueryWrapper);
127   -// if (StringUtils.isNull(location)) {
128   -// return Result.error("库位已锁定!");
129   -// }
  127 +
  128 + LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  129 + cycleCountDetailLambdaQueryWrapper.eq(CycleCountDetail::getContainerCode,inventoryDetails.get(0).getContainerCode())
  130 + .ne(CycleCountDetail::getEnableStatus,QuantityConstant.CYCLECOUNT_STATUS_COMPLETED);
  131 + List<CycleCountDetail> cycleCountDetails = this.list(cycleCountDetailLambdaQueryWrapper);
  132 + if (cycleCountDetails.size() >0)
  133 + {
  134 + return Result.error("当前容器已经在盘点队列还没有完成 盘点单号"+cycleCountDetails.get(0).getCycleCountHeadCode());
  135 + }
130 136  
131 137 CycleCountDetail cycleCountDetail = new CycleCountDetail();
132 138 cycleCountDetail.setCycleCountHeadId(headerId);
133 139 cycleCountDetail.setContainerCode(inventoryDetails.get(0).getContainerCode());
134 140  
135   -
136   -
137 141 cycleCountDetail.setCycleCountHeadCode(code);
138 142 cycleCountDetail.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
139 143 cycleCountDetail.setWarehouseCode(inventoryDetails.get(0).getWarehouseCode());
... ... @@ -198,14 +202,21 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
198 202 }
199 203 Location location = locationService.getLocationByCode(
200 204 cycleCountDetail.getLocationCode(), warehouseCode);
201   - /*if(!loc.getStatus().equals(QuantityConstant.STATUS_EMPTY)){
202   - return AjaxResult.error(cycleCountDetail.getLocationCode() + "库位不在空闲状态,请先完成其他任务,操作失败!");
203   - }*/
  205 + if(!location.getStatus().equals(QuantityConstant.STATUS_LOCATION_EMPTY)){
  206 + return Result.error(cycleCountDetail.getLocationCode() + "库位不在空闲状态,请先完成其他任务,操作失败!");
  207 + }
204 208 if(StringUtils.isEmpty(location.getContainerCode())){
205 209 return Result.error(cycleCountDetail.getLocationCode() + "库位中没有容器,操作失败!");
206 210 }
  211 +
207 212 //生成任务同时锁定库位
208 213 locationService.updateStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK,warehouseCode);
  214 +
  215 + //生成任务同时锁定容器
  216 + containerServiceImpl.updateStatus(location.getContainerCode(),QuantityConstant.STATUS_LOCATION_LOCK,warehouseCode);
  217 +
  218 +
  219 +
209 220 //每个明细单生成一张主任务,子单就是任务明细。
210 221 TaskHeader task = new TaskHeader();
211 222 task.setWarehouseCode(warehouseCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1725,6 +1725,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1725 1725 locationService.updateStatus(cycleCountDetail.getLocationCode(),
1726 1726 QuantityConstant.STATUS_LOCATION_EMPTY, taskHeader.getWarehouseCode());
1727 1727  
  1728 +
  1729 + //还原容器状态
  1730 + containerService.restoreContainer(cycleCountDetail.getLocationCode(),taskHeader.getWarehouseCode());
  1731 +
1728 1732 return Result.OK("完成盘点任务成功");
1729 1733 }
1730 1734  
... ...