| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772 |
- package cn.com.goldenwater.dcproj.service.impl.tac;
- import cn.com.goldenwater.dcproj.constValue.JinChaEnum;
- import cn.com.goldenwater.dcproj.constValue.SplitValue;
- import cn.com.goldenwater.dcproj.dao.*;
- import cn.com.goldenwater.dcproj.dto.TacPawpRgstrDto;
- import cn.com.goldenwater.dcproj.model.*;
- import cn.com.goldenwater.dcproj.param.*;
- import cn.com.goldenwater.dcproj.service.GwComFileService;
- import cn.com.goldenwater.core.service.AbstractCrudService;
- import cn.com.goldenwater.dcproj.service.TacPawpRgstrService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.dcproj.utils.GeoUtil;
- import cn.com.goldenwater.dcproj.utils.InspUtils;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import org.apache.commons.io.FileUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.data.redis.core.RedisTemplate;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.io.File;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.concurrent.TimeUnit;
- /**
- * @author lune
- * @date 2019-6-19
- */
- @Service
- @Transactional(rollbackFor = Exception.class)
- public class TacPawpRgstrServiceImpl extends AbstractCrudService<TacPawpRgstr, TacPawpRgstrParam> implements TacPawpRgstrService {
- @Autowired
- private TacPawpRgstrDao tacPawpRgstrDao;
- @Autowired
- private TacProvincePlanTaskDao tacProvincePlanTaskDao;
- public TacPawpRgstrServiceImpl(TacPawpRgstrDao tacPawpRgstrDao) {
- super(tacPawpRgstrDao);
- this.tacPawpRgstrDao = tacPawpRgstrDao;
- }
- /**
- * app获取稽察项目督查项目列表
- *
- * @param typeParam
- * @return
- */
- @Override
- public PageInfo<TacPawpRgstrDto> findPageWagaPage(TypeParam typeParam) {
- if (StringUtils.isNotBlank(typeParam.getAdCode())) {
- typeParam.setAdCode(String.valueOf(AdLevelUtil.SubAd(typeParam.getAdCode()).get(SplitValue.SUBAD)));
- }
- PageHelper.startPage(typeParam);
- List<TacPawpRgstrDto> list = tacPawpRgstrDao.findPawpPage(typeParam);
- PageInfo<TacPawpRgstrDto> pageInfo = new PageInfo(list);
- return pageInfo;
- }
- @Autowired
- TacPawpListDao tacPawpListDao;
- @Autowired
- private TacPawpPdbstDao tacPawpPdbstDao;
- @Autowired
- private TacPawpRaiobisDao tacPawpRaiobisDao;
- @Autowired
- private TacPawpBstocmPlprsDao tacPawpBstocmPlprsDao;
- @Autowired
- private TacPawpBitopqQmsDao tacPawpBitopqQmsDao;
- @Autowired
- private TacPawpBioesPeDao tacPawpBioesPeDao;
- @Autowired
- private TacPawpBiofuamDao tacPawpBiofuamDao;
- @Autowired
- private TacPblmInfoDao tacPblmInfoDao;
- @Autowired
- private TacPawpDrmDao tacPawpDrmDao;
- @Autowired
- private TacPawpBioesRwunitDao tacPawpBioesRwunitDao;
- @Autowired
- private TacPawpBitopqPeqaaDao tacPawpBitopqPeqaaDao;
- @Autowired
- private TacPawpUnitSctnDao tacPawpUnitSctnDao;
- @Autowired
- private TacPblmSubjectDao tacPblmSubjectDao;
- @Autowired
- private TacWordBaseDao tacWordBaseDao;
- @Value("${jc.baseinfo.word.path}")
- private String docxPath;
- @Override
- public TacPawpRgstr createZhuliData(String persId, String regstrId, String type, TacPawpRgstr pawpRgstr, String regstrId_zhuli, String state) {
- //复制稽察项目基本信息的word文档
- TacWordBaseParam wordBaseParam = new TacWordBaseParam();
- wordBaseParam.setType("10" + type);
- wordBaseParam.setBizId(regstrId);
- TacWordBase wordBase = tacWordBaseDao.getBy(wordBaseParam);
- if (wordBase != null) {
- String filePath = wordBase.getFilePath();
- String oldPath = docxPath + filePath;
- String newId = UuidUtil.uuid();
- String newfilePath = filePath.replace(regstrId, regstrId_zhuli);
- String newPath = oldPath.replace(regstrId, regstrId_zhuli);
- File newFile = new File(newPath);
- File oldFile = new File(oldPath);
- try {
- FileUtils.copyFile(oldFile, newFile);
- } catch (Exception e) {
- e.printStackTrace();
- }
- wordBase.setId(newId);
- wordBase.setBizId(regstrId_zhuli);
- wordBase.setFilePath(newfilePath);
- wordBase.setIntm(new Date());
- wordBase.setUptm(new Date());
- tacWordBaseDao.insert(wordBase);
- }
- //复制稽察项目单位及标段信息
- addUnitSctn(regstrId, regstrId_zhuli);
- //添加问题
- addParam(regstrId, type, "", regstrId_zhuli, pawpRgstr.getProvince());
- //创建附件1-附件6
- if (JinChaEnum.TACPAWPPDBST.getKey().equals(type) || StringUtils.isBlank(type)) {
- TacPawpPdbstParam pawpPdbstParam = new TacPawpPdbstParam();
- pawpPdbstParam.setRgstrId(regstrId);
- TacPawpPdbst tacPawpPdbst = tacPawpPdbstDao.getBy(pawpPdbstParam);
- //附件1
- if (tacPawpPdbst != null) {
- tacPawpPdbst.setId(UuidUtil.uuid());
- tacPawpPdbst.setPersId(persId);
- tacPawpPdbst.setRgstrId(regstrId_zhuli);
- tacPawpPdbstDao.insert(tacPawpPdbst);
- }
- pawpRgstr.setPdbstStat(state);//StateEnum.SUBMIT_ZHUANJIA.getKey()
- }
- //附件2
- if (JinChaEnum.TacPawpBstocmTsopbfp.getKey().equals(type) || StringUtils.isBlank(type)) {
- addBstocm(regstrId, regstrId_zhuli, persId);
- pawpRgstr.setBstocmTsopbfpStat(state);
- }
- //附件3
- if (JinChaEnum.TacPawpRaiobis.getKey().equals(type) || StringUtils.isBlank(type)) {
- addRaiobis(regstrId, regstrId_zhuli, persId);
- pawpRgstr.setRaiobisStat(state);
- }
- //附件4
- if (JinChaEnum.TacPawpBstocmCms.getKey().equals(type) || StringUtils.isBlank(type)) {
- addBiofuam(regstrId, regstrId_zhuli, persId);
- pawpRgstr.setBstocmCmsStat(state);
- }
- //附件5
- if (JinChaEnum.TacPawpBitopqPeqaa.getKey().equals(type) || StringUtils.isBlank(type)) {
- addBitopq(regstrId, regstrId_zhuli, persId);
- pawpRgstr.setBitopqPeqaaStat(state);
- }
- //附件6
- if (JinChaEnum.TacPawpBioesRwunit.getKey().equals(type) || StringUtils.isBlank(type)) {
- addBioes(regstrId, regstrId_zhuli, persId);
- pawpRgstr.setBioesRwunitStat(state);
- }
- if (state.equals(pawpRgstr.getPdbstStat()) && state.equals(pawpRgstr.getBstocmTsopbfpStat()) && state.equals(pawpRgstr.getRaiobisStat()) && state.equals(pawpRgstr.getBstocmCmsStat()) && state.equals(pawpRgstr.getBitopqPeqaaStat()) && state.equals(pawpRgstr.getBioesRwunitStat())) {
- pawpRgstr.setState(state);
- }
- return pawpRgstr;
- }
- public void delete(String regstrId_zhuli, String type, String province) {
- TacPblmInfoParam pblmInfoParam = new TacPblmInfoParam();
- pblmInfoParam.setRgstrId(regstrId_zhuli);
- pblmInfoParam.setListType(type);
- pblmInfoParam.setProvince(province);
- List<TacPblmInfo> pblmInfoList = tacPblmInfoDao.findList(pblmInfoParam);
- if (pblmInfoList != null && !pblmInfoList.isEmpty()) {
- for (TacPblmInfo pblmInfo : pblmInfoList) {
- GwComFileParam fileParam = new GwComFileParam();
- fileParam.setBizId(pblmInfo.getId());
- gwComFileService.deleteBy(fileParam);
- }
- tacPblmInfoDao.deleteBy(pblmInfoParam);
- }
- }
- @Override
- public TacPawpRgstr rollbackControl(String regstrId_zhuli, String persId, String type, TacPawpRgstr pawpRgstr, String state) {
- //删除问题,附件
- delete(regstrId_zhuli, type, pawpRgstr.getProvince());
- //删除附件1-6
- //删除附件1
- if (JinChaEnum.TACPAWPPDBST.getKey().equals(type)) {
- TacPawpPdbstParam pawpPdbstParam = new TacPawpPdbstParam();
- pawpPdbstParam.setRgstrId(regstrId_zhuli);
- // pawpPdbstParam.setPersId(persId);
- tacPawpPdbstDao.deleteBy(pawpPdbstParam);
- pawpRgstr.setPdbstStat(state);
- }
- deleteUnitSctn(regstrId_zhuli);
- //附件2
- if (JinChaEnum.TacPawpBstocmTsopbfp.getKey().equals(type)) {
- TacPawpBstocmPlprsParam pawpBstocmPlprsParam = new TacPawpBstocmPlprsParam();
- pawpBstocmPlprsParam.setRgstrId(regstrId_zhuli);
- // pawpBstocmPlprsParam.setPersId(persId);
- tacPawpBstocmPlprsDao.deleteBy(pawpBstocmPlprsParam);
- TacPawpBstocmTsopbfpParam bstocmTsopbfpParam = new TacPawpBstocmTsopbfpParam();
- bstocmTsopbfpParam.setRgstrId(regstrId_zhuli);
- // bstocmTsopbfpParam.setPersId(persId);
- List<TacPawpBstocmTsopbfp> bstocmTsopbfpList = tacPawpBstocmTsopbfpDao.findList(bstocmTsopbfpParam);
- if (bstocmTsopbfpList != null && !bstocmTsopbfpList.isEmpty()) {
- tacPawpBstocmTsopbfpDao.deleteBy(bstocmTsopbfpParam);
- for (TacPawpBstocmTsopbfp bstocmTsopbfp : bstocmTsopbfpList) {
- TacPawpBstocmTsopbfpSctnParam bstocmTsopbfpSctnParam = new TacPawpBstocmTsopbfpSctnParam();
- bstocmTsopbfpSctnParam.setTsopbfpId(bstocmTsopbfp.getId());
- // bstocmTsopbfpSctnParam.setPersId(persId);
- tacPawpBstocmTsopbfpSctnDao.deleteBy(bstocmTsopbfpSctnParam);
- }
- }
- TacPawpBstocmCpssInfoParam bstocmCpssInfoParam = new TacPawpBstocmCpssInfoParam();
- bstocmCpssInfoParam.setRgstrId(regstrId_zhuli);
- // bstocmCpssInfoParam.setPersId(persId);
- List<TacPawpBstocmCpssInfo> bstocmCpssInfoList = pawpBstocmCpssInfoDao.findList(bstocmCpssInfoParam);
- if (bstocmCpssInfoList != null && !bstocmCpssInfoList.isEmpty()) {
- for (TacPawpBstocmCpssInfo bstocmCpssInfo : bstocmCpssInfoList) {
- TacPawpBstocmCpssParam pawpBstocmCpssParam = new TacPawpBstocmCpssParam();
- pawpBstocmCpssParam.setCpssId(bstocmCpssInfo.getId());
- // pawpBstocmCpssParam.setPersId(persId);
- pawpBstocmCpssDao.deleteBy(pawpBstocmCpssParam);
- }
- pawpBstocmCpssInfoDao.deleteBy(bstocmCpssInfoParam);
- }
- TacPawpBstocmCmsParam pawpBstocmCmsParam = new TacPawpBstocmCmsParam();
- pawpBstocmCmsParam.setRgstrId(regstrId_zhuli);
- // pawpBstocmCmsParam.setPersId(persId);
- List<TacPawpBstocmCms> pawpBstocmCmsList = pawpBstocmCmsDao.findList(pawpBstocmCmsParam);
- if (pawpBstocmCmsList != null && !pawpBstocmCmsList.isEmpty()) {
- for (TacPawpBstocmCms pawpBstocmCms : pawpBstocmCmsList) {
- TacPawpBstocmCmsPactListParam bstocmCmsPactListParam = new TacPawpBstocmCmsPactListParam();
- bstocmCmsPactListParam.setCmsId(pawpBstocmCms.getId());
- // bstocmCmsPactListParam.setPersId(persId);
- pawpBstocmCmsPactListDao.deleteBy(bstocmCmsPactListParam);
- pawpBstocmCmsDao.deleteBy(pawpBstocmCmsParam);
- }
- }
- pawpRgstr.setBstocmTsopbfpStat(state);
- }
- //附件3
- if (JinChaEnum.TacPawpRaiobis.getKey().equals(type)) {
- TacPawpRaiobisParam pawpRaiobisParam = new TacPawpRaiobisParam();
- pawpRaiobisParam.setRgstrId(regstrId_zhuli);
- // pawpRaiobisParam.setPersId(persId);
- tacPawpRaiobisDao.deleteBy(pawpRaiobisParam);
- pawpRgstr.setRaiobisStat(state);
- }
- //附件4
- if (JinChaEnum.TacPawpBstocmCms.getKey().equals(type)) {
- TacPawpBiofuamParam pawpBiofuamParam = new TacPawpBiofuamParam();
- pawpBiofuamParam.setRgstrId(regstrId_zhuli);
- // pawpBiofuamParam.setPersId(persId);
- tacPawpBiofuamDao.deleteBy(pawpBiofuamParam);
- pawpRgstr.setBstocmCmsStat(state);
- }
- //附件5
- if (JinChaEnum.TacPawpBitopqPeqaa.getKey().equals(type)) {
- TacPawpBitopqQmsParam pawpBitopqQmsParam = new TacPawpBitopqQmsParam();
- pawpBitopqQmsParam.setRgstrId(regstrId_zhuli);
- // pawpBitopqQmsParam.setPersId(persId);
- tacPawpBitopqQmsDao.deleteBy(pawpBitopqQmsParam);
- TacPawpBitopqPeqaaParam pawpBitopqPeqaaParam = new TacPawpBitopqPeqaaParam();
- pawpBitopqPeqaaParam.setRgstrId(regstrId_zhuli);
- // pawpBitopqPeqaaParam.setPersId(persId);
- List<TacPawpBitopqPeqaa> pawpBitopqPeqaaList = tacPawpBitopqPeqaaDao.findList(pawpBitopqPeqaaParam);
- if (pawpBitopqPeqaaList != null && !pawpBitopqPeqaaList.isEmpty()) {
- tacPawpBitopqPeqaaDao.deleteBy(pawpBitopqPeqaaParam);
- for (TacPawpBitopqPeqaa pawpBitopqPeqaa : pawpBitopqPeqaaList) {
- TacPawpBitopqPeqaaUnitParam bitopqPeqaaUnitParam = new TacPawpBitopqPeqaaUnitParam();
- bitopqPeqaaUnitParam.setPeqaaId(pawpBitopqPeqaa.getId());
- tacPawpBitopqPeqaaUnitDao.deleteBy(bitopqPeqaaUnitParam);
- }
- }
- pawpRgstr.setBitopqPeqaaStat(state);
- }
- //附件6
- if (JinChaEnum.TacPawpBioesRwunit.getKey().equals(type)) {
- TacPawpBioesPeParam pawpBioesPeParam = new TacPawpBioesPeParam();
- pawpBioesPeParam.setRgstrId(regstrId_zhuli);
- // pawpBioesPeParam.setPersId(persId);
- tacPawpBioesPeDao.deleteBy(pawpBioesPeParam);
- TacPawpBioesRwunitParam pawpBioesRwunitParam = new TacPawpBioesRwunitParam();
- pawpBioesRwunitParam.setRgstrId(regstrId_zhuli);
- // pawpBioesRwunitParam.setPersId(persId);
- tacPawpBioesRwunitDao.deleteBy(pawpBioesRwunitParam);
- pawpRgstr.setBioesRwunitStat(state);
- }
- //删除底稿
- TacWordBaseParam wordBaseParam = new TacWordBaseParam();
- wordBaseParam.setType("10" + type);
- wordBaseParam.setBizId(regstrId_zhuli);
- List<TacWordBase> wordBaseList = tacWordBaseDao.findList(wordBaseParam);
- if (wordBaseList != null && !wordBaseList.isEmpty()) {
- tacWordBaseDao.deleteBy(wordBaseParam);
- }
- pawpRgstr.setState(state);
- return pawpRgstr;
- }
- @Override
- public String findZhuli(String regstrId) {
- return tacPawpRgstrDao.findZhuli(regstrId);
- }
- @Autowired
- private TacPawpBstocmTsopbfpDao tacPawpBstocmTsopbfpDao;
- @Autowired
- private TacPawpBstocmTsopbfpSctnDao tacPawpBstocmTsopbfpSctnDao;
- @Autowired
- private TacPawpBstocmCpssInfoDao pawpBstocmCpssInfoDao;
- @Autowired
- private TacPawpBstocmCpssDao pawpBstocmCpssDao;
- @Autowired
- private TacPawpBstocmCmsDao pawpBstocmCmsDao;
- @Autowired
- private TacPawpBstocmCmsPactListDao pawpBstocmCmsPactListDao;
- //添加附件2
- private void addBstocm(String regstrId, String newRegstrId, String persId) {
- TacPawpBstocmPlprsParam pawpBstocmPlprsParam = new TacPawpBstocmPlprsParam();
- pawpBstocmPlprsParam.setRgstrId(regstrId);
- List<TacPawpBstocmPlprs> pawpBstocmPlprsList = tacPawpBstocmPlprsDao.findList(pawpBstocmPlprsParam);
- if (pawpBstocmPlprsList != null && !pawpBstocmPlprsList.isEmpty()) {
- for (TacPawpBstocmPlprs pawpBstocmPlprs : pawpBstocmPlprsList) {
- pawpBstocmPlprs.setId(UuidUtil.uuid());
- pawpBstocmPlprs.setPersId(persId);
- pawpBstocmPlprs.setUptm(new Date());
- pawpBstocmPlprs.setRgstrId(newRegstrId);
- tacPawpBstocmPlprsDao.insert(pawpBstocmPlprs);
- }
- }
- TacPawpBstocmTsopbfpParam bstocmTsopbfpParam = new TacPawpBstocmTsopbfpParam();
- bstocmTsopbfpParam.setRgstrId(regstrId);
- List<TacPawpBstocmTsopbfp> bstocmTsopbfpList = tacPawpBstocmTsopbfpDao.findList(bstocmTsopbfpParam);
- if (bstocmTsopbfpList != null && !bstocmTsopbfpList.isEmpty()) {
- for (TacPawpBstocmTsopbfp bstocmTsopbfp : bstocmTsopbfpList) {
- bstocmTsopbfp.setRgstrId(newRegstrId);
- bstocmTsopbfp.setPersId(persId);
- String pbftId = UuidUtil.uuid();
- String oldId = bstocmTsopbfp.getId();
- bstocmTsopbfp.setUptm(new Date());
- bstocmTsopbfp.setId(pbftId);
- tacPawpBstocmTsopbfpDao.insert(bstocmTsopbfp);
- TacPawpBstocmTsopbfpSctnParam bstocmTsopbfpSctnParam = new TacPawpBstocmTsopbfpSctnParam();
- bstocmTsopbfpSctnParam.setTsopbfpId(oldId);
- List<TacPawpBstocmTsopbfpSctn> bstocmTsopbfpSctnList = tacPawpBstocmTsopbfpSctnDao.findList(bstocmTsopbfpSctnParam);
- if (bstocmTsopbfpSctnList != null && !bstocmTsopbfpSctnList.isEmpty()) {
- for (TacPawpBstocmTsopbfpSctn bstocmTsopbfpSctn : bstocmTsopbfpSctnList) {
- bstocmTsopbfpSctn.setId(UuidUtil.uuid());
- bstocmTsopbfpSctn.setPersId(persId);
- bstocmTsopbfpSctn.setUptm(new Date());
- bstocmTsopbfpSctn.setTsopbfpId(pbftId);
- tacPawpBstocmTsopbfpSctnDao.insert(bstocmTsopbfpSctn);
- }
- }
- }
- }
- TacPawpBstocmCpssInfoParam bstocmCpssInfoParam = new TacPawpBstocmCpssInfoParam();
- bstocmCpssInfoParam.setRgstrId(regstrId);
- TacPawpBstocmCpssInfo bstocmCpssInfo = pawpBstocmCpssInfoDao.getBy(bstocmCpssInfoParam);
- if (bstocmCpssInfo != null) {
- bstocmCpssInfo.setPersId(persId);
- String oId = bstocmCpssInfo.getId();
- bstocmCpssInfo.setRgstrId(newRegstrId);
- String cpssInfoId = UuidUtil.uuid();
- bstocmCpssInfo.setUptm(new Date());
- bstocmCpssInfo.setId(cpssInfoId);
- pawpBstocmCpssInfoDao.insert(bstocmCpssInfo);
- TacPawpBstocmCpssParam pawpBstocmCpssParam = new TacPawpBstocmCpssParam();
- pawpBstocmCpssParam.setCpssId(oId);
- List<TacPawpBstocmCpss> bstocmCpssList = pawpBstocmCpssDao.findList(pawpBstocmCpssParam);
- if (bstocmCpssList != null && !bstocmCpssList.isEmpty()) {
- for (TacPawpBstocmCpss bstocmCpss : bstocmCpssList) {
- bstocmCpss.setCpssId(cpssInfoId);
- bstocmCpss.setId(UuidUtil.uuid());
- bstocmCpss.setUptm(new Date());
- bstocmCpss.setPersId(persId);
- pawpBstocmCpssDao.insert(bstocmCpss);
- }
- }
- }
- TacPawpBstocmCmsParam pawpBstocmCmsParam = new TacPawpBstocmCmsParam();
- pawpBstocmCmsParam.setRgstrId(regstrId);
- List<TacPawpBstocmCms> pawpBstocmCmsList = pawpBstocmCmsDao.findList(pawpBstocmCmsParam);
- if (pawpBstocmCmsList != null && !pawpBstocmCmsList.isEmpty()) {
- for (TacPawpBstocmCms pawpBstocmCms : pawpBstocmCmsList) {
- String cmsId = pawpBstocmCms.getId();
- pawpBstocmCms.setRgstrId(newRegstrId);
- pawpBstocmCms.setPersId(persId);
- String bstocmCmsId = UuidUtil.uuid();
- pawpBstocmCms.setUptm(new Date());
- pawpBstocmCms.setId(bstocmCmsId);
- pawpBstocmCmsDao.insert(pawpBstocmCms);
- TacPawpBstocmCmsPactListParam bstocmCmsPactListParam = new TacPawpBstocmCmsPactListParam();
- bstocmCmsPactListParam.setCmsId(cmsId);
- List<TacPawpBstocmCmsPactList> bstocmCmsPactLists = pawpBstocmCmsPactListDao.findList(bstocmCmsPactListParam);
- if (bstocmCmsPactLists != null && !bstocmCmsPactLists.isEmpty()) {
- for (TacPawpBstocmCmsPactList bstocmCmsPactList : bstocmCmsPactLists) {
- bstocmCmsPactList.setCmsId(bstocmCmsId);
- bstocmCmsPactList.setPersId(persId);
- bstocmCmsPactList.setUptm(new Date());
- bstocmCmsPactList.setId(UuidUtil.uuid());
- pawpBstocmCmsPactListDao.insert(bstocmCmsPactList);
- }
- }
- }
- }
- }
- //添加附件3
- private void addRaiobis(String regstrId, String newRegstrId, String persId) {
- TacPawpRaiobisParam pawpRaiobisParam = new TacPawpRaiobisParam();
- pawpRaiobisParam.setRgstrId(regstrId);
- List<TacPawpRaiobis> pawpRaiobisList = tacPawpRaiobisDao.findList(pawpRaiobisParam);
- if (pawpRaiobisList != null && !pawpRaiobisList.isEmpty()) {
- for (TacPawpRaiobis pawpRaiobis : pawpRaiobisList) {
- pawpRaiobis.setId(UuidUtil.uuid());
- pawpRaiobis.setUptm(new Date());
- pawpRaiobis.setRgstrId(newRegstrId);
- pawpRaiobis.setPersId(persId);
- tacPawpRaiobisDao.insert(pawpRaiobis);
- }
- }
- }
- //添加附件4
- private void addBiofuam(String regstrId, String newRegstrId, String persId) {
- TacPawpBiofuamParam pawpBiofuamParam = new TacPawpBiofuamParam();
- pawpBiofuamParam.setRgstrId(regstrId);
- List<TacPawpBiofuam> tacPawpBiofuamList = tacPawpBiofuamDao.findList(pawpBiofuamParam);
- if (tacPawpBiofuamList != null && !tacPawpBiofuamList.isEmpty()) {
- for (TacPawpBiofuam tacPawpBiofuam : tacPawpBiofuamList) {
- tacPawpBiofuam.setRgstrId(newRegstrId);
- tacPawpBiofuam.setPersId(persId);
- tacPawpBiofuam.setUptm(new Date());
- tacPawpBiofuam.setId(UuidUtil.uuid());
- tacPawpBiofuamDao.insert(tacPawpBiofuam);
- }
- }
- }
- @Autowired
- private TacPawpBitopqPeqaaUnitDao tacPawpBitopqPeqaaUnitDao;
- //附件5添加
- private void addBitopq(String regstrId, String newRegstrId, String persId) {
- TacPawpBitopqQmsParam pawpBitopqQmsParam = new TacPawpBitopqQmsParam();
- pawpBitopqQmsParam.setRgstrId(regstrId);
- List<TacPawpBitopqQms> pawpBitopqQmsDaoList = tacPawpBitopqQmsDao.findList(pawpBitopqQmsParam);
- if (pawpBitopqQmsDaoList != null && !pawpBitopqQmsDaoList.isEmpty()) {
- for (TacPawpBitopqQms pawpBitopqQms : pawpBitopqQmsDaoList) {
- pawpBitopqQms.setId(UuidUtil.uuid());
- pawpBitopqQms.setUptm(new Date());
- pawpBitopqQms.setRgstrId(newRegstrId);
- pawpBitopqQms.setPersId(persId);
- tacPawpBitopqQmsDao.insert(pawpBitopqQms);
- }
- }
- TacPawpBitopqPeqaaParam pawpBitopqPeqaaParam = new TacPawpBitopqPeqaaParam();
- pawpBitopqPeqaaParam.setRgstrId(regstrId);
- List<TacPawpBitopqPeqaa> pawpBitopqPeqaaList = tacPawpBitopqPeqaaDao.findList(pawpBitopqPeqaaParam);
- if (pawpBitopqPeqaaList != null && !pawpBitopqPeqaaList.isEmpty()) {
- for (TacPawpBitopqPeqaa pawpBitopqPeqaa : pawpBitopqPeqaaList) {
- String peqaaId = pawpBitopqPeqaa.getId();
- pawpBitopqPeqaa.setRgstrId(newRegstrId);
- String newPeqaaId = UuidUtil.uuid();
- pawpBitopqPeqaa.setId(newPeqaaId);
- pawpBitopqPeqaa.setUptm(new Date());
- pawpBitopqPeqaa.setPersId(persId);
- tacPawpBitopqPeqaaDao.insert(pawpBitopqPeqaa);
- TacPawpBitopqPeqaaUnitParam bitopqPeqaaUnitParam = new TacPawpBitopqPeqaaUnitParam();
- bitopqPeqaaUnitParam.setPeqaaId(peqaaId);
- List<TacPawpBitopqPeqaaUnit> bitopqPeqaaUnitList = tacPawpBitopqPeqaaUnitDao.findList(bitopqPeqaaUnitParam);
- if (bitopqPeqaaUnitList != null && !bitopqPeqaaUnitList.isEmpty()) {
- for (TacPawpBitopqPeqaaUnit bitopqPeqaaUnit : bitopqPeqaaUnitList) {
- bitopqPeqaaUnit.setPeqaaId(newPeqaaId);
- bitopqPeqaaUnit.setPersId(persId);
- bitopqPeqaaUnit.setUptm(new Date());
- bitopqPeqaaUnit.setId(UuidUtil.uuid());
- tacPawpBitopqPeqaaUnitDao.insert(bitopqPeqaaUnit);
- }
- }
- }
- }
- }
- //附件6添加
- private void addBioes(String regstrId, String newRegstrId, String persId) {
- TacPawpBioesPeParam pawpBioesPeParam = new TacPawpBioesPeParam();
- pawpBioesPeParam.setRgstrId(regstrId);
- List<TacPawpBioesPe> pawpBioesPeList = tacPawpBioesPeDao.findList(pawpBioesPeParam);
- if (pawpBioesPeList != null && !pawpBioesPeList.isEmpty()) {
- for (TacPawpBioesPe pawpBioesPe : pawpBioesPeList) {
- pawpBioesPe.setId(UuidUtil.uuid());
- pawpBioesPe.setRgstrId(newRegstrId);
- pawpBioesPe.setUptm(new Date());
- pawpBioesPe.setPersId(persId);
- tacPawpBioesPeDao.insert(pawpBioesPe);
- }
- }
- TacPawpBioesRwunitParam pawpBioesRwunitParam = new TacPawpBioesRwunitParam();
- pawpBioesRwunitParam.setRgstrId(regstrId);
- List<TacPawpBioesRwunit> pawpBioesRwunitList = tacPawpBioesRwunitDao.findList(pawpBioesRwunitParam);
- if (pawpBioesRwunitList != null && !pawpBioesRwunitList.isEmpty()) {
- for (TacPawpBioesRwunit bioesRwunit : pawpBioesRwunitList) {
- bioesRwunit.setPersId(persId);
- bioesRwunit.setRgstrId(newRegstrId);
- bioesRwunit.setUptm(new Date());
- bioesRwunit.setId(UuidUtil.uuid());
- tacPawpBioesRwunitDao.insert(bioesRwunit);
- }
- }
- }
- //添加资料目录
- private void addPawDrm(String listId, String newListId, String persId) {
- TacPawpDrmParam tacPawpDrmParam = new TacPawpDrmParam();
- tacPawpDrmParam.setListId(listId);
- List<TacPawpDrm> pawpDrmList = tacPawpDrmDao.findList(tacPawpDrmParam);
- if (pawpDrmList != null && !pawpDrmList.isEmpty()) {
- for (TacPawpDrm pawpDrm : pawpDrmList) {
- pawpDrm.setId(UuidUtil.uuid());
- pawpDrm.setListId(newListId);
- pawpDrm.setPersId(persId);
- pawpDrm.setUptm(new Date());
- tacPawpDrmDao.insert(pawpDrm);
- }
- }
- }
- @Autowired
- private GwComFileService gwComFileService;
- private void deleteUnitSctn(String newRegstrId) {
- TacPawpUnitSctnParam tacPawpUnitSctnParam = new TacPawpUnitSctnParam();
- tacPawpUnitSctnParam.setRgstrId(newRegstrId);
- tacPawpUnitSctnDao.deleteBy(tacPawpUnitSctnParam);
- }
- @Override
- public void addUnitSctn(String regstrId, String newRegstrId) {
- TacPawpUnitSctnParam tacPawpUnitSctnParam = new TacPawpUnitSctnParam();
- tacPawpUnitSctnParam.setRgstrId(newRegstrId);
- List<TacPawpUnitSctn> unitSctnList = tacPawpUnitSctnDao.findList(tacPawpUnitSctnParam);
- if (unitSctnList != null && !unitSctnList.isEmpty()) {
- return;
- }
- tacPawpUnitSctnParam.setRgstrId(regstrId);
- unitSctnList = tacPawpUnitSctnDao.findList(tacPawpUnitSctnParam);
- if (unitSctnList != null && !unitSctnList.isEmpty()) {
- for (TacPawpUnitSctn unitSctn : unitSctnList) {
- String newId = UuidUtil.uuid();
- unitSctn.setId(newId);
- unitSctn.setRgstrId(newRegstrId);
- unitSctn.setIntm(new Date());
- unitSctn.setUptm(new Date());
- tacPawpUnitSctnDao.insert(unitSctn);
- }
- }
- }
- //添加问题
- private void addParam(String regstrId, String type, String listId, String newRegstrId, String province) {
- TacPblmInfoParam pblmInfoParam = new TacPblmInfoParam();
- pblmInfoParam.setRgstrId(newRegstrId);
- pblmInfoParam.setListType(type);
- pblmInfoParam.setProvince(province);
- synchronized (this) {
- List<TacPblmInfo> pblmInfoList = tacPblmInfoDao.findPblmList(pblmInfoParam);
- if (pblmInfoList != null && !pblmInfoList.isEmpty()) {
- return;
- }
- pblmInfoParam.setRgstrId(regstrId);
- pblmInfoList = tacPblmInfoDao.findPblmList(pblmInfoParam);
- if (pblmInfoList != null && !pblmInfoList.isEmpty()) {
- for (TacPblmInfo pblmInfo : pblmInfoList) {
- String pblmId = pblmInfo.getId();
- String newPblmId = UuidUtil.uuid();
- pblmInfo.setId(newPblmId);
- pblmInfo.setRgstrId(newRegstrId);
- pblmInfo.setListId(listId);
- pblmInfo.setUptm(new Date());
- tacPblmInfoDao.insert(pblmInfo);
- //添加附件
- List<GwComFile> comFileList = gwComFileService.findFileByBiz(pblmId);
- for (GwComFile comFile : comFileList) {
- comFile.setId(UuidUtil.uuid());
- comFile.setBizId(newPblmId);
- gwComFileService.insert(comFile);
- }
- //复制稽察问题相关责任主体列表
- TacPblmSubjectParam subjectParam = new TacPblmSubjectParam();
- subjectParam.setPblmId(pblmId);
- List<TacPblmSubject> subjectList = tacPblmSubjectDao.findList(subjectParam);
- if (subjectList != null && !subjectList.isEmpty()) {
- for (TacPblmSubject subJect : subjectList) {
- String newId = UuidUtil.uuid();
- subJect.setId(newId);
- subJect.setPblmId(newPblmId);
- tacPblmSubjectDao.insert(subJect);
- }
- }
- }
- }
- }
- }
- @Override
- public int insert(TacPawpRgstr tacPawpRgstr) {
- int ret = 0;
- if (tacPawpRgstr.getCenterX() != null && tacPawpRgstr.getGdX() == null) {
- Map<String, Double> map = GeoUtil.wgs84togcj02(tacPawpRgstr.getCenterX(), tacPawpRgstr.getCenterY());
- tacPawpRgstr.setGdX(map.get("lon"));
- tacPawpRgstr.setGdY(map.get("lat"));
- } else if (tacPawpRgstr.getCenterX() == null && tacPawpRgstr.getGdX() != null) {
- Map<String, Double> map = GeoUtil.gcj02towgs84(tacPawpRgstr.getGdX(), tacPawpRgstr.getGdY());
- tacPawpRgstr.setCenterX(map.get("lon"));
- tacPawpRgstr.setCenterY(map.get("lat"));
- }
- ret = tacPawpRgstrDao.insert(tacPawpRgstr);
- return ret;
- }
- @Override
- public int update(TacPawpRgstr tacPawpRgstr) {
- int ret = 0;
- if (tacPawpRgstr.getCenterX() != null && tacPawpRgstr.getGdX() == null) {
- Map<String, Double> map = GeoUtil.wgs84togcj02(tacPawpRgstr.getCenterX(), tacPawpRgstr.getCenterY());
- tacPawpRgstr.setGdX(map.get("lon"));
- tacPawpRgstr.setGdY(map.get("lat"));
- } else if (tacPawpRgstr.getCenterX() == null && tacPawpRgstr.getGdX() != null) {
- Map<String, Double> map = GeoUtil.gcj02towgs84(tacPawpRgstr.getGdX(), tacPawpRgstr.getGdY());
- tacPawpRgstr.setCenterX(map.get("lon"));
- tacPawpRgstr.setCenterY(map.get("lat"));
- }
- ret = tacPawpRgstrDao.update(tacPawpRgstr);
- return ret;
- }
- @Autowired
- private RedisTemplate redisTemplate;
- @Override
- public boolean suoding(String key) {
- Object input = redisTemplate.opsForValue().get(key);
- if (input != null) {
- return false;
- }
- redisTemplate.opsForValue().set(key, "1", 20, TimeUnit.SECONDS);
- return true;
- }
- @Override
- public void updateSubmit(TacPawpRgstr pawpRgstr, String type, String state) {
- if (JinChaEnum.TACPAWPPDBST.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setPdbstStat(state);//StateEnum.SUBMIT_ZHUANJIA.getKey()
- }
- //附件2
- if (JinChaEnum.TacPawpBstocmTsopbfp.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setBstocmTsopbfpStat(state);
- }
- //附件3
- if (JinChaEnum.TacPawpRaiobis.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setRaiobisStat(state);
- }
- //附件4
- if (JinChaEnum.TacPawpBstocmCms.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setBstocmCmsStat(state);
- }
- //附件5
- if (JinChaEnum.TacPawpBitopqPeqaa.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setBitopqPeqaaStat(state);
- }
- //附件6
- if (JinChaEnum.TacPawpBioesRwunit.getKey().equals(type) || StringUtils.isBlank(type)) {
- pawpRgstr.setBioesRwunitStat(state);
- }
- if (state.equals(pawpRgstr.getPdbstStat()) && state.equals(pawpRgstr.getBstocmTsopbfpStat()) && state.equals(pawpRgstr.getRaiobisStat()) && state.equals(pawpRgstr.getBstocmCmsStat()) && state.equals(pawpRgstr.getBitopqPeqaaStat()) && state.equals(pawpRgstr.getBioesRwunitStat())) {
- pawpRgstr.setState(state);
- }
- }
- @Override
- public Map<String, String> getState(String regstrId, String type) {
- TacPawpRgstr tacPawpRgstr = tacPawpRgstrDao.get(regstrId);
- //匹配新阶段 0-4为稽察项目问题的初始阶段,省份对应阶段下存在工程项目阶段记录值则
- Map<String, String> retMap = new HashMap<>();
- if (StringUtils.isNotBlank(tacPawpRgstr.getState())) {
- int stateType = Integer.parseInt(tacPawpRgstr.getState());
- if (stateType > 3) {
- retMap.put("state", stateType + "");
- if (StringUtils.isNotBlank(tacPawpRgstr.getTaskId())) {
- TacProvincePlanTask tacProvincePlanTask = tacProvincePlanTaskDao.get(tacPawpRgstr.getTaskId());
- retMap.put("stateName", tacProvincePlanTask.getNowStep());
- } else {
- retMap.put("stateName", getStateName(stateType));
- }
- return retMap;
- }
- }
- String state = InspUtils.getTypeState(type, tacPawpRgstr);
- if (StringUtils.isNotBlank(tacPawpRgstr.getTaskId()) && !tacPawpRgstr.getTaskId().equals("0")) {
- TacProvincePlanTask tacProvincePlanTask = tacProvincePlanTaskDao.get(tacPawpRgstr.getTaskId());
- if(null != tacProvincePlanTask){
- retMap.put("stateName", tacProvincePlanTask.getNowStep());
- }
- } else {
- if (StringUtils.isNotBlank(state)) {
- retMap.put("stateName", getStateName(Integer.parseInt(state)));
- } else {
- retMap.put("stateName", "");
- }
- }
- retMap.put("state", state);
- return retMap;
- }
- private String getStateName(int stateType) {
- String stateName;
- switch (stateType) {
- case 3:
- stateName = "(助理退回给专家)";
- break;
- case 4:
- stateName = "(专家提交到助理)";
- break;
- case 5:
- stateName = "(成果讨论阶段)";
- break;
- case 6:
- stateName = "(中心修改阶段)";
- break;
- case 7:
- stateName = "(司局修改阶段)";
- break;
- default:
- stateName = "";
- break;
- }
- return stateName;
- }
- }
|