资产修改

main
dongdingding 1 month ago
parent 9203bdc762
commit b37c20938b

@ -747,12 +747,18 @@ public class AssetTaskController extends BaseController {
/** /**
* - * -
* *
* @param * @param taskName
* @param taskId id
* @return * @return
*/ */
@ApiOperation(value = "管理端-关闭") @ApiOperation(value = "管理端-关闭")
@GetMapping("/close") @GetMapping("/close")
public AjaxResult close(@RequestParam(value = "taskId", required = false) Integer taskId) { public AjaxResult close(@RequestParam(value = "taskName") String taskName, @RequestParam(value = "taskId") Integer taskId) {
AssetLc assetLc = new AssetLc();
assetLc.setAssetName("管理员关闭" + taskName + "任务");
assetLc.setTaskId(taskId);
assetLc.setXfTime(LocalDateTime.now());
assetLcService.insert(assetLc);
assetTaskService.close(taskId); assetTaskService.close(taskId);
return AjaxResult.success(); return AjaxResult.success();
} }

@ -1,5 +1,6 @@
package com.ruoyi.tc.entity.response; package com.ruoyi.tc.entity.response;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -16,6 +17,7 @@ public class AssetdwHcResponse {
/** /**
* *
*/ */
@Excel(name = "单位名称")
@ApiModelProperty("单位名称") @ApiModelProperty("单位名称")
private String dwmc; private String dwmc;
@ -25,6 +27,7 @@ public class AssetdwHcResponse {
/** /**
* *
*/ */
@Excel(name = "单位名称")
@ApiModelProperty("核查资产数量") @ApiModelProperty("核查资产数量")
private Integer total; private Integer total;
@ -32,13 +35,14 @@ public class AssetdwHcResponse {
/** /**
* *
*/ */
@Excel(name = "完成数量")
@ApiModelProperty("完成数量") @ApiModelProperty("完成数量")
private Integer checked; private Integer checked;
/** /**
* *
*/ */
@ApiModelProperty("完成状态") @Excel(name = "完成状态")
private Integer taskStatus; private Integer taskStatus;
@ -46,6 +50,7 @@ public class AssetdwHcResponse {
/** /**
* 退 * 退
*/ */
@Excel(name = "审核退回次数")
@ApiModelProperty("审核退回次数") @ApiModelProperty("审核退回次数")
private Integer shthcs; private Integer shthcs;
@ -53,6 +58,7 @@ public class AssetdwHcResponse {
/** /**
* *
*/ */
@Excel(name = "百分比")
@ApiModelProperty("百分比") @ApiModelProperty("百分比")
private double checkedRatio; private double checkedRatio;

@ -246,32 +246,42 @@
SELECT SELECT
s.dwmc, s.dwmc,
s.task_id, s.task_id,
latest_create_time, CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
b.task_deadline, b.task_deadline,
SUM(total) AS total, SUM(s.total) AS total,
SUM(checked) AS checked, SUM(s.checked) AS checked,
COALESCE(SUM(s.returned), 0) AS shthcs,
ROUND(
CASE CASE
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0 WHEN SUM(s.total) > 0 THEN
ELSE SUM(returned) SUM(s.checked) * 100.0 / SUM(s.total)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0 ELSE 0
END, 2) AS checkedRatio, END,
2
) AS checkedRatio,
CASE CASE
WHEN ROUND(CASE WHEN ROUND(
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) < b.task_deadline THEN 2 2
WHEN ROUND(CASE ) = 100
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) AND CURRENT_TIMESTAMP < b.task_deadline THEN 2
WHEN ROUND(
CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) >= b.task_deadline THEN 3 2
) = 100
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
ELSE 1 ELSE 1
END AS taskStatus END AS taskStatus
FROM ( FROM
(
SELECT SELECT
dwmc, dwmc,
COUNT(*) AS total, COUNT(*) AS total,
@ -392,8 +402,8 @@
</where> </where>
GROUP BY GROUP BY
s.dwmc , s.dwmc ,
s.task_id, s.task_id
s.latest_create_time
</select> </select>
<select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse"> <select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse">
@ -541,32 +551,42 @@
SELECT SELECT
s.dwmc, s.dwmc,
s.task_id, s.task_id,
latest_create_time, CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
b.task_deadline, b.task_deadline,
SUM(total) AS total, SUM(s.total) AS total,
SUM(checked) AS checked, SUM(s.checked) AS checked,
COALESCE(SUM(s.returned), 0) AS shthcs,
ROUND(
CASE CASE
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0 WHEN SUM(s.total) > 0 THEN
ELSE SUM(returned) SUM(s.checked) * 100.0 / SUM(s.total)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0 ELSE 0
END, 2) AS checkedRatio, END,
2
) AS checkedRatio,
CASE CASE
WHEN ROUND(CASE WHEN ROUND(
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) &lt; b.task_deadline THEN 2 2
WHEN ROUND(CASE ) = 100
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) AND CURRENT_TIMESTAMP &lt; b.task_deadline THEN 2
WHEN ROUND(
CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) >= b.task_deadline THEN 3 2
) = 100
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
ELSE 1 ELSE 1
END AS taskStatus END AS taskStatus
FROM ( FROM
(
SELECT SELECT
dwmc, dwmc,
COUNT(*) AS total, COUNT(*) AS total,
@ -693,39 +713,50 @@
</select> </select>
<select id="dwHcBl" resultType="com.ruoyi.tc.entity.response.AssetdwHcBlResponse" <select id="dwHcBl" resultType="com.ruoyi.tc.entity.response.AssetdwHcBlResponse"
parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest"> parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest">
select count(*) as count ,taskStatus from (
SELECT SELECT
taskStatus, count(*) AS count,
COUNT(*) AS count -- Count of records for each taskStatus g.taskStatus
FROM ( FROM
SELECT ( SELECT
s.dwmc, s.dwmc,
s.task_id, s.task_id,
latest_create_time, CURRENT_TIMESTAMP AS latest_create_time, -- 使用当前时间
b.task_deadline, b.task_deadline,
SUM(total) AS total, SUM(s.total) AS total,
SUM(checked) AS checked, SUM(s.checked) AS checked,
COALESCE(SUM(s.returned), 0) AS shthcs,
ROUND(
CASE CASE
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0 WHEN SUM(s.total) > 0 THEN
ELSE SUM(returned) SUM(s.checked) * 100.0 / SUM(s.total)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0 ELSE 0
END, 2) AS checkedRatio, END,
2
) AS checkedRatio,
CASE CASE
WHEN ROUND(CASE WHEN ROUND(
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) &lt; b.task_deadline THEN 2 2
WHEN ROUND(CASE ) = 100
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total) AND CURRENT_TIMESTAMP &lt; b.task_deadline THEN 2
WHEN ROUND(
CASE
WHEN SUM(s.total) > 0 THEN
SUM(s.checked) * 100.0 / SUM(s.total)
ELSE 0 ELSE 0
END, 2) = 100 END,
AND MAX(latest_create_time) >= b.task_deadline THEN 3 2
) = 100
AND CURRENT_TIMESTAMP >= b.task_deadline THEN 3
ELSE 1 ELSE 1
END AS taskStatus END AS taskStatus
FROM ( FROM
(
SELECT SELECT
dwmc, dwmc,
COUNT(*) AS total, COUNT(*) AS total,
@ -737,6 +768,9 @@
FROM FROM
asset_current_cp asset_current_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and dwmc like concat('%',#{req.dwmc},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId} and task_id =#{req.taskId}
@ -757,6 +791,10 @@
FROM FROM
asset_mini_programs_cp asset_mini_programs_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.dwmc},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId} and task_id =#{req.taskId}
</if> </if>
@ -776,6 +814,10 @@
FROM FROM
asset_app_cp asset_app_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.dwmc},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId} and task_id =#{req.taskId}
</if> </if>
@ -793,6 +835,10 @@
FROM FROM
asset_official_account_cp asset_official_account_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.dwmc},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId} and task_id =#{req.taskId}
</if> </if>
@ -812,6 +858,10 @@
FROM FROM
asset_email_cp asset_email_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.dwmc},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId} and task_id =#{req.taskId}
</if> </if>
@ -820,15 +870,19 @@
ssdw, ssdw,
task_id task_id
) AS s left join asset_task b on s.task_id=b.id ) AS s left join asset_task b on s.task_id=b.id
<where>
<if test="req.taskStatus != null and req.taskStatus != ''">
b.task_status = #{req.taskStatus}
</if>
</where>
GROUP BY GROUP BY
s.dwmc , s.dwmc ,
s.task_id, s.task_id
s.latest_create_time ) g
)AS aggregated_results
GROUP BY GROUP BY
dwmc,
taskStatus taskStatus
ORDER BY )f group by taskStatus
taskStatus
</select> </select>
<update id="xcxsh" <update id="xcxsh"
parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest"> parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest">

Loading…
Cancel
Save