任务模块编写

main
dongdingding 2 months ago
parent 4e9fb96ddc
commit 3a5a8e86e5

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.AssetLc;
import com.ruoyi.tc.entity.AssetTask;
@ -74,6 +75,9 @@ public class AssetTaskController extends BaseController {
@Resource
private AssetLcService assetLcService;
@Resource
private AssetCurrentService assetCurrentService;
/**
*
*
@ -184,6 +188,7 @@ public class AssetTaskController extends BaseController {
assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
AssetCurrent ac = new AssetCurrent();
if (StringUtils.isBlank(assetCurrent.getBfyy())) {
//待审批
assetCurrent.setStatus(0);
@ -191,6 +196,7 @@ public class AssetTaskController extends BaseController {
//已报废
assetCurrent.setStatus(5);
assetCurrent.setXtzt("5");
}
StringBuilder a = new StringBuilder();
if (!assetCurrent.getGlymList().isEmpty()) {
@ -209,6 +215,8 @@ public class AssetTaskController extends BaseController {
}
assetCurrent.setGlIp(b.toString());
// assetCurrent.setCurrentId(null);
BeanUtils.copyProperties(assetCurrent,ac);
assetCurrentService.updateById(ac);
assetCurrentCpService.save(assetCurrent);
//新增新监管业务形态
if (assetCurrent.getXjgywxt() != null) {

@ -18,7 +18,11 @@ public class AssetCurrentShRequest {
@ApiModelProperty("任务id")
private Integer taskId;
/**
*
*/
@ApiModelProperty("系统名称")
private String xtmc;
/**
* id

@ -20,4 +20,11 @@ public class AssetdwHcRequest {
private String dwmc;
/**
* id
*/
@ApiModelProperty("任务id")
private Integer taskId;
}

@ -22,5 +22,12 @@ public interface AssetBasicNetWorkMapper extends BaseMapper<AssetBasicNetwork> {
*/
void deleteByAssetIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -16,5 +16,12 @@ public interface AssetBusinessFormMapper extends BaseMapper<AssetBusinessForm> {
*
*/
void deleteByAssetIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -33,5 +33,13 @@ public interface AssetCurrentMapper extends BaseMapper<AssetCurrent> {
*
*/
void deleteByUnitIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -28,5 +28,13 @@ public interface AssetSupplyChainMapper extends BaseMapper<AssetSupplyChain> {
* id
*/
AssetSupplyChain getYydw(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -20,4 +20,11 @@ public interface UnitOtherConcatMapper extends BaseMapper<UnitOtherConcat>
* assetId
*/
void deleteByAssetIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -23,4 +23,13 @@ public interface AssetBasicNetworkService extends IService<AssetBasicNetwork> {
*
*/
void deleteByAssetIds(Long id);
/**
*
* @param netWorkidList
*/
void deleteIdList(List<Long> netWorkidList);
}

@ -17,5 +17,12 @@ public interface AssetBusinessFormService extends IService<AssetBusinessForm> {
*
*/
void deleteByAssetIds(Long id);
/**
*
* @param bussinessidList
*/
void deleteIdList(List<Long> bussinessidList);
}

@ -46,5 +46,11 @@ public interface AssetCurrentService extends IService<AssetCurrent> {
*
*/
void deleteByUnitIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
}

@ -27,4 +27,12 @@ public interface AssetSupplyChainService extends IService<AssetSupplyChain> {
* id
*/
AssetSupplyChain getYydw(Long id);
/**
*
* @param SupplyChainidList
*/
void deleteIdList(List<Long> SupplyChainidList);
}

@ -22,4 +22,11 @@ public interface UnitOtherConcatService extends IService<UnitOtherConcat> {
* unitId
*/
void deleteByUnitIds(Long id);
/**
*
* @param UnitOtherConcatidList
*/
void deleteIdList(List<Long> UnitOtherConcatidList);
}

@ -32,4 +32,9 @@ public class AssetBasicNetworkServiceImpl extends ServiceImpl<AssetBasicNetWorkM
public void deleteByAssetIds(Long id) {
baseMapper.deleteByAssetIds(id);
}
@Override
public void deleteIdList(List<Long> netWorkidList) {
baseMapper.deleteIdList(netWorkidList);
}
}

@ -24,5 +24,10 @@ public class AssetBusinessFormServiceImpl extends ServiceImpl<AssetBusinessFormM
public void deleteByAssetIds(Long id) {
baseMapper.deleteByAssetIds(id);
}
@Override
public void deleteIdList(List<Long> idList) {
baseMapper.deleteIdList(idList);
}
}

@ -95,5 +95,10 @@ public class AssetCurrentServiceImpl extends ServiceImpl<AssetCurrentMapper, Ass
public void deleteByUnitIds(Long id) {
baseMapper.deleteByUnitIds(id);
}
@Override
public void deleteIdList(List<Long> idList) {
baseMapper.deleteIdList(idList);
}
}

@ -41,4 +41,9 @@ public class AssetSupplyChainServiceImpl extends ServiceImpl<AssetSupplyChainMap
public AssetSupplyChain getYydw(Long id) {
return baseMapper.getYydw(id);
}
@Override
public void deleteIdList(List<Long> SupplyChainidList) {
baseMapper.deleteIdList(SupplyChainidList);
}
}

@ -235,11 +235,11 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
if (req.getStatus() == 3) {
assetLc.setTaskId(req.getTaskId());
assetLc.setXfTime(LocalDateTime.now());
assetLc.setAssetName("管理员审核通过");
assetLc.setAssetName("管理员审核通过"+req.getXtmc());
assetLcService.insert(assetLc);
} else if (req.getStatus() == 4) {
assetLc.setTaskId(req.getTaskId());
assetLc.setAssetName("管理员审核不通过");
assetLc.setAssetName("管理员审核不通过"+req.getXtmc());
assetLc.setXfTime(LocalDateTime.now());
assetLcService.insert(assetLc);
}
@ -281,6 +281,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
taskStatus = 3;
finishTime = LocalDateTime.now();
taskSaveOrDelete(req);
} else if (hased && !hasPendingApproval && !allApproved && ! hasExpired && !hasRejected) {
taskStatus = 3;
}
//修改主表任务状态
assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime);
@ -294,7 +296,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetCurrentCpPo::getId)
.collect(Collectors.toList());
//删除原有数据
assetCurrentService.removeBatchByIds(idList);
assetCurrentService.deleteIdList(idList);
//将子表数据复制到主表中
List<AssetCurrent> currentNewList = currentList.stream()
.map(cpPo -> {
@ -310,7 +312,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetBusinessFormCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
assetBusinessFormService.removeBatchByIds(bussinessidList);
assetBusinessFormService.deleteIdList(bussinessidList);
//将子表数据复制到主表中
List<AssetBusinessForm> bussinessNewList = bussinessList.stream()
.map(cpPo -> {
@ -326,7 +328,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetBasicNetworkCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
assetBasicNetworkService.removeBatchByIds(netWorkidList);
assetBasicNetworkService.deleteIdList(netWorkidList);
//将子表数据复制到主表中
List<AssetBasicNetwork> netWorkNewList = netWorkList.stream()
.map(cpPo -> {
@ -342,7 +344,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetSupplyChainCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
assetSupplyChainService.removeBatchByIds(SupplyChainidList);
assetSupplyChainService.deleteIdList(SupplyChainidList);
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
.map(cpPo -> {
AssetSupplyChain supplyChain = new AssetSupplyChain();
@ -358,7 +360,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(UnitOtherConcatCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
unitOtherConcatService.removeBatchByIds(UnitOtherConcatidList);
unitOtherConcatService.deleteIdList(UnitOtherConcatidList);
List<UnitOtherConcat> UnitOtherConcatNewList = UnitOtherConcatList.stream()
.map(cpPo -> {
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();

@ -30,4 +30,9 @@ public class UnitOtherConcatServiceImpl extends ServiceImpl<UnitOtherConcatMapp
public void deleteByUnitIds(Long id) {
baseMapper.deleteByUnitIds(id);
}
@Override
public void deleteIdList(List<Long> UnitOtherConcatidList) {
baseMapper.deleteIdList(UnitOtherConcatidList);
}
}

@ -4,6 +4,13 @@
<update id="deleteByAssetIds">
update asset_basic_network set del_flag = '2' where asset_id = #{id}
</update>
<delete id="deleteIdList">
DELETE FROM asset_basic_network
WHERE asset_id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getByAssetId" resultType="com.ruoyi.tc.entity.AssetBasicNetwork">
select *

@ -5,5 +5,12 @@
<update id="deleteByAssetIds">
update asset_business_form set del_flag = '2' where asset_id = #{id}
</update>
<delete id="deleteIdList">
DELETE FROM asset_business_form
WHERE asset_id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -3,6 +3,13 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetCurrentMapper">
<delete id="deleteIdList">
DELETE FROM asset_current
WHERE id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="page" resultType="com.ruoyi.tc.entity.AssetCurrent">

@ -4,6 +4,13 @@
<update id="deleteByAssetIds">
update asset_supply_chain set del_flag = '2' where asset_id = #{id}
</update>
<delete id="deleteIdList">
DELETE FROM asset_supply_chain
WHERE id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getJsdw" resultType="com.ruoyi.tc.entity.AssetSupplyChain">
select *

@ -221,6 +221,10 @@
<if test="req.taskId !=null ">
and a.id = #{req.taskId}
</if>
<if test="req.taskId !=null ">
and b.task_id=#{req.taskId}
</if>
<if test="req.status!=null ">
and b.status =#{req.status}
</if>
@ -254,6 +258,10 @@
<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}
</if>
</where>
GROUP BY
dwmc

@ -10,4 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="deleteByAssetIds">
update unit_other_contact set del_flag = '2' where asset_id = #{id}
</update>
<delete id="deleteIdList">
DELETE FROM unit_other_contact
WHERE id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save