laozt 1 year ago
commit ae8a91a7ab

@ -179,7 +179,7 @@ public class BPlanEnterpriseRequest {
* 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();
/**
*
*/
void updateEndTime();
}

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

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

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

@ -6,17 +6,18 @@ spring:
druid:
# 主库数据源
master:
#远程
#公司远程
# url: jdbc:mysql://39.101.188.84:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: Admin123@
#本地
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
# url: jdbc:mysql://localhost:3306/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# 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
# username: root

@ -177,6 +177,7 @@
</foreach>
</if>
</where>
order by law_sort,planned_month+0
</select>
<select id="page" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
select * from b_plan_enterprise
@ -349,7 +350,6 @@
) e ON a.enterprise_id = e.USC_CODE
</select>
<update id="updateIdList" parameterType="java.util.List">
UPDATE b_plan_enterprise
SET status = 1
@ -386,7 +386,20 @@
</trim>
where id = #{id}
</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">
@ -413,6 +426,7 @@
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="uuto != null">uuto,</if>
<if test="checkStatus != null">check_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -437,6 +451,7 @@
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="uuto != null">#{uuto},</if>
<if test="checkStatus != null">#{checkStatus},</if>
</trim>
</insert>

Loading…
Cancel
Save