From 8cdb56d16c15137c0ce220da12769db452755d11 Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Fri, 22 Dec 2023 13:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BC=81=E4=B8=9A=E6=96=B0?= =?UTF-8?q?=E8=A1=A8=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BEnterpriseNewController.java | 12 +++++- .../mapper/BEnterpriseNewMapper.java | 23 ++++++---- .../quartz/EnterpristQuartz.java | 34 ++++++++------- .../service/IBEnterpriseNewService.java | 11 ++++- .../impl/BEnterpriseNewServiceImpl.java | 11 ++++- .../mapper/yingji/BEnterpriseNewMapper.xml | 42 +++++++++++++++++-- 6 files changed, 105 insertions(+), 28 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java index 0fecce4..083458e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java @@ -3,7 +3,6 @@ package com.ruoyi.programManagement.controller; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; - import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.programManagement.entity.BEnterpriseNew; import com.ruoyi.programManagement.service.IBEnterpriseNewService; @@ -85,4 +84,15 @@ public class BEnterpriseNewController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bEnterpriseNewService.deleteBEnterpriseNewByIds(ids)); } + + /** + * 企业新表企业不存在计划表list + */ + @GetMapping("/getList") + @ApiOperation("企业新表企业不存在计划表list") + public TableDataInfo getList(BEnterpriseNew bEnterpriseNew) { + startPage(); + List list = bEnterpriseNewService.getList(bEnterpriseNew); + return getDataTable(list); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java index 7273732..67df8c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java @@ -1,17 +1,12 @@ package com.ruoyi.programManagement.mapper; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.toolkit.Constants; import com.ruoyi.programManagement.entity.BEnterpriseNew; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; import java.util.List; - /** * 企业新表Mapper接口 * @@ -69,9 +64,23 @@ public interface BEnterpriseNewMapper extends BaseMapper { int deleteBEnterpriseNewByIds(Long[] ids); - @Select("SELECT COUNT(*) FROM b_enterprise_new ${ew.customSqlSegment}") - Long selectCount(@Param(Constants.WRAPPER) Wrapper wrapper); + /** + * 定时任务删除企业新表数据 + */ + int deletAll(); + /** + * 定时任务三表关联查询数据 + * @return + */ + List seletAll(); + /** + * 企业新表企业不存在计划表list + * + * @return list + */ + List getList(BEnterpriseNew bEnterpriseNew); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java index 702e283..ba82cac 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java @@ -1,23 +1,23 @@ package com.ruoyi.programManagement.quartz; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.programManagement.entity.*; +import com.ruoyi.programManagement.entity.BEnterpriseNew; +import com.ruoyi.programManagement.entity.SzEnforExamine; import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse; import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper; -import com.ruoyi.programManagement.mapper.BStandardizationMapper; -import com.ruoyi.programManagement.mapper.SzsEnterpriseInformationMapper; import com.ruoyi.programManagement.service.BPlanEnterpriseService; +import com.ruoyi.programManagement.service.IBEnterpriseNewService; import com.ruoyi.programManagement.service.ISzEnforExamineService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.ibatis.session.SqlSession; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.ArrayList; import java.util.List; /** @@ -27,20 +27,20 @@ import java.util.List; //@EnableScheduling @Api(tags = "定时任务") @RestController +@Transactional(rollbackFor = Exception.class) @RequestMapping("/pharmaceuticals/quartz") public class EnterpristQuartz { - @Autowired - private SzsEnterpriseInformationMapper szsEnterpriseInformationMapper; + @Autowired private BEnterpriseNewMapper bEnterpriseNewMapper; - @Autowired - private BStandardizationMapper bStandardizationMapper; @Autowired private ISzEnforExamineService szEnforExamineService; + @Resource + private IBEnterpriseNewService bEnterpriseNewService; @Resource private BPlanEnterpriseService bPlanEnterpriseService; @@ -50,8 +50,12 @@ public class EnterpristQuartz { @GetMapping("/getList") @ApiOperation(value = "定时任务") public AjaxResult updateInformationData() { - - return AjaxResult.success(null); + //三表关联查询数据 + List list = bEnterpriseNewMapper.seletAll(); + //清空企业新表中的数据 + bEnterpriseNewMapper.deletAll(); + bEnterpriseNewService.saveBatch(list); + return AjaxResult.success(); } @@ -59,12 +63,12 @@ public class EnterpristQuartz { @GetMapping("/updateExamine") @ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段") public AjaxResult updateExamine() { - //查询计划表中的所有数据 + //查询计划表中的所有数据 List list = bPlanEnterpriseService.selectBPlanEnterpriseList(null); - for (BPlanEnterpriseResponse a:list){ + for (BPlanEnterpriseResponse a : list) { BEnterpriseNew bEnterpriseNew = new BEnterpriseNew(); List szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId()); - for (SzEnforExamine b:szEnforExamineList) { + for (SzEnforExamine b : szEnforExamineList) { bEnterpriseNew.setId(a.getId()); bEnterpriseNew.setExamineEndTime(b.getExamineEndTime()); bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew); @@ -73,4 +77,6 @@ public class EnterpristQuartz { return null; } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java index 42a1569..8b34731 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java @@ -1,5 +1,6 @@ package com.ruoyi.programManagement.service; +import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.programManagement.entity.BEnterpriseNew; import java.util.List; @@ -11,7 +12,7 @@ import java.util.List; * @author ruoyi * @since 2023-12-12 */ -public interface IBEnterpriseNewService { +public interface IBEnterpriseNewService extends IService { /** * 查询企业新表 * @@ -59,4 +60,12 @@ public interface IBEnterpriseNewService { * @return 结果 */ int deleteBEnterpriseNewById(Long id); + + + /** + * 企业新表企业不存在计划表list + * + * @return list + */ + List getList(BEnterpriseNew bEnterpriseNew); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java index 3d59560..e2f9097 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java @@ -1,9 +1,13 @@ package com.ruoyi.programManagement.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.programManagement.entity.BEnterpriseNew; +import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper; +import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper; +import com.ruoyi.programManagement.service.BPlanEnterpriseService; import com.ruoyi.programManagement.service.IBEnterpriseNewService; import org.springframework.stereotype.Service; @@ -17,7 +21,7 @@ import java.util.List; * @since 2023-12-12 */ @Service -public class BEnterpriseNewServiceImpl implements IBEnterpriseNewService { +public class BEnterpriseNewServiceImpl extends ServiceImpl implements IBEnterpriseNewService { @Resource private BEnterpriseNewMapper bEnterpriseNewMapper; @@ -89,4 +93,9 @@ public class BEnterpriseNewServiceImpl implements IBEnterpriseNewService { public int deleteBEnterpriseNewById(Long id) { return bEnterpriseNewMapper.deleteBEnterpriseNewById(id); } + + @Override + public List getList(BEnterpriseNew bEnterpriseNew) { + return bEnterpriseNewMapper.getList(bEnterpriseNew); + } } diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml index 80fbd8f..92e9f31 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml @@ -67,11 +67,9 @@ a.remark, a.user_id, a.dept_id, - c.status, CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint FROM b_enterprise_new a LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code - LEFT JOIN b_plan_enterprise c ON a.enterprise_id = c.enterprise_id ) s and s.enterprise_id = #{enterpriseId} @@ -102,7 +100,6 @@ and s.user_id = #{userId} and s.dept_id = #{deptId} and s.isPoint = #{isPoint} - and s.status = 0 @@ -188,7 +185,7 @@ - delete from b_enterprise_new + truncate table b_enterprise_new + \ No newline at end of file