diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualitySuperviseController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualitySuperviseController.java new file mode 100644 index 000000000..1844f7960 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualitySuperviseController.java @@ -0,0 +1,186 @@ +package com.zhgd.xmgl.modules.baotou.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gexin.fastjson.JSON; +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.baotou.entity.QualitySupervise; +import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo; +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.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import org.apache.commons.collections.MapUtils; +import com.zhgd.xmgl.modules.baotou.entity.QualitySupervise; +import com.zhgd.xmgl.modules.baotou.service.IQualitySuperviseService; + +import org.simpleframework.xml.core.Validate; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; + + +/** + * @Title: Controller + * @Description: 质量监督 + * @author: pds + * @date: 2024-10-14 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/qualitySupervise") +@Slf4j +@Api(tags = "质量监督相关Api") +public class QualitySuperviseController { + @Autowired + private IQualitySuperviseService qualitySuperviseService; + + /** + * 分页列表查询 + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "分页查询", operDesc = "分页列表查询质量监督信息") + @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> queryPageList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(qualitySuperviseService.queryPageList(param)); + } + + /** + * 列表查询 + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "列表查询", operDesc = "列表查询质量监督信息") + @ApiOperation(value = "列表查询质量监督信息", notes = "列表查询质量监督信息", httpMethod="GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(qualitySuperviseService.queryList(param)); + } + + /** + * 添加 + * @param qualitySupervise + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "添加", operDesc = "添加质量监督信息") + @ApiOperation(value = "添加质量监督信息", notes = "添加质量监督信息" , httpMethod="POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate QualitySupervise qualitySupervise) { + qualitySuperviseService.add(qualitySupervise); + return Result.ok(); + } + + /** + * 编辑 + * @param qualitySupervise + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "编辑", operDesc = "编辑质量监督信息") + @ApiOperation(value = "编辑质量监督信息", notes = "编辑质量监督信息" , httpMethod="POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody QualitySupervise qualitySupervise) { + qualitySuperviseService.edit(qualitySupervise); + return Result.ok(); + } + + /** + * 通过id删除 + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "删除", operDesc = "删除质量监督信息") + @ApiOperation(value = "删除质量监督信息", notes = "删除质量监督信息" , httpMethod="POST") + @ApiImplicitParam(name = "id", value = "质量监督ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody HashMap map) { + qualitySuperviseService.delete(MapUtils.getString(map, "id")); + return Result.ok(); + } + + /** + * 通过id查询 + * @param id + * @return + */ + @OperLog(operModul = "质量监督管理", operType = "通过id查询", operDesc = "通过id查询质量监督信息") + @ApiOperation(value = "通过id查询质量监督信息", notes = "通过id查询质量监督信息" , httpMethod="GET") + @ApiImplicitParam(name = "id", value = "质量监督ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + return Result.success(qualitySuperviseService.queryById(id)); + } + + + @OperLog(operModul = "质量监督记录", operType = "", operDesc = "工作流添加质量监督记录") + @ApiOperation(value = "工作流添加质量监督记录", notes = "工作流添加质量监督记录", httpMethod = "GET") + @GetMapping(value = "/flow/add") + public Result addFromFlow(@ApiIgnore @RequestParam Map map) { + log.info("工作流添加质量监督记录:{}", com.gexin.fastjson.JSON.toJSONString(map)); + try { + qualitySuperviseService.addFromFlow(map); + } catch (Exception e) { + log.error("工作流添加质量监督记录:", e); + } + return Result.ok(); + } + + @OperLog(operModul = "质量监督记录", operType = "", operDesc = "工作流更改质量监督记录状态") + @ApiOperation(value = "工作流更改质量监督记录状态", notes = "工作流更改质量监督记录状态", httpMethod = "GET") + @GetMapping(value = "/flow/set/status") + public Result setRectification(@ApiIgnore @RequestParam Map map) { + log.info("工作流更改质量监督记录为整改中:{}", JSON.toJSONString(map)); + String instanceId = MapUtils.getString(map, "instanceId"); + qualitySuperviseService.update(new LambdaUpdateWrapper() + .set(QualitySupervise::getStatus, MapUtils.getInteger(map, "status")) + .eq(QualitySupervise::getInstanceId, instanceId) + ); + return Result.ok(); + } + + @ApiOperation(value = "记录统计", notes = "记录统计", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "changeUser", value = "整改人", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "itemId", value = "子任务ID", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "engineeringId", value = "危大工程记录ID", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "createUser", value = "创建人", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "recordType", value = "类型,1隐患问题,2排查记录", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "reviewId", value = "复查人", paramType = "body", required = false, dataType = "String"), +// @ApiImplicitParam(name = "status", value = "状态,1无需整改,2待整改,3待复查,4合格", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "body", required = false, dataType = "String"), + }) + @PostMapping(value = "/getProjectInspectRecordCount") + public Result getProjectInspectRecordCount(@RequestBody Map map) { + return Result.success(qualitySuperviseService.getProjectInspectRecordCount(map)); + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/QualitySupervise.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/QualitySupervise.java new file mode 100644 index 000000000..800b04ea2 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/QualitySupervise.java @@ -0,0 +1,149 @@ +package com.zhgd.xmgl.modules.baotou.entity; + +import java.io.Serializable; +import java.util.Date; +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 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; +/** + * @Description: 质量监督 + * @author: pds + * @date: 2024-10-14 + * @version: V1.0 + */ +@Data +@TableName("quality_supervise") +@ApiModel(value="QualitySupervise实体类",description="QualitySupervise") +public class QualitySupervise implements Serializable { + private static final long serialVersionUID = 1L; + + /**id*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value="id") + private java.lang.Long id ; + /**合同模式:1EPC;2E+P+C*/ + @ApiModelProperty(value="合同模式:1EPC;2E+P+C") + private java.lang.Integer contractModel ; + /**下发层级*/ + @ApiModelProperty(value="下发层级") + private java.lang.String deliveryLevel ; + /**质量监督机构*/ + @ApiModelProperty(value="质量监督机构") + private java.lang.String qualitySupervisionAgency ; + /**签发人*/ + @ApiModelProperty(value="签发人") + private java.lang.Long issuer ; + /**签发日期*/ + @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 issuingDate ; + /**联系人*/ + @ApiModelProperty(value="联系人") + private java.lang.String contactPerson ; + /**联系人电话*/ + @ApiModelProperty(value="联系人电话") + private java.lang.String contactPhoneNumber ; + /**装置id*/ + @ApiModelProperty(value="装置id") + private java.lang.Long deviceId ; + /**建设管理单位*/ + @ApiModelProperty(value="建设管理单位") + private java.lang.Long projectGroupId ; + /**监理单位id*/ + @ApiModelProperty(value="监理单位id") + private java.lang.Long supervisingUnitId ; + /**EPC承包商id*/ + @ApiModelProperty(value="EPC承包商id") + private java.lang.Long epcContractorId ; + /**设计单位id*/ + @ApiModelProperty(value="设计单位id") + private java.lang.Long designEnterpriseId ; + /**施工承包商id*/ + @ApiModelProperty(value="施工承包商id") + private java.lang.Long constructionUnitId ; + /**检测单位*/ + @ApiModelProperty(value="检测单位") + private java.lang.Long testingUnit ; + /**质量问题事实描述*/ + @ApiModelProperty(value="质量问题事实描述") + private java.lang.String qualityDescription ; + /**质量问题处置要求*/ + @ApiModelProperty(value="质量问题处置要求") + private java.lang.String qualityHandlingRequirement ; + /**上传图片*/ + @ApiModelProperty(value="上传图片") + private java.lang.String picUrl ; + /**上传附件*/ + @ApiModelProperty(value="上传附件") + private java.lang.String fileUrl ; + /**整改时限*/ + @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 changeLimitTime ; + /**工作流实例id*/ + @ApiModelProperty(value="工作流实例id") + private java.lang.String instanceId ; + /**所属项目SN*/ + @ApiModelProperty(value="所属项目SN") + private java.lang.String projectSn ; + /**创建时间*/ + @ApiModelProperty(value="创建时间") + private java.util.Date createDate ; + /**更新时间*/ + @ApiModelProperty(value="更新时间") + private java.util.Date updateDate ; + /**状态,2待整改,3整改中,5合格,6已撤回*/ + @ApiModelProperty(value="状态,2待整改,3整改中,5合格,6已撤回") + private java.lang.Integer status ; + /**检查时间*/ + @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 inspectTime ; + /**单位id*/ + @ApiModelProperty(value="单位id") + private java.lang.Long enterpriseId ; + /**检查人id*/ + @ApiModelProperty(value="检查人id") + private java.lang.Long inspectManId ; + + @TableField(exist = false) + @ApiModelProperty(value="签发人名称") + private java.lang.String issuerName ; + @TableField(exist = false) + @ApiModelProperty(value="装置名称") + private java.lang.String deviceName ; + @TableField(exist = false) + @ApiModelProperty(value="建设管理单位名称") + private java.lang.String projectGroupName ; + @TableField(exist = false) + @ApiModelProperty(value="监理单位名称") + private java.lang.String supervisingUnitName ; + @TableField(exist = false) + @ApiModelProperty(value="EPC承包商名称") + private java.lang.String epcContractorName ; + @TableField(exist = false) + @ApiModelProperty(value="设计单位名称") + private java.lang.String designEnterpriseName ; + @TableField(exist = false) + @ApiModelProperty(value="施工承包商名称") + private java.lang.String constructionUnitName ; + @TableField(exist = false) + @ApiModelProperty(value="检测单位名称") + private java.lang.String testingUnitName ; + @TableField(exist = false) + @ApiModelProperty(value="单位名称") + private java.lang.String enterpriseName ; + @TableField(exist = false) + @ApiModelProperty(value="检查人名称") + private java.lang.String inspectManName ; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/QualitySuperviseMapper.java b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/QualitySuperviseMapper.java new file mode 100644 index 000000000..e39a33cbe --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/QualitySuperviseMapper.java @@ -0,0 +1,55 @@ +package com.zhgd.xmgl.modules.baotou.mapper; + +import java.util.List; +import java.util.HashMap; +import java.util.Map; + +import com.zhgd.xmgl.modules.baotou.entity.QualitySupervise; +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.dangerous.entity.vo.ProjectInspectRecordCountVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 质量监督 + * @author: pds + * @date: 2024-10-14 + * @version: V1.0 + */ +@Mapper +public interface QualitySuperviseMapper extends BaseMapper { + + /** + * 分页列表查询质量监督信息 + * + * @param page + * @param queryWrapper + * @param param + * @return + */ + IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + /** + * 列表查询质量监督信息 + * + * @param queryWrapper + * @param param + * @return + */ + List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + + /** + * 通过id查询质量监督信息 + * + * @param id + * @return + */ + QualitySupervise queryById(String id); + + ProjectInspectRecordCountVo getProjectInspectRecordCount(Map map); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualitySuperviseMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualitySuperviseMapper.xml new file mode 100644 index 000000000..d3543a2fa --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/QualitySuperviseMapper.xml @@ -0,0 +1,109 @@ + + + + + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/IQualitySuperviseService.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/IQualitySuperviseService.java new file mode 100644 index 000000000..77aea1bd8 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/IQualitySuperviseService.java @@ -0,0 +1,59 @@ +package com.zhgd.xmgl.modules.baotou.service; + +import com.zhgd.xmgl.modules.baotou.entity.QualitySupervise; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description: 质量监督 + * @author: pds + * @date: 2024-10-14 + * @version: V1.0 + */ +public interface IQualitySuperviseService extends IService { + /** + * 分页列表查询质量监督信息 + * @param param 参数map + * @return + */ + IPage queryPageList(HashMap param); + /** + * 列表查询质量监督信息 + * @param param 参数map + * @return + */ + List queryList(HashMap param); + /** + * 添加质量监督信息 + * @param qualitySupervise 质量监督 + * @return + */ + void add(QualitySupervise qualitySupervise); + /** + * 编辑质量监督信息 + * @param qualitySupervise 质量监督 + * @return + */ + void edit(QualitySupervise qualitySupervise); + /** + * 根据id删除质量监督信息 + * @param id 质量监督的id + * @return + */ + void delete(String id); + /** + * 根据id查询质量监督信息 + * @param id 质量监督的id + * @return + */ + QualitySupervise queryById(String id); + + void addFromFlow(Map map); + + ProjectInspectRecordCountVo getProjectInspectRecordCount(Map map); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/QualitySuperviseServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/QualitySuperviseServiceImpl.java new file mode 100644 index 000000000..0fe221a77 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/QualitySuperviseServiceImpl.java @@ -0,0 +1,211 @@ +package com.zhgd.xmgl.modules.baotou.service.impl; +import java.util.Date; + +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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wflow.workflow.bean.process.OrgUser; +import com.wflow.workflow.bean.vo.ProcessProgressVo; +import com.wflow.workflow.service.ProcessInstanceService; +import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.xmgl.call.SanjiangDataCall; +import com.zhgd.xmgl.modules.baotou.entity.QualitySupervise; +import com.zhgd.xmgl.modules.baotou.mapper.QualityProblemMapper; +import com.zhgd.xmgl.modules.baotou.mapper.QualitySuperviseMapper; +import com.zhgd.xmgl.modules.baotou.security.mapper.XzSecurityDangerItemRecordMapper; +import com.zhgd.xmgl.modules.baotou.service.IQualitySuperviseService; +import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; +import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper; +import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl; +import com.zhgd.xmgl.modules.dangerous.entity.vo.ProjectInspectRecordCountVo; +import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper; +import com.zhgd.xmgl.modules.exam.service.IExamTrainService; +import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoAuditRecordMapper; +import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; +import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService; +import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl; +import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper; +import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressContentMapper; +import com.zhgd.xmgl.modules.xz.special.service.CountApiService; +import com.zhgd.xmgl.util.FlowSeviceUtil; +import com.zhgd.xmgl.util.FlowUtil; +import com.zhgd.xmgl.util.PageUtil; +import com.zhgd.xmgl.util.RefUtil; +import org.apache.commons.collections.MapUtils; +import org.flowable.engine.RuntimeService; +import org.flowable.engine.runtime.ProcessInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @Description: 质量监督 + * @author: pds + * @date: 2024-10-14 + * @version: V1.0 + */ +@Service +public class QualitySuperviseServiceImpl extends ServiceImpl implements IQualitySuperviseService { + @Autowired + SanjiangDataCall sanjiangDataCall; + @Autowired + XzSecurityDangerItemRecordMapper xzSecurityDangerItemRecordMapper; + @Autowired + SystemUserMapper systemUserMapper; + @Autowired + WorkerInfoMapper workerInfoMapper; + @Autowired + XzDeductScoreRecordMapper xzDeductScoreRecordMapper; + @Autowired + AiAnalyseHardWareAlarmRecordMapper aiAnalyseHardWareAlarmRecordMapper; + @Autowired + XzTaskProgressContentMapper xzTaskProgressContentMapper; + @Autowired + DangerousEngineeringRecordMapper dangerousEngineeringRecordMapper; + @Autowired + WorkerInfoAuditRecordMapper workerInfoAuditRecordMapper; + @Autowired + XzSecurityDangerItemRecordMapper dangerItemRecordMapper; + @Autowired + WorkerInfoServiceImpl workerInfoService; + @Lazy + @Autowired + SystemUserServiceImpl systemUserService; + @Lazy + @Autowired + CountApiService countApiService; + @Lazy + @Autowired + IExamTrainService examTrainService; + @Lazy + @Autowired + IEnterpriseInfoService enterpriseInfoService; + @Lazy + @Autowired + RuntimeService runtimeService; + @Autowired + FlowSeviceUtil flowSeviceUtil; + @Autowired + private QualitySuperviseMapper qualitySuperviseMapper; + @Autowired + private QualityProblemMapper qualityProblemMapper; + @Autowired + private ProcessInstanceService processService; + + @Override + public IPage queryPageList(HashMap param) { + QueryWrapper queryWrapper = this.getQueryWrapper(param); + if (Objects.equals(MapUtils.getInteger(param, "isMyTodo"), 1)) { + List instanceIds = flowSeviceUtil.getMyTodoInstanceIds("wf67072b923afc947a1a819313",MapUtils.getString(param,"projectSn")); + param.put("instanceIds", instanceIds); + } + Page page = PageUtil.getPage(param); + IPage pageList = baseMapper.queryList(page, queryWrapper, param); + pageList.setRecords(this.dealList(pageList.getRecords())); + return pageList; + } + + @Override + public List queryList(HashMap param) { + QueryWrapper queryWrapper = getQueryWrapper(param); + return dealList(baseMapper.queryList(queryWrapper, param)); + } + + private QueryWrapper getQueryWrapper(HashMap param) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(QualitySupervise.class, param, true); + queryWrapper.orderByDesc(RefUtil.fieldNameUlc(QualitySupervise::getId)); + return queryWrapper; + } + + private List dealList(List list) { + return list; + } + + @Override + public void add(QualitySupervise qualitySupervise) { + qualitySupervise.setId(null); + baseMapper.insert(qualitySupervise); + } + + @Override + public void edit(QualitySupervise qualitySupervise) { + QualitySupervise oldQualitySupervise = baseMapper.selectById(qualitySupervise.getId()); + if (oldQualitySupervise == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.updateById(qualitySupervise); + } + + @Override + public void delete(String id) { + QualitySupervise qualitySupervise = baseMapper.selectById(id); + if (qualitySupervise == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.deleteById(id); + } + + @Override + public QualitySupervise queryById(String id) { + QualitySupervise entity = baseMapper.queryById(id); + if (entity == null) { + throw new OpenAlertException("未找到对应实体"); + } + return entity; + } + + @Override + public void addFromFlow(Map map) { + String instanceId = FlowUtil.getString(map, "instanceId"); + ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, instanceId); + ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult(); + Map formData = instanceProgress.getFormData(); + List progress = instanceProgress.getProgress(); + ProcessProgressVo.ProgressNode node = progress.get(progress.size() - 1); + OrgUser user = node.getUser(); + String projectSn = processInstance.getTenantId(); + SystemUser user1 = systemUserService.getById(user.getId()); + WorkerInfo info = workerInfoService.getById(user1.getWorkerId()); + QualitySupervise record = new QualitySupervise(); + record.setContractModel(Objects.equals(FlowUtil.getString(formData, "field6263895325071"), "EPC") ? 1 : 2); + record.setDeliveryLevel(FlowUtil.getString(formData, "field5089995326471")); + record.setQualitySupervisionAgency(FlowUtil.getString(formData,"field4427127220717")); + record.setIssuer(FlowUtil.getPullDownLong(formData,"field6606727229026")); + record.setIssuingDate(FlowUtil.getDate(formData,"field1013227240565")); + record.setContactPerson(FlowUtil.getString(formData,"field6427495431488")); + record.setContactPhoneNumber(FlowUtil.getString(formData,"field2045027293082")); + record.setDeviceId(FlowUtil.getPullDownLong(formData,"field8461427261832")); + record.setProjectGroupId(FlowUtil.getPullDownLong(formData,"field2236827437883")); + record.setSupervisingUnitId(FlowUtil.getPullDownLong(formData,"field4800627374284")); + record.setEpcContractorId(FlowUtil.getPullDownLong(formData,"field7608927385682")); + record.setDesignEnterpriseId(FlowUtil.getPullDownLong(formData,"field3317527412133")); + record.setConstructionUnitId(FlowUtil.getPullDownLong(formData,"field8417827396166")); + record.setTestingUnit(FlowUtil.getPullDownLong(formData,"field9019727475232")); + record.setQualityDescription(FlowUtil.getString(formData,"field5217527483082")); + record.setQualityHandlingRequirement(FlowUtil.getString(formData,"field3613727494350")); + record.setPicUrl(FlowUtil.getJSONString(formData,"field4163295310790")); + record.setFileUrl(FlowUtil.getJSONString(formData,"field1531195312272")); + record.setChangeLimitTime(FlowUtil.getDate(formData,"field5732403118189")); + record.setInstanceId(instanceId); + record.setProjectSn(projectSn); + record.setCreateDate(new Date()); + record.setUpdateDate(new Date()); + record.setStatus(2); + record.setInspectTime(FlowUtil.getDate(formData,"field3424903116326")); + record.setEnterpriseId(Optional.ofNullable(info).map(WorkerInfo::getEnterpriseId).orElse(null)); + record.setInspectManId(Long.valueOf(processInstance.getStartUserId())); + baseMapper.insert(record); + } + + @Override + public ProjectInspectRecordCountVo getProjectInspectRecordCount(Map map) { + return baseMapper.getProjectInspectRecordCount(map); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 23235b006..19f75e7a1 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -81,6 +81,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { http.authorizeRequests() //请求路径允许访问 .antMatchers("/xmgl/hat/httpAlarmServer").permitAll() + .antMatchers("/xmgl/qualitySupervise/flow/**").permitAll() .antMatchers("/xmgl/civilizeConstruction/flow/**").permitAll() .antMatchers("/xmgl/qualityProblem/flow/**").permitAll() .antMatchers("/xmgl/xzSecurityQualityInspectionRecord/flow/**").permitAll()