| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521 |
- package cn.com.goldenwater.dcproj.service.impl.offline;
- import cn.com.goldenwater.dcproj.dao.*;
- import cn.com.goldenwater.dcproj.model.*;
- import cn.com.goldenwater.dcproj.param.*;
- import cn.com.goldenwater.dcproj.service.GwComFileService;
- import cn.com.goldenwater.dcproj.service.SupervisionPlanService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.fasterxml.jackson.databind.DeserializationFeature;
- import com.fasterxml.jackson.databind.ObjectMapper;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.io.IOException;
- import java.util.Date;
- import java.util.List;
- /**
- * 小水库处理业务逻辑
- *
- * @author lhc
- * @date 2019/11/18 17:00
- */
- @Service
- @Transactional
- public class BisInspOffLineRsvrProcess extends BisInspOffLineProcess {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- AttRsBaseDao attRsBaseDao;//水库基本信息
- @Autowired
- BisInspRsvrRgstrDao bisInspRsvrRgstrDao;//水库登记信息
- @Autowired
- BisInspBasePresExtDao bisInspBasePresExtDao;//“三个责任人”落实情况
- @Autowired
- BisInspPresSafeDao bisInspPresSafeDao;//“三个责任人”落实情况
- @Autowired
- BisInspBaseExtDao bisInspBaseExtDao;//“三项基本要求”落实情况
- @Autowired
- BisInspSafeExtManageDao bisInspSafeExtManageDao;//安全运行管理情况
- @Autowired
- BisInspRsvrProjectDao bisInspRsvrProjectDao;//水库工程实体情况
- @Autowired
- BisInspRsvrBenefitsDao bisInspRsvrBenefitsDao;//水库效益发挥情况
- @Autowired
- BisInspBaseViewDao bisInspBaseViewDao;//走访情况
- @Autowired
- BisInspPreListDao bisInspPreListDao;//走访人员
- @Autowired
- BisInspAllObjDao bisInspAllObjDao;//督查任务
- @Autowired
- BisInspPblmDao bisInspPblmDao;//督查问题
- @Autowired
- SupervisionPlanService supervisionPlanService;
- @Autowired
- private GwComFileService gwComFileService;//文件操作
- @Value("${getFile.prefix}")
- public String prefix;
- @Override
- public BisInspOffLineRet process(BisInspOffLineObj bisInspOffLineObj, String fileDir) throws IOException {
- BisInspOffLineRet bisInspOffLineRet = new BisInspOffLineRet();
- ObjectMapper om = new ObjectMapper();
- om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- //解析小水库填报信息
- BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister = om.readValue(bisInspOffLineObj.getRegister(), BisInspOffLineRsvrRgeister.class);
- //解析小水库基本信息对象
- if (bisInspOffLineObj.getBase() != null) {
- BisInspRsvrRgstr bisInspRsvrRgstr = new BisInspRsvrRgstr();
- String objId = UuidUtil.uuid();
- String regId = objId;
- BisInspOffLineRsvr bisInspOffLineRsvr = bisInspOffLineRsvrRgeister.getBisInspOffLineRsvr();
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- bisInspRsvrRgstr.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- regId = bisInspOffLineRsvr.getRgstrId();
- bisInspRsvrRgstr.setObjId(bisInspOffLineRsvr.getObjId());
- objId = bisInspOffLineRsvr.getObjId();
- bisInspRsvrRgstr.setState("1");
- } else {
- //添加到督查任务
- String goupId = bisInspOffLineObj.getGroupId();
- AttRsBase attRsBase = om.readValue(bisInspOffLineObj.getBase(), AttRsBase.class);
- insertBisInspAllObj(bisInspOffLineObj, attRsBase, objId, goupId);
- bisInspRsvrRgstr.setRgstrId(regId);
- bisInspRsvrRgstr.setObjId(objId);
- //插入登记表信息
- insertBisInspRsvrRgstr(attRsBase, bisInspRsvrRgstr, om);
- }
- //插入三个责任人信息
- insertBisInspBasePresExt(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //水库安全管理三级责任人
- insertBisInspPresSafe(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //三个重点环节
- insertBisInspBaseExt(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //运行管理情况
- inserBisInspSafeExtManage(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //工程实体
- insertBisInspRsvrProject(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //插入水库收益情况
- insertBisInspRsvrBenefits(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- //插入走访情况
- insertBisInspBaseView(bisInspOffLineRsvrRgeister, bisInspRsvrRgstr, bisInspOffLineRsvr);
- bisInspRsvrRgstrDao.update(bisInspRsvrRgstr);//更新各个填报项目状态
- bisInspOffLineRet.setRegId(regId);
- bisInspOffLineRet.setObjId(objId);
- }
- return bisInspOffLineRet;
- }
- /**
- * 插入小水库督查任务信息
- *
- * @param attRsBase 对象基本信息
- * @param objId 督查对象ID
- * @param groupId 督查组ID
- */
- public void insertBisInspAllObj(BisInspOffLineObj bisInspOffLineObj, AttRsBase attRsBase, String objId, String groupId) {
- BisInspAllObj bisInspAllObj = new BisInspAllObj();
- bisInspAllObj.setId(groupId);
- bisInspAllObj.setObjId(objId);
- bisInspAllObj.setNm(attRsBase.getRsName());
- bisInspAllObj.setCode(attRsBase.getRsCode());
- bisInspAllObj.setPtype("1");
- bisInspAllObj.setOrgId(bisInspOffLineObj.getOrgId());
- bisInspAllObj.setAdCode(bisInspOffLineObj.getProvince());
- bisInspAllObj.setLttd(StringUtils.isNotBlank(attRsBase.getCenterX()) ? Double.parseDouble(attRsBase.getCenterX()) : 0);
- bisInspAllObj.setLttd(StringUtils.isNotBlank(attRsBase.getCenterY()) ? Double.parseDouble(attRsBase.getCenterY()) : 0);
- bisInspAllObj.setLgtd(StringUtils.isNotBlank(attRsBase.getCenterX()) ? Double.parseDouble(attRsBase.getCenterX()) : 0);
- bisInspAllObj.setLttd(StringUtils.isNotBlank(attRsBase.getCenterX()) ? Double.parseDouble(attRsBase.getCenterX()) : 0);
- bisInspAllObjDao.insert(bisInspAllObj);
- }
- /**
- * 插入小水库登记信息
- *
- * @param attRsBase 对象基本信息
- * @param bisInspRsvrRgstr 注册信息
- * @param om 转换对象
- * @throws IOException
- */
- public void insertBisInspRsvrRgstr(AttRsBase attRsBase, BisInspRsvrRgstr bisInspRsvrRgstr, ObjectMapper om) {
- bisInspRsvrRgstr.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspRsvrRgstr.setObjId(bisInspRsvrRgstr.getObjId());
- bisInspRsvrRgstr.setRsCode(attRsBase.getRsCode());
- bisInspRsvrRgstr.setRsvrNm(attRsBase.getRsName());
- bisInspRsvrRgstr.setAdCode(attRsBase.getAdmDiv());
- bisInspRsvrRgstr.setCompDateStr(attRsBase.getCompDateStr());
- bisInspRsvrRgstr.setHystSite(attRsBase.getLocation());
- bisInspRsvrRgstr.setTotCap(attRsBase.getTotCap());
- bisInspRsvrRgstr.setCompDateStr(attRsBase.getCompDateStr());
- bisInspRsvrRgstr.setLocation(attRsBase.getLocation());
- bisInspRsvrRgstr.setIntm(new Date());
- bisInspRsvrRgstr.setUptm(new Date());
- bisInspRsvrRgstr.setState("1");
- bisInspRsvrRgstr.setDamRegCode(attRsBase.getRegCode());//大坝注册登记号*/
- bisInspRsvrRgstr.setDataStat("0");
- //添加注册登记表
- bisInspRsvrRgstrDao.insert(bisInspRsvrRgstr);
- }
- /**
- * 插入三个责任人信息
- *
- * @param bisInspOffLineRsvrRgeister 三个责任人信息
- * @param bisInspRsvrRgstr
- */
- public void insertBisInspBasePresExt(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvr.getBasePresExt() && bisInspOffLineRsvr.getBasePresExt()
- ) {
- if (null != bisInspOffLineRsvrRgeister.getBisInspBasePresExt()) {
- BisInspBasePresExt bisInspBasePresExt = bisInspOffLineRsvrRgeister.getBisInspBasePresExt();
- bisInspBasePresExt.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- BisInspBasePresExtParam bisInspBasePresExtParam = new BisInspBasePresExtParam();
- bisInspBasePresExtParam.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- List<BisInspBasePresExt> bisInspBasePresExts = bisInspBasePresExtDao.findList(bisInspBasePresExtParam);
- //找到dutyId
- if (bisInspBasePresExts != null && bisInspBasePresExts.size() > 0) {
- bisInspBasePresExt.setDutyId(bisInspBasePresExts.get(0).getDutyId());
- bisInspBasePresExtDao.update(bisInspBasePresExt);
- } else {
- bisInspBasePresExt.setDutyId(UuidUtil.uuid());
- bisInspBasePresExtDao.insert(bisInspBasePresExt);
- }
- //更新状态
- bisInspRsvrRgstr.setPresStat("2");
- }
- }
- } else {
- BisInspBasePresExt bisInspBasePresExt = null;
- if (bisInspOffLineRsvrRgeister.getBisInspBasePresExt() != null) {
- bisInspBasePresExt = bisInspOffLineRsvrRgeister.getBisInspBasePresExt();
- bisInspRsvrRgstr.setPresStat("2");
- } else {
- bisInspBasePresExt = new BisInspBasePresExt();
- bisInspRsvrRgstr.setPresStat("1");
- }
- bisInspBasePresExt.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspBasePresExt.setDutyId(UuidUtil.uuid());
- bisInspBasePresExtDao.insert(bisInspBasePresExt);
- }
- }
- /**
- * 插入水库安全管理三级责任人
- *
- * @param bisInspOffLineRsvrRgeister 水库安全管理三级责任人
- * @param bisInspRsvrRgstr
- */
- public void insertBisInspPresSafe(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvr.getPresSafe() && bisInspOffLineRsvr.getPresSafe()
- ) {
- if (null != bisInspOffLineRsvrRgeister.getBisInspPresSafe()) {
- BisInspPresSafe bisInspPresSafe = bisInspOffLineRsvrRgeister.getBisInspPresSafe();
- bisInspPresSafe.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- BisInspPresSafeParam bisInspPresSafeParam = new BisInspPresSafeParam();
- bisInspPresSafeParam.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- List<BisInspPresSafe> bisInspPresSafes = bisInspPresSafeDao.findList(bisInspPresSafeParam);
- //找到dutyId
- if (bisInspPresSafes != null && bisInspPresSafes.size() > 0) {
- bisInspPresSafe.setId(bisInspPresSafes.get(0).getId());
- bisInspPresSafeDao.update(bisInspPresSafe);
- } else {
- bisInspPresSafe.setId(UuidUtil.uuid());
- bisInspPresSafeDao.insert(bisInspPresSafe);
- }
- //更新状态
- bisInspRsvrRgstr.setSafeStat("2");
- }
- }
- } else {
- BisInspPresSafe bisInspPresSafes = null;
- if (bisInspOffLineRsvrRgeister.getBisInspPresSafe() != null) {
- bisInspPresSafes = bisInspOffLineRsvrRgeister.getBisInspPresSafe();
- bisInspRsvrRgstr.setSafeStat("2");
- } else {
- bisInspPresSafes = new BisInspPresSafe();
- bisInspRsvrRgstr.setSafeStat("1");
- }
- bisInspPresSafes.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspPresSafes.setId(UuidUtil.uuid());
- bisInspPresSafeDao.insert(bisInspPresSafes);
- }
- }
- /**
- * 三个重点环节
- *
- * @param bisInspOffLineRsvrRgeister
- * @param bisInspRsvrRgstr
- */
- public void insertBisInspBaseExt(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvr.getBaseExt() && bisInspOffLineRsvr.getBaseExt() && null != bisInspOffLineRsvrRgeister.getBisInspBaseExt()) {
- BisInspBaseExt bisInspBaseExt = bisInspOffLineRsvrRgeister.getBisInspBaseExt();
- bisInspBaseExt.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- BisInspBaseExtParam bisInspBaseExtParam = new BisInspBaseExtParam();
- bisInspBaseExtParam.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- List<BisInspBaseExt> bisInspBaseExts = bisInspBaseExtDao.findList(bisInspBaseExtParam);
- if (bisInspBaseExts != null && bisInspBaseExts.size() > 0) {
- bisInspBaseExt.setThrqId(bisInspBaseExts.get(0).getThrqId());
- bisInspBaseExtDao.update(bisInspBaseExt);
- } else {
- bisInspBaseExt.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- bisInspBaseExt.setThrqId(UuidUtil.uuid());
- bisInspBaseExtDao.insert(bisInspBaseExt);
- }
- bisInspRsvrRgstr.setBaseStat("2");
- }
- } else {
- BisInspBaseExt bisInspBaseExt = null;
- if (bisInspOffLineRsvrRgeister.getBisInspBaseExt() != null) {
- bisInspBaseExt = bisInspOffLineRsvrRgeister.getBisInspBaseExt();
- bisInspRsvrRgstr.setBaseStat("2");
- } else {
- bisInspBaseExt = new BisInspBaseExt();
- bisInspRsvrRgstr.setBaseStat("1");
- }
- bisInspBaseExt.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspBaseExt.setThrqId(UuidUtil.uuid());
- bisInspBaseExtDao.insert(bisInspBaseExt);
- }
- }
- /**
- * 运行管理情况
- *
- * @param bisInspOffLineRsvrRgeister
- * @param bisInspRsvrRgstr
- */
- public void inserBisInspSafeExtManage(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr
- bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvrRgeister.getBisInspSafeExtManage()) {
- BisInspSafeExtManage bisInspSafeExtManage = bisInspOffLineRsvrRgeister.getBisInspSafeExtManage();
- bisInspSafeExtManage.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- //找到对应的ID update
- BisInspSafeExtManageParam bisInspSafeExtManageParam = new BisInspSafeExtManageParam();
- bisInspSafeExtManageParam.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- List<BisInspSafeExtManage> bisInspSafeExtManages = bisInspSafeExtManageDao.findList(bisInspSafeExtManageParam);
- if (bisInspSafeExtManages != null && bisInspSafeExtManages.size() > 0) {
- bisInspSafeExtManage.setMngrnId(bisInspSafeExtManages.get(0).getMngrnId());
- if (null != bisInspOffLineRsvr.getSafeExtManage() && bisInspOffLineRsvr.getSafeExtManage()) {
- if (StringUtils.isNotBlank(bisInspSafeExtManage.getHasSpeManage())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIsHasMangPers())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getHasWdEmnic())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfManageRegRel())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfManageReg())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfDamWarnLogo())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIsClean())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfFsltdz())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfFsltdzNo())
- || StringUtils.isNotBlank(bisInspSafeExtManage.getIfFsltdzRun())
- ) {
- bisInspSafeExtManageDao.updateResRun(bisInspSafeExtManage);
- }
- }
- if (null != bisInspOffLineRsvr.getDam() && bisInspOffLineRsvr.getDam()) {
- if (StringUtils.isNotBlank(bisInspSafeExtManage.getSafeComment())
- ) {
- bisInspSafeExtManageDao.updateDam(bisInspSafeExtManage);
- }
- }
- } else {
- bisInspSafeExtManage.setMngrnId(UuidUtil.uuid());
- bisInspSafeExtManageDao.insert(bisInspSafeExtManage);
- }
- bisInspRsvrRgstr.setResRunStat("2");
- bisInspRsvrRgstr.setDamStat("2");
- }
- } else {
- BisInspSafeExtManage bisInspSafeExtManage = null;
- if (bisInspOffLineRsvrRgeister.getBisInspSafeExtManage() != null) {
- bisInspSafeExtManage = bisInspOffLineRsvrRgeister.getBisInspSafeExtManage();
- bisInspRsvrRgstr.setResRunStat("2");
- bisInspRsvrRgstr.setDamStat("2");
- } else {
- bisInspSafeExtManage = new BisInspSafeExtManage();
- bisInspRsvrRgstr.setResRunStat("1");
- bisInspRsvrRgstr.setDamStat("1");
- }
- bisInspSafeExtManage.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspSafeExtManage.setMngrnId(UuidUtil.uuid());
- bisInspSafeExtManageDao.insert(bisInspSafeExtManage);
- }
- }
- /**
- * 工程实体
- *
- * @param bisInspOffLineRsvrRgeister
- * @param bisInspRsvrRgstr
- */
- void insertBisInspRsvrProject(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr
- bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvrRgeister.getBisInspRsvrProject()) {
- BisInspRsvrProject bisInspRsvrProject = bisInspOffLineRsvrRgeister.getBisInspRsvrProject();
- bisInspRsvrProject.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- //找到对应的ID update
- BisInspRsvrProjectParam bisInspRsvrProjectParam = new BisInspRsvrProjectParam();
- bisInspRsvrProjectParam.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- List<BisInspRsvrProject> bisInspRsvrProjects = bisInspRsvrProjectDao.findList(bisInspRsvrProjectParam);
- if (bisInspRsvrProjects != null && bisInspRsvrProjects.size() > 0) {
- bisInspRsvrProject.setId(bisInspRsvrProjects.get(0).getId());
- if (null != bisInspOffLineRsvr.getRsvrProject() && bisInspOffLineRsvr.getRsvrProject()) {
- if (StringUtils.isNotBlank(bisInspRsvrProject.getReverOrg())
- || StringUtils.isNotBlank(bisInspRsvrProject.getReverOrgName())
- || StringUtils.isNotBlank(bisInspRsvrProject.getPoorCountry())
- || StringUtils.isNotBlank(bisInspRsvrProject.getDiskRunInfo())
- || StringUtils.isNotBlank(bisInspRsvrProject.getHasSetMainFl())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIsMainFlNormal())
- || StringUtils.isNotBlank(bisInspRsvrProject.getHasSetPourFl())
- || StringUtils.isNotBlank(bisInspRsvrProject.getPourFyIsNormal())
- ) {
- bisInspRsvrProjectDao.updateRever(bisInspRsvrProject);
- }
- }
- if (null != bisInspOffLineRsvr.getRein() && bisInspOffLineRsvr.getRein()) {
- if (StringUtils.isNotBlank(bisInspRsvrProject.getIfDamSafe())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfDamSafeReq())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfDamSafeRul())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfDamSafeDepRul())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfDamSafeThr())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfReinForce())
- || StringUtils.isNotBlank(bisInspRsvrProject.getReinForceRun())
- || StringUtils.isNotBlank(bisInspRsvrProject.getReinForceRun2())
- || StringUtils.isNotBlank(bisInspRsvrProject.getReinForceRun3())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfReinImpGve())
- || StringUtils.isNotBlank(bisInspRsvrProject.getIfReinImpPlan())
- ) {
- bisInspRsvrProjectDao.updateRein(bisInspRsvrProject);
- }
- }
- } else {
- bisInspRsvrProject.setId(UuidUtil.uuid());
- bisInspRsvrProjectDao.insert(bisInspRsvrProject);
- }
- bisInspRsvrRgstr.setReverStat("2");
- bisInspRsvrRgstr.setReinStat("2");
- }
- } else {
- BisInspRsvrProject bisInspRsvrProject = null;
- if (bisInspOffLineRsvrRgeister.getBisInspRsvrProject() != null) {
- bisInspRsvrProject = bisInspOffLineRsvrRgeister.getBisInspRsvrProject();
- bisInspRsvrRgstr.setReverStat("2");
- bisInspRsvrRgstr.setReinStat("2");
- } else {
- bisInspRsvrProject = new BisInspRsvrProject();
- bisInspRsvrRgstr.setReverStat("1");
- bisInspRsvrRgstr.setReinStat("1");
- }
- bisInspRsvrProject.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspRsvrProject.setId(UuidUtil.uuid());
- bisInspRsvrProjectDao.insert(bisInspRsvrProject);
- }
- }
- /**
- * 插入水库收益情况
- *
- * @param bisInspOffLineRsvrRgeister
- * @param bisInspRsvrRgstr
- */
- void insertBisInspRsvrBenefits(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr
- bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (null != bisInspOffLineRsvr && StringUtils.isNotBlank(bisInspOffLineRsvr.getRgstrId())) {
- if (null != bisInspOffLineRsvr.getBenefits() && bisInspOffLineRsvr.getBenefits() && null != bisInspOffLineRsvrRgeister.getBisInspRsvrBenefits()) {
- BisInspRsvrBenefits bisInspRsvrBenefits = bisInspOffLineRsvrRgeister.getBisInspRsvrBenefits();
- bisInspRsvrBenefits.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- //找到id update
- BisInspRsvrBenefitsParam bisInspRsvrBenefitsParam = new BisInspRsvrBenefitsParam();
- bisInspRsvrBenefitsParam.setRgstrId(bisInspOffLineRsvr.getRgstrId());
- List<BisInspRsvrBenefits> bisInspRsvrBenefitss = bisInspRsvrBenefitsDao.findList(bisInspRsvrBenefitsParam);
- if (bisInspRsvrBenefitss != null && bisInspRsvrBenefitss.size() > 0) {
- bisInspRsvrBenefits.setId(bisInspRsvrBenefitss.get(0).getId());
- bisInspRsvrBenefitsDao.update(bisInspRsvrBenefits);
- } else {
- bisInspRsvrBenefits.setId(UuidUtil.uuid());
- bisInspRsvrBenefitsDao.insert(bisInspRsvrBenefits);
- }
- bisInspRsvrRgstr.setBenefitStat("2");
- }
- } else {
- BisInspRsvrBenefits bisInspRsvrBenefits = null;
- if (bisInspOffLineRsvrRgeister.getBisInspRsvrBenefits() != null) {
- bisInspRsvrBenefits = bisInspOffLineRsvrRgeister.getBisInspRsvrBenefits();
- bisInspRsvrRgstr.setBenefitStat("2");
- } else {
- bisInspRsvrBenefits = new BisInspRsvrBenefits();
- bisInspRsvrRgstr.setBenefitStat("1");
- }
- bisInspRsvrBenefits.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspRsvrBenefits.setId(UuidUtil.uuid());
- bisInspRsvrBenefitsDao.insert(bisInspRsvrBenefits);
- }
- }
- /**
- * 插入走访情况
- *
- * @param bisInspOffLineRsvrRgeister
- * @param bisInspRsvrRgstr
- */
- void insertBisInspBaseView(BisInspOffLineRsvrRgeister bisInspOffLineRsvrRgeister, BisInspRsvrRgstr
- bisInspRsvrRgstr, BisInspOffLineRsvr bisInspOffLineRsvr) {
- if (bisInspOffLineRsvrRgeister.getBisInspBaseView() != null) {
- BisInspBaseView bisInspBaseView = new BisInspBaseView();
- String viewId = UuidUtil.uuid();
- bisInspBaseView.setRgstrId(bisInspRsvrRgstr.getRgstrId());
- bisInspBaseView.setViewId(viewId);
- bisInspBaseView.setResCode(bisInspRsvrRgstr.getRsCode());
- bisInspBaseView.setCreateTime(new Date());
- bisInspBaseView.setUpdateTime(new Date());
- bisInspBaseView.setStatus("2");
- bisInspBaseViewDao.insert(bisInspBaseView);
- for (BisInspPreList bisInspPreList : bisInspOffLineRsvrRgeister.getBisInspBaseView()) {
- bisInspPreList.setViewId(viewId);
- bisInspPreList.setViewPreId(UuidUtil.uuid());
- bisInspPreList.setInspTm(new Date());
- bisInspPreList.setViewPreName(bisInspPreList.getViewPreName());
- bisInspPreList.setKnowResManager(bisInspPreList.getKnowResManager());
- bisInspPreList.setManagerComment(bisInspPreList.getManagerComment());
- bisInspPreListDao.insert(bisInspPreList);
- }
- bisInspRsvrRgstr.setViewStat("2");
- } else {
- bisInspRsvrRgstr.setViewStat("1");
- }
- }
- @Override
- public BisInspOffLineRetBase getBaseInfo(BisInspOffLine bisInspOffLine) {
- BisInspOffLineRetBase bisInspOffLineRetBase = new BisInspOffLineRetBase();
- AttRsBaseParam attRsBaseParam = new AttRsBaseParam();
- attRsBaseParam.setRsName(bisInspOffLine.getName());
- attRsBaseParam.setAdmDiv(AdLevelUtil.getAddvcd(bisInspOffLine.getAddvcd()));
- bisInspOffLineRetBase.setBase(attRsBaseDao.findList(attRsBaseParam));
- //判断登记表是否有重复对象
- List<BisInspBase> bisInspRsvrRgstrs = bisInspRsvrRgstrDao.getRsvrByIdNm(bisInspOffLine.getGroupId(), bisInspOffLine.getName());
- if (null != bisInspRsvrRgstrs && bisInspRsvrRgstrs.size() > 0) {
- bisInspOffLineRetBase.setRepeat(true);
- bisInspOffLineRetBase.setRepeatList(bisInspRsvrRgstrs);
- } else {
- bisInspOffLineRetBase.setRepeat(false);
- }
- return bisInspOffLineRetBase;
- }
- }
|