rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/TaskController.java
@@ -10,10 +10,13 @@ import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.entity.Task; import com.vincent.rsf.server.manager.entity.TaskItem; import com.vincent.rsf.server.manager.service.TaskItemService; import com.vincent.rsf.server.manager.service.TaskService; import com.vincent.rsf.server.system.controller.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -24,6 +27,9 @@ @Autowired private TaskService taskService; @Autowired private TaskItemService taskItemService; @PreAuthorize("hasAuthority('manager:task:list')") @PostMapping("/task/page") @@ -80,10 +86,17 @@ @PreAuthorize("hasAuthority('manager:task:remove')") @OperationLog("Delete 任务工作档") @PostMapping("/task/remove/{ids}") @Transactional(rollbackFor = Exception.class) public R remove(@PathVariable Long[] ids) { if (Objects.isNull(ids) || ids.length < 1) { return R.error("参数不能为空!!"); } if (!taskService.removeByIds(Arrays.asList(ids))) { return R.error("Delete Fail"); } if (!taskItemService.remove(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getTaskId, ids))) { return R.error("删除失败!!"); } return R.ok("Delete Success").add(ids); } rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/QlyInspect.java
@@ -174,6 +174,17 @@ // null // 备注 // ); public String getwkType$() { if (null == this.wkType) {return null;} DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_BUSINESS_TYPE) .eq(DictData::getValue, this.wkType)); if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { return null; } return dictDatas.getLabel(); } public String getIsptStatus$() { if (null == this.isptStatus) {return null;} rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java
@@ -43,11 +43,23 @@ List<QlyIsptItem> isptItem = params.getIsptItem(); List<Long> list = isptItem.stream().map(QlyIsptItem::getId).collect(Collectors.toList()); if (params.getType().equals("2") || params.getType().equals("1")) { if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() .set(QlyIsptItem::getIsptResult, params.getType()) .in(QlyIsptItem::getId, list))) { throw new CoolException("修改失败!!"); } isptItem.forEach(item -> { if (params.getType().equals("1")) { //TODO 先捡后收为送货数量,先收后捡为收货数量 item.setSafeQty(item.getDlyQty()); item.setDisQty(0.0); } else { item.setSafeQty(0.0); item.setDisQty(item.getDlyQty()); } if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() .set(QlyIsptItem::getSafeQty, item.getSafeQty()) .set(QlyIsptItem::getIsptResult, params.getType()) .set(QlyIsptItem::getDisQty, item.getDisQty()) .in(QlyIsptItem::getId, item.getId()))) { throw new CoolException("修改失败!!"); } }); } else { if (!this.updateBatchById(isptItem)) { throw new CoolException("明细修改失败"); @@ -63,7 +75,7 @@ QlyInspect inspect = qlyInspectService.getById(key); List<QlyIsptItem> items = listMap.get(key); Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum(); Double rcptQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum(); Double dlyQty = items.stream().mapToDouble(QlyIsptItem::getDlyQty).sum(); Double disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum(); Double qlyQty = safeQty + disQty; //安全数量,质检数量 @@ -72,7 +84,8 @@ if (Double.compare(disQty, 0) > 0) { inspect.setIsptResult(Short.parseShort("4")); } if (Double.compare(safeQty, rcptQty) == 0) { if (Double.compare(safeQty, dlyQty) == 0) { inspect.setIsptStatus("1"); inspect.setIsptResult(Short.parseShort("1")); } if (!qlyInspectService.updateById(inspect)) { rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -70,7 +70,7 @@ Task task = new Task(); task.setTaskCode(ruleCode) .setTaskStatus(TaskStsType.GENERATE_IN.id.shortValue()) .setTaskStatus(TaskType.TASK_TYPE_IN.type.shortValue()) .setTaskType(TaskType.TASK_TYPE_IN.type.shortValue()) .setTargLoc(LocManageUtil.getTargetLoc()) .setBarcode(pakin.getBarcode()) .setTargSite(LocManageUtil.getTargetSite());