任务模块编写

main
dongdingding 2 months ago
parent 7bc094af3d
commit 1a36bc3da4

@ -11,8 +11,10 @@ import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.response.AssetTaskIdResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import com.ruoyi.tc.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -185,7 +187,7 @@ public class AssetTaskController extends BaseController {
assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
if (StringUtils.isBlank(assetCurrent.getBfyy())) {
//待审批
assetCurrent.setStatus(1);
assetCurrent.setStatus(0);
} else {
//已报废
assetCurrent.setStatus(5);
@ -266,7 +268,10 @@ public class AssetTaskController extends BaseController {
assetLc.setAssetName(assetCurrent.getXtmc());
//当审核状态为审核不通过 单位端重新提交
if (assetCurrent.getStatus().equals(4)){
assetLc.setDwcxhcTime(LocalDateTime.now());
assetLc.setTaskId(assetCurrent.getTaskId());
assetLc.setXfTime(LocalDateTime.now());
assetLc.setAssetName("单位重新核查提交时间"+assetCurrent.getXtmc());
assetLcService.insert(assetLc);
}
StringBuilder a = new StringBuilder();
@ -284,12 +289,18 @@ public class AssetTaskController extends BaseController {
b.append(",");
});
}
assetCurrent.setGlIp(b.toString());
assetCurrentJyService.save(assetCurrent);
assetCurrent.setStatus(1);
//当审核状态为带待核查
if(assetCurrent.getStatus().equals(1)){
assetLc.setDwhcTime(LocalDateTime.now());
assetLc.setXfTime(LocalDateTime.now());
assetLc.setTaskId(assetCurrent.getTaskId());
assetLc.setAssetName("单位核查完成提交"+assetCurrent.getXtmc());
assetLcService.insert(assetLc);
}
assetCurrentJyService.save(assetCurrent);
//新增新监管业务形态
if (assetCurrent.getXjgywxt() != null) {
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
@ -335,5 +346,22 @@ public class AssetTaskController extends BaseController {
public AjaxResult sh(@RequestBody AssetCurrentShRequest req) {
return AjaxResult.success(assetTaskService.sh(req));
}
/**
* -
*
* @param req
* @return
*/
@ApiOperation(value = "管理端-单位核查情况",response =AssetdwHcResponse.class )
@PostMapping("/dwHc")
public AjaxResult dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, AssetdwHcRequest req) {
return AjaxResult.success(assetTaskService.dwHc(assetdwHcResponsePage,req));
}
}

@ -32,38 +32,19 @@ public class AssetLc implements Serializable {
/**
*
*/
@ApiModelProperty("管理员下发时间")
@ApiModelProperty("时间")
@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 xfTime;
/**
*
*/
@ApiModelProperty("单位核查完成提交时间")
@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 dwhcTime;
/**
*
*/
@ApiModelProperty("管理员审核驳回时间")
@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 shbhTime;
/**
*
*/
@ApiModelProperty("单位重新核查提交时间")
@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 dwcxhcTime;
/**
*
*
*/
@ApiModelProperty("管理员审核通过时间")
@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 shtgTime;
@ApiModelProperty("流程名称")
private String assetName;
/**
* id
*/
@ -119,11 +100,6 @@ public class AssetLc implements Serializable {
@ApiModelProperty("备注")
private String remark;
/**
*
*/
@ApiModelProperty("资产名称")
private String assetName;
}

@ -27,6 +27,8 @@ public class AssetCurrentShRequest {
private Integer assetId;
/**
* 01345
*/

@ -0,0 +1,23 @@
package com.ruoyi.tc.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2024/11/21 18:49
*/
@Data
@ApiModel("单位核查情况请求类")
public class AssetdwHcRequest {
/**
*
*/
@ApiModelProperty("单位名称")
private String dwmc;
}

@ -0,0 +1,45 @@
package com.ruoyi.tc.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2024/11/21 18:36
*/
@Data
@ApiModel("核查单位信息响应类")
public class AssetdwHcResponse {
/**
*
*/
@ApiModelProperty("单位名称")
private String dwmc;
/**
*
*/
@ApiModelProperty("核查资产数量")
private Integer total;
/**
*
*/
@ApiModelProperty("完成数量")
private Integer checked;
/**
*
*/
@ApiModelProperty("百分比")
private double checkedRatio;
}

@ -6,9 +6,11 @@ import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
@ -128,7 +130,6 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
AssetCurrentCpPo findBytaskIdandAssestId(@Param("taskId") int taskId, @Param("assetId") int assetId);
/**
*
*
@ -136,5 +137,15 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @return
*/
int sh(@Param("req") AssetCurrentShRequest req);
/**
* -
*
* @return
*/
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, @Param("req") AssetdwHcRequest req);
}

@ -6,9 +6,11 @@ import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.request.AssetdwHcRequest;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
/**
* (AssetTask)
@ -86,4 +88,12 @@ public interface AssetTaskService extends IService<AssetTask> {
* @return
*/
int sh(AssetCurrentShRequest req);
/**
* -
*
* @return
*/
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage,AssetdwHcRequest req);
}

@ -4,17 +4,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.AssetLc;
import com.ruoyi.tc.entity.AssetTask;
import com.ruoyi.tc.entity.request.Acomma;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest;
import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.request.*;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import com.ruoyi.tc.mapper.AssetTaskMapper;
import com.ruoyi.tc.service.*;
import org.springframework.stereotype.Service;
@ -55,6 +49,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
@Resource
private AssetLcService assetLcService;
/**
* ID
*
@ -92,6 +87,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
AssetLc assetLc = new AssetLc();
assetLc.setTaskId(id);
assetLc.setXfTime(LocalDateTime.now());
assetLc.setAssetName("管理员任务下发");
assetLcService.insert(assetLc);
String[] parts = assetTask.getDwmc().split(",");
for (String part : parts) {
@ -201,15 +197,32 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
}
@Override
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest)
{
public Page<AssestTaskXqresponse> zcHc(Page<AssestTaskXqresponse> assetTask, AssestTaskXqRequest pageRequest) {
assetTask.setOptimizeCountSql(false);
return assetTaskDao.zcHc(assetTask, pageRequest);
}
@Override
public int sh(AssetCurrentShRequest req) {
AssetLc assetLc = new AssetLc();
if (req.getStatus()==3) {
assetLc.setTaskId(req.getTaskId());
assetLc.setXfTime(LocalDateTime.now());
assetLc.setAssetName("管理员审核通过");
assetLcService.insert(assetLc);
} else if (req.getStatus()==4) {
assetLc.setTaskId(req.getTaskId());
assetLc.setAssetName("管理员审核不通过");
assetLc.setXfTime(LocalDateTime.now());
assetLcService.insert(assetLc);
}
return assetTaskDao.sh(req);
}
@Override
public Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage,AssetdwHcRequest req) {
return assetTaskDao.dwHc(assetdwHcResponsePage,req);
}
}

@ -48,7 +48,7 @@
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="AssetLcMap">
select
id,task_id,xf_time,dwhc_time,shbh_time,dwcxhc_time,shtg_time,ueser_i,ddept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark
id,task_id,xf_time,dept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark,assetName
from asset_lc
<where>
<if test="id != null">
@ -164,11 +164,28 @@
</if>
</where>
</select>
<select id="queryByPage" resultType="com.ruoyi.tc.entity.AssetLc">
select
id,task_id,xf_time,dept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark,assetName
from asset_lc
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="taskId != null">
and task_id = #{taskId}
</if>
<if test="xfTime != null">
and xf_time = #{xfTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into asset_lc(task_id,xf_time,dwhc_time,shbh_time,dwcxhc_time,shtg_time,ueser_id,dept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark)
values (#{taskId},#{xfTime},#{dwhcTime},#{shbhTime},#{dwcxhcTime},#{shtgTime},#{ueserId},#{deptId},#{createId},#{createBy},#{createTime},#{updateId},#{updateBy},#{updateTime},#{version},#{remark})
insert into asset_lc(task_id,xf_time,asset_name,ueser_id,dept_id,create_id,create_by,create_time,update_id,update_by,update_time,version,remark)
values (#{taskId},#{xfTime},#{assetName},#{ueserId},#{deptId},#{createId},#{createBy},#{createTime},#{updateId},#{updateBy},#{updateTime},#{version},#{remark})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">

@ -221,6 +221,7 @@
and b.xtlx = #{req.xtlx}
</if>
</where>
order by b.current_id desc
</select>
<select id="findBytaskIdandAssestId" resultType="com.ruoyi.tc.entity.po.AssetCurrentCpPo">
select *
@ -228,6 +229,29 @@
where task_id = #{taskId}
and id = #{assetId}
</select>
<select id="dwHc" resultType="com.ruoyi.tc.entity.response.AssetdwHcResponse">
SELECT
dwmc,
COUNT(*) AS total,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS notChecked,
SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) AS checked,
ROUND(
CASE
WHEN COUNT(*) > 0 THEN
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) * 1.0 / COUNT(*)
ELSE 0
END, 2) AS checkedRatio
FROM
asset_current_cp
<where>
<if test="req.dwmc!=null and req.dwmc!='' ">
and dwmc = #{req.dwmc}
</if>
</where>
GROUP BY
dwmc
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">

Loading…
Cancel
Save