فهرست منبع

修改sql查询bug

车车 3 ماه پیش
والد
کامیت
6641ff915b

+ 2 - 3
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/job/SopExecutionPlanJob.java

@@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.iscs.job;
 import cn.hutool.core.date.DateUtil;
 import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
 import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
+import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
 import cn.iocoder.yudao.module.iscs.controller.admin.jobticket.vo.JobTicketSaveReqVO;
 import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopExecutionPlanRespVO;
 import cn.iocoder.yudao.module.iscs.dal.dataobject.jobticket.JobTicketDO;
 import cn.iocoder.yudao.module.iscs.service.jobticket.JobTicketService;
 import cn.iocoder.yudao.module.iscs.service.sop.SopExecutionPlanService;
-import cn.iocoder.yudao.module.iscs.service.sop.SopService;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
@@ -31,8 +31,6 @@ public class SopExecutionPlanJob implements JobHandler {
     @Resource
     private SopExecutionPlanService sopExecutionPlanService;
     @Resource
-    private SopService sopService;
-    @Resource
     private JobTicketService jobTicketService;
 
     /**
@@ -45,6 +43,7 @@ public class SopExecutionPlanJob implements JobHandler {
     @Override
     @TenantIgnore
     public String execute(String param) {
+        TenantUtils.execute(1L, () -> {});
         String yyyymmdd = DateUtil.format(new Date(), "yyyy-MM-dd");
         SopExecutionPlanRespVO sopExecutionPlanRespVO = new SopExecutionPlanRespVO();
         sopExecutionPlanRespVO.setNextExecutDate(yyyymmdd);

+ 4 - 0
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/jobticket/JobTicketServiceImpl.java

@@ -265,6 +265,10 @@ public class JobTicketServiceImpl extends ServiceImpl<JobTicketMapper, JobTicket
         Assert.notNull(vo.getSopId(), "sopId不能为空!");
         SopDO sopDO = sopService.getById(vo.getSopId());
         Assert.isTrue(sopDO != null, "sop信息不存在!");
+        if (sopDO.getWorkstationId() != null) {
+            vo.setWorkstationId(sopDO.getWorkstationId());
+            vo.setMachineryId(sopDO.getMachineryId());
+        }
         // 1.1.名称重复
         Assert.isTrue(StringUtils.isNotBlank(vo.getTicketName()), "作业名称不可为空!");
         List<JobTicketDO> list = list(Wrappers.<JobTicketDO>lambdaQuery().eq(JobTicketDO::getTicketName, vo.getTicketName()));

+ 1 - 1
yudao-module-iscs/src/main/resources/mapper/SopExecutionPlanMapper.xml

@@ -19,7 +19,7 @@
                 LEFT JOIN isc_sop s ON s.id = e.sop_id
         <where>
             <if test="vo.nextExecutDate != null and vo.nextExecutDate.trim != ''">
-                e.next_execut_date #{vo.nextExecutDate}
+                e.next_execut_date = #{vo.nextExecutDate}
             </if>
         </where>
     </select>