diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index 02c948d..f13e4e5 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -58,6 +58,8 @@ const queryMyDepartTreeList = (params) => getAction("/sys/sysDepart/queryMyDeptT //日志管理 const deleteLog = (params) => deleteAction("/sys/log/delete", params); const deleteLogList = (params) => deleteAction("/sys/log/deleteBatch", params); +//获得所有接口日志名称 +const getApiNameList = (params) => deleteAction("/monitor/apiLog/getApiNameList", params); //数据字典 const addDict = (params) => postAction("/sys/dict/add", params); @@ -160,11 +162,11 @@ export const selectPort = (params) => postAction('/task/taskHeader/selectPort', //创建跨站任务 export const createOverStationTask = (params) => postAction('/task/taskHeader/createOverStationTask', params); //盘点任务创建 -export const stockTakeTask = (params,headerId,code) => postAction('/cycleCountDetail/cycleCountDetail/stockTakeTask?ids='+params+'&headerId='+headerId+'&code='+code, code); +export const stockTakeTask = (params, headerId, code) => postAction('/cycleCountDetail/cycleCountDetail/stockTakeTask?ids=' + params + '&headerId=' + headerId + '&code=' + code, code); //盘盈添加 export const increaseInInventoryGain = (params) => postAction('/cycleCountDetail/cycleCountDetail/increaseInInventoryGain', params); //盘点任务生成 -export const createCycleCoutTaskByDetailId = (params,toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId='+params+'&toPort='+toPort, params); +export const createCycleCoutTaskByDetailId = (params, toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId=' + params + '&toPort=' + toPort, params); //盘点确定实盘数量 export const confirmGapQty = (params) => postAction('/cycleCountDetail/cycleCountDetail/confirmGapQty', params); //创建空托盘组入库任务 @@ -277,5 +279,6 @@ export { saveDeptRolePermission, queryMyDepartTreeList, getUserNoticeInfo, - getDictItemsFromCache + getDictItemsFromCache, + getApiNameList } diff --git a/ant-design-vue-jeecg/src/views/system/UserList.vue b/ant-design-vue-jeecg/src/views/system/UserList.vue index 124db88..c988cd9 100644 --- a/ant-design-vue-jeecg/src/views/system/UserList.vue +++ b/ant-design-vue-jeecg/src/views/system/UserList.vue @@ -230,19 +230,16 @@ export default { { title: '用户账号', align: "center", - dataIndex: 'username', - width: 120 + dataIndex: 'username' }, { title: '用户姓名', align: "center", - width: 100, dataIndex: 'realname', }, { title: '工号', align: "center", - width: 100, dataIndex: 'workNo', }, // { @@ -256,13 +253,11 @@ export default { { title: '性别', align: "center", - width: 80, dataIndex: 'sex_dictText' }, { title: '角色', align: "center", - width: 200, dataIndex: 'selectedRoles', key: 'selectedRoles', scopedSlots: {customRender: 'selectedRoles'} @@ -276,19 +271,18 @@ export default { { title: '手机号码', align: "center", - width: 100, dataIndex: 'phone' }, { title: '邮箱', align: "center", - width: 200, dataIndex: 'email' }, { title: '所属仓库', align: "center", dataIndex: 'selectedWarehouses', + width: 300, key: 'selectedWarehouses', scopedSlots: {customRender: 'selectedWarehouses'} }, @@ -306,11 +300,8 @@ export default { { title: '状态', align: "center", - width: 80, dataIndex: 'status_dictText' }, - - { title: '操作', dataIndex: 'action', diff --git a/ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue b/ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue index 08b881c..3670b09 100644 --- a/ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue @@ -90,9 +90,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'bomHeader:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'bomHeader:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/config/CarrierList.vue b/ant-design-vue-jeecg/src/views/system/config/CarrierList.vue index bb6322d..ddc9007 100644 --- a/ant-design-vue-jeecg/src/views/system/config/CarrierList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/CarrierList.vue @@ -74,9 +74,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'carrier:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'carrier:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/config/CustomerList.vue b/ant-design-vue-jeecg/src/views/system/config/CustomerList.vue index cf0b7e5..2a69a15 100644 --- a/ant-design-vue-jeecg/src/views/system/config/CustomerList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/CustomerList.vue @@ -74,9 +74,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'customer:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'customer:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue b/ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue index 226b794..e761cc6 100644 --- a/ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue @@ -100,9 +100,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'locationHigh:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'locationHigh:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue index 0b3093c..dc34fab 100644 --- a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue @@ -19,22 +19,22 @@ <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="location_status" /> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="库位类型"> - <a-select - show-search - placeholder="请选择库位类型" - option-filter-prop="children" - v-model="queryParam.locationTypeCode" - > - <a-select-option v-for="item in locationTypeList" :key="item.name" :value="item.code"> - {{ item.name }} - </a-select-option> - </a-select> - </a-form-item> - </a-col> <template v-if="toggleSearchStatus"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="库位类型"> + <a-select + show-search + placeholder="请选择库位类型" + option-filter-prop="children" + v-model="queryParam.locationTypeCode" + > + <a-select-option v-for="item in locationTypeList" :key="item.name" :value="item.code"> + {{ item.name }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="库区"> <a-select show-search diff --git a/ant-design-vue-jeecg/src/views/system/config/SupplierList.vue b/ant-design-vue-jeecg/src/views/system/config/SupplierList.vue index 21a7cb0..0c77223 100644 --- a/ant-design-vue-jeecg/src/views/system/config/SupplierList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/SupplierList.vue @@ -101,9 +101,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'supplier:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'supplier:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue index 49d6b7d..4ff77ea 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue @@ -166,9 +166,7 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-has="'inventoryTransaction:edit'" @click="handleEdit(record)">编辑</a> - - <a-divider type="vertical"/> + <a v-has="'inventoryTransaction:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> diff --git a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue index e9c8f9f..5d1cd43 100644 --- a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue +++ b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue @@ -4,9 +4,13 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="接口名称"> - <j-input placeholder="请输入接口名称" v-model="queryParam.apiName"></j-input> + <a-col :xl='6' :lg='7' :md='8' :sm='24'> + <a-form-item label='接口名称'> + <a-select show-search placeholder='请输入接口名称' option-filter-prop='children' v-model='queryParam.apiName'> + <a-select-option v-for='name in apiNameList' :key='name' :value='name'> + {{ name }} + </a-select-option> + </a-select> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> @@ -128,6 +132,7 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import ApiLogModal from './modules/ApiLogModal' import JEllipsis from '@comp/jeecg/JEllipsis' +import {getApiNameList} from '@api/api' export default { name: 'ApiLogList', @@ -139,6 +144,7 @@ export default { data() { return { description: '接口日志管理页面', + apiNameList: [], // 表头 columns: [ { @@ -211,6 +217,7 @@ export default { }, created() { this.getSuperFieldList() + this.loadFrom() }, mounted() { this.expandedRowRender = "expandedRowRender"; @@ -221,6 +228,13 @@ export default { } }, methods: { + loadFrom() { + getApiNameList().then((res) => { + if (res.success) { + this.apiNameList = res.result + } + }) + }, initDictConfig() {}, getSuperFieldList() { let fieldList = [] diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue index 2eafe6e..61d637f 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue @@ -72,9 +72,8 @@ <span slot="action" slot-scope="text, record"> <a v-has="'receiptDetail:edit'" @click="edit(record)">编辑</a> - <a-divider type="vertical"/> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> - <a v-has="'receiptDetail:delete'">删除</a> + <a v-has="'receiptDetail:delete'"><a-divider type="vertical"/>删除</a> </a-popconfirm> </span> diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue index 1cca438..bd4058d 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue @@ -120,11 +120,11 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 0" @click="selectPort(record)">生成任务<a-divider type="vertical"/></a> + <a v-if="record.status == 0" @click="selectPort(record)">生成任务</a> <a-popconfirm v-if="record.status == 0" v-has="'shipmentContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> - <a>取消配盘<a-divider type="vertical"/></a> + <a><a-divider type="vertical"/>取消配盘</a> </a-popconfirm> - <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)">编辑</a> + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-divider type="vertical"/>编辑</a> </span> </a-table> </div> diff --git a/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue b/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue index 10edd7b..28e4a8b 100644 --- a/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue @@ -111,8 +111,8 @@ <a-menu-item> <a @click="handleDetail(record)">详情</a> </a-menu-item> - <a-menu-item> - <a v-has="'agvTask:edit'" @click="handleEdit(record)">编辑</a> + <a-menu-item v-has="'agvTask:edit'"> + <a @click="handleEdit(record)">编辑</a> </a-menu-item> </a-menu> </a-dropdown> diff --git a/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue index 2d23c43..95b9be3 100644 --- a/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue @@ -148,9 +148,8 @@ <a-divider type="vertical"/></a> <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 <a-divider type="vertical"/></a> - <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消</a> </span> - </a-table> </div> diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java index 096921c..c13f8d9 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java @@ -1,5 +1,7 @@ package org.jeecg.modules.wms.api.wcs.controller; +import java.net.SocketException; + import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -59,8 +61,7 @@ public class WcsController extends HuahengBaseController { Result result = handleMultiProcess("warecellAllocation", lockKey, new MultiProcessListener() { @Override public Result<?> doProcess() { - Result result = wcsService.warecellAllocation(warecellDomain); - return result; + return wcsService.warecellAllocation(warecellDomain); } }); return result; diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java index fca4232..2338143 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java @@ -107,8 +107,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService searchNumber = Integer.parseInt(value); } String lastString = "ORDER BY layer asc, id asc limit " + searchNumber; - StopWatch stopWatch = new StopWatch(); - stopWatch.start("aaa"); List<Integer> removeRoadWays = new ArrayList<>(); // 寻找可用巷道,空闲的空库位低于设定值,那么这个巷道就不能用来分配库位 for (Integer roadWay : roadWays) { @@ -122,9 +120,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService removeRoadWays.add(roadWay); } } - stopWatch.stop(); - System.out.println("waste aa:" + stopWatch.getLastTaskTimeMillis()); - stopWatch.start("bbb"); roadWays.removeAll(removeRoadWays); if (roadWays == null || roadWays.size() == 0) { throw new JeecgBootException("分配库位时, 巷道为空"); @@ -147,8 +142,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService } } locationList.removeAll(removeLocaationList); - stopWatch.stop(); - System.out.println("waste bb:" + stopWatch.getLastTaskTimeMillis()); if (locationList.size() == 0) { locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay) @@ -170,8 +163,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService return null; } Location location = locationList.stream().findFirst().orElse(null); - String locationCode = location.getCode(); - return locationCode; + return location.getCode(); } /** diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java index e5a244a..6639820 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java @@ -1,5 +1,7 @@ package org.jeecg.modules.wms.api.wcs.service; +import java.net.SocketException; + import org.jeecg.common.api.vo.Result; import org.jeecg.modules.wms.api.wcs.entity.MaterialInfoEntity; import org.jeecg.modules.wms.api.wcs.entity.WarecellDomain; @@ -11,7 +13,8 @@ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; */ public interface WcsService { - /** 仓位分配 */ + /** 仓位分配 + * @throws SocketException */ Result warecellAllocation(WarecellDomain warecellDomain); /** diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java index 78bd0d7..91f73fe 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java @@ -1,5 +1,6 @@ package org.jeecg.modules.wms.api.wcs.service; +import java.net.SocketException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -59,43 +60,57 @@ public class WcsServiceImpl implements WcsService { @Resource private IZoneService zoneService; + @Resource private ITaskHeaderService taskHeaderService; + @Resource private ITaskDetailService taskDetailService; + @Resource private IContainerService containerService; + @Resource private ILocationTypeService locationTypeService; + @Resource private ILocationHighService locationHighService; + @Resource private IParameterConfigurationService parameterConfigurationService; + @Resource private IReceiptContainerDetailService receiptContainerDetailService; + @Resource private IMaterialService materialService; + @Resource private IReceiptContainerHeaderService receiptContainerHeaderService; + @Resource private LocationAllocationService locationAllocationService; + @Resource private ILocationService locationService; + @Resource private IAddressService addressService; + @Resource private IContainerTypeService containerTypeService; /** * 库位分配 + * @throws SocketException */ @Override @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情分配库位'", extra = "#extraJsonString", - msg = "'任务ID:' + #warecellDomain.getTaskNo() + ',库位编码:' + #locationCode", condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) - @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'分配库位'", extra = "''", + msg = "'任务ID:' + #warecellDomain.getTaskNo() + ',库位编码:' + #locationCode", condition = "null != #success && #success", recordReturnValue = true) + @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'分配库位'", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result warecellAllocation(WarecellDomain warecellDomain) { log.info("开始分配库位"); String warehouseCode = warecellDomain.getWarehouseCode(); @@ -247,14 +262,15 @@ public class WcsServiceImpl implements WcsService { if (!taskHeaderService.updateById(taskHeader)) { throw new JeecgBootException("更新任务头表目标库位失败"); } - + WcsTask wcsTask = new WcsTask(); wcsTask.setToLocationCode(locationCode); wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); - LogRecordContext.putVariable("locationCode", locationCode);// 操作日志收集 - LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 - LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + // 操作日志收集 + LogRecordContext.putVariable("locationCode", locationCode); + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList)); + LogRecordContext.putVariable("taskHeader", taskHeader); + LogRecordContext.putVariable("success", true); log.info("完成分配库位,任务号:" + taskNo + ", 库位号:" + locationCode); return Result.OK(wcsTask); } @@ -263,7 +279,7 @@ public class WcsServiceImpl implements WcsService { @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'任务下发'", extra = "''", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result wcsTaskAssign(TaskHeader taskHeader) { if (taskHeader == null) { return Result.error("wms任务为空"); @@ -415,6 +431,7 @@ public class WcsServiceImpl implements WcsService { } } LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + LogRecordContext.putVariable("success", true); return Result.ok("下发任务成功"); } @@ -500,7 +517,7 @@ public class WcsServiceImpl implements WcsService { @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'空出处理'", extra = "''", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result emptyOutHandle(String taskNo) { if (StringUtils.isEmpty(taskNo)) { return Result.error("任务号为空"); @@ -525,7 +542,9 @@ public class WcsServiceImpl implements WcsService { if (!success) { return Result.error("修改任务失败,空出处理失败"); } - LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + // 操作日志收集 + LogRecordContext.putVariable("taskHeader", taskHeader); + LogRecordContext.putVariable("success", true); return Result.ok("空出处理成功"); } @@ -533,7 +552,7 @@ public class WcsServiceImpl implements WcsService { @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'重入处理'", extra = "''", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result reentryHandle(String taskNo) { // 1、判断非空字段 if (StringUtils.isEmpty(taskNo)) { @@ -630,7 +649,9 @@ public class WcsServiceImpl implements WcsService { TaskReentryEntity taskReentryEntity = new TaskReentryEntity(); taskReentryEntity.setTaskNo(Integer.parseInt(taskNo)); taskReentryEntity.setRedirectionLocationCode(locationCode); - LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + // 操作日志收集 + LogRecordContext.putVariable("taskHeader", taskHeader); + LogRecordContext.putVariable("success", true); return Result.ok(taskReentryEntity); } @@ -638,7 +659,7 @@ public class WcsServiceImpl implements WcsService { @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'取货错处理'", extra = "''", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result pickupErrorHandle(String taskNo) { // 1、判断非空字段 if (StringUtils.isEmpty(taskNo)) { @@ -662,6 +683,7 @@ public class WcsServiceImpl implements WcsService { return Result.error("取货错处理失败,更新任务失败"); } LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + LogRecordContext.putVariable("success", true); return Result.ok("取货错处理成功"); } @@ -669,7 +691,7 @@ public class WcsServiceImpl implements WcsService { @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'到达站台'", extra = "''", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", - recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) public Result arrivedNotice(String taskNo, String port) { TaskHeader taskHeader = taskHeaderService.getById(taskNo); if (taskHeader == null) { @@ -685,7 +707,9 @@ public class WcsServiceImpl implements WcsService { if (!result) { return Result.error("更新到达站台失败"); } - LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 + // 操作日志收集 + LogRecordContext.putVariable("taskHeader", taskHeader); + LogRecordContext.putVariable("success", true); return Result.ok("更新到达站台成功"); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java index c4198a1..6279bfe 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java @@ -5,6 +5,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.utils.support.RedissonDistributedLocker; import org.springframework.beans.factory.annotation.Autowired; @@ -73,7 +74,7 @@ public class HuahengBaseController { result = multiProcessListener.doProcess(); } catch (Exception e) { log.error("[{}] 执行分布式事务失败 lockKey = {},errorMessage = {}", taskName, fullLockKey, ExceptionUtil.getMessage(e), e); - throw ExceptionUtil.convertFromOrSuppressedThrowable(e, RuntimeException.class); + return Result.error(ExceptionUtil.getMessage(e)); } finally { redissonDistributedLocker.unlock(fullLockKey); final long finishTime = SystemClock.now(); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java index 3932c33..e301259 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java @@ -13,7 +13,14 @@ import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -148,4 +155,12 @@ public class ApiLogController extends JeecgController<ApiLog, IApiLogService> { return super.importExcel(request, response, ApiLog.class); } + /** + * 获得所有接口日志名称 + */ + @RequestMapping(value = "/getApiNameList") + public Result<?> getApiNameList(HttpServletRequest request) { + return Result.OK(apiLogService.getApiNameList()); + } + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/IApiLogService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/IApiLogService.java index 622a237..d0e3856 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/IApiLogService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/IApiLogService.java @@ -1,8 +1,11 @@ package org.jeecg.modules.wms.monitor.apiLog.service; -import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; +import com.baomidou.mybatisplus.extension.service.IService; + /** * @Description: 接口日志 * @Author: jeecg-boot @@ -11,4 +14,6 @@ import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; */ public interface IApiLogService extends IService<ApiLog> { + public List<String> getApiNameList(); + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/impl/ApiLogServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/impl/ApiLogServiceImpl.java index ad4d7c1..2fc5af2 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/impl/ApiLogServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/impl/ApiLogServiceImpl.java @@ -1,12 +1,21 @@ package org.jeecg.modules.wms.monitor.apiLog.service.impl; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; import org.jeecg.modules.wms.monitor.apiLog.mapper.ApiLogMapper; import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.hutool.core.date.DateUtil; + /** * @Description: 接口日志 * @Author: jeecg-boot @@ -16,4 +25,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ApiLogServiceImpl extends ServiceImpl<ApiLogMapper, ApiLog> implements IApiLogService { + @Override + @Cacheable(cacheNames = "getApiNameList#7200", key = "#root.methodName", unless = "#result == null ") + public List<String> getApiNameList() { + LambdaQueryWrapper<ApiLog> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.select(ApiLog::getApiName).groupBy(ApiLog::getApiName).ge(ApiLog::getCreateTime, DateUtil.offsetDay(new Date(), -7)); + List<ApiLog> apiLogList = list(lambdaQueryWrapper); + return apiLogList.stream().map(t -> t.getApiName()).collect(Collectors.toList()); + } + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index 5aa5ae7..febd237 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -196,8 +196,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "未找到"); } Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); - if (fromLocation == null) { - return Result.error("创建移库任务时,起始库位:" + fromLocationCode + "未找到"); + if (toLocation == null) { + return Result.error("创建移库任务时,目标库位:" + toLocation + "未找到"); } String containerCode = fromLocation.getContainerCode(); // 这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库 @@ -979,11 +979,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", - condition = "#taskDetailList.size() > 0", recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", - condition = "#taskDetailList.size() > 0", recordReturnValue = true) - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库完成'", extra = "#extraJsonString2", msg = "''", condition = "#receiptDetaiList.size() > 0", + condition = "null != #success && #success", recordReturnValue = true) + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库完成'", extra = "#extraJsonString2", msg = "''", condition = "null != #success && #success", recordReturnValue = true) public Result completeReceiptTask(TaskHeader taskHeader) { if (taskHeader == null) { @@ -1161,11 +1161,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } receiptDetaiList = receiptDetaiList.stream().filter(t -> t.getStatus().equals(QuantityConstant.RECEIPT_HEADER_COMPLETED)).collect(Collectors.toList()); LogRecordContext.putVariable("taskHeader", taskHeader); - LogRecordContext.putVariable("taskDetailList", taskDetailList); LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(taskDetailList)); - LogRecordContext.putVariable("receiptDetaiList", receiptDetaiList); LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(receiptDetaiList)); - log.info("完成入库任务, 任务号" + taskHeader.getId()); + LogRecordContext.putVariable("success", true);// 操作日志收集 + log.info("完成入库任务, 任务号:" + taskHeader.getId()); return Result.ok("完成入库任务"); } @@ -1178,11 +1177,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea @Transactional(rollbackFor = Exception.class) @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", - condition = "#taskDetailList.size() > 0", recordReturnValue = true) + condition = "null != #success && #success", recordReturnValue = true) @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务完成'", extra = "#extraJsonString1", msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", - recordReturnValue = true) - @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情出库完成'", extra = "#extraJsonString2", msg = "''", condition = "#shipmentDetailList.size() > 0", + condition = "null != #success && #success", recordReturnValue = true) + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情出库完成'", extra = "#extraJsonString2", msg = "''", condition = "null != #success && #success", recordReturnValue = true) public Result completeShipmentTask(TaskHeader taskHeader) { if (taskHeader == null) { @@ -1193,7 +1192,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea String fromLocationCode = taskHeader.getFromLocationCode(); String toLocationCode = taskHeader.getToLocationCode(); String containerCode = taskHeader.getContainerCode(); - String zoneCode = taskHeader.getZoneCode(); int taskType = taskHeader.getTaskType(); List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByTaskId(taskHeader.getId()); boolean success = false; @@ -1383,10 +1381,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea // 操作记录添加 shipmentDetailList = shipmentDetailList.stream().filter(t -> t.getStatus().equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)).collect(Collectors.toList()); LogRecordContext.putVariable("taskHeader", taskHeader); - LogRecordContext.putVariable("taskDetailList", taskDetailList); // 操作记录添加 LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(taskDetailList)); - LogRecordContext.putVariable("shipmentDetailList", shipmentDetailList); LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(shipmentDetailList)); + LogRecordContext.putVariable("success", true); log.info("完成出库任务,任务号:" + taskHeader.getId()); return Result.ok("完成出库任务"); }