| | |
| | | * 检测或校准物品的处置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @author |
| | | * @since 2024-11-02 02:50:19 |
| | | */ |
| | | @Service |
| | |
| | | String currentMonth = currentDate.format(formatter); |
| | | //查询历史 |
| | | ProcessTotaldeal processTotaldeal = processTotaldealMapper.selectOne(Wrappers.<ProcessTotaldeal>lambdaQuery().eq(ProcessTotaldeal::getMonth, currentMonth)); |
| | | processDeal.setTotaldealId(processTotaldeal.getId()); |
| | | if(ObjectUtils.isNotEmpty(processTotaldeal)){ |
| | | processDeal.setTotaldealId(processTotaldeal.getId()); |
| | | } |
| | | } |
| | | |
| | | return processDealMapper.pageProcessDeal(page, QueryWrappers.queryWrappers(processDeal)); |
| | |
| | | // 格式化当前日期 |
| | | String currentMonth = dealTime.format(formatter); |
| | | processTotaldeal= processTotaldealMapper.selectOne(Wrappers.<ProcessTotaldeal>lambdaQuery().eq(ProcessTotaldeal::getMonth,currentMonth)); |
| | | processDeal.setTotaldealId(processTotaldeal.getId()); |
| | | if(ObjectUtils.isNotEmpty(processTotaldeal)){ |
| | | processDeal.setTotaldealId(processTotaldeal.getId()); |
| | | } |
| | | }else { |
| | | processTotaldeal= processTotaldealMapper.selectById(processDeal.getTotaldealId()); |
| | | } |
| | |
| | | public int doProcessDeal(ProcessDeal processDeal) { |
| | | if (ObjectUtils.isNotEmpty(processDeal.getNum())) { |
| | | ProcessDeal oldProcessDeal = processDealMapper.selectById(processDeal.getId()); |
| | | ProcessTotaldeal processTotaldeal = processTotaldealMapper.selectById(processDeal.getTotaldealId()); |
| | | processTotaldeal.setTotalNum(processTotaldeal.getTotalNum() - oldProcessDeal.getNum() + processDeal.getNum()); |
| | | processTotaldealMapper.updateById(processTotaldeal); |
| | | if(null != processDeal.getTotaldealId()){ |
| | | ProcessTotaldeal processTotaldeal = processTotaldealMapper.selectById(processDeal.getTotaldealId()); |
| | | int totalNum = ObjectUtils.isEmpty(processTotaldeal) ? 0 : processTotaldeal.getTotalNum(); |
| | | processTotaldeal.setTotalNum(totalNum - oldProcessDeal.getNum() + processDeal.getNum()); |
| | | processTotaldealMapper.updateById(processTotaldeal); |
| | | } |
| | | } |
| | | return processDealMapper.updateById(processDeal); |
| | | } |