Merge remote-tracking branch 'origin/guoshengxiong' into guoshengxiong
# Conflicts: # src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/SystemUserMapper.xml
This commit is contained in:
commit
936cbb091a
@ -100,6 +100,7 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
tables.put("xz_material", "enterprise_id");
|
||||
tables.put("inspect_task_record", "enterprise_id");
|
||||
tables.put("xz_security_inspect_task_record", "enterprise_id");
|
||||
tables.put("xz_security_quality_inspection_record", "enterprise_id");
|
||||
return tables;
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,9 @@
|
||||
<if test="xzProjectOrgId != null and xzProjectOrgId != ''">
|
||||
and po.id = #{xzProjectOrgId}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and a.user_id = #{userId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findByUsername" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="string">
|
||||
select *
|
||||
|
||||
@ -2,11 +2,11 @@ package com.zhgd.xmgl.modules.basicdata.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.entity.sj.JwtPayloadUserInfo;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.dto.LoginInfoByTokenDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.dto.LoginInfoByTokenDto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @Description: 账号
|
||||
* @author: pds
|
||||
* @date: 2020-08-06
|
||||
* @date: 2020-08-06
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface ISystemUserService extends IService<SystemUser> {
|
||||
@ -38,8 +38,6 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
|
||||
void batchDeleteSystemUserAndRole(String projectSn);
|
||||
|
||||
List<SystemUser> getProjectChilderSystemUserList(Map<String, Object> map);
|
||||
|
||||
void addProjectUser(SystemUser systemUser);
|
||||
|
||||
Map<String, Object> getToken(Map<String, Object> map);
|
||||
@ -115,4 +113,10 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
boolean isTenant();
|
||||
|
||||
List<SystemUser> getUsersByRegionId(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查找项目子账号列表
|
||||
*/
|
||||
List<SystemUser> getProjectChilderSystemUserList(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -124,21 +124,30 @@ public class DangerousEngineeringRecord implements Serializable {
|
||||
private java.lang.Integer specialConstructionSchemeType;
|
||||
/**
|
||||
* 专项施工方案附件
|
||||
*/
|
||||
@Excel(name = "专项施工方案附件", width = 15)
|
||||
@ApiModelProperty(value = "专项施工方案附件")
|
||||
private java.lang.String specialConstructionSchemeFile;
|
||||
@ApiModelProperty(value = "责任人id")
|
||||
private java.lang.Long personLiableId;
|
||||
@ApiModelProperty(value = "已结束?1是,0否")
|
||||
private java.lang.Integer isEnd;
|
||||
@ApiModelProperty(value = "分包单位id")
|
||||
private java.lang.Long responsibilityCompanyId;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "类别描述列表")
|
||||
private List<DangerousEngineeringChooseTypeDescribe> typeDescribeList;
|
||||
*/
|
||||
@Excel(name = "专项施工方案附件", width = 15)
|
||||
@ApiModelProperty(value = "专项施工方案附件")
|
||||
private java.lang.String specialConstructionSchemeFile;
|
||||
@ApiModelProperty(value = "责任人id")
|
||||
private java.lang.Long personLiableId;
|
||||
@ApiModelProperty(value = "已结束?1是,0否")
|
||||
private java.lang.Integer isEnd;
|
||||
@ApiModelProperty(value = "分包单位id")
|
||||
private java.lang.Long responsibilityCompanyId;
|
||||
|
||||
@ApiModelProperty(value = "最终验收状态1进行中2已闭合")
|
||||
private Integer finalAcceptanceStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "类别描述列表")
|
||||
private List<DangerousEngineeringChooseTypeDescribe> typeDescribeList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "管控要点明细ID列表")
|
||||
private List<Long> controlItemList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "是否逾期")
|
||||
private Boolean isOverdue;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "管控要点明细ID列表")
|
||||
private List<Long> controlItemList;
|
||||
}
|
||||
|
||||
@ -4,10 +4,15 @@
|
||||
|
||||
<select id="queryDangerousEngineeringPageList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,IFNULL(tp.hidden_danger_num,0) hidden_danger_num,
|
||||
(case when a.build_end_time is not null and a.build_end_time!='' and a.build_end_time <DATE_FORMAT(now(),"%Y-%m-%d") then 3
|
||||
when a.build_end_time is not null and a.build_end_time!='' and a.build_start_time is not null and a.build_start_time!=''
|
||||
and a.build_end_time >=DATE_FORMAT(now(),"%Y-%m-%d") and a.build_start_time <=DATE_FORMAT(now(),"%Y-%m-%d") then 2
|
||||
else 1 END) engineering_state
|
||||
(case when a.build_end_time is not null and a.build_end_time!='' and a.build_end_time <DATE_FORMAT(now(),"%Y-%m-%d")
|
||||
then 3
|
||||
when a.build_end_time is not null and a.build_end_time!='' and a.build_start_time is not null and
|
||||
a.build_start_time!=''
|
||||
and a.build_end_time >=DATE_FORMAT(now(),"%Y-%m-%d") and a.build_start_time <=DATE_FORMAT(now(),"%Y-%m-%d")
|
||||
then 2
|
||||
else 1 END) engineering_state,
|
||||
if(a.final_acceptance_status=1 and now()>=if(LENGTH(a.plan_end_time) = 10, CONCAT(DATE_FORMAT(a.plan_end_time,
|
||||
'%Y-%m-%d'), ' 23:59:59'), a.plan_end_time),1,0) isOverdue
|
||||
from dangerous_engineering_record a
|
||||
LEFT JOIN (SELECT engineering_id,COUNT(1) hidden_danger_num
|
||||
from hidden_danger_inspection_record
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.video.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.video.entity.VideoItem;
|
||||
import com.zhgd.xmgl.modules.yunlianwanwu.middle.entity.VideoItemConfigBo;
|
||||
@ -18,6 +19,7 @@ import java.util.Map;
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "video_item")
|
||||
public interface VideoItemMapper extends BaseMapper<VideoItem> {
|
||||
|
||||
List<EntityMap> selectVideoItemListByVideoId(Map<String, Object> map);
|
||||
|
||||
@ -173,21 +173,21 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
}
|
||||
AiAnalyseHardWareAlarmRecord aiAnalyseHardWareAlarmRecord = new AiAnalyseHardWareAlarmRecord();
|
||||
aiAnalyseHardWareAlarmRecord.setCreateTime(body.getString("alarmTime"));
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmType(Integer.parseInt(body.getString("eventId")));
|
||||
aiAnalyseHardWareAlarmRecord.setHardwareId(aiAnalyseHardWareRecord.getHardwareId());
|
||||
aiAnalyseHardWareAlarmRecord.setHardwareName(aiAnalyseHardWareRecord.getHardwareName());
|
||||
String alarmVideo = body.getString("alarmVideo");
|
||||
alarmVideo = alarmVideo.split(":")[2];
|
||||
alarmVideo = alarmVideo.substring(alarmVideo.indexOf("/"));
|
||||
FileInfo alarmVideoInfo = fileStorageService.of(UrlUtil.uploadImgUrlToMultipartFile(serverUrl + alarmVideo)).setPath(DateUtil.today()).upload();
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmVideo(DateUtil.today() + "/" + alarmVideoInfo.getUrl());
|
||||
if (StringUtils.isNotEmpty(alarmVideo)) {
|
||||
FileInfo alarmVideoInfo = fileStorageService.of(UrlUtil.uploadImgUrlToMultipartFile(alarmVideo)).setPath(DateUtil.today()).upload();
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmVideo(DateUtil.today() + "/" + alarmVideoInfo.getFilename());
|
||||
}
|
||||
aiAnalyseHardWareAlarmRecord.setProjectSn(aiAnalyseHardWareRecord.getProjectSn());
|
||||
aiAnalyseHardWareAlarmRecord.setStatus(1);
|
||||
String alarmImage = body.getString("alarmImage");
|
||||
alarmImage = alarmImage.split(":")[2];
|
||||
alarmImage = alarmImage.substring(alarmImage.indexOf("/"));
|
||||
FileInfo alarmImageInfo = fileStorageService.of(UrlUtil.uploadImgUrlToMultipartFile(serverUrl + alarmImage)).setPath(DateUtil.today()).upload();
|
||||
aiAnalyseHardWareAlarmRecord.setImageUrl(DateUtil.today() + "/" + alarmImageInfo.getUrl());
|
||||
if (StringUtils.isNotEmpty(alarmImage)) {
|
||||
FileInfo alarmImageInfo = fileStorageService.of(UrlUtil.uploadImgUrlToMultipartFile(alarmImage)).setPath(DateUtil.today()).upload();
|
||||
aiAnalyseHardWareAlarmRecord.setImageUrl(DateUtil.today() + "/" + alarmImageInfo.getFilename());
|
||||
}
|
||||
|
||||
aiAnalyseHardWareAlarmRecord.setAlarmDesc(body.getString("alarmDesc"));
|
||||
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, aiAnalyseHardWareRecord.getProjectSn());
|
||||
for (DictionaryItem dictionaryItem : dictList) {
|
||||
|
||||
@ -116,7 +116,7 @@ public class UserDevAuthorityServiceImpl extends ServiceImpl<UserDevAuthorityMap
|
||||
if (Objects.equals(user.getAccountType(), 6)) {
|
||||
//项目子账号就筛选自己能看到的
|
||||
Long userId = user.getUserId();
|
||||
UserDevAuthority userEnterprise = baseMapper.selectOne(new LambdaQueryWrapper<UserDevAuthority>().eq(UserDevAuthority::getUserId, userId));
|
||||
UserDevAuthority userEnterprise = baseMapper.selectOne(new LambdaQueryWrapper<UserDevAuthority>().eq(UserDevAuthority::getUserId, userId).eq(UserDevAuthority::getDevType, 2));
|
||||
String enterpriseId;
|
||||
if (userEnterprise == null || StringUtils.isBlank(userEnterprise.getDevId())) {
|
||||
enterpriseId = "0";
|
||||
|
||||
@ -0,0 +1,130 @@
|
||||
package com.zhgd.xmgl.modules.xz.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.entity.XzDangerousEngineeringAcceptance;
|
||||
import com.zhgd.xmgl.modules.xz.service.IXzDangerousEngineeringAcceptanceService;
|
||||
|
||||
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-04-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/xzDangerousEngineeringAcceptance")
|
||||
@Slf4j
|
||||
@Api(tags = "星纵-危大验收相关Api")
|
||||
public class XzDangerousEngineeringAcceptanceController {
|
||||
@Autowired
|
||||
private IXzDangerousEngineeringAcceptanceService xzDangerousEngineeringAcceptanceService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @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"),
|
||||
@ApiImplicitParam(name = "applyAcceptanceUserId", value = "申请验收人id", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "acceptanceUserId", value = "验收人id", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<XzDangerousEngineeringAcceptance>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzDangerousEngineeringAcceptanceService.queryPageList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-危大验收信息", notes = "列表查询星纵-危大验收信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<XzDangerousEngineeringAcceptance>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzDangerousEngineeringAcceptanceService.queryList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzDangerousEngineeringAcceptance
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-危大验收信息", notes = "添加星纵-危大验收信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzDangerousEngineeringAcceptance> add(@RequestBody @Validate XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance) {
|
||||
xzDangerousEngineeringAcceptanceService.add(xzDangerousEngineeringAcceptance);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzDangerousEngineeringAcceptance
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑星纵-危大验收信息", notes = "编辑星纵-危大验收信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzDangerousEngineeringAcceptance> edit(@RequestBody XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance) {
|
||||
xzDangerousEngineeringAcceptanceService.edit(xzDangerousEngineeringAcceptance);
|
||||
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<XzDangerousEngineeringAcceptance> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
xzDangerousEngineeringAcceptanceService.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<XzDangerousEngineeringAcceptance> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<XzDangerousEngineeringAcceptance> result = new Result<XzDangerousEngineeringAcceptance>();
|
||||
XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance = xzDangerousEngineeringAcceptanceService.getById(id);
|
||||
if (xzDangerousEngineeringAcceptance == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(xzDangerousEngineeringAcceptance);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.xz.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
@ -163,10 +164,26 @@ public class XzMaterialController {
|
||||
@PostMapping(value = "/save")
|
||||
public Result<Object> save(@RequestBody JSONObject obj) {
|
||||
log.info("添加材料信息" + JSON.toJSONString(obj));
|
||||
List<String> enterpriseIds = (List<String>) obj.get("enterpriseId");
|
||||
XzMaterial xzMaterial = new XzMaterial();
|
||||
String [] param = {"name", "model", "specifications", "unit", "num", "remark"};
|
||||
List<XzMaterialDetail> list = new ArrayList<>();
|
||||
xzMaterial.setName(obj.getString("name"));
|
||||
XzMaterial exist = xzMaterialService.getOne(Wrappers.<XzMaterial>lambdaQuery()
|
||||
.like(XzMaterial::getName, DateUtil.today())
|
||||
.orderByDesc(XzMaterial::getCreateTime).last("limit 1"));
|
||||
if (exist == null) {
|
||||
xzMaterial.setName(DateUtil.today() + "/01批次");
|
||||
xzMaterial.setNum(1);
|
||||
} else {
|
||||
Integer index = exist.getNum();
|
||||
index = index + 1;
|
||||
if (index < 10) {
|
||||
xzMaterial.setName(DateUtil.today() + "/第0" + index + "批次");
|
||||
} else {
|
||||
xzMaterial.setName(DateUtil.today() + "/第" + index + "批次");
|
||||
}
|
||||
xzMaterial.setNum(index);
|
||||
}
|
||||
xzMaterial.setEntryTime(obj.getDate("entryTime"));
|
||||
JSONArray detail = obj.getJSONArray("detail");
|
||||
if (detail != null) {
|
||||
@ -183,11 +200,11 @@ public class XzMaterialController {
|
||||
}
|
||||
}
|
||||
xzMaterial.setProjectSn(obj.getString("projectSn"));
|
||||
List<String> enterpriseIds = (List<String>) obj.get("enterpriseId");
|
||||
if (enterpriseIds != null && enterpriseIds.size() >0) {
|
||||
if (enterpriseIds != null && enterpriseIds.size() > 0) {
|
||||
xzMaterial.setEnterpriseId(enterpriseIds.get(0));
|
||||
}
|
||||
xzMaterial.setXzMaterialList(list);
|
||||
xzMaterial.setCreateTime(new Date());
|
||||
xzMaterialService.saveInfo(xzMaterial);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
@ -0,0 +1,133 @@
|
||||
package com.zhgd.xmgl.modules.xz.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-危大验收
|
||||
* @author: pds
|
||||
* @date: 2024-04-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_dangerous_engineering_acceptance")
|
||||
@ApiModel(value = "XzDangerousEngineeringAcceptance实体类", description = "XzDangerousEngineeringAcceptance")
|
||||
public class XzDangerousEngineeringAcceptance implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 危大工程ID
|
||||
*/
|
||||
@Excel(name = "危大工程ID", width = 15)
|
||||
@ApiModelProperty(value = "危大工程ID")
|
||||
@NotNull
|
||||
private java.lang.Long engineeringId;
|
||||
/**
|
||||
* 计划执行时间
|
||||
*/
|
||||
@Excel(name = "计划执行时间", 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 = "计划执行时间")
|
||||
private java.util.Date planTime;
|
||||
/**
|
||||
* 申请验收单位id
|
||||
*/
|
||||
@Excel(name = "申请验收单位id", width = 15)
|
||||
@ApiModelProperty(value = "申请验收单位id")
|
||||
private java.lang.Long applyAcceptanceUnitId;
|
||||
/**
|
||||
* 申请验收人id
|
||||
*/
|
||||
@Excel(name = "申请验收人id", width = 15)
|
||||
@ApiModelProperty(value = "申请验收人id")
|
||||
private java.lang.Long applyAcceptanceUserId;
|
||||
/**
|
||||
* 验收单位id
|
||||
*/
|
||||
@Excel(name = "验收单位id", width = 15)
|
||||
@ApiModelProperty(value = "验收单位id")
|
||||
@NotNull
|
||||
private java.lang.Long acceptanceUnitId;
|
||||
/**
|
||||
* 验收人id
|
||||
*/
|
||||
@Excel(name = "验收人id", width = 15)
|
||||
@ApiModelProperty(value = "验收人id")
|
||||
@NotNull
|
||||
private java.lang.Long acceptanceUserId;
|
||||
/**
|
||||
* 验收结果1合格2不合格
|
||||
*/
|
||||
@Excel(name = "验收结果1合格2不合格", width = 15)
|
||||
@ApiModelProperty(value = "验收结果1合格2不合格")
|
||||
private java.lang.Integer acceptanceResult;
|
||||
/**
|
||||
* 验收描述
|
||||
*/
|
||||
@Excel(name = "验收描述", width = 15)
|
||||
@ApiModelProperty(value = "验收描述")
|
||||
private java.lang.String acceptanceDesc;
|
||||
/**
|
||||
* 现场图片
|
||||
*/
|
||||
@Excel(name = "现场图片", width = 15)
|
||||
@ApiModelProperty(value = "现场图片")
|
||||
private java.lang.String photo;
|
||||
/**
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 创建时间 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;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "危大工程名称(显示用,新增不用传)")
|
||||
private String engineeringName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "申请验收单位名称(显示用,新增不用传)")
|
||||
private String applyAcceptanceUnitName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "申请验收人名称(显示用,新增不用传)")
|
||||
private String applyAcceptanceUserName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "验收单位名称(显示用,新增不用传)")
|
||||
private String acceptanceUnitName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "验收人名称(显示用,新增不用传)")
|
||||
private String acceptanceUserName;
|
||||
|
||||
}
|
||||
@ -39,6 +39,12 @@ public class XzMaterial implements Serializable {
|
||||
@Excel(name = "批次名称", width = 15)
|
||||
@ApiModelProperty(value = "批次名称")
|
||||
private String name;
|
||||
/**
|
||||
* 批次数量
|
||||
*/
|
||||
@Excel(name = "批次数量", width = 15)
|
||||
@ApiModelProperty(value = "批次数量")
|
||||
private Integer num;
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
@ -58,6 +64,9 @@ public class XzMaterial implements Serializable {
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private String enterpriseId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package com.zhgd.xmgl.modules.xz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzDangerousEngineeringAcceptance;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-危大验收
|
||||
* @author: pds
|
||||
* @date: 2024-04-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzDangerousEngineeringAcceptanceMapper extends BaseMapper<XzDangerousEngineeringAcceptance> {
|
||||
|
||||
List<XzDangerousEngineeringAcceptance> queryList(@Param(Constants.WRAPPER) QueryWrapper<XzDangerousEngineeringAcceptance> queryWrapper);
|
||||
|
||||
IPage<XzDangerousEngineeringAcceptance> queryList(Page<XzDangerousEngineeringAcceptance> page, @Param(Constants.WRAPPER) QueryWrapper<XzDangerousEngineeringAcceptance> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<?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.mapper.XzDangerousEngineeringAcceptanceMapper">
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.xz.entity.XzDangerousEngineeringAcceptance">
|
||||
select xdea.*,
|
||||
depr.engineering_name,
|
||||
ei2.enterprise_name as applyAcceptanceUnitName,
|
||||
ei1.enterprise_name as acceptanceUnitName,
|
||||
su1.real_name as applyAcceptanceUserName,
|
||||
su2.real_name as acceptanceUserName
|
||||
from xz_dangerous_engineering_acceptance xdea
|
||||
left join dangerous_engineering_record depr on xdea.engineering_id = depr.id
|
||||
left join enterprise_info ei2 on ei2.id = xdea.apply_acceptance_unit_id
|
||||
left join enterprise_info ei1 on ei1.id = xdea.acceptance_unit_id
|
||||
left join system_user su1 on su1.user_id = xdea.apply_acceptance_user_id
|
||||
left join system_user su2 on su2.user_id = xdea.acceptance_user_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,27 @@
|
||||
package com.zhgd.xmgl.modules.xz.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzDangerousEngineeringAcceptance;
|
||||
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-04-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzDangerousEngineeringAcceptanceService extends IService<XzDangerousEngineeringAcceptance> {
|
||||
|
||||
IPage<XzDangerousEngineeringAcceptance> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzDangerousEngineeringAcceptance> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance);
|
||||
|
||||
void edit(XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance);
|
||||
|
||||
void delete(String id);
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package com.zhgd.xmgl.modules.xz.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringRecord;
|
||||
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzDangerousEngineeringAcceptance;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzDangerousEngineeringAcceptanceMapper;
|
||||
import com.zhgd.xmgl.modules.xz.service.IXzDangerousEngineeringAcceptanceService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-危大验收
|
||||
* @author: pds
|
||||
* @date: 2024-04-30
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzDangerousEngineeringAcceptanceServiceImpl extends ServiceImpl<XzDangerousEngineeringAcceptanceMapper, XzDangerousEngineeringAcceptance> implements IXzDangerousEngineeringAcceptanceService {
|
||||
@Autowired
|
||||
DangerousEngineeringRecordMapper dangerousEngineeringRecordMapper;
|
||||
@Autowired
|
||||
private XzDangerousEngineeringAcceptanceMapper xzDangerousEngineeringAcceptanceMapper;
|
||||
@Autowired
|
||||
private SystemUserServiceImpl systemUserService;
|
||||
|
||||
@Override
|
||||
public IPage<XzDangerousEngineeringAcceptance> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzDangerousEngineeringAcceptance> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzDangerousEngineeringAcceptance> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzDangerousEngineeringAcceptance> pageList = baseMapper.queryList(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzDangerousEngineeringAcceptance> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzDangerousEngineeringAcceptance> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzDangerousEngineeringAcceptance> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "xdea.";
|
||||
QueryWrapper<XzDangerousEngineeringAcceptance> queryWrapper = QueryGenerator.initPageQueryWrapper(XzDangerousEngineeringAcceptance.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzDangerousEngineeringAcceptance::getCreateTime));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzDangerousEngineeringAcceptance> dealList(List<XzDangerousEngineeringAcceptance> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance) {
|
||||
xzDangerousEngineeringAcceptance.setId(null);
|
||||
Long userId = SecurityUtils.getUser().getUserId();
|
||||
xzDangerousEngineeringAcceptance.setApplyAcceptanceUserId(userId);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("userId", userId);
|
||||
List<SystemUser> userList = systemUserService.getProjectChilderSystemUserList(map);
|
||||
if (CollUtil.isNotEmpty(userList)) {
|
||||
xzDangerousEngineeringAcceptance.setApplyAcceptanceUnitId(userList.get(0).getEnterpriseId());
|
||||
}
|
||||
baseMapper.insert(xzDangerousEngineeringAcceptance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance) {
|
||||
XzDangerousEngineeringAcceptance oldXzDangerousEngineeringAcceptance = baseMapper.selectById(xzDangerousEngineeringAcceptance.getId());
|
||||
if (oldXzDangerousEngineeringAcceptance == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(xzDangerousEngineeringAcceptance);
|
||||
|
||||
if (Objects.equals(xzDangerousEngineeringAcceptance.getAcceptanceResult(), 1)) {
|
||||
dangerousEngineeringRecordMapper.update(null, new LambdaUpdateWrapper<DangerousEngineeringRecord>()
|
||||
.eq(DangerousEngineeringRecord::getId, oldXzDangerousEngineeringAcceptance.getEngineeringId())
|
||||
.set(DangerousEngineeringRecord::getFinalAcceptanceStatus, 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzDangerousEngineeringAcceptance xzDangerousEngineeringAcceptance = baseMapper.selectById(id);
|
||||
if (xzDangerousEngineeringAcceptance == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user