细节优化 注释添加,增加订单加工数量统计
This commit is contained in:
		| @@ -46,7 +46,7 @@ public class CurrTaskController extends BaseController { | |||||||
|  |  | ||||||
|  |  | ||||||
|     @PostMapping(value = "currentTaskNow") |     @PostMapping(value = "currentTaskNow") | ||||||
|     @ApiOperation(value = "获取当前执行的任务") |     @ApiOperation(value = "获取当前执行的任务 (车辆名称传id)") | ||||||
|     public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) { |     public R<PageVo<CurrTaskQueryVo>> currentTask(@Validated @RequestBody CurrTaskQueryParam param) { | ||||||
|         return currTaskService.currentTaskPage(param); |         return currTaskService.currentTaskPage(param); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -40,11 +40,16 @@ public class OrderInfoController extends BaseController { | |||||||
|         return orderInfoService.page(orderBaseParam); |         return orderInfoService.page(orderBaseParam); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 应该没有人工创建信息这个接口 | ||||||
|  |      */ | ||||||
|     @PostMapping(value = "personCreateOrder") |     @PostMapping(value = "personCreateOrder") | ||||||
|     @ApiOperation(value = "人工创建订单信息") |     @ApiOperation(value = "人工创建订单信息") | ||||||
|     private R personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { |     @Deprecated | ||||||
|  |     private R<String> personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { | ||||||
|         return orderInfoService.personCreateOrder(orderInfoPersonCreateParam); |         return orderInfoService.personCreateOrder(orderInfoPersonCreateParam); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @PostMapping(value = "get") |     @PostMapping(value = "get") | ||||||
|     @ApiOperation(value = "当前订单查看详情") |     @ApiOperation(value = "当前订单查看详情") | ||||||
|     private R<OrderInfoVo> get(@Validated @RequestBody IdParam idParam) { |     private R<OrderInfoVo> get(@Validated @RequestBody IdParam idParam) { | ||||||
| @@ -66,13 +71,15 @@ public class OrderInfoController extends BaseController { | |||||||
|  |  | ||||||
|     @PostMapping(value = "completeOrder") |     @PostMapping(value = "completeOrder") | ||||||
|     @ApiOperation(value = "完成订单") |     @ApiOperation(value = "完成订单") | ||||||
|     private R completeOrder(@Validated @RequestBody IdParam idParam) { |     @Deprecated | ||||||
|  |     private R<String> completeOrder(@Validated @RequestBody IdParam idParam) { | ||||||
|         return orderInfoService.completeOrder(idParam); |         return orderInfoService.completeOrder(idParam); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @PostMapping(value = "voidOrder") |     @PostMapping(value = "voidOrder") | ||||||
|     @ApiOperation(value = "作废订单") |     @ApiOperation(value = "作废订单") | ||||||
|     private R voidOrder(@Validated @RequestBody IdParam idParam) { |     @Deprecated | ||||||
|  |     private R<String> voidOrder(@Validated @RequestBody IdParam idParam) { | ||||||
|         return orderInfoService.voidOrder(idParam); |         return orderInfoService.voidOrder(idParam); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ public class TaskCreateParam extends BaseParam { | |||||||
|     private String startPosition; |     private String startPosition; | ||||||
|     @ApiModelProperty(value = "终点位置", required = true) |     @ApiModelProperty(value = "终点位置", required = true) | ||||||
|     private String targetPosition; |     private String targetPosition; | ||||||
|     @ApiModelProperty(value = "加工任务类型", required = true) |     @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工 ,2 追加加工", required = true) | ||||||
|     private Integer processType; |     private Integer processType; | ||||||
|     @ApiModelProperty(value = "窑炉Id", required = true) |     @ApiModelProperty(value = "窑炉Id", required = true) | ||||||
|     private Long kilnId; |     private Long kilnId; | ||||||
|   | |||||||
| @@ -10,6 +10,7 @@ import com.mt.wms.empty.params.TaskCreateDetParam; | |||||||
| import com.mt.wms.empty.vo.CurrTaskDetVo; | import com.mt.wms.empty.vo.CurrTaskDetVo; | ||||||
| import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | ||||||
|  |  | ||||||
|  | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -66,4 +67,12 @@ public interface CurrTaskDetService { | |||||||
|      * @return 结果 |      * @return 结果 | ||||||
|      */ |      */ | ||||||
|     R<String> deleteByCurrTaskId(Long currTaskId); |     R<String> deleteByCurrTaskId(Long currTaskId); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 通过标识卡号查询订单统计数 | ||||||
|  |      * | ||||||
|  |      * @param idCard 任务详情历史 | ||||||
|  |      * @return 结果 | ||||||
|  |      */ | ||||||
|  |     HashMap<String, Double> getSumByIdCard(String idCard); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ public interface CurrTaskService { | |||||||
|     R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param); |     R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 完成执行任务 |      * 完成执行任务 不会物理删除,会将删除值置为0,同时在历史表复制一份记录 方便在订单未完成时查询任务详情 | ||||||
|      * |      * | ||||||
|      * @param param id |      * @param param id | ||||||
|      * @return 结果 |      * @return 结果 | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ import com.mt.wms.core.vo.R; | |||||||
| import com.mt.wms.empty.params.OrderInfoTaskDetParam; | import com.mt.wms.empty.params.OrderInfoTaskDetParam; | ||||||
| import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | ||||||
|  |  | ||||||
|  | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -39,4 +40,12 @@ public interface TaskDetHisService { | |||||||
|      * @return 结果 |      * @return 结果 | ||||||
|      */ |      */ | ||||||
|     PageVo<OrderInfoTaskDetVo> getHisOrderHisTask(OrderInfoTaskDetParam param); |     PageVo<OrderInfoTaskDetVo> getHisOrderHisTask(OrderInfoTaskDetParam param); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 通过标识卡号查询订单统计数 | ||||||
|  |      * | ||||||
|  |      * @param idCard 任务详情历史 | ||||||
|  |      * @return 结果 | ||||||
|  |      */ | ||||||
|  |     HashMap<String, Double> getSumByIdCard(String idCard); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -13,12 +13,15 @@ import com.mt.wms.empty.params.CurrTaskDetQueryParam; | |||||||
| import com.mt.wms.empty.params.OrderInfoTaskDetParam; | import com.mt.wms.empty.params.OrderInfoTaskDetParam; | ||||||
| import com.mt.wms.empty.params.TaskCreateDetParam; | import com.mt.wms.empty.params.TaskCreateDetParam; | ||||||
| import com.mt.wms.empty.service.CurrTaskDetService; | import com.mt.wms.empty.service.CurrTaskDetService; | ||||||
|  | import com.mt.wms.empty.service.CurrTaskService; | ||||||
| import com.mt.wms.empty.vo.CurrTaskDetVo; | import com.mt.wms.empty.vo.CurrTaskDetVo; | ||||||
|  | import com.mt.wms.empty.vo.CurrTaskVo; | ||||||
| import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
|  |  | ||||||
|  | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -34,15 +37,17 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe | |||||||
|  |  | ||||||
|     @Autowired |     @Autowired | ||||||
|     CurrTaskDetServiceBiz currTaskDetServiceBiz; |     CurrTaskDetServiceBiz currTaskDetServiceBiz; | ||||||
|  |     @Autowired | ||||||
|  |     CurrTaskService currTaskService; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageVo<OrderInfoTaskDetVo> getCurrOrderCurrTask(OrderInfoTaskDetParam param) { |     public PageVo<OrderInfoTaskDetVo> getCurrOrderCurrTask(OrderInfoTaskDetParam param) { | ||||||
|         QueryWrapper<CurrTaskDet> queryWrapper = new QueryWrapper<>(); |         QueryWrapper<CurrTaskDet> queryWrapper = new QueryWrapper<>(); | ||||||
|         queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM,param.getIdenCardNum()) |         queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) | ||||||
|                         .eq(CurrTaskDet.ORDER_NO,param.getOrderNo()) |                 .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) | ||||||
|                                 .eq(CurrTaskDet.VALID,1); |                 .eq(CurrTaskDet.VALID, 1); | ||||||
|         Page<CurrTaskDet> page = currTaskDetServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); |         Page<CurrTaskDet> page = currTaskDetServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); | ||||||
|        return new PageVo<>(page, OrderInfoTaskDetVo.class); |         return new PageVo<>(page, OrderInfoTaskDetVo.class); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -85,4 +90,27 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe | |||||||
|         currTaskDetServiceBiz.remove(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTaskId)); |         currTaskDetServiceBiz.remove(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTaskId)); | ||||||
|         return successful("成功。"); |         return successful("成功。"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public HashMap<String, Double> getSumByIdCard(String idCard) { | ||||||
|  |         HashMap<String, Double> result = new HashMap<>(2); | ||||||
|  |         QueryWrapper<CurrTaskDet> queryWrapper = new QueryWrapper<>(); | ||||||
|  |         queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, idCard) | ||||||
|  |                 .eq(CurrTaskDet.VALID, 1); | ||||||
|  |         List<CurrTaskDet> list = currTaskDetServiceBiz.list(queryWrapper); | ||||||
|  |         list.forEach(e -> { | ||||||
|  |             CurrTaskVo byId = currTaskService.getCurrTask(IdParam.builder().id(e.getCurrTaskId()).build()); | ||||||
|  |             //如果加工类型是复加工,或者任务作废。移除对象 | ||||||
|  |             if (byId.getProcessType().equals(2) || byId.getValid() != 1) | ||||||
|  |             { | ||||||
|  |                 list.remove(e); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |         //计算加工总数 | ||||||
|  |         double sumWeight = list.stream().mapToDouble(CurrTaskDet::getWeight).sum(); | ||||||
|  |         double sumQuantity = list.stream().mapToDouble(CurrTaskDet::getQuantity).sum(); | ||||||
|  |         result.put("weight", sumWeight); | ||||||
|  |         result.put("quantity", sumQuantity); | ||||||
|  |         return result; | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -94,7 +94,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService | |||||||
|         taskHis.setId(null); |         taskHis.setId(null); | ||||||
|         //将主任务放入到历史表,清空id,防止重复 |         //将主任务放入到历史表,清空id,防止重复 | ||||||
|         R<IdVo> save = taskHisService.save(taskHis); |         R<IdVo> save = taskHisService.save(taskHis); | ||||||
|         currTaskServiceBiz.removeById(byId.getId()); |         byId.setValid(0); | ||||||
|  |         byId.setStatus(2); | ||||||
|  |         currTaskServiceBiz.updateById(byId); | ||||||
|         List<CurrTaskDet> taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build()); |         List<CurrTaskDet> taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build()); | ||||||
|         List<TaskDetHis> taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class); |         List<TaskDetHis> taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class); | ||||||
|         taskDetHis.forEach(detHis -> { |         taskDetHis.forEach(detHis -> { | ||||||
|   | |||||||
| @@ -23,10 +23,7 @@ import com.mt.wms.core.vo.R; | |||||||
| import com.mt.wms.empty.controller.ApmsController; | import com.mt.wms.empty.controller.ApmsController; | ||||||
| import com.mt.wms.empty.enums.OrderSourceEnum; | import com.mt.wms.empty.enums.OrderSourceEnum; | ||||||
| import com.mt.wms.empty.params.*; | import com.mt.wms.empty.params.*; | ||||||
| import com.mt.wms.empty.service.CurrTaskDetService; | import com.mt.wms.empty.service.*; | ||||||
| import com.mt.wms.empty.service.CurrTaskService; |  | ||||||
| import com.mt.wms.empty.service.OrderInfoHisService; |  | ||||||
| import com.mt.wms.empty.service.OrderInfoService; |  | ||||||
| import com.mt.wms.empty.vo.CurrTaskVo; | import com.mt.wms.empty.vo.CurrTaskVo; | ||||||
| import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | ||||||
| import com.mt.wms.empty.vo.OrderInfoVo; | import com.mt.wms.empty.vo.OrderInfoVo; | ||||||
| @@ -37,6 +34,7 @@ import org.springframework.stereotype.Service; | |||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
|  |  | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
|  | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||||
| @@ -60,6 +58,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic | |||||||
|     @Autowired |     @Autowired | ||||||
|     CurrTaskDetService currTaskDetService; |     CurrTaskDetService currTaskDetService; | ||||||
|     @Autowired |     @Autowired | ||||||
|  |     TaskDetHisService taskDetHisService; | ||||||
|  |     @Autowired | ||||||
|     CurrTaskService currTaskService; |     CurrTaskService currTaskService; | ||||||
|     @Autowired |     @Autowired | ||||||
|     KilnInfoService kilnInfoService; |     KilnInfoService kilnInfoService; | ||||||
| @@ -165,10 +165,21 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic | |||||||
|     @Override |     @Override | ||||||
|     public R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum) { |     public R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum) { | ||||||
|         QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>(); |         QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>(); | ||||||
|         wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1).eq(OrderInfo.STATUS, 0); |         wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1); | ||||||
|         OrderInfo one = orderInfoService.getOne(wrapper); |         OrderInfo one = orderInfoService.getOne(wrapper); | ||||||
|         OrderInfoVo build = OrderInfoVo.builder().build(); |         OrderInfoVo build = OrderInfoVo.builder().build(); | ||||||
|         BeanUtils.copyProperties(one, build); |         BeanUtils.copyProperties(one, build); | ||||||
|  |         //查询历史任务表,当前任务表,拉取加工完成 创建任务未加工 计算剩余数量 | ||||||
|  |         HashMap<String, Double> sumCurrTask = currTaskDetService.getSumByIdCard(idenCardNum); | ||||||
|  |         build.setWaitQuantity(sumCurrTask.get("quantity").floatValue()); | ||||||
|  |         build.setWaitWeight(sumCurrTask.get("weight").floatValue()); | ||||||
|  |  | ||||||
|  |         HashMap<String, Double> sumTaskHis = taskDetHisService.getSumByIdCard(idenCardNum); | ||||||
|  |         build.setFinishQuantity(sumTaskHis.get("quantity").floatValue()); | ||||||
|  |         build.setFinishWeight(sumTaskHis.get("weight").floatValue()); | ||||||
|  |  | ||||||
|  |         build.setLastQuantity(build.getQuantity() - build.getFinishQuantity() - build.getWaitQuantity()); | ||||||
|  |         build.setLastWeight(build.getWeight() - build.getFinishWeight() - build.getWaitWeight()); | ||||||
|         return successful(build); |         return successful(build); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,18 +3,21 @@ package com.mt.wms.empty.service.impl; | |||||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
| import com.mt.wms.core.base.BaseService; | import com.mt.wms.core.base.BaseService; | ||||||
| import com.mt.wms.core.dal.entity.CurrTaskDet; |  | ||||||
| import com.mt.wms.core.dal.entity.TaskDetHis; | import com.mt.wms.core.dal.entity.TaskDetHis; | ||||||
| import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; | import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; | ||||||
|  | import com.mt.wms.core.params.IdParam; | ||||||
| import com.mt.wms.core.vo.PageVo; | import com.mt.wms.core.vo.PageVo; | ||||||
| import com.mt.wms.core.vo.R; | import com.mt.wms.core.vo.R; | ||||||
| import com.mt.wms.empty.params.OrderInfoTaskDetParam; | import com.mt.wms.empty.params.OrderInfoTaskDetParam; | ||||||
| import com.mt.wms.empty.service.TaskDetHisService; | import com.mt.wms.empty.service.TaskDetHisService; | ||||||
|  | import com.mt.wms.empty.service.TaskHisService; | ||||||
|  | import com.mt.wms.empty.vo.CurrTaskVo; | ||||||
| import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | import com.mt.wms.empty.vo.OrderInfoTaskDetVo; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
|  |  | ||||||
|  | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -30,7 +33,8 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ | |||||||
|  |  | ||||||
|     @Autowired |     @Autowired | ||||||
|     TaskDetHisServiceBiz taskDetHisServiceBiz; |     TaskDetHisServiceBiz taskDetHisServiceBiz; | ||||||
|  |     @Autowired | ||||||
|  |     TaskHisService taskhisService; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public R<String> save(TaskDetHis taskDetHis) { |     public R<String> save(TaskDetHis taskDetHis) { | ||||||
| @@ -47,10 +51,33 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ | |||||||
|     @Override |     @Override | ||||||
|     public PageVo<OrderInfoTaskDetVo> getHisOrderHisTask(OrderInfoTaskDetParam param) { |     public PageVo<OrderInfoTaskDetVo> getHisOrderHisTask(OrderInfoTaskDetParam param) { | ||||||
|         QueryWrapper<TaskDetHis> queryWrapper = new QueryWrapper<>(); |         QueryWrapper<TaskDetHis> queryWrapper = new QueryWrapper<>(); | ||||||
|         queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) |         queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, param.getIdenCardNum()) | ||||||
|                 .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) |                 .eq(TaskDetHis.ORDER_NO, param.getOrderNo()) | ||||||
|                 .eq(CurrTaskDet.VALID, 1); |                 .eq(TaskDetHis.VALID, 1); | ||||||
|         Page<TaskDetHis> page = taskDetHisServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); |         Page<TaskDetHis> page = taskDetHisServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); | ||||||
|         return new PageVo<>(page, OrderInfoTaskDetVo.class); |         return new PageVo<>(page, OrderInfoTaskDetVo.class); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public HashMap<String, Double> getSumByIdCard(String idCard) { | ||||||
|  |         HashMap<String, Double> result = new HashMap<>(2); | ||||||
|  |         QueryWrapper<TaskDetHis> queryWrapper = new QueryWrapper<>(); | ||||||
|  |         queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, idCard) | ||||||
|  |                 .eq(TaskDetHis.VALID, 1); | ||||||
|  |         List<TaskDetHis> list = taskDetHisServiceBiz.list(queryWrapper); | ||||||
|  |         list.forEach(e -> { | ||||||
|  |             CurrTaskVo byId = taskhisService.getById(IdParam.builder().id(e.getTaskId()).build()); | ||||||
|  |             //如果加工类型是复加工,或者任务作废。移除对象 | ||||||
|  |             if (byId.getProcessType().equals(2) || byId.getValid() != 1) | ||||||
|  |             { | ||||||
|  |                 list.remove(e); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |         //计算加工总数 | ||||||
|  |         double sumWeight = list.stream().mapToDouble(TaskDetHis::getWeight).sum(); | ||||||
|  |         double sumQuantity = list.stream().mapToDouble(TaskDetHis::getQuantity).sum(); | ||||||
|  |         result.put("weight", sumWeight); | ||||||
|  |         result.put("quantity", sumQuantity); | ||||||
|  |         return result; | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -25,6 +25,14 @@ import java.time.LocalDateTime; | |||||||
| public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { | public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { | ||||||
|     @ApiModelProperty(value = "id") |     @ApiModelProperty(value = "id") | ||||||
|     private Long id; |     private Long id; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 删除标志,是否有效:1 可用 0不可用,2停止 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty("删除标志") | ||||||
|  |     private Integer valid; | ||||||
|  |  | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 状态:	0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) |      * 状态:	0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) | ||||||
|      */ |      */ | ||||||
| @@ -55,6 +63,12 @@ public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { | |||||||
|     @ApiModelProperty("任务类型") |     @ApiModelProperty("任务类型") | ||||||
|     private Integer taskType; |     private Integer taskType; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 加工类型:0 初始加工,1 复加工 ,2 追加加工 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty("任务类型") | ||||||
|  |     private Integer processType; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 托盘编码 |      * 托盘编码 | ||||||
|      */ |      */ | ||||||
|   | |||||||
| @@ -1,8 +1,6 @@ | |||||||
| package com.mt.wms.empty.vo; | package com.mt.wms.empty.vo; | ||||||
|  |  | ||||||
| import com.baomidou.mybatisplus.annotation.*; |  | ||||||
| import com.mt.wms.core.base.BaseVo; | import com.mt.wms.core.base.BaseVo; | ||||||
| import com.mt.wms.core.base.ITree; |  | ||||||
| import com.mt.wms.core.vo.PageVo; | import com.mt.wms.core.vo.PageVo; | ||||||
| import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||||
| import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||||
| @@ -11,9 +9,7 @@ import lombok.Data; | |||||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||||
| import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||||
|  |  | ||||||
| import javax.validation.constraints.NotNull; |  | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
| import java.util.List; |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
| @@ -32,6 +28,12 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { | |||||||
|      */ |      */ | ||||||
|     @ApiModelProperty(value = "主键") |     @ApiModelProperty(value = "主键") | ||||||
|     private Long id; |     private Long id; | ||||||
|  |     /** | ||||||
|  |      * 删除标志,是否有效:1 可用 0不可用,2停止 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty("删除标志") | ||||||
|  |     private Integer valid; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 来源:1.APMS  2.人工输入 |      * 来源:1.APMS  2.人工输入 | ||||||
|      */ |      */ | ||||||
| @@ -65,13 +67,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { | |||||||
|      */ |      */ | ||||||
|     @ApiModelProperty(value = "状态") |     @ApiModelProperty(value = "状态") | ||||||
|     private Integer status; |     private Integer status; | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 内部编码,系统自动生成 |  | ||||||
|      */ |  | ||||||
|     @ApiModelProperty(value = "内部编码") |  | ||||||
|     private String interCode; |  | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 编码 |      * 编码 | ||||||
|      */ |      */ | ||||||
| @@ -143,4 +138,41 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { | |||||||
|      */ |      */ | ||||||
|     @ApiModelProperty(value = "数量") |     @ApiModelProperty(value = "数量") | ||||||
|     private Float quantity; |     private Float quantity; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 重量 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "完成加工重量") | ||||||
|  |     private Float finishWeight; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 数量 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "完成加工数量") | ||||||
|  |     private Float finishQuantity; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 待加工重量 任务创建等待中 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "等待重量") | ||||||
|  |     private Float waitWeight; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 待加工数量 任务创建等待中 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "等待数量") | ||||||
|  |     private Float waitQuantity; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 剩余重量 完全未处理 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "剩余重量") | ||||||
|  |     private Float lastWeight; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 剩余数量 完全未处理 | ||||||
|  |      */ | ||||||
|  |     @ApiModelProperty(value = "剩余数量") | ||||||
|  |     private Float lastQuantity; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
		Referens i nytt ärende
	
	Block a user