资产修改

main
dongdingding 2 months ago
parent 0dd26b2676
commit 1d2f0b40bb

@ -5,6 +5,7 @@ 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.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.*; import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.po.*; import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest; import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
@ -13,6 +14,7 @@ import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest; import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse; import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetTaskIdResponse; import com.ruoyi.tc.entity.response.AssetTaskIdResponse;
import com.ruoyi.tc.entity.response.AssetdwHcBlResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse; import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
@ -22,8 +24,10 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** /**
@ -238,7 +242,7 @@ public class AssetTaskController extends BaseController {
@GetMapping("/emailtaskSh") @GetMapping("/emailtaskSh")
public AjaxResult emailtaskSh(@RequestParam("taskId") int taskId, @RequestParam("assetId") int assetId) { public AjaxResult emailtaskSh(@RequestParam("taskId") int taskId, @RequestParam("assetId") int assetId) {
return AjaxResult.success( assetTaskService.emailtaskSh(taskId, assetId)); return AjaxResult.success(assetTaskService.emailtaskSh(taskId, assetId));
} }
/** /**
@ -298,7 +302,7 @@ public class AssetTaskController extends BaseController {
assetCurrent.setXtzt("5"); assetCurrent.setXtzt("5");
//已关停 //已关停
ygt++; ygt++;
assetTaskService.updateYgtByTaskId(assetCurrent.getTaskId(),ygt); assetTaskService.updateYgtByTaskId(assetCurrent.getTaskId(), ygt);
} }
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
@ -470,6 +474,22 @@ public class AssetTaskController extends BaseController {
return AjaxResult.success(assetTaskService.dwHc(assetdwHcResponsePage, req)); return AjaxResult.success(assetTaskService.dwHc(assetdwHcResponsePage, req));
} }
/**
* -
*
* @param req
* @return
*/
@ApiOperation(value = "导出管理端-单位核查情况")
@PostMapping("/export")
public void export(HttpServletResponse response, AssetdwHcRequest req) {
List<AssetdwHcResponse> list = assetTaskService.export(req);
ExcelUtil<AssetdwHcResponse> util = new ExcelUtil<AssetdwHcResponse>(AssetdwHcResponse.class);
util.exportExcel(response, list, "单位完成情况");
}
/** /**
* *
* *
@ -497,7 +517,7 @@ public class AssetTaskController extends BaseController {
assetMiniProgramsService.updateById(ac); assetMiniProgramsService.updateById(ac);
//已关停 //已关停
ygt++; ygt++;
assetTaskService.updateYgtByTaskId(assetMiniProgramsCpPo.getTaskId(),ygt); assetTaskService.updateYgtByTaskId(assetMiniProgramsCpPo.getTaskId(), ygt);
} }
assetMiniProgramsCpService.save(assetMiniProgramsCpPo); assetMiniProgramsCpService.save(assetMiniProgramsCpPo);
return success(); return success();
@ -531,7 +551,7 @@ public class AssetTaskController extends BaseController {
assetOfficialAccountService.updateById(ac); assetOfficialAccountService.updateById(ac);
//已关停 //已关停
ygt++; ygt++;
assetTaskService.updateYgtByTaskId(assetOfficialAccountCpPo.getTaskId(),ygt); assetTaskService.updateYgtByTaskId(assetOfficialAccountCpPo.getTaskId(), ygt);
} }
assetOfficialAccountCpService.save(assetOfficialAccountCpPo); assetOfficialAccountCpService.save(assetOfficialAccountCpPo);
@ -566,7 +586,7 @@ public class AssetTaskController extends BaseController {
assetAppService.updateById(ac); assetAppService.updateById(ac);
//已关停 //已关停
ygt++; ygt++;
assetTaskService.updateYgtByTaskId(assetAppCpPo.getTaskId(),ygt); assetTaskService.updateYgtByTaskId(assetAppCpPo.getTaskId(), ygt);
} }
assetAppCpService.save(assetAppCpPo); assetAppCpService.save(assetAppCpPo);
@ -601,7 +621,7 @@ public class AssetTaskController extends BaseController {
assetEmailService.updateById(ac); assetEmailService.updateById(ac);
//已关停 //已关停
ygt++; ygt++;
assetTaskService.updateYgtByTaskId(assetEmailCpPo.getTaskId(),ygt); assetTaskService.updateYgtByTaskId(assetEmailCpPo.getTaskId(), ygt);
} }
@ -722,5 +742,33 @@ public class AssetTaskController extends BaseController {
assetEmailJyService.save(assetEmailJyPo); assetEmailJyService.save(assetEmailJyPo);
return success(); return success();
} }
/**
* -
*
* @param
* @return
*/
@ApiOperation(value = "管理端-关闭")
@GetMapping("/close")
public AjaxResult close(@RequestParam(value = "taskId", required = false) Integer taskId) {
assetTaskService.close(taskId);
return AjaxResult.success();
}
/**
* -
*
* @param req
* @return
*/
@ApiOperation(value = "管理端-单位核查比例图", response = AssetdwHcBlResponse.class)
@PostMapping("/dwHcBl")
public AjaxResult dwHcBl(@RequestBody AssetdwHcRequest req) {
return AjaxResult.success(assetTaskService.dwHcBl(req));
}
} }

@ -45,6 +45,12 @@ public class AssetLc implements Serializable {
private String assetName; private String assetName;
/**
*
*/
@ApiModelProperty("企业名称")
private String uintName;
/** /**
* id * id
*/ */

@ -56,7 +56,7 @@ public class AssetTask implements Serializable {
/** /**
* 123 * 123
*/ */
@ApiModelProperty("任务状态1进行中2正常完成3超期完成4审核驳回") @ApiModelProperty("任务状态0已关闭1进行中2正常完成3超期完成4审核驳回")
private Integer taskStatus=1; private Integer taskStatus=1;
/** /**
* *

@ -150,4 +150,7 @@ public class AssetAppCpPo extends BaseClass implements Serializable {
@ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废") @ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废")
private Integer status; private Integer status;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -153,7 +153,8 @@ public class AssetAppJyPo extends BaseClass implements Serializable {
private Integer status; private Integer status;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -936,4 +936,8 @@ public class AssetCurrentCpPo extends BaseClass implements Serializable {
@ApiModelProperty("不通过原因") @ApiModelProperty("不通过原因")
private String btgyy; private String btgyy;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -1058,4 +1058,7 @@ public class AssetCurrentJyPo extends BaseClass implements Serializable {
@ApiModelProperty("不通过原因") @ApiModelProperty("不通过原因")
private String btgyy; private String btgyy;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -154,6 +154,7 @@ public class AssetEmailCpPo extends BaseClass implements Serializable {
@ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废") @ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废")
private Integer status; private Integer status;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -152,6 +152,7 @@ public class AssetEmailJyPo extends BaseClass implements Serializable {
@ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废") @ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废")
private Integer status; private Integer status;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -196,7 +196,8 @@ public class AssetMiniProgramsCpPo extends BaseClass implements Serializable {
@ApiModelProperty("不通过次数")
private Integer count;
@ApiModelProperty("不通过原因") @ApiModelProperty("不通过原因")

@ -196,7 +196,8 @@ public class AssetMiniProgramsJyPo extends BaseClass implements Serializable {
private String bfyy; private String bfyy;
@ApiModelProperty("不通过次数")
private Integer count;
@ApiModelProperty("不通过原因") @ApiModelProperty("不通过原因")
private String btgyy; private String btgyy;

@ -158,7 +158,8 @@ public class AssetOfficialAccountCpPo extends BaseClass implements Serializable
@ApiModelProperty("报废原因") @ApiModelProperty("报废原因")
private String bfyy; private String bfyy;
@ApiModelProperty("不通过次数")
private Integer count;
@ApiModelProperty("不通过原因") @ApiModelProperty("不通过原因")

@ -185,4 +185,7 @@ public class AssetOfficialAccountJyPo extends BaseClass implements Serializable
@ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废") @ApiModelProperty("审核状态0待核查1待审批3审核通过4审核不通过5已报废")
private Integer status; private Integer status;
@ApiModelProperty("不通过次数")
private Integer count;
} }

@ -31,6 +31,13 @@ public class AssetCurrentShRequest {
@ApiModelProperty("系统名称") @ApiModelProperty("系统名称")
private String xtmc; private String xtmc;
/**
*
*/
@ApiModelProperty("单位名称")
private String dwmc;
/** /**
* id * id
*/ */

@ -19,6 +19,11 @@ public class AssetdwHcRequest {
@ApiModelProperty("单位名称") @ApiModelProperty("单位名称")
private String dwmc; private String dwmc;
/**
*
*/
@ApiModelProperty("完成状态")
private Integer taskStatus;
/** /**
* id * id

@ -0,0 +1,30 @@
package com.ruoyi.tc.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2024/12/10 11:24
*/
@Data
@ApiModel("单位核查比例图")
public class AssetdwHcBlResponse {
/**
* 123
*/
@ApiModelProperty("完成状态1进行中2正常完成3超期完成")
private Integer taskStatus;
/**
*
*/
@ApiModelProperty("数量")
private Integer count;
}

@ -35,12 +35,19 @@ public class AssetdwHcResponse {
@ApiModelProperty("完成数量") @ApiModelProperty("完成数量")
private Integer checked; private Integer checked;
/** /**
* *
*/ */
@ApiModelProperty("完成数量") @ApiModelProperty("完成状态")
private Integer notChecked; private Integer taskStatus;
/**
* 退
*/
@ApiModelProperty("审核退回次数")
private Integer shthcs;
/** /**

@ -1,10 +1,7 @@
package com.ruoyi.tc.mapper; package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.request.AssetAppPageRequest;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -14,13 +11,13 @@ import java.util.List;
/** /**
* (asset_app_cp)访 * (asset_app_cp)访
*
* @author makejava * @author makejava
* @since 2024-11-15 10:03:56 * @since 2024-11-15 10:03:56
*/ */
public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> { public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> {
/** /**
* idid * idid
* *
@ -31,9 +28,6 @@ public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> {
void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId); void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId);
/** /**
* taskid * taskid
* *
@ -44,8 +38,6 @@ public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> {
List<AssetAppCpPo> findByTaskId(@Param("taskId") int taskId); List<AssetAppCpPo> findByTaskId(@Param("taskId") int taskId);
/** /**
* *
* *
@ -53,9 +45,19 @@ public interface AssetAppCpMapper extends BaseMapper<AssetAppCpPo> {
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
*/ */
@Update("update asset_app_cp set btgyy=#{btgyy} where asset_id=#{assetId} and task_id =#{taskId} ") @Update("update asset_app_cp set btgyy=#{btgyy},count=#{newThcs} where asset_id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy); void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy") String btgyy, @Param("newThcs") Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/
@Select("select * from asset_app_cp where asset_id=#{assetId} and task_id =#{taskId} ")
AssetAppCpPo findByassetIdandTaskId(@Param("assetId") Integer assetId, @Param("taskId")Integer taskId);
} }

@ -40,8 +40,18 @@ public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> {
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
* @param newThcs 退
*/ */
@Update("update asset_current_cp set btgyy=#{btgyy} where id=#{assetId} and task_id =#{taskId} ") @Update("update asset_current_cp set btgyy=#{btgyy},count=#{newThcs} where id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy") String btgyy); void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy") String btgyy, @Param("newThcs") Integer newThcs);
/**
* @param assetId id
* @param taskId id
* @return
*/
@Select("select * from asset_current_cp where id=#{assetId} and task_id =#{taskId}")
AssetCurrentCpPo findByassetIdandTaskId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId);
} }

@ -45,8 +45,20 @@ public interface AssetEmailCpMapper extends BaseMapper<AssetEmailCpPo> {
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
*/ */
@Update("update asset_email_cp set btgyy=#{btgyy} where asset_id=#{assetId} and task_id =#{taskId} ") @Update("update asset_email_cp set btgyy=#{btgyy},count=#{newThcs} where asset_id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy); void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy,@Param("newThcs") Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/
@Select("select * from asset_email_cp where asset_id=#{assetId} and task_id =#{taskId} ")
AssetEmailCpPo findByassetIdandTaskId(@Param("assetId") Integer assetId, @Param("taskId")Integer taskId);
} }

@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import org.springframework.security.core.parameters.P;
import java.util.List; import java.util.List;
@ -46,9 +47,20 @@ public interface AssetMiniProgramsCpMapper extends BaseMapper<AssetMiniProgramsC
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
*/ */
@Update("update asset_mini_programs_cp set btgyy=#{btgyy} where asset_id=#{assetId} and task_id =#{taskId} ") @Update("update asset_mini_programs_cp set btgyy=#{btgyy},count=#{newThcs} where asset_id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy); void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy,@Param("newThcs") Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
*/
@Select("select * from asset_mini_programs_cp where asset_id=#{assetId} and task_id =#{taskId}")
AssetMiniProgramsCpPo findByassetIdandTaskId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId);
} }

@ -46,8 +46,20 @@ public interface AssetOfficialAccountCpMapper extends BaseMapper<AssetOfficialAc
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
*/ */
@Update("update asset_official_account_cp set btgyy=#{btgyy} where asset_id=#{assetId} and task_id =#{taskId} ") @Update("update asset_official_account_cp set btgyy=#{btgyy},count=#{newThcs} where asset_id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy); void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy")String btgyy,@Param("newThcs") Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/
@Select("select * from asset_official_account_cp where asset_id=#{assetId} and task_id =#{taskId} ")
AssetOfficialAccountCpPo findByassetIdandTaskId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId);
} }

@ -8,10 +8,7 @@ import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest; import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest; import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest; import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse; import com.ruoyi.tc.entity.response.*;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetTaskStatusResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -224,6 +221,14 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, @Param("req") AssetdwHcRequest req); Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, @Param("req") AssetdwHcRequest req);
/**
* -
*
* @param req
* @return
*/
List<AssetdwHcResponse> export(@Param("req") AssetdwHcRequest req);
/** /**
* *
* *
@ -258,7 +263,7 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @param taskId id * @param taskId id
*/ */
void updateYgtByTaskId(@Param("taskId") Integer taskId,@Param("count") int count); void updateYgtByTaskId(@Param("taskId") Integer taskId, @Param("count") int count);
/** /**
* taskidcount * taskidcount
@ -267,5 +272,22 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @return * @return
*/ */
AssetTask getByTaskId(@Param("taskId") int taskId); AssetTask getByTaskId(@Param("taskId") int taskId);
/**
*
*
* @param taskId id
*/
void close(@Param("taskId") Integer taskId);
/**
* -
*
* @return
*/
List<AssetdwHcBlResponse> dwHcBl(@Param("req") AssetdwHcRequest req);
} }

@ -2,7 +2,6 @@ package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import java.util.List; import java.util.List;
@ -23,7 +22,6 @@ public interface AssetAppCpService extends IService<AssetAppCpPo> {
void deletByAssetIdandTaskId(Long assetId, int taskId); void deletByAssetIdandTaskId(Long assetId, int taskId);
/** /**
* taskid * taskid
* *
@ -39,6 +37,17 @@ public interface AssetAppCpService extends IService<AssetAppCpPo> {
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
* @param newThcs
*/
void updateByAssetId(Integer assetId, Integer taskId, String btgyy,Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/ */
void updateByAssetId(Integer assetId, Integer taskId, String btgyy); AssetAppCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
} }

@ -37,8 +37,19 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
* @param newThcs 退
*/ */
void updateByAssetId(Integer assetId, Integer taskId, String btgyy); void updateByAssetId(Integer assetId, Integer taskId, String btgyy, Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/
AssetCurrentCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
} }

@ -1,12 +1,7 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo; import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.request.AssetEmailPageRequest;
import java.util.List; import java.util.List;
@ -28,7 +23,6 @@ public interface AssetEmailCpService extends IService<AssetEmailCpPo> {
void deletByAssetIdandTaskId(Long assetId, int taskId); void deletByAssetIdandTaskId(Long assetId, int taskId);
/** /**
* taskid * taskid
* *
@ -44,7 +38,18 @@ public interface AssetEmailCpService extends IService<AssetEmailCpPo> {
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
* @param newThcs
*/
void updateByAssetId(Integer assetId, Integer taskId, String btgyy, Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/ */
void updateByAssetId(Integer assetId, Integer taskId, String btgyy); AssetEmailCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
} }

@ -1,7 +1,6 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import java.util.List; import java.util.List;
@ -24,7 +23,6 @@ public interface AssetMiniProgramsCpService extends IService<AssetMiniProgramsCp
void deletByAssetIdandTaskId(Long assetId, int taskId); void deletByAssetIdandTaskId(Long assetId, int taskId);
/** /**
* taskid * taskid
* *
@ -34,9 +32,6 @@ public interface AssetMiniProgramsCpService extends IService<AssetMiniProgramsCp
List<AssetMiniProgramsCpPo> findByTaskId(int taskId); List<AssetMiniProgramsCpPo> findByTaskId(int taskId);
/** /**
* *
* *
@ -44,10 +39,16 @@ public interface AssetMiniProgramsCpService extends IService<AssetMiniProgramsCp
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
*/ */
void updateByAssetId(Integer assetId, Integer taskId, String btgyy); void updateByAssetId(Integer assetId, Integer taskId, String btgyy, Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
*/
AssetMiniProgramsCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
} }

@ -1,12 +1,7 @@
package com.ruoyi.tc.service; package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo; import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest;
import com.ruoyi.tc.mapper.AssetOfficialAccountCpMapper;
import java.util.List; import java.util.List;
@ -27,7 +22,6 @@ public interface AssetOfficialAccountCpService extends IService<AssetOfficialAcc
void deletByAssetIdandTaskId(Long assetId, int taskId); void deletByAssetIdandTaskId(Long assetId, int taskId);
/** /**
* taskid * taskid
* *
@ -42,6 +36,16 @@ public interface AssetOfficialAccountCpService extends IService<AssetOfficialAcc
* @param assetId id * @param assetId id
* @param taskId id * @param taskId id
* @param btgyy * @param btgyy
* @param newThcs
*/
void updateByAssetId(Integer assetId, Integer taskId, String btgyy, Integer newThcs);
/**
* id,id退
*
* @param assetId id
* @param taskId id
* @return
*/ */
void updateByAssetId(Integer assetId, Integer taskId, String btgyy); AssetOfficialAccountCpPo findByassetIdandTaskId(Integer assetId, Integer taskId);
} }

@ -10,8 +10,8 @@ import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest; import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse; import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetTaskResponse; import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcBlResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse; import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import io.swagger.models.auth.In;
import java.util.List; import java.util.List;
@ -140,6 +140,15 @@ public interface AssetTaskService extends IService<AssetTask> {
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, AssetdwHcRequest req); Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, AssetdwHcRequest req);
/**
* -
*
* @param req
* @return
*/
List<AssetdwHcResponse> export(AssetdwHcRequest req);
/** /**
* *
* *
@ -154,5 +163,19 @@ public interface AssetTaskService extends IService<AssetTask> {
* @param taskId id * @param taskId id
*/ */
void updateYgtByTaskId(Integer taskId,Integer count); void updateYgtByTaskId(Integer taskId, Integer count);
/**
*
*
* @param taskId id
*/
void close(Integer taskId);
/**
* -
*
* @return
*/
List<AssetdwHcBlResponse> dwHcBl(AssetdwHcRequest req);
} }

@ -35,7 +35,12 @@ public class AssetAppCpServiceImpl extends ServiceImpl<AssetAppCpMapper, AssetAp
} }
@Override @Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) { public void updateByAssetId(Integer assetId, Integer taskId, String btgyy,Integer newThcs) {
baseMapper.updateByAssetId(assetId,taskId,btgyy); baseMapper.updateByAssetId(assetId,taskId,btgyy,newThcs);
}
@Override
public AssetAppCpPo findByassetIdandTaskId(Integer assetId, Integer taskId) {
return baseMapper.findByassetIdandTaskId(assetId,taskId);
} }
} }

@ -31,8 +31,13 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl<AssetCurrentCpMapper,
} }
@Override @Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) { public void updateByAssetId(Integer assetId, Integer taskId, String btgyy,Integer newThcs) {
assetCurrentCpMapper.updateByAssetId(assetId,taskId,btgyy); assetCurrentCpMapper.updateByAssetId(assetId,taskId,btgyy,newThcs);
}
@Override
public AssetCurrentCpPo findByassetIdandTaskId(Integer assetId, Integer taskId) {
return assetCurrentCpMapper.findByassetIdandTaskId(assetId,taskId);
} }
} }

@ -42,7 +42,12 @@ public class AssetEmailCpServiceImpl extends ServiceImpl<AssetEmailCpMapper, Ass
@Override @Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) { public void updateByAssetId(Integer assetId, Integer taskId, String btgyy,Integer newThcs) {
assetEmailCpMapper.updateByAssetId(assetId,taskId,btgyy); assetEmailCpMapper.updateByAssetId(assetId,taskId,btgyy,newThcs);
}
@Override
public AssetEmailCpPo findByassetIdandTaskId(Integer assetId, Integer taskId) {
return assetEmailCpMapper.findByassetIdandTaskId(assetId,taskId);
} }
} }

@ -33,7 +33,12 @@ public class AssetMiniProgramsCpServiceImpl extends ServiceImpl<AssetMiniProgram
} }
@Override @Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) { public void updateByAssetId(Integer assetId, Integer taskId, String btgyy,Integer newThcs) {
assetMiniProgramsCpMapper.updateByAssetId(assetId,taskId,btgyy); assetMiniProgramsCpMapper.updateByAssetId(assetId,taskId,btgyy,newThcs);
}
@Override
public AssetMiniProgramsCpPo findByassetIdandTaskId(Integer assetId, Integer taskId) {
return assetMiniProgramsCpMapper.findByassetIdandTaskId(assetId,taskId);
} }
} }

@ -41,7 +41,12 @@ public class AssetOfficialAccountCpServiceImpl extends ServiceImpl<AssetOfficial
} }
@Override @Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) { public void updateByAssetId(Integer assetId, Integer taskId, String btgyy, Integer newThcs) {
assetOfficialAccountCpMapper.updateByAssetId(assetId,taskId,btgyy); assetOfficialAccountCpMapper.updateByAssetId(assetId,taskId,btgyy,newThcs);
}
@Override
public AssetOfficialAccountCpPo findByassetIdandTaskId(Integer assetId, Integer taskId) {
return assetOfficialAccountCpMapper.findByassetIdandTaskId(assetId,taskId);
} }
} }

@ -10,6 +10,7 @@ import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.*; import com.ruoyi.tc.entity.request.*;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse; import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetTaskResponse; import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcBlResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse; import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.*; import com.ruoyi.tc.service.*;
@ -137,19 +138,18 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
int a = 0; int a = 0;
//遍历单位 //遍历单位
String[] taskParts = assetTask.getDwmc().split(","); String[] taskParts = assetTask.getDwmc().split(",");
for (String part : taskParts) {
//根据单位查询所有资产
//web
// 遍历资产类型字段
String[] uParts = assetTask.getType().split(",");
int current = 0; int current = 0;
int xcx = 0; int xcx = 0;
int gzh = 0; int gzh = 0;
int email = 0; int email = 0;
int app = 0; int app = 0;
int totalCount = 0; int totalCount = 0;
for (String part : taskParts) {
//根据单位查询所有资产
//web
// 遍历资产类型字段
String[] uParts = assetTask.getType().split(",");
for (String qq : uParts) { for (String qq : uParts) {
if (qq.equals("0")) { if (qq.equals("0")) {
current = assetCurrentService.findBydwmc(part); current = assetCurrentService.findBydwmc(part);
totalCount += current; totalCount += current;
@ -251,7 +251,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("isbf", 0); queryWrapper.eq("isbf", 0);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetMiniPrograms> list = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, part).eq(AssetMiniPrograms::getIsbf,0).eq(AssetMiniPrograms::getDelFlag,0).list(); List<AssetMiniPrograms> list = assetMiniProgramsService.lambdaQuery().eq(AssetMiniPrograms::getSsdw, part).eq(AssetMiniPrograms::getIsbf, 0).eq(AssetMiniPrograms::getDelFlag, 0).list();
List<AssetMiniProgramsCpPo> miniProgramsNewList = list.stream() List<AssetMiniProgramsCpPo> miniProgramsNewList = list.stream()
.map(cpPo -> { .map(cpPo -> {
AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo(); AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo();
@ -273,7 +273,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("isbf", 0); queryWrapper.eq("isbf", 0);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetOfficialAccount> list = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, part).eq(AssetOfficialAccount::getIsbf,0).eq(AssetOfficialAccount::getDelFlag,0).list(); List<AssetOfficialAccount> list = assetOfficialAccountService.lambdaQuery().eq(AssetOfficialAccount::getSsdw, part).eq(AssetOfficialAccount::getIsbf, 0).eq(AssetOfficialAccount::getDelFlag, 0).list();
List<AssetOfficialAccountCpPo> officialAccountProgramsNewList = list.stream() List<AssetOfficialAccountCpPo> officialAccountProgramsNewList = list.stream()
.map(cpPo -> { .map(cpPo -> {
AssetOfficialAccountCpPo assetOfficialAccountCpPo = new AssetOfficialAccountCpPo(); AssetOfficialAccountCpPo assetOfficialAccountCpPo = new AssetOfficialAccountCpPo();
@ -295,7 +295,8 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("isbf", 0); queryWrapper.eq("isbf", 0);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetEmail> list = assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw, part).eq(AssetEmail::getIsbf,0).eq(AssetEmail::getDelFlag,0).list();; List<AssetEmail> list = assetEmailService.lambdaQuery().eq(AssetEmail::getSsdw, part).eq(AssetEmail::getIsbf, 0).eq(AssetEmail::getDelFlag, 0).list();
;
List<AssetEmailCpPo> emailCpNewList = list.stream() List<AssetEmailCpPo> emailCpNewList = list.stream()
.map(cpPo -> { .map(cpPo -> {
AssetEmailCpPo emailCpPo = new AssetEmailCpPo(); AssetEmailCpPo emailCpPo = new AssetEmailCpPo();
@ -317,7 +318,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
queryWrapper.eq("ssdw", part); queryWrapper.eq("ssdw", part);
queryWrapper.eq("isbf", 0); queryWrapper.eq("isbf", 0);
queryWrapper.eq("del_flag", 0); queryWrapper.eq("del_flag", 0);
List<AssetApp> list = assetAppService.lambdaQuery().eq(AssetApp::getSsdw, part).eq(AssetApp::getIsbf,0).eq(AssetApp::getDelFlag,0).list(); List<AssetApp> list = assetAppService.lambdaQuery().eq(AssetApp::getSsdw, part).eq(AssetApp::getIsbf, 0).eq(AssetApp::getDelFlag, 0).list();
List<AssetAppCpPo> appCpNewList = list.stream() List<AssetAppCpPo> appCpNewList = list.stream()
.map(cpPo -> { .map(cpPo -> {
AssetAppCpPo appCpPo = new AssetAppCpPo(); AssetAppCpPo appCpPo = new AssetAppCpPo();
@ -502,26 +503,67 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
//同步主表数据 web //同步主表数据 web
taskSaveOrDelete(req); taskSaveOrDelete(req);
syb(req); syb(req);
} else { } else if( req.getBtgyy()!=null){
// 状态是进行中 status=1 //不通过 状态为1
finalTask.setTaskStatus(1); finalTask.setTaskStatus(1);
String btgyy = req.getBtgyy(); String btgyy = req.getBtgyy();
assetTaskService.update(finalTask); assetTaskService.update(finalTask);
//修改不通过原因 //修改不通过原因
if (req.getType()==0){ if (req.getType() == 0) {
assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy); //根据任务id,资产id获取退回次数
}else if(req.getType()==1){ AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
assetMiniProgramsCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
}else if(req.getType()==2){
assetOfficialAccountCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
}else if(req.getType()==3){
assetEmailCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
}else if(req.getType()==4){
assetAppCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
}
//获取退回次数
Integer thcs = 0;
if (assetCurrentCpPo.getCount() != null) {
thcs = assetCurrentCpPo.getCount();
}
int newThcs = thcs + 1;
assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
} else if (req.getType() == 1) {
//根据任务id,资产id获取退回次数
AssetMiniProgramsCpPo assetMiniProgramsCpPo = assetMiniProgramsCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
//获取退回次数
Integer thcs = 0;
if (assetMiniProgramsCpPo.getCount() != null) {
thcs = assetMiniProgramsCpPo.getCount();
}
int newThcs = thcs + 1;
assetMiniProgramsCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
} else if (req.getType() == 2) {
//根据任务id,资产id获取退回次数
AssetOfficialAccountCpPo assetOfficialAccountCpPo = assetOfficialAccountCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
//获取退回次数
Integer thcs = 0;
if (assetOfficialAccountCpPo.getCount() != null) {
thcs = assetOfficialAccountCpPo.getCount();
}
int newThcs = thcs + 1;
assetOfficialAccountCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
} else if (req.getType() == 3) {
//根据任务id,资产id获取退回次数
AssetEmailCpPo assetEmailCpPo = assetEmailCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
//获取退回次数
Integer thcs = 0;
if (assetEmailCpPo.getCount() != null) {
thcs = assetEmailCpPo.getCount();
}
int newThcs = thcs + 1;
assetEmailCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
} else if (req.getType() == 4) {
//根据任务id,资产id获取退回次数
AssetAppCpPo assetAppCpPo = assetAppCpService.findByassetIdandTaskId(req.getAssetId(), req.getTaskId());
//获取退回次数
Integer thcs = 0;
if (assetAppCpPo.getCount() != null) {
thcs = assetAppCpPo.getCount();
}
int newThcs = thcs + 1;
assetAppCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy, newThcs);
}
} }
return 0; return 0;
} }
@ -625,19 +667,21 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} }
} }
//当前时间喝任务截至时间比较 //当前时间喝任务截至时间比较
private int extracted(AssetTask assetTask) { private int extracted(AssetTask assetTask) {
int status = 0; int status = 0;
// 获取当前时间 // 获取当前时间
LocalDate now = LocalDate.now(); LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDateTime = formatter.format(now); // 创建格式化器,时间部分使用冒号
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// 格式化当前的日期和时间
String formattedDateTime = now.format(formatter);
//获取任务截至时间 //获取任务截至时间
String deadLine = assetTask.getTaskDeadline(); String deadLine = assetTask.getTaskDeadline();
// 转换为 LocalDateTime // 转换为 LocalDateTime,使用相同的格式
LocalDate deadlineDate = LocalDate.parse(deadLine, formatter); LocalDateTime deadlineDate = LocalDateTime.parse(deadLine, formatter);
LocalDate currentDate = LocalDate.parse(formattedDateTime, formatter); LocalDateTime currentDate = LocalDateTime.parse(formattedDateTime, formatter);
if (deadlineDate.isBefore(currentDate)) { if (deadlineDate.isBefore(currentDate)) {
//超期 //超期
status = 1; status = 1;
@ -751,6 +795,11 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return assetTaskDao.dwHc(assetdwHcResponsePage, req); return assetTaskDao.dwHc(assetdwHcResponsePage, req);
} }
@Override
public List<AssetdwHcResponse> export(AssetdwHcRequest req) {
return assetTaskDao.export(req);
}
@Override @Override
public List<AssetTask> taskList(String dwmc) { public List<AssetTask> taskList(String dwmc) {
return assetTaskDao.taskList(dwmc); return assetTaskDao.taskList(dwmc);
@ -761,10 +810,20 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetTaskDao.updateYgtByTaskId(taskId, count); assetTaskDao.updateYgtByTaskId(taskId, count);
} }
@Override
public void close(Integer taskId) {
assetTaskDao.close(taskId);
}
@Override
public List<AssetdwHcBlResponse> dwHcBl(AssetdwHcRequest req) {
return assetTaskDao.dwHcBl(req);
}
//创建任务流程 //创建任务流程
private void getTaskStatus(AssetCurrentShRequest req) { private void getTaskStatus(AssetCurrentShRequest req) {
AssetLc assetLc = new AssetLc(); AssetLc assetLc = new AssetLc();
int taskStatus = 0;
if (req.getStatus() == 3) { if (req.getStatus() == 3) {
assetLc.setTaskId(req.getTaskId()); assetLc.setTaskId(req.getTaskId());
assetLc.setXfTime(LocalDateTime.now()); assetLc.setXfTime(LocalDateTime.now());
@ -775,54 +834,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
assetLc.setAssetName("管理员审核不通过" + req.getXtmc()); assetLc.setAssetName("管理员审核不通过" + req.getXtmc());
assetLc.setXfTime(LocalDateTime.now()); assetLc.setXfTime(LocalDateTime.now());
assetLcService.insert(assetLc); assetLcService.insert(assetLc);
}
} }
}
// //单位端资产审核,更新任务表状态
// //查询当前任务下的所有资产状态和完成时间
// List<AssetTaskStatusResponse> list = assetTaskDao.findByTaskId(req.getTaskId());
// // 检查状态
// boolean hasPendingApproval = list.stream().anyMatch(item -> item.getStatus() == 0 || item.getStatus() == 1);
// 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;
// String btgyy = null;
// if (hasPendingApproval) {
// // 资产状态存在待审批,任务状态为进行中
// taskStatus = 1;
// } else if (allApproved && !hasPendingApproval && !hasRejected && !hasExpired) {
// // 资产状态全部为已通过中并且全部资产完成时间在任务期限之前
// taskStatus = 2;
// finishTime = LocalDateTime.now();
// taskSaveOrDelete(req);
// } else if (allApproved && !hasPendingApproval && !hasRejected && hasExpired) {
// // 资产状态全部为已通过,资产完成时间有超期的为超期完成
// taskStatus = 3;
// finishTime = LocalDateTime.now();
// taskSaveOrDelete(req);
// } else if (hasRejected) {
// // 审核不通过
// taskStatus = 1;
// btgyy = req.getBtgyy();
// //修改不通过原因
// assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
// } else if (hased && !hasRejected && !hasExpired) {
// //存在已报废并且其他都已完成 且未超期
// taskStatus = 2;
// finishTime = LocalDateTime.now();
// taskSaveOrDelete(req);
// } else if (hased && !hasRejected && hasExpired) {
// //存在已报废并且其他都已完成 且未超期
// taskStatus = 3;
// finishTime = LocalDateTime.now();
// taskSaveOrDelete(req);
// } else if (hased && !hasPendingApproval && !allApproved && !hasExpired && !hasRejected) {
// taskStatus = 3;
// }
// //修改主表任务状态
// assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime);
} }

@ -244,22 +244,42 @@
</select> </select>
<select id="dwHc" resultType="com.ruoyi.tc.entity.response.AssetdwHcResponse"> <select id="dwHc" resultType="com.ruoyi.tc.entity.response.AssetdwHcResponse">
SELECT SELECT
dwmc, s.dwmc,
s.task_id,
latest_create_time,
b.task_deadline,
SUM(total) AS total, SUM(total) AS total,
SUM(notChecked) AS notChecked,
SUM(checked) AS checked, SUM(checked) AS checked,
ROUND(
CASE CASE
WHEN SUM(total) > 0 THEN WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
SUM(notChecked) * 100 / SUM(total) ELSE SUM(returned)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) AS checkedRatio,
CASE
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0 ELSE 0
END, 2) AS checkedRatio END, 2) = 100
AND MAX(latest_create_time) &lt; b.task_deadline THEN 2
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) = 100
AND MAX(latest_create_time) >= b.task_deadline THEN 3
ELSE 1
END AS taskStatus
FROM ( FROM (
SELECT SELECT
dwmc , dwmc,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked, task_id,
SUM(CASE WHEN status = 3 OR status = 5 THEN 1 ELSE 0 END) AS checked MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM FROM
asset_current_cp asset_current_cp
<where> <where>
@ -272,20 +292,22 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
dwmc dwmc,
task_id
UNION ALL UNION ALL
SELECT SELECT
ssdw AS dwmc, ssdw AS dwmc,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked, task_id,
SUM(CASE WHEN status = 3 OR status = 5 THEN 1 ELSE 0 END) AS checked MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM FROM
asset_mini_programs_cp asset_mini_programs_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' "> <if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%') and ssdw like concat('%',#{req.dwmc},'%')
</if> </if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
@ -293,20 +315,22 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
ssdw ssdw,
task_id
UNION ALL UNION ALL
SELECT SELECT
ssdw AS dwmc, ssdw AS dwmc,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked, task_id,
SUM(CASE WHEN status = 3 OR status = 5 THEN 1 ELSE 0 END) AS checked MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM FROM
asset_app_cp asset_app_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' "> <if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%') and ssdw like concat('%',#{req.dwmc},'%')
</if> </if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
@ -314,18 +338,20 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
ssdw ssdw ,task_id
UNION ALL UNION ALL
SELECT SELECT ssdw AS dwmc,
ssdw AS dwmc,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked, task_id,
SUM(CASE WHEN status = 3 OR status = 5 THEN 1 ELSE 0 END) AS checked MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM FROM
asset_official_account_cp asset_official_account_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' "> <if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%') and ssdw like concat('%',#{req.dwmc},'%')
</if> </if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
@ -333,18 +359,22 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
ssdw ssdw,
task_id
UNION ALL UNION ALL
SELECT SELECT
ssdw AS dwmc, ssdw AS dwmc,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked, task_id,
SUM(CASE WHEN status = 3 OR status = 5 THEN 1 ELSE 0 END) AS checked MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM FROM
asset_email_cp asset_email_cp
<where> <where>
<if test="req.dwmc!=null and req.dwmc!='' "> <if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%') and ssdw like concat('%',#{req.dwmc},'%')
</if> </if>
<if test="req.taskId!=null and req.taskId!='' "> <if test="req.taskId!=null and req.taskId!='' ">
@ -352,11 +382,18 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
ssdw ssdw,
) AS combined_results task_id
) AS s left join asset_task b on s.task_id=b.id
<where>
<if test="req.taskStatus != null and req.taskStatus != ''">
b.task_status = #{req.taskStatus}
</if>
</where>
GROUP BY GROUP BY
dwmc s.dwmc ,
s.task_id,
s.latest_create_time
</select> </select>
<select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse"> <select id="findByTaskId" resultType="com.ruoyi.tc.entity.response.AssetTaskStatusResponse">
@ -499,6 +536,300 @@
<select id="getByTaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="int"> <select id="getByTaskId" resultType="com.ruoyi.tc.entity.AssetTask" parameterType="int">
select * from asset_task where id=#{taskId} select * from asset_task where id=#{taskId}
</select> </select>
<select id="export" resultType="com.ruoyi.tc.entity.response.AssetdwHcResponse"
parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest">
SELECT
s.dwmc,
s.task_id,
latest_create_time,
b.task_deadline,
SUM(total) AS total,
SUM(checked) AS checked,
CASE
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
ELSE SUM(returned)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) AS checkedRatio,
CASE
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) = 100
AND MAX(latest_create_time) &lt; b.task_deadline THEN 2
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) = 100
AND MAX(latest_create_time) >= b.task_deadline THEN 3
ELSE 1
END AS taskStatus
FROM (
SELECT
dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_current_cp
<where>
<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,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_mini_programs_cp
<where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_app_cp
<where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw ,
task_id
UNION ALL
SELECT ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_official_account_cp
<where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_email_cp
<where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and ssdw like concat('%',#{req.ssdw},'%')
</if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
) AS s left join asset_task b on s.task_id=b.id
<where>
<if test="req.taskStatus != null and req.taskStatus != ''">
b.task_status = #{req.taskStatus}
</if>
</where>
GROUP BY
s.dwmc ,
s.task_id,
s.latest_create_time
</select>
<select id="dwHcBl" resultType="com.ruoyi.tc.entity.response.AssetdwHcBlResponse"
parameterType="com.ruoyi.tc.entity.request.AssetdwHcRequest">
SELECT
taskStatus,
COUNT(*) AS count -- Count of records for each taskStatus
FROM (
SELECT
s.dwmc,
s.task_id,
latest_create_time,
b.task_deadline,
SUM(total) AS total,
SUM(checked) AS checked,
CASE
WHEN SUM(returned) IS NULL OR SUM(returned) = 0 THEN 0
ELSE SUM(returned)
END AS shthcs,
ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) AS checkedRatio,
CASE
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) = 100
AND MAX(latest_create_time) &lt; b.task_deadline THEN 2
WHEN ROUND(CASE
WHEN SUM(total) > 0 THEN SUM(checked) * 100 / SUM(total)
ELSE 0
END, 2) = 100
AND MAX(latest_create_time) >= b.task_deadline THEN 3
ELSE 1
END AS taskStatus
FROM (
SELECT
dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_current_cp
<where>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
dwmc,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_mini_programs_cp
<where>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_app_cp
<where>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw ,task_id
UNION ALL
SELECT ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_official_account_cp
<where>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
UNION ALL
SELECT
ssdw AS dwmc,
COUNT(*) AS total,
task_id,
MAX(create_time) AS latest_create_time,
SUM(CASE WHEN STATUS = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN STATUS = 3 OR STATUS = 5 THEN 1 ELSE 0 END) AS checked,
SUM(count) AS returned
FROM
asset_email_cp
<where>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
ssdw,
task_id
) AS s left join asset_task b on s.task_id=b.id
GROUP BY
s.dwmc ,
s.task_id,
s.latest_create_time
)AS aggregated_results
GROUP BY
taskStatus
ORDER BY
taskStatus
</select>
<update id="xcxsh" <update id="xcxsh"
parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest"> parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest">
update asset_mini_programs_cp update asset_mini_programs_cp
@ -679,6 +1010,11 @@
<update id="updateYgtByTaskId" parameterType="java.lang.Integer"> <update id="updateYgtByTaskId" parameterType="java.lang.Integer">
update asset_task set ygt=#{count} where id =#{taskId} update asset_task set ygt=#{count} where id =#{taskId}
</update> </update>
<update id="close" parameterType="java.lang.Integer">
update asset_task
set task_status=0
where id = #{taskId}
</update>
<!--通过主键删除--> <!--通过主键删除-->
<delete id="deleteById"> <delete id="deleteById">

Loading…
Cancel
Save