bug修复
This commit is contained in:
parent
e2628bb94a
commit
6555c13200
@ -363,7 +363,8 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
if (Objects.equals(systemUser.getAccountType(), 10)) {
|
||||
XzSystemUserToCompanyProject xzSystemUserToCompanyProject = xzSystemUserToCompanyProjectMapper.selectOne(new LambdaQueryWrapper<XzSystemUserToCompanyProject>()
|
||||
.eq(XzSystemUserToCompanyProject::getType, 2)
|
||||
.last("limit 1")
|
||||
.eq(XzSystemUserToCompanyProject::getUserId, systemUser.getUserId())
|
||||
.last("order by id limit 1")
|
||||
);
|
||||
if (xzSystemUserToCompanyProject != null) {
|
||||
result.put("sn", xzSystemUserToCompanyProject.getSn());
|
||||
@ -477,7 +478,8 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
if (Objects.equals(systemUser.getAccountType(), 10)) {
|
||||
XzSystemUserToCompanyProject xzSystemUserToCompanyProject = xzSystemUserToCompanyProjectMapper.selectOne(new LambdaQueryWrapper<XzSystemUserToCompanyProject>()
|
||||
.eq(XzSystemUserToCompanyProject::getType, 2)
|
||||
.last("limit 1")
|
||||
.eq(XzSystemUserToCompanyProject::getUserId, systemUser.getUserId())
|
||||
.last("order by id limit 1")
|
||||
);
|
||||
if (xzSystemUserToCompanyProject != null) {
|
||||
result.put("sn", xzSystemUserToCompanyProject.getSn());
|
||||
|
||||
@ -11,6 +11,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -165,6 +166,11 @@ public class CheckingPoint implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateDate;
|
||||
@Excel(name = "区域id", width = 15)
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private java.lang.Long qualityRegionId;
|
||||
@ApiModelProperty(value = "合作单位ids")
|
||||
private java.lang.String enterpriseId;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.checking.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.modules.checking.entity.dto.CheckingPointInfoPageDto;
|
||||
import com.zhgd.xmgl.modules.checking.entity.CheckingPointInfo;
|
||||
import com.zhgd.xmgl.modules.checking.entity.dto.PointIdCountDTO;
|
||||
@ -19,6 +20,7 @@ import java.util.Set;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "enterprise_info")
|
||||
public interface CheckingPointInfoMapper extends BaseMapper<CheckingPointInfo> {
|
||||
IPage<CheckingPointInfo> selectCheckingPointInfoPage(@Param("dto") CheckingPointInfoPageDto dto, Page<?> objectPage);
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.checking.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.modules.checking.entity.CheckingPoint;
|
||||
import com.zhgd.xmgl.modules.checking.entity.qo.ProjectSnQO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -17,6 +18,7 @@ import java.util.List;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "enterprise_info")
|
||||
public interface CheckingPointMapper extends BaseMapper<CheckingPoint> {
|
||||
IPage<CheckingPoint> selectCheckingPointPage(@Param("qo") ProjectSnQO projectSnQO, Page<?> objectPage);
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
uo.real_name operate_name
|
||||
from checking_point_info cpi
|
||||
inner join checking_point cp on cpi.checking_point_id = cp.id
|
||||
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
inner join system_user su on cpi.checking_point_user_id = su.user_id
|
||||
left join system_user uo on cpi.operate_id = uo.user_id
|
||||
where cp.project_sn = #{dto.projectSn}
|
||||
@ -48,19 +49,22 @@
|
||||
from checking_point_info cpi
|
||||
inner join checking_point cp on cpi.checking_point_id = cp.id
|
||||
inner join system_user su on cpi.checking_point_user_id = su.user_id
|
||||
left join enterprise_info ei on find_in_set(ei.id, cp.enterprise_id)
|
||||
order by cpi.create_date desc
|
||||
</select>
|
||||
|
||||
<select id="getPointIdCountByPointSetAndCreateDate"
|
||||
resultType="com.zhgd.xmgl.modules.checking.entity.dto.PointIdCountDTO">
|
||||
select checking_point_id, count(checking_point_id) count
|
||||
from checking_point_info
|
||||
from checking_point_info cpi
|
||||
inner join checking_point cp on cpi.checking_point_id = cp.id
|
||||
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
where checking_point_id in
|
||||
<foreach collection="checkingPointIdSet" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="createDate != null and createDate != ''">
|
||||
and create_date >= #{createDate}
|
||||
and cpi.create_date >= #{createDate}
|
||||
</if>
|
||||
group by checking_point_id
|
||||
</select>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
noticeUserNames
|
||||
from checking_point cp
|
||||
inner join system_user su on cp.create_user_id = su.user_id
|
||||
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
<where>
|
||||
<if test="qo.projectSn != null and qo.projectSn != ''">
|
||||
and cp.project_sn = #{qo.projectSn}
|
||||
@ -23,8 +24,8 @@
|
||||
</select>
|
||||
|
||||
<select id="getStartingListByFrequencyType" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPoint">
|
||||
select id,
|
||||
checking_point_name,
|
||||
select cp.id,
|
||||
checking_point_name,
|
||||
project_sn,
|
||||
position,
|
||||
longitude,
|
||||
@ -41,7 +42,8 @@
|
||||
end_time,
|
||||
create_date,
|
||||
update_date
|
||||
from checking_point
|
||||
from checking_point cp
|
||||
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
where frequency_type = #{type}
|
||||
and current_date() > start_time
|
||||
and end_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
@ -49,7 +51,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getFinishList" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPoint">
|
||||
select id,
|
||||
select cp.id,
|
||||
checking_point_name,
|
||||
project_sn,
|
||||
position,
|
||||
@ -67,7 +69,8 @@
|
||||
end_time,
|
||||
create_date,
|
||||
update_date
|
||||
from checking_point
|
||||
from checking_point cp
|
||||
left join enterprise_info ei on find_in_set(ei.id, cp.enterprise_id)
|
||||
where end_time = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
and frequency_num is not null
|
||||
</select>
|
||||
|
||||
@ -16,9 +16,6 @@ import java.util.List;
|
||||
public interface CheckingPointInfoService extends IService<CheckingPointInfo> {
|
||||
|
||||
/**
|
||||
* @param queryStr
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<CheckingPointInfo> selectCheckingPointInfoPage(CheckingPointInfoPageDto dto);
|
||||
|
||||
@ -14,6 +14,7 @@ import com.gexin.fastjson.TypeReference;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.redis.lock.redisson.DistributedLock;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
@ -469,14 +470,21 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
|
||||
}
|
||||
|
||||
@Override
|
||||
@DistributedLock(keyPrefix = "quality_inspection_record:", key = "#qualityInspectionRecord.id", tryLok = true, lockTime = 0)
|
||||
public void edit(QualityInspectionRecord qualityInspectionRecord) {
|
||||
QualityInspectionRecord xzSecurityQualityInspectionRecordEntity = getById(qualityInspectionRecord.getId());
|
||||
if (xzSecurityQualityInspectionRecordEntity == null) {
|
||||
QualityInspectionRecord old = getById(qualityInspectionRecord.getId());
|
||||
if (old == null) {
|
||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||
}
|
||||
boolean ok = updateById(qualityInspectionRecord);
|
||||
|
||||
deductScoreIf(qualityInspectionRecord);
|
||||
if (Objects.equals(old.getStatus(), 6)) {
|
||||
//重新提交
|
||||
deleteQualityInspectionRecord(String.valueOf(qualityInspectionRecord.getId()));
|
||||
qualityInspectionRecord.setId(null);
|
||||
saveQualityInspectionRecord(qualityInspectionRecord);
|
||||
} else {
|
||||
updateById(qualityInspectionRecord);
|
||||
deductScoreIf(qualityInspectionRecord);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,128 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzMilestone;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzMilestoneService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 星纵-里程碑
|
||||
* @author: pds
|
||||
* @date: 2024-05-08
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/xzMilestone")
|
||||
@Slf4j
|
||||
@Api(tags = "星纵-里程碑相关Api")
|
||||
public class XzMilestoneController {
|
||||
@Autowired
|
||||
private IXzMilestoneService xzMilestoneService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询星纵-里程碑信息", notes = "分页列表查询星纵-里程碑信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<XzMilestone>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzMilestoneService.queryPageList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-里程碑信息", notes = "列表查询星纵-里程碑信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<XzMilestone>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzMilestoneService.queryList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzMilestone
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-里程碑信息", notes = "添加星纵-里程碑信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzMilestone> add(@RequestBody @Validate XzMilestone xzMilestone) {
|
||||
xzMilestoneService.add(xzMilestone);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzMilestone
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑星纵-里程碑信息", notes = "编辑星纵-里程碑信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzMilestone> edit(@RequestBody XzMilestone xzMilestone) {
|
||||
xzMilestoneService.edit(xzMilestone);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除星纵-里程碑信息", notes = "删除星纵-里程碑信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-里程碑ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<XzMilestone> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
xzMilestoneService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询星纵-里程碑信息", notes = "通过id查询星纵-里程碑信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-里程碑ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<XzMilestone> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<XzMilestone> result = new Result<XzMilestone>();
|
||||
XzMilestone xzMilestone = xzMilestoneService.getById(id);
|
||||
if (xzMilestone == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(xzMilestone);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-里程碑
|
||||
* @author: pds
|
||||
* @date: 2024-05-08
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_milestone")
|
||||
@ApiModel(value = "XzMilestone实体类", description = "XzMilestone")
|
||||
public class XzMilestone implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 项目唯一标识
|
||||
*/
|
||||
@Excel(name = "项目唯一标识", width = 15)
|
||||
@ApiModelProperty(value = "项目唯一标识")
|
||||
@NotBlank
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 里程碑名称
|
||||
*/
|
||||
@Excel(name = "里程碑名称", width = 15)
|
||||
@ApiModelProperty(value = "里程碑名称")
|
||||
@NotBlank
|
||||
private java.lang.String milestoneName;
|
||||
/**
|
||||
* 合作单位id
|
||||
*/
|
||||
@Excel(name = "合作单位id", width = 15)
|
||||
@ApiModelProperty(value = "合作单位id")
|
||||
@NotNull
|
||||
private java.lang.Long enterpriseId;
|
||||
/**
|
||||
* 里程碑时间节点 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Excel(name = "里程碑时间节点 yyyy-MM-dd", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "里程碑时间节点 yyyy-MM-dd")
|
||||
@NotNull
|
||||
private java.util.Date milestoneTime;
|
||||
/**
|
||||
* 创建时间 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新时间 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzMilestone;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-里程碑
|
||||
* @author: pds
|
||||
* @date: 2024-05-08
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzMilestoneMapper extends BaseMapper<XzMilestone> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.xz.security.mapper.XzMilestoneMapper">
|
||||
</mapper>
|
||||
@ -0,0 +1,27 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzMilestone;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-里程碑
|
||||
* @author: pds
|
||||
* @date: 2024-05-08
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzMilestoneService extends IService<XzMilestone> {
|
||||
|
||||
IPage<XzMilestone> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzMilestone> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzMilestone xzMilestone);
|
||||
|
||||
void edit(XzMilestone xzMilestone);
|
||||
|
||||
void delete(String id);
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzMilestone;
|
||||
import com.zhgd.xmgl.modules.xz.security.mapper.XzMilestoneMapper;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzMilestoneService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-里程碑
|
||||
* @author: pds
|
||||
* @date: 2024-05-08
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzMilestoneServiceImpl extends ServiceImpl<XzMilestoneMapper, XzMilestone> implements IXzMilestoneService {
|
||||
@Autowired
|
||||
private XzMilestoneMapper xzMilestoneMapper;
|
||||
|
||||
@Override
|
||||
public IPage<XzMilestone> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzMilestone> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzMilestone> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzMilestone> pageList = this.page(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzMilestone> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzMilestone> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzMilestone> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
QueryWrapper<XzMilestone> queryWrapper = QueryGenerator.initPageQueryWrapper(XzMilestone.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzMilestone::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzMilestone> dealList(List<XzMilestone> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzMilestone xzMilestone) {
|
||||
List<XzMilestone> xzMilestones = xzMilestoneMapper.selectList(new LambdaQueryWrapper<XzMilestone>()
|
||||
.eq(XzMilestone::getMilestoneTime, xzMilestone.getMilestoneTime())
|
||||
.eq(XzMilestone::getProjectSn, xzMilestone.getProjectSn())
|
||||
.eq(XzMilestone::getEnterpriseId, xzMilestone.getEnterpriseId())
|
||||
);
|
||||
if (CollUtil.isNotEmpty(xzMilestones)) {
|
||||
throw new OpenAlertException("里程碑时间节点已存在");
|
||||
}
|
||||
xzMilestone.setId(null);
|
||||
baseMapper.insert(xzMilestone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzMilestone xzMilestone) {
|
||||
XzMilestone oldXzMilestone = baseMapper.selectById(xzMilestone.getId());
|
||||
if (oldXzMilestone == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
List<XzMilestone> xzMilestones = xzMilestoneMapper.selectList(new LambdaQueryWrapper<XzMilestone>()
|
||||
.eq(XzMilestone::getMilestoneTime, xzMilestone.getMilestoneTime())
|
||||
.eq(XzMilestone::getProjectSn, xzMilestone.getProjectSn())
|
||||
.eq(XzMilestone::getEnterpriseId, xzMilestone.getEnterpriseId())
|
||||
.ne(XzMilestone::getId, xzMilestone.getId())
|
||||
);
|
||||
if (CollUtil.isNotEmpty(xzMilestones)) {
|
||||
throw new OpenAlertException("里程碑时间节点已存在");
|
||||
}
|
||||
baseMapper.updateById(xzMilestone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzMilestone xzMilestone = baseMapper.selectById(id);
|
||||
if (xzMilestone == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -14,6 +14,7 @@ import com.gexin.fastjson.TypeReference;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.redis.lock.redisson.DistributedLock;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
@ -477,14 +478,21 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
}
|
||||
|
||||
@Override
|
||||
@DistributedLock(keyPrefix = "xz_security_quality_inspection_record:", key = "#xzSecurityQualityInspectionRecord.id", tryLok = true, lockTime = 0)
|
||||
public void edit(XzSecurityQualityInspectionRecord xzSecurityQualityInspectionRecord) {
|
||||
XzSecurityQualityInspectionRecord xzSecurityQualityInspectionRecordEntity = getById(xzSecurityQualityInspectionRecord.getId());
|
||||
if (xzSecurityQualityInspectionRecordEntity == null) {
|
||||
XzSecurityQualityInspectionRecord old = getById(xzSecurityQualityInspectionRecord.getId());
|
||||
if (old == null) {
|
||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||
}
|
||||
boolean ok = updateById(xzSecurityQualityInspectionRecord);
|
||||
|
||||
deductScoreIf(xzSecurityQualityInspectionRecord);
|
||||
if (Objects.equals(old.getStatus(), 6)) {
|
||||
//重新提交
|
||||
deleteQualityInspectionRecord(String.valueOf(xzSecurityQualityInspectionRecord.getId()));
|
||||
xzSecurityQualityInspectionRecord.setId(null);
|
||||
saveQualityInspectionRecord(xzSecurityQualityInspectionRecord);
|
||||
} else {
|
||||
updateById(xzSecurityQualityInspectionRecord);
|
||||
deductScoreIf(xzSecurityQualityInspectionRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.xz.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
@ -28,6 +29,7 @@ import java.net.URLEncoder;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@ -270,4 +272,13 @@ public class XzTaskProgressController {
|
||||
public Result<CountTaskProgressVo> countTaskProgress(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(taskProgressService.countTaskProgress(paramMap));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目进度总览", notes = "项目进度总览", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/statsByEnterprise")
|
||||
public Result<JSONArray> statsByEnterprise(@ApiIgnore @RequestBody Map<String, Object> paramMap) {
|
||||
return Result.success(taskProgressService.statsByEnterprise(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.xz.entity;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -70,6 +71,7 @@ public class XzTaskProgress implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "预计开始时间")
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private java.util.Date startDate;
|
||||
/**
|
||||
* 实际开始时间
|
||||
@ -78,6 +80,7 @@ public class XzTaskProgress implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实际开始时间")
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private java.util.Date actualStartDate;
|
||||
/**
|
||||
* 预计完成时间
|
||||
@ -86,6 +89,7 @@ public class XzTaskProgress implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "预计完成时间")
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private java.util.Date finishDate;
|
||||
/**
|
||||
* 实际完成时间
|
||||
@ -94,6 +98,7 @@ public class XzTaskProgress implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实际完成时间")
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private java.util.Date actualFinishDate;
|
||||
/**
|
||||
* 创建时间
|
||||
@ -101,6 +106,7 @@ public class XzTaskProgress implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private java.util.Date createDate;
|
||||
/**
|
||||
* 更新时间
|
||||
|
||||
@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 任务进度甘特图
|
||||
@ -39,4 +40,6 @@ public interface XzTaskProgressMapper extends BaseMapper<XzTaskProgress> {
|
||||
CountTaskProgressVo countTaskProgress(HashMap<String, Object> paramMap);
|
||||
|
||||
CountTaskProgressVo getMaxMinProgress(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzTaskProgress> statsByEnterprise(Map<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -185,4 +185,21 @@
|
||||
WHERE find_in_set(#{supplierEnterpriseId}, ancestors) ))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="statsByEnterprise" resultType="com.zhgd.xmgl.modules.xz.entity.XzTaskProgress">
|
||||
select ei.enterprise_name,
|
||||
t.project_sn,
|
||||
min(t.start_date) start_date,
|
||||
min(t.actual_start_date) actual_start_date,
|
||||
max(t.finish_date) finish_date,
|
||||
max(t.actual_finish_date) actual_finish_date,
|
||||
pe.parent_project_enterprise_id as parentId,
|
||||
pe.id,
|
||||
t.*
|
||||
from xz_task_progress t
|
||||
left join enterprise_info ei on ei.id = t.enterprise_id
|
||||
left join project_enterprise pe on pe.enterprise_id = t.enterprise_id and pe.project_sn = t.project_sn
|
||||
where t.project_sn = #{projectSn}
|
||||
group by t.enterprise_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.xz.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorVo;
|
||||
@ -12,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 任务进度甘特图
|
||||
@ -44,4 +46,6 @@ public interface IXzTaskProgressService extends IService<XzTaskProgress> {
|
||||
List<XzTaskProgress> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
XzTaskProgress queryById(String id);
|
||||
|
||||
JSONArray statsByEnterprise(Map<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -36,6 +38,8 @@ import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressContentMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressTotalMapper;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzMilestone;
|
||||
import com.zhgd.xmgl.modules.xz.security.mapper.XzMilestoneMapper;
|
||||
import com.zhgd.xmgl.modules.xz.service.IXzTaskProgressService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.ListUtils;
|
||||
@ -73,16 +77,6 @@ import java.util.stream.Collectors;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Slf4j
|
||||
public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper, XzTaskProgress> implements IXzTaskProgressService {
|
||||
@Autowired
|
||||
private QualityRegionMapper qualityRegionMapper;
|
||||
@Autowired
|
||||
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
@Autowired
|
||||
private SystemUserServiceImpl systemUserService;
|
||||
@Value("${basePath}")
|
||||
private String basePath;
|
||||
@Autowired
|
||||
XzTaskProgressTotalMapper xzTaskProgressTotalMapper;
|
||||
@Autowired
|
||||
@ -95,6 +89,18 @@ public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper,
|
||||
SystemUserMapper systemUserMapper;
|
||||
@Autowired
|
||||
UploadFileService uploadFileService;
|
||||
@Autowired
|
||||
XzMilestoneMapper xzMilestoneMapper;
|
||||
@Autowired
|
||||
private QualityRegionMapper qualityRegionMapper;
|
||||
@Autowired
|
||||
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
@Autowired
|
||||
private SystemUserServiceImpl systemUserService;
|
||||
@Value("${basePath}")
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
* 所有进度甘特图, 以父子节点形式呈现
|
||||
@ -230,7 +236,6 @@ public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delete(HashMap<String, Object> map) {
|
||||
String id = MapUtils.getString(map, "id");
|
||||
@ -440,7 +445,6 @@ public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归设置子节点列表
|
||||
*
|
||||
@ -607,4 +611,20 @@ public class XzTaskProgressServiceImpl extends ServiceImpl<XzTaskProgressMapper,
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray statsByEnterprise(Map<String, Object> paramMap) {
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
List<XzTaskProgress> list = baseMapper.statsByEnterprise(paramMap);
|
||||
JSONArray notTreeArr = JSONArray.parseArray(JSON.toJSONStringWithDateFormat(list, "yyyy-MM-dd", SerializerFeature.WriteDateUseDateFormat));
|
||||
JSONArray result = ListUtils.listToTree(notTreeArr, "id", "parentId", "children");
|
||||
List<XzMilestone> xzMilestones = xzMilestoneMapper.selectList(new LambdaQueryWrapper<XzMilestone>()
|
||||
.eq(XzMilestone::getProjectSn, projectSn));
|
||||
Map<Long, List<XzMilestone>> map = xzMilestones.stream().collect(Collectors.groupingBy(XzMilestone::getEnterpriseId));
|
||||
for (int i = 0; i < notTreeArr.size(); i++) {
|
||||
JSONObject jo = notTreeArr.getJSONObject(i);
|
||||
jo.put("xzMilestoneList", map.get(jo.getLong("enterpriseId")));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ public class ListUtils {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = (JSONObject) arr.get(i);
|
||||
hash.put(json.getString(id), json);
|
||||
json.put(child, new JSONArray());
|
||||
}
|
||||
//遍历结果集
|
||||
for (int j = 0; j < arr.size(); j++) {
|
||||
@ -47,7 +48,6 @@ public class ListUtils {
|
||||
JSONObject aVal = (JSONObject) arr.get(j);
|
||||
//在hash中取出key为单条记录中pid的值
|
||||
String pidStr = "";
|
||||
Object pidObj = aVal.get(pid);
|
||||
if (aVal.get(pid) != null) {
|
||||
pidStr = aVal.get(pid).toString();
|
||||
}
|
||||
@ -65,9 +65,6 @@ public class ListUtils {
|
||||
hashVP.put(child, ch);
|
||||
}
|
||||
} else {
|
||||
if (arr.size() == 1) {
|
||||
aVal.put(child, new JSONArray());
|
||||
}
|
||||
r.add(aVal);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user