任务模块编写

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") @TableId(type = IdType.AUTO,value = "business_id")
private Long businessId; private Long businessId;
/**
* id
*/
private Long id;
/** /**
* id * id
*/ */

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

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

@ -176,6 +176,9 @@
<if test="req.taskName != null and req.taskName != ''"> <if test="req.taskName != null and req.taskName != ''">
and task_name = #{req.taskName} and task_name = #{req.taskName}
</if> </if>
<if test="req.dwmc != null and req.dwmc != ''">
and dwmc = #{req.dwmc}
</if>
<if test="req.begainTime != null"> <if test="req.begainTime != null">
and task_finish_time &gt;= #{req.begainTime} and task_finish_time &gt;= #{req.begainTime}
</if> </if>
@ -185,7 +188,6 @@
<if test="req.taskStatus != null and req.taskStatus != ''"> <if test="req.taskStatus != null and req.taskStatus != ''">
and task_status = #{req.taskStatus} and task_status = #{req.taskStatus}
</if> </if>
<if test="req.id != null "> <if test="req.id != null ">
and id = #{req.id} and id = #{req.id}
</if> </if>
@ -259,7 +261,7 @@
SELECT SELECT
a.status, a.status,
CASE 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' ELSE '7'
END AS deadstatus END AS deadstatus
FROM FROM

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

Loading…
Cancel
Save