任务模块编写

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

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

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

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

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

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

@ -24,7 +24,7 @@ public interface AssetCurrentService extends IService<AssetCurrent> {
* @param as * @param as
* @return * @return
*/ */
Page<AssetCurrent> page(Page<AssetCurrent> page, AssetCurrentPageRequest as ); Page<AssetCurrent> page(Page<AssetCurrent> page, AssetCurrentPageRequest as);
/** /**
* *
@ -32,7 +32,7 @@ public interface AssetCurrentService extends IService<AssetCurrent> {
* @param as * @param as
* @return * @return
*/ */
List<AssetExport> page(AssetCurrentPageRequest as ); List<AssetExport> page(AssetCurrentPageRequest as);
/** /**
* *
@ -46,5 +46,11 @@ public interface AssetCurrentService extends IService<AssetCurrent> {
* *
*/ */
void deleteByUnitIds(Long id); void deleteByUnitIds(Long id);
/**
*
* @param idList
*/
void deleteIdList(List<Long> idList);
} }

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

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

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

@ -4,6 +4,13 @@
<update id="deleteByAssetIds"> <update id="deleteByAssetIds">
update asset_basic_network set del_flag = '2' where asset_id = #{id} update asset_basic_network set del_flag = '2' where asset_id = #{id}
</update> </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 id="getByAssetId" resultType="com.ruoyi.tc.entity.AssetBasicNetwork">
select * select *

@ -5,5 +5,12 @@
<update id="deleteByAssetIds"> <update id="deleteByAssetIds">
update asset_business_form set del_flag = '2' where asset_id = #{id} update asset_business_form set del_flag = '2' where asset_id = #{id}
</update> </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> </mapper>

@ -3,6 +3,13 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetCurrentMapper"> <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"> <select id="page" resultType="com.ruoyi.tc.entity.AssetCurrent">

@ -4,6 +4,13 @@
<update id="deleteByAssetIds"> <update id="deleteByAssetIds">
update asset_supply_chain set del_flag = '2' where asset_id = #{id} update asset_supply_chain set del_flag = '2' where asset_id = #{id}
</update> </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 id="getJsdw" resultType="com.ruoyi.tc.entity.AssetSupplyChain">
select * select *

@ -221,6 +221,10 @@
<if test="req.taskId !=null "> <if test="req.taskId !=null ">
and a.id = #{req.taskId} and a.id = #{req.taskId}
</if> </if>
<if test="req.taskId !=null ">
and b.task_id=#{req.taskId}
</if>
<if test="req.status!=null "> <if test="req.status!=null ">
and b.status =#{req.status} and b.status =#{req.status}
</if> </if>
@ -254,6 +258,10 @@
<if test="req.dwmc!=null and req.dwmc!='' "> <if test="req.dwmc!=null and req.dwmc!='' ">
and dwmc like concat('%',#{req.dwmc},'%') and dwmc like concat('%',#{req.dwmc},'%')
</if> </if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where> </where>
GROUP BY GROUP BY
dwmc dwmc

@ -10,4 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="deleteByAssetIds"> <update id="deleteByAssetIds">
update unit_other_contact set del_flag = '2' where asset_id = #{id} update unit_other_contact set del_flag = '2' where asset_id = #{id}
</update> </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> </mapper>
Loading…
Cancel
Save