| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- package cn.com.goldenwater.dcproj.controller.tac;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.constValue.StateEnum;
- import cn.com.goldenwater.dcproj.dao.TacObjSubject515Dao;
- import cn.com.goldenwater.dcproj.dto.TacCountDto;
- import cn.com.goldenwater.dcproj.dto.TacPblmInfoDto;
- import cn.com.goldenwater.dcproj.model.*;
- import cn.com.goldenwater.dcproj.param.GwComFileParam;
- import cn.com.goldenwater.dcproj.param.TacPblmInfoParam;
- import cn.com.goldenwater.dcproj.param.TacPblmSubjectParam;
- import cn.com.goldenwater.dcproj.service.*;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.util.Assert;
- import org.springframework.util.CollectionUtils;
- import org.springframework.web.bind.annotation.*;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.List;
- /**
- * @author lune
- * @date 2019-6-19
- */
- @Api(value = "TAC 稽察问题信息表管理", tags = "TAC 稽察问题信息表管理")
- @RestController
- @RequestMapping("/tac/pblm/info")
- public class TacPblmInfoController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private TacPblmInfoService tacPblmInfoService;
- @Autowired
- private TacPblmSubjectService tacPblmSubjectService;
- @Autowired
- private TacObjPblmstbService tacObjPblmstbService;
- @Autowired
- private TacObjSubjectService tacObjSubjectService;
- @Autowired
- private GwComFileService gwComFileService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @Autowired
- private TacPawpRgstrService pawpRgstrService;
- @Autowired
- private TacObjSubject515Dao tacObjSubject515Dao;
- /**
- * 稽查业务--稽查填报 添加问题 法律条款 法规内容 从问题清单 带过来 ,
- * 保存 专家编辑后的内容 ,存入 问题表 tac_pblm_info 的冗余字段 :法律条款、法规内容
- *
- * @param tacPblmInfo
- * @return
- * @date 2023/01/28
- */
- @ApiOperation(value = "添加/修改稽察问题信息表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<TacPblmInfo> insert(@ApiParam(name = "tacPblmInfo", value = "TacPblmInfo", required = true) @RequestBody TacPblmInfo tacPblmInfo) {
- tacPblmInfo.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- // if(StringUtils.isBlank(tacPblmInfo.getPblmReason())){
- // return buildFailResponse("原因分析必填");
- // }
- // if(StringUtils.isBlank(tacPblmInfo.getPblmSggtn())){
- // return buildFailResponse("意见建议必填");
- // }
- if (StringUtils.isNotBlank(tacPblmInfo.getId())) {
- tacPblmInfo.setUptm(new Date());
- tacPblmInfoService.updatePblm(tacPblmInfo);
- } else {
- String key = getCurrentPersId() + "_pblm_info";
- synchronized (this) {
- if (!pawpRgstrService.suoding(key)) {
- return buildFailResponse("操作太频繁,请等会儿再操作");
- }
- }
- if (StringUtils.isBlank(tacPblmInfo.getIfCasePblm())) {
- tacPblmInfo.setIfCasePblm("0");
- }
- String uuid = UuidUtil.uuid();
- tacPblmInfo.setId(uuid);
- tacPblmInfo.setIntm(new Date());
- tacPblmInfo.setDataStat(StateEnum.NOWASTSTATE.getKey());
- tacPblmInfoService.insertPblm(tacPblmInfo);
- }
- return buildSuccessResponse(tacPblmInfo);
- }
- @ApiOperation(value = "根据问题id锁定问题,让专家修改")
- @RequestMapping(value = "/rect/{id}", method = RequestMethod.GET)
- @Transactional(rollbackFor = Exception.class)
- public BaseResponse rect(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- String key = id + "_rect";
- synchronized (this) {
- if (!pawpRgstrService.suoding(key)) {
- return buildFailResponse("操作太频繁,请等会儿再操作");
- }
- }
- TacPblmInfo pblmInfo = tacPblmInfoService.get(id);
- if (pblmInfo == null) {
- return buildFailResponse("数据不存在,不支持问题锁定");
- }
- String rgstrId = pblmInfo.getRgstrId();
- if (!rgstrId.contains("_")) {
- return buildFailResponse("当前阶段问题不能再回退");
- }
- String[] arrays = rgstrId.split("_");
- String newRegistrId = arrays[0] + "_8";
- pblmInfo.setRgstrId(newRegistrId);
- pblmInfo.setId(UuidUtil.uuid());
- tacPblmInfoService.insert(pblmInfo);
- List<GwComFile> comFiles = gwComFileService.findFileByBiz(id);
- if (comFiles != null && !comFiles.isEmpty()) {
- for (GwComFile comFile : comFiles) {
- comFile.setBizId(pblmInfo.getId());
- comFile.setId(UuidUtil.uuid());
- gwComFileService.insert(comFile);
- }
- }
- pawpRgstrService.addUnitSctn(rgstrId, newRegistrId);
- tacPblmInfoService.delete(id);
- GwComFileParam comFileParam = new GwComFileParam();
- comFileParam.setBizId(id);
- gwComFileService.deleteBy(comFileParam);
- return buildSuccessResponse(pblmInfo);
- }
- @ApiOperation(value = "根据问题id锁定问题,让专家修改列表")
- @RequestMapping(value = "/rectList", method = RequestMethod.GET)
- public BaseResponse rectList(@RequestBody TacPblmInfoParam pblmInfoParam) {
- BisInspAllRlationPers pers = rlationPersService.get(getCurrentPersId());
- if (pers == null) {
- return null;
- }
- pblmInfoParam.setPersId(getCurrentPersId());
- if ("1".equals(pers.getPersType()) || "2".equals(pers.getPersType())) {
- pblmInfoParam.setPersId("");
- }
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- pblmInfoParam.setRgstrId("_8");
- List<TacWorkerB> tacWorkerBList = workerBService.findPerInZLOrTPY(getCurrentPersId());
- if (tacWorkerBList != null && !tacWorkerBList.isEmpty()) {
- return buildSuccessResponse(tacPblmInfoService.findPageJieduanZLorTPY(pblmInfoParam));
- }
- return buildSuccessResponse(tacPblmInfoService.findPageJieduanInfo(pblmInfoParam));
- }
- @ApiOperation(value = "根据ID删除稽察问题信息表")
- @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = tacPblmInfoService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新稽察问题信息表信息")
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public BaseResponse<TacPblmInfo> update(@ApiParam(name = "tacPblmInfo", value = "TacPblmInfo", required = true) @RequestBody TacPblmInfo tacPblmInfo) {
- Assert.notNull(tacPblmInfo.getId(), "主键id为必填参数");
- tacPblmInfo.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- int ret = tacPblmInfoService.update(tacPblmInfo);
- return buildSuccessResponse(tacPblmInfo);
- }
- /**
- * 获取稽查填报--问题详情的 时候,法律条款、法规内容 取专家编辑后的值,编辑时不允许修改
- * tac_pblm_info 的字段 :法律条款 RELATIVE_LAW、法规内容 LAW_CONTENT
- * @param id
- * @return
- */
- @ApiOperation(value = "根据ID获取稽察问题信息表(单表)详情,包括主体单位,标准库信息等")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<TacPblmInfo> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- TacPblmInfo tacPblmInfo = tacPblmInfoService.get(id);
- if (tacPblmInfo != null) {
- TacPblmSubjectParam pblmSubjectParam = new TacPblmSubjectParam();
- pblmSubjectParam.setPblmId(id);
- List<TacPblmSubject> pblmSubjectList = tacPblmSubjectService.findList(pblmSubjectParam);
- if (pblmSubjectList != null && !pblmSubjectList.isEmpty()) {
- tacPblmInfo.setPblmSubjectList(pblmSubjectList);
- } else {
- pblmSubjectList = new ArrayList<>();
- if (StringUtils.isNotBlank(tacPblmInfo.getSubjectNames())) {
- String[] subjects = tacPblmInfo.getSubjectNames().split(",");
- String[] subjeids = tacPblmInfo.getSubjectIds().split(",");
- for (int i = 0; i < subjects.length; i++) {
- TacObjSubject objSubject = tacObjSubjectService.get(subjeids[i]);
- if (objSubject == null) {
- objSubject = tacObjSubject515Dao.get(subjeids[i]);
- }
- if (objSubject != null) {
- TacPblmSubject subject = new TacPblmSubject();
- subject.setPblmId(tacPblmInfo.getId());
- subject.setSubId(subjeids[i]);
- subject.setSubName(objSubject.getSubName());
- subject.setIntm(new Date());
- subject.setUnitNm(subjects[i]);
- pblmSubjectList.add(subject);
- }
- }
- tacPblmInfo.setPblmSubjectList(pblmSubjectList);
- }
- }
- if (StringUtils.isNotBlank(tacPblmInfo.getPblmstdId())) {
- TacObjPblmstb objPblmstb = tacObjPblmstbService.getOne(tacPblmInfo.getPblmstdId());
- tacPblmInfo.setTacObjPblmstb(objPblmstb);
- }
- tacPblmInfo.setGwComFileList(gwComFileService.findFileByBiz(id));
- }
- return buildSuccessResponse(tacPblmInfo);
- }
- @ApiOperation(value = "分页查询稽察问题清单")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPblmInfo>> page(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- return buildSuccessResponse(getpageInfo(pblmInfoParam));
- }
- @ApiOperation(value = "分页查询稽察问题清单-成果")
- @RequestMapping(value = "/pagecg", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPblmInfo>> pageCg(@RequestBody TacPblmInfoParam pblmInfoParam) {
- String province = olBisInspOrgService.getRlProvince(getCurrentOrgId());
- pblmInfoParam.setProvince(province);
- return buildSuccessResponse(tacPblmInfoService.findPageJieduanInfo(pblmInfoParam));
- }
- @Autowired
- private TacWorkerBService workerBService;
- @Autowired
- private BisInspAllRlationPersService rlationPersService;
- @ApiOperation(value = "分页查询稽察问题清单-手机app稽察问题")
- @RequestMapping(value = "/pageNew", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPblmInfo>> pageNew(@RequestBody TacPblmInfoParam pblmInfoParam) {
- String province = olBisInspOrgService.getRlProvince(getCurrentOrgId());
- pblmInfoParam.setProvince(province);
- return buildSuccessResponse(getpageInfo(pblmInfoParam));
- }
- private PageInfo<TacPblmInfo> getpageInfo(TacPblmInfoParam pblmInfoParam) {
- BisInspAllRlationPers pers = rlationPersService.get(getCurrentPersId());
- if (pers == null) {
- return null;
- }
- pblmInfoParam.setPersId(getCurrentPersId());
- //管理员
- PageInfo<TacPblmInfo> tacPawpRgstr = new PageInfo<>();
- if ("1".equals(pers.getPersType()) || "2".equals(pers.getPersType())) {
- pblmInfoParam.setPersId("");
- tacPawpRgstr = tacPblmInfoService.findPageInfoNew(pblmInfoParam);
- return tacPawpRgstr;
- }
- //助理
- List<TacWorkerB> tacWorkerBList = workerBService.findPerInZLOrTPY(getCurrentPersId());
- if (tacWorkerBList == null || tacWorkerBList.isEmpty()) {
- tacPawpRgstr = tacPblmInfoService.findPageInfo(pblmInfoParam);
- } else {
- tacPawpRgstr = tacPblmInfoService.findPageInfoZLorTPY(pblmInfoParam);
- }
- return tacPawpRgstr;
- }
- @ApiOperation(value = "稽察问题统计 - 统计分类")
- @RequestMapping(value = "/countPblmInfoByType", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByType(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByType(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计-- 责任主体")
- @RequestMapping(value = "/countPblmInfoBySub", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoBySub(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoBySub(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计新-- 责任主体(对应新阶段流程信息)")
- @RequestMapping(value = "/countPblmInfoBySubNew", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoBySubNew(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- pblmInfoParam.setYear(Long.parseLong(pblmInfoParam.getYears()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoBySubNew(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计-- 行政区划")
- @RequestMapping(value = "/countPblmInfoByAdCode", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByAdCode(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByAdCode(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计新-- 所在省份地市(对应新阶段流程信息)")
- @RequestMapping(value = "/countPblmInfoByAdCodeNew", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByAdCodeNew(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByAdCodeNew(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计-- 标准库")
- @RequestMapping(value = "/countPblmInfoByStb", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByStb(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByStb(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "批量修改问题")
- @RequestMapping(value = "/updatePblmInfoList", method = RequestMethod.POST)
- public BaseResponse updatePblmInfoList(@RequestBody TacPblmInfoDto dto) {
- int a = tacPblmInfoService.updatePblmInfoList(dto);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "统计典型问题")
- @RequestMapping(value = "/countPblmInfoByCase", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByCase(@RequestBody TacPblmInfoParam pblmInfoParam) {
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByCase(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @Deprecated
- @ApiOperation(value = "统计问题发生频度")
- @RequestMapping(value = "/countPblmInfoByQlttv", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByQlttv(@RequestBody TacPblmInfoParam pblmInfoParam) {
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByQlttv(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "问题发生频度第一个接口,统计问题数或项目数")
- @RequestMapping(value = "/countPblmInfoByQt", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByQt(@RequestBody TacPblmInfoParam pblmInfoParam) {
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByQt(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "问题发生频度新第一个接口,统计问题数或项目数(对应新阶段流程信息)")
- @RequestMapping(value = "/countPblmInfoByQtNew", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByQtNew(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoByQtNew(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "问题发生频度第二个接口,统计问题数或项目数 问题分类最大值")
- @RequestMapping(value = "/countPblmInfoMaxByQt", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoMaxByQt(@RequestBody TacPblmInfoParam pblmInfoParam) {
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoMaxByQt(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "问题发生频度新第二个接口,统计问题数或项目数 问题分类最大值(对应新阶段流程信息)")
- @RequestMapping(value = "/countPblmInfoMaxByQtNew", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoMaxByQtNew(@RequestBody TacPblmInfoParam pblmInfoParam) {
- pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacPblmInfoService.countPblmInfoMaxByQtNew(pblmInfoParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "分页查询稽察问题清单")
- @RequestMapping(value = "/pageObjPblm", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPblmInfo>> pageObjPblm(@RequestBody TacPblmInfoParam pblmInfoParam) {
- String province = olBisInspOrgService.getRlProvince(getCurrentOrgId());
- pblmInfoParam.setProvince(province);
- pblmInfoParam.setOrgId(getCurrentOrgId());
- PageInfo<TacPblmInfo> tacPawpRgstr = tacPblmInfoService.findPageInfoNew(pblmInfoParam);
- return buildSuccessResponse(tacPawpRgstr);
- }
- @ApiOperation(value = "分页查询稽察问题清单")
- @RequestMapping(value = "/pageProvincePblm", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPblmInfo>> pageProvincePblm(@RequestBody TacPblmInfoParam pblmInfoParam) {
- String province = olBisInspOrgService.getRlProvince(getCurrentOrgId());
- pblmInfoParam.setProvince(province);
- pblmInfoParam.setOrgId(getCurrentOrgId());
- PageInfo<TacPblmInfo> tacPawpRgstr = tacPblmInfoService.findProvincePblmInfo(pblmInfoParam);
- return buildSuccessResponse(tacPawpRgstr);
- }
- @ApiOperation(value = "问题统计-工程项目")
- @RequestMapping(value = "/countPblmInfoByObj", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByObj(@RequestBody TacPblmInfoParam pblmInfoParam) {
- String province = olBisInspOrgService.getRlProvince(getCurrentOrgId());
- pblmInfoParam.setProvince(province);
- List<TacCountDto> tacCountDtos = tacPblmInfoService.countPblmInfoByObj(pblmInfoParam);
- return buildSuccessResponse(tacCountDtos);
- }
- @ApiOperation(value = "获取当前人员是否是当前问题所在组的组长")
- @RequestMapping(value = "/ifLeader/{id}", method = RequestMethod.GET)
- public BaseResponse<Boolean> ifLeader(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- List<String> guids = tacPblmInfoService.getLeaderId(id);
- if(!CollectionUtils.isEmpty(guids) && guids.contains(getCurrentPersId())){
- return buildSuccessResponse(true);
- }
- return buildSuccessResponse(false);
- }
- }
|