From 00bea068ad5dbb49a90a87f0fdbed4f3e0b51468 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080> Date: Fri, 1 Dec 2023 09:52:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E4=BB=BB=E5=8A=A1=E6=97=B6=E9=97=B4=E5=88=B0?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWorkOrderController.java | 2 +- .../controller/TaskQuestController.java | 17 ++++++++++- .../warehouse/service/ITaskQuestService.java | 6 ++++ .../service/impl/TaskQuestServiceImpl.java | 30 +++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java index b93ca2c2a..df48d1e8b 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java @@ -114,7 +114,7 @@ public class AftersalesWorkOrderController extends BladeController { /** - * 客服异常工单 完结处理熟练 + * 客服异常工单 完结处理 */ @PostMapping("/addCompletionEnd") @ApiOperationSupport(order = 4) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java index e5f84ea83..55bab8e5e 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java @@ -31,6 +31,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; import javax.validation.Valid; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.secure.BladeUser; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -63,6 +64,7 @@ import javax.servlet.http.HttpServletResponse; @AllArgsConstructor @RequestMapping("blade-taskQuest/taskQuest") @Api(value = "盘点任务", tags = "盘点任务接口") +@Slf4j public class TaskQuestController extends BladeController { private final ITaskQuestService taskQuestService; @@ -79,6 +81,19 @@ public class TaskQuestController extends BladeController { } + /** + * 盘点任务 到时间結束盘点任务 + */ + @GetMapping("/finishTask") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入taskQuest") + public void finishTask() { + log.info("查询盘点任务!!"); + taskQuestService.getFinishTask(); + + } + + /** * 盘点任务 任务下的包条 @@ -250,7 +265,7 @@ public class TaskQuestController extends BladeController { } /** - * 盘点任务 修改 + * 盘点任务 实体 修改 */ @PostMapping("/updateInfo") @ApiOperationSupport(order = 5) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java index 1b383e8e0..b958e8eb1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java @@ -269,4 +269,10 @@ public interface ITaskQuestService extends BaseService { * @return */ List exportGetContrastInfo(QuestDetailDTO questDetailDTO); + + /** + * 查询盘点任务是否结束 + * @param id + */ + void getFinishTask(); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index 7863a0502..2a1141b9c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -63,6 +63,7 @@ import org.springblade.system.feign.IUserSearchClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -1357,6 +1358,35 @@ public class TaskQuestServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + List taskQuestEntities = baseMapper.selectList(queryWrapper); + taskQuestEntities.forEach( i ->{ + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + long l = format.parse(i.getEndTime()).getTime() / 1000; + long l1 = new Date().getTime() / 1000; + if(l < l1){ + //结束当前任务 + TaskQuestEntity taskQuestEntity = new TaskQuestEntity(); + taskQuestEntity.setId(i.getId()); + taskQuestEntity.setQuestStatus(String.valueOf(3)); + baseMapper.updateById(taskQuestEntity); + } + } catch (ParseException e) { + throw new RuntimeException(e); + } + + + + }); + } + /** * 查询货位上的数据 * @param taskSearchDTO From cde307a111f4c8e5b28c44ce62adca649b9f5003 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 1 Dec 2023 10:36:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=87=E8=B4=A7SQL=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapper/DistributionReservationMapper.xml | 7 ++++--- .../service/impl/DistributionSignforServiceImpl.java | 2 +- .../wrapper/DistributionDisStockListWrapper.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 5070469d2..cf65074d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -308,9 +308,10 @@ ldslNew.tray_name AS trayName, ldslNew.unpack AS unpack, ldslNew.source_type AS sourceType, - count(ldss.id) AS realNum, + + (SELECT count(*) FROM logpm_distribution_stock AS lds WHERE lds.stock_list_id = t.id AND lds.is_deleted = 0) AS realNum, - t.reservation_num as planNum, + t.reservationNum as planNum, ( select GROUP_CONCAT( DISTINCT (allocation_id)) from logpm_warehouse_updown_goods where association_value =ldslNew.cargo_number or association_value in ( SELECT order_package_code from logpm_distribution_parcel_list where conditions=2 and material_code=ldslNew.cargo_number) @@ -322,7 +323,7 @@ ldsl.description_goods, ldsl.id, ldrs.id as deliveryDetailsId, - ldrs.reservation_num + SUM(ldrs.reservation_num) AS reservationNum FROM logpm_distribution_reservation_stocklist ldrs LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index a340f408a..af03418ff 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -389,7 +389,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl