资产修改

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
*/
@ApiOperation(value = "管理端-关闭")
@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);
return AjaxResult.success();
}

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

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

Loading…
Cancel
Save