laozt 1 year ago
commit 9f13f175ab

@ -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<BEnterpriseNew> list = bEnterpriseNewService.getList(bEnterpriseNew);
return getDataTable(list);
}
}

@ -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<BEnterpriseNew> {
int deleteBEnterpriseNewByIds(Long[] ids);
@Select("SELECT COUNT(*) FROM b_enterprise_new ${ew.customSqlSegment}")
Long selectCount(@Param(Constants.WRAPPER) Wrapper<BEnterpriseNew> wrapper);
/**
*
*/
int deletAll();
/**
*
* @return
*/
List<BEnterpriseNew> seletAll();
/**
* list
*
* @return list
*/
List<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew);
}

@ -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<BEnterpriseNew> list = bEnterpriseNewMapper.seletAll();
//清空企业新表中的数据
bEnterpriseNewMapper.deletAll();
bEnterpriseNewService.saveBatch(list);
return AjaxResult.success();
}
@ -61,10 +65,10 @@ public class EnterpristQuartz {
public AjaxResult updateExamine() {
//查询计划表中的所有数据
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(null);
for (BPlanEnterpriseResponse a:list){
for (BPlanEnterpriseResponse a : list) {
BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
List<SzEnforExamine> 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;
}
}

@ -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<BEnterpriseNew> {
/**
*
*
@ -59,4 +60,12 @@ public interface IBEnterpriseNewService {
* @return
*/
int deleteBEnterpriseNewById(Long id);
/**
* list
*
* @return list
*/
List<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew);
}

@ -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<BEnterpriseNewMapper, BEnterpriseNew> 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<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew) {
return bEnterpriseNewMapper.getList(bEnterpriseNew);
}
}

@ -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
<where>
<if test="enterpriseId != null and enterpriseId != ''">and s.enterprise_id = #{enterpriseId}</if>
@ -102,7 +100,6 @@
<if test="userId != null ">and s.user_id = #{userId}</if>
<if test="deptId != null ">and s.dept_id = #{deptId}</if>
<if test="isPoint != null ">and s.isPoint = #{isPoint}</if>
and s.status = 0
</where>
</select>
@ -188,7 +185,7 @@
</foreach>
</delete>
<delete id="deletAll">
delete from b_enterprise_new
truncate table b_enterprise_new
</delete>
<select id="seletAll" resultType="com.ruoyi.programManagement.entity.BEnterpriseNew">
@ -203,4 +200,41 @@
GROUP BY USC_CODE
) e ON a.enterprise_id = e.USC_CODE;
</select>
<select id="getList" resultType="com.ruoyi.programManagement.entity.BEnterpriseNew">
select s.* from(SELECT a.*
FROM b_enterprise_new a
LEFT JOIN b_plan_enterprise b ON a.enterprise_id = b.enterprise_id
WHERE b.enterprise_id IS NULL)s
<where>
<if test="enterpriseId != null and enterpriseId != ''">and s.enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''">and s.enterprise_name like concat('%',
#{enterpriseName}, '%')
</if>
<if test="district != null and district.length==3">
and s.district like concat('%',#{district}, '%')
</if>
<if test="district != null and district.length==6">
and s.district like concat('%',#{district}, '%')
</if>
<if test="district != null and district != '' and district.length!=3 and district.length!=6">
and s.district in
<foreach item="item" index="index" collection="district.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="supervisionLarge != null and supervisionLarge != ''">and s.SUPERVISION_LARGE =
#{supervisionLarge}
</if>
<if test="riskLevel != null and riskLevel != ''">and s.RISK_LEVEL = #{riskLevel}</if>
<if test="standLevel != null and standLevel != ''">and s.STAND_LEVEL = #{standLevel}</if>
<if test="examineEndTime != null ">and s.EXAMINE_END_TIME = #{examineEndTime}</if>
<if test="createId != null ">and s.create_id = #{createId}</if>
<if test="updateId != null ">and s.update_id = #{updateId}</if>
<if test="userId != null ">and s.user_id = #{userId}</if>
<if test="deptId != null ">and s.dept_id = #{deptId}</if>
<if test="isPoint != null ">and s.isPoint = #{isPoint}</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save