任务模块编写

main
dongdingding 2 months ago
parent f36cdd51d1
commit 88424ed677

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

@ -58,4 +58,11 @@ public class AssetTaskPageRequest {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
/**
*
*/
@ApiModelProperty("单位名称")
private String dwmc;
}

@ -67,7 +67,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
private AssetSupplyChainService assetSupplyChainService;
@Resource
private UnitOtherConcatService unitOtherConcatService;
private UnitOtherConcatService unitOtherConcatService;
/**
* ID
*
@ -100,7 +101,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Override
public void insert(AssetTask assetTask) {
//任务新增
int id = assetTaskDao.insert(assetTask);
assetTaskDao.insert(assetTask);
int id = assetTask.getId();
//新增流程节点
AssetLc assetLc = new AssetLc();
assetLc.setTaskId(id);
@ -122,10 +124,11 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
List<AssetBusinessFormCpPo> bussList = assetBusinessFormCpService.findByassetId(assetCurrentResponse.getId());
if (bussList != null) {
for (AssetBusinessFormCpPo assetBusinessFormCpResponse : bussList) {
assetCurrentResponse.getXjgywxt().setBusinessId(assetBusinessFormCpResponse.getBusinessId());
assetCurrentResponse.getXjgywxt().setAssetId(assetCurrentResponse.getId());
assetCurrentResponse.getXjgywxt().setTaskId(id);
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
if (assetCurrentResponse.getXjgywxt() != null) {
assetCurrentResponse.getXjgywxt().setAssetId(assetBusinessFormCpResponse.getId());
assetCurrentResponse.getXjgywxt().setTaskId(id);
assetBusinessFormCpResponseList.add(assetCurrentResponse.getXjgywxt());
}
}
assetBusinessFormCpService.saveBatch(assetBusinessFormCpResponseList);
}
@ -134,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);
//新增供应链
}
@ -145,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);
//新增基础网络
}
@ -156,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);
//新增其他联系人
}
@ -326,6 +329,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
.map(cpPo -> {
AssetSupplyChain supplyChain = new AssetSupplyChain();
supplyChain.setId(null);
BeanUtils.copyProperties(cpPo, supplyChain); // 复制属性
return supplyChain; // 返回新对象
})
@ -345,7 +349,6 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return unitOtherConcat; // 返回新对象
})
.collect(Collectors.toList());
assetSupplyChainService.saveBatch(SupplyChainNewList);
unitOtherConcatService.saveBatch(UnitOtherConcatNewList);
}

@ -176,6 +176,9 @@
<if test="req.taskName != null and req.taskName != ''">
and task_name = #{req.taskName}
</if>
<if test="req.dwmc != null and req.dwmc != ''">
and dwmc = #{req.dwmc}
</if>
<if test="req.begainTime != null">
and task_finish_time &gt;= #{req.begainTime}
</if>
@ -185,7 +188,6 @@
<if test="req.taskStatus != null and req.taskStatus != ''">
and task_status = #{req.taskStatus}
</if>
<if test="req.id != null ">
and id = #{req.id}
</if>
@ -259,7 +261,7 @@
SELECT
a.status,
CASE
WHEN DATE(a.update_time) > STR_TO_DATE(IFNULL(b.task_deadline, '1970-01-01'), '%Y-%m-%d') THEN '6'
WHEN a.update_time > b.task_deadline THEN '6'
ELSE '7'
END AS deadstatus
FROM

@ -115,9 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="dwList" resultType="com.ruoyi.tc.entity.Unit">
SELECT a.*
FROM unit_info a
WHERE NOT EXISTS (
SELECT 1
FROM asset_task
<where>
a.nick_name NOT IN (SELECT dwmc FROM asset_task where task_status=1) and
a.del_flag = '0'
task_status = 1 AND FIND_IN_SET(a.nick_name, dwmc)
) AND a.del_flag = '0'
<if test="req.nickName != null and req.nickName != '' ">
and a.nick_name like concat('%',#{req.nickName},'%')
</if>

Loading…
Cancel
Save