任务模块编写

main
dongdingding 2 months ago
parent aadf64cb69
commit 90cfb1285e

@ -190,6 +190,7 @@ public class AssetTaskController extends BaseController {
} else {
//已报废
assetCurrent.setStatus(5);
assetCurrent.setXtzt("5");
}
StringBuilder a = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) {
@ -266,12 +267,12 @@ public class AssetTaskController extends BaseController {
assetLc.setTaskId(assetCurrent.getTaskId());
assetLc.setAssetName(assetCurrent.getXtmc());
//当审核状态为审核不通过 单位端重新提交
if (assetCurrent.getStatus().equals(4)) {
assetLc.setTaskId(assetCurrent.getTaskId());
assetLc.setXfTime(LocalDateTime.now());
assetLc.setAssetName("单位重新核查提交时间" + assetCurrent.getXtmc());
assetLcService.insert(assetLc);
}
// if (assetCurrent.getStatus().equals(4)) {
// assetLc.setTaskId(assetCurrent.getTaskId());
// assetLc.setXfTime(LocalDateTime.now());
// assetLc.setAssetName("单位重新核查提交时间" + assetCurrent.getXtmc());
// assetLcService.insert(assetLc);
// }
StringBuilder a = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) {

@ -34,7 +34,7 @@ import java.util.List;
*/
@Api(tags = "单位表控制层")
@RestController
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
//@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@RequestMapping("/tc/unit")
public class UnitController {

@ -27,10 +27,7 @@ public class AssetBusinessFormCpPo extends BaseClass implements Serializable {
@TableId(type = IdType.AUTO,value = "business_id")
private Long businessId;
/**
* id
*/
private Long id;
/**
* id
*/

@ -13,7 +13,7 @@ public class UnitRequest {
@ApiModelProperty("1 查询已有资产的单位")
private String isSearch;
private int isSearch;
@ApiModelProperty("统一社会信用代码")
private String userName;

@ -125,7 +125,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (bussList != null) {
for (AssetBusinessFormCpPo assetBusinessFormCpResponse : bussList) {
if (assetCurrentResponse.getXjgywxt() != null) {
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getId());
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getAssetId());
assetCurrentResponse.getXjgywxt().setTaskId(id);
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
}
@ -137,7 +137,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (supplyChainList != null) {
for (AssetSupplyChainCpPo items : supplyChainList) {
items.setAssetId(assetCurrentResponse.getId());
// items.setSupplyId(items.getSupplyId());
items.setSupplyId(items.getSupplyId());
items.setTaskId(id);
//新增供应链
}
@ -148,7 +148,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
for (AssetBasicNetworkCpPo items : BasicNetworkCpList) {
//根据资产id查询基础网络主表id
items.setAssetId(assetCurrentResponse.getId());
// items.setNetworkId(items.getNetworkId());
items.setNetworkId(items.getNetworkId());
items.setTaskId(id);
//新增基础网络
}
@ -159,7 +159,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
for (UnitOtherConcatCpPo items : unitOtherConcatList) {
//根据资产id查询其他联系人主表id
items.setAssetId(assetCurrentResponse.getId());
// items.setConcatId(items.getConcatId());
items.setConcatId(items.getConcatId());
items.setTaskId(id);
//新增其他联系人
}
@ -220,7 +220,12 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Override
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
assetTask.setOptimizeCountSql(false);
return assetTaskDao.zcHc(assetTask, pageRequest);
Page<AssestTaskXqresponse> result = assetTaskDao.zcHc(assetTask, pageRequest);
// 确保 records 不为 null
if (result.getRecords() == null) {
result.setRecords(new ArrayList<>()); // 设置为空数组
}
return result;
}
@Override
@ -247,6 +252,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
boolean allApproved = list.stream().allMatch(item -> item.getStatus() == 3);
boolean hasExpired = list.stream().anyMatch(item -> item.getDeadstatus() == 6);
boolean hasRejected = list.stream().anyMatch(item -> item.getStatus() == 4);
boolean hased = list.stream().anyMatch(item -> item.getStatus() == 5);
LocalDateTime finishTime = null;
if (hasPendingApproval) {
// 资产状态存在待审批,任务状态为进行中
@ -263,7 +269,18 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
taskSaveOrDelete(req);
} else if (hasRejected) {
// 审核不通过
taskStatus = 4;
taskStatus = 1;
} else if (hased && !hasRejected && !hasExpired) {
//存在已报废并且其他都已完成 且未超期
taskStatus = 2;
finishTime = LocalDateTime.now();
taskSaveOrDelete(req);
}
else if(hased && !hasRejected && hasExpired){
//存在已报废并且其他都已完成 且未超期
taskStatus = 3;
finishTime = LocalDateTime.now();
taskSaveOrDelete(req);
}
//修改主表任务状态
assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime);

@ -8,7 +8,7 @@
<select id="page" resultType="com.ruoyi.tc.entity.AssetCurrent">
select * from asset_current
<where>
del_flag = '0' and isbf = '0'
del_flag = '0'
<if test="req.xtmc!=null and req.xtmc!='' ">
and xtmc like concat('%',#{req.xtmc},'%')
</if>

@ -177,7 +177,7 @@
and task_name = #{req.taskName}
</if>
<if test="req.dwmc != null and req.dwmc != ''">
and dwmc = #{req.dwmc}
and dwmc like concat('%',#{req.dwmc},'%')
</if>
<if test="req.begainTime != null">
and task_finish_time &gt;= #{req.begainTime}
@ -191,7 +191,9 @@
<if test="req.id != null ">
and id = #{req.id}
</if>
</where>
order by task_time desc
</select>
<select id="findByDwmcAssetCurrent" resultType="com.ruoyi.tc.entity.po.AssetCurrentCpPo">
select * from asset_current
@ -239,7 +241,7 @@
dwmc,
COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) AS checked,
SUM(CASE WHEN status = 3 or status = 5 THEN 1 ELSE 0 END) AS checked,
ROUND(
CASE
WHEN COUNT(*) > 0 THEN
@ -259,15 +261,15 @@
</select>
<select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse">
SELECT
a.status,
a.STATUS,
CASE
WHEN a.update_time > b.task_deadline THEN '6'
ELSE '7'
WHEN DATE ( a.update_time ) > b.task_deadline THEN
'6' ELSE '7'
END AS deadstatus
FROM
asset_current_cp a
LEFT JOIN
asset_task b ON a.task_id = b.id
LEFT JOIN asset_task b ON a.task_id = b.id
<where>
<if test="taskId!=null ">
and a.task_id =#{taskId}

@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM asset_task
<where>
task_status = 1 AND FIND_IN_SET(a.nick_name, dwmc)
) AND a.del_flag = '0'
) AND a.del_flag = '0' and a.nick_name IN (SELECT dwmc FROM asset_current)
<if test="req.nickName != null and req.nickName != '' ">
and a.nick_name like concat('%',#{req.nickName},'%')
</if>
@ -131,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.user_name like concat('%',#{req.userName},'%')
</if>
</where>
</select>
<update id="deleteUnits">
update unit_info set del_flag = '2' where id = #{id}

Loading…
Cancel
Save