laozt 1 year ago
commit ae8a91a7ab

@ -179,7 +179,7 @@ public class BPlanEnterpriseRequest {
* 0 1 * 0 1
*/ */
@ApiModelProperty(value = "0未检查 1已检查") @ApiModelProperty(value = "0未检查 1已检查")
private Integer checkStatus; private Integer checkStatus=0;
/** /**

@ -133,5 +133,10 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
*/ */
List<BPlanEnterprise> selectUpdateAll(); List<BPlanEnterprise> selectUpdateAll();
/**
*
*/
void updateEndTime();
} }

@ -37,16 +37,20 @@ public class EnterpristQuartz {
private IBEnterpriseNewService bEnterpriseNewService; private IBEnterpriseNewService bEnterpriseNewService;
// 每周一早上五点5点执行一次任务 生成企业新表 // 每天早上5点执行一次任务 更新企业新表的最新检查时间字段
@Scheduled(cron = "0 0 17 ? * SUN") @Scheduled(cron = "0 0 5 * * ?")
// @GetMapping("/getList") // @GetMapping("/getList")
// @ApiOperation(value = "定时任务") // @ApiOperation(value = "定时任务")
public AjaxResult updateInformationData() { public AjaxResult updateInformationData() {
//三表关联查询数据 //三表关联查询数据
List<BEnterpriseNew> list = bEnterpriseNewMapper.seletAll(); List<BEnterpriseNew> list = bEnterpriseNewMapper.seletAll();
//清空企业新表中的数据 //清空企业新表中的数据
bEnterpriseNewMapper.deletAll(); // bEnterpriseNewMapper.deletAll();
bEnterpriseNewService.saveBatch(list); // bEnterpriseNewService.saveBatch(list);
// 改成只更新最新检查时间字段
bPlanEnterpriseService.updateEndTime();
return AjaxResult.success(); return AjaxResult.success();
} }

@ -120,5 +120,11 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
* @return * @return
*/ */
List<BPlanEnterprise> selectUpdateAll(); List<BPlanEnterprise> selectUpdateAll();
/**
*
*/
void updateEndTime();
} }

@ -124,6 +124,10 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
return bPlanEnterpriseMapper.selectUpdateAll(); return bPlanEnterpriseMapper.selectUpdateAll();
} }
@Override
public void updateEndTime() {
bPlanEnterpriseMapper.updateEndTime();
}
} }

@ -6,17 +6,18 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
#远程 #公司远程
# url: jdbc:mysql://39.101.188.84:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://39.101.188.84:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root # username: root
# password: Admin123@ # password: Admin123@
#本地 #本地
url: jdbc:mysql://localhost:3306/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://localhost:3306/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: adminadmin
# url: jdbc:mysql://192.167.2.56:3306/ying_ji?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC
# username: root # username: root
# password: Jichuang@2023 # password: adminadmin
#远程
url: jdbc:mysql://192.167.2.56:3306/ying_ji?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC
username: root
password: Jichuang@2023
#公司本地 #公司本地
# url: jdbc:mysql://localhost:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://localhost:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root # username: root

@ -177,6 +177,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
order by law_sort,planned_month+0
</select> </select>
<select id="page" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise"> <select id="page" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
select * from b_plan_enterprise select * from b_plan_enterprise
@ -349,7 +350,6 @@
) e ON a.enterprise_id = e.USC_CODE ) e ON a.enterprise_id = e.USC_CODE
</select> </select>
<update id="updateIdList" parameterType="java.util.List"> <update id="updateIdList" parameterType="java.util.List">
UPDATE b_plan_enterprise UPDATE b_plan_enterprise
SET status = 1 SET status = 1
@ -386,7 +386,20 @@
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateEndTime">
UPDATE b_enterprise_new a
INNER JOIN (
SELECT
USC_CODE,
MAX_EXAMINE_END_TIME
FROM
( SELECT ROW_NUMBER ( ) over ( PARTITION BY USC_CODE ORDER BY EXAMINE_END_TIME DESC ) rowId, USC_CODE, EXAMINE_END_TIME AS MAX_EXAMINE_END_TIME FROM sz_enfor_examine ) S
WHERE
rowId = 1
) c
ON a.enterprise_id = c.USC_CODE
SET a.EXAMINE_END_TIME = c.MAX_EXAMINE_END_TIME
</update>
<insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id"> <insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id">
@ -413,6 +426,7 @@
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if> <if test="deptId != null">dept_id,</if>
<if test="uuto != null">uuto,</if> <if test="uuto != null">uuto,</if>
<if test="checkStatus != null">check_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -437,6 +451,7 @@
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if> <if test="deptId != null">#{deptId},</if>
<if test="uuto != null">#{uuto},</if> <if test="uuto != null">#{uuto},</if>
<if test="checkStatus != null">#{checkStatus},</if>
</trim> </trim>
</insert> </insert>

Loading…
Cancel
Save