Commit d46b773521c219470138301ccc16281d5c33334e
1 parent
66fba61d
优化定时任务
Showing
4 changed files
with
15 additions
and
13 deletions
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
... | ... | @@ -85,7 +85,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
85 | 85 | @Override |
86 | 86 | public AjaxResult createCheckCountTask(List<Integer> ids) { |
87 | 87 | //生成出库查看任务 |
88 | - return workTaskService.createCheckCountTask(ids); | |
88 | + if(ShiroUtils.getUser()!=null&& Arrays.asList(QuantityConstant.USERID_AGV).contains(ShiroUtils.getUserId().toString())) { | |
89 | + return workTaskService.createCheckCountTask(ids); | |
90 | + } | |
91 | + return AjaxResult.error("AGV库才能盘点!"); | |
89 | 92 | } |
90 | 93 | @Override |
91 | 94 | public int getUncompleteReceiptContainer(String locationCode) { |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -169,7 +169,7 @@ public class RyTask extends BaseController { |
169 | 169 | * 定时清除日志 |
170 | 170 | */ |
171 | 171 | public void truncateTable(String params) { |
172 | - //删除上个月 | |
172 | + //删除上个月数据 | |
173 | 173 | apiLogService.deleteMonth(); |
174 | 174 | operLogService.truncateTable(); |
175 | 175 | jobLogService.truncateTable(); |
... | ... | @@ -429,8 +429,9 @@ public class RyTask extends BaseController { |
429 | 429 | .eq(ReceiptContainerDetail::getToMes, 0)//未回传 |
430 | 430 | .lt(ReceiptContainerDetail::getToMesErrorCount, 3)//错误次数小于3 |
431 | 431 | .eq(ReceiptContainerDetail::getMaterialIsBattery, 1)//是电池类 |
432 | + .isNotNull(ReceiptContainerDetail::getBatteryPackTwoCode) | |
432 | 433 | .last("limit 1")); |
433 | - if (list.size() < 1) { | |
434 | + if (list.isEmpty()) { | |
434 | 435 | return; |
435 | 436 | } |
436 | 437 | |
... | ... | @@ -438,9 +439,9 @@ public class RyTask extends BaseController { |
438 | 439 | for (ReceiptContainerDetail detail : list) { |
439 | 440 | ToMes.ContentDTO.BarcodedataDTO barcodedataDTO = new ToMes.ContentDTO.BarcodedataDTO(); |
440 | 441 | //获取供应商 |
441 | - Supplier supplier = supplierService.list(new LambdaQueryWrapper<Supplier>().eq(Supplier::getCode, detail.getSupplierCode())).get(0); | |
442 | - if (supplier == null) { | |
443 | - supplier = new Supplier(); | |
442 | + Supplier supplier = new Supplier(); | |
443 | + List<Supplier> list1 = supplierService.list(new LambdaQueryWrapper<Supplier>().eq(Supplier::getCode, detail.getSupplierCode())); | |
444 | + if (list1.isEmpty()) { | |
444 | 445 | supplier.setName("没有供应商"); |
445 | 446 | } |
446 | 447 | barcodedataDTO.setBatterybarcode(detail.getBatteryPackTwoCode()); |
... | ... |
src/main/java/com/huaheng/pc/system/user/controller/IndexController.java
... | ... | @@ -107,12 +107,12 @@ public class IndexController extends BaseController |
107 | 107 | // ") t"; |
108 | 108 | //String receiptTotal = "SELECT IFNULL(SUM(d.qty),0) 'total' FROM receipt_container_detail d join receipt_container_header h on d.receiptContainerId = h.id WHERE DATEDIFF(NOW(), h.created) = 0 AND d.status > 19 AND h.warehouseCode = '"+ShiroUtils.getWarehouseCode()+"' ;"; |
109 | 109 | //String shipmentTotal = "SELECT IFNULL(SUM(d.qty),0) 'total' from shipment_container_detail d JOIN shipment_container_header h on d.shippingContainerId = h.id WHERE DATEDIFF(NOW(), h.created) = 0 AND h.status > 19 AND h.warehouseCode = '"+ShiroUtils.getWarehouseCode()+"' ;"; |
110 | - String bllCount = "select sum(d.qty) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=100 or h.taskType=200 or h.taskType=300 or h.taskType=400) and h.status=100"; | |
111 | - String receiptTotal= "select sum(d.qty) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=100 or h.taskType=200) and h.status=100"; | |
112 | - String shipmentTotal = "select sum(d.qty) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=300 or h.taskType=400) and h.status=100"; | |
110 | + String bllCount = "select ifnull(sum( d.qty ),0) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=100 or h.taskType=200 or h.taskType=300 or h.taskType=400) and h.status=100"; | |
111 | + String receiptTotal= "select ifnull(sum( d.qty ),0) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=100 or h.taskType=200) and h.status=100"; | |
112 | + String shipmentTotal = "select ifnull(sum( d.qty ),0) 'total' FROM task_header h join task_detail d on h.id =d.taskId WHERE DATEDIFF(NOW(), h.completeTime) = 0 and (h.taskType=300 or h.taskType=400) and h.status=100"; | |
113 | 113 | String inventoryTotal = "SELECT IFNULL(SUM(totalQty),0) 'total' from inventory_header where 1=1 " + condition; |
114 | - String materialCount = "SELECT count(DISTINCT materialSkuQty) 'total' from inventory_header WHERE 1=1" + condition; | |
115 | - String taskUncompletedTotal = "SELECT COUNT(*) 'total' from task_header WHERE status < 100 " + condition; | |
114 | + String materialCount = "SELECT ifnull(count(DISTINCT materialCode),0) 'total' from inventory_detail WHERE 1=1" + condition; | |
115 | + String taskUncompletedTotal = "SELECT ifnull(COUNT(*),0) 'total' from task_header WHERE status < 100 " + condition; | |
116 | 116 | |
117 | 117 | Map<String, Object> map = new HashMap<>(); |
118 | 118 | List<LinkedHashMap<String, Object>> temp1 = mapper.selectCommon(bllCount); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/WorkTaskService.java
... | ... | @@ -1016,9 +1016,7 @@ public class WorkTaskService { |
1016 | 1016 | taskHeader.setAgv(QuantityConstant.AGV_TASK_ALREADY_CREATE); |
1017 | 1017 | taskHeaderService.updateById(taskHeader); |
1018 | 1018 | } |
1019 | - return AjaxResult.error("不是agv账户不能用agv盘点"); | |
1020 | 1019 | } |
1021 | - | |
1022 | 1020 | return AjaxResult.success(); |
1023 | 1021 | } |
1024 | 1022 | |
... | ... |