fix : 시군구코드 기관코드 변환 메소드 추가

main
이범준 1 year ago
parent a0fbc61031
commit 76fb1772b9

@ -15,6 +15,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import kr.xit.fims.biz.cmm.service.FimsCrackdownMgtService; import kr.xit.fims.biz.cmm.service.FimsCrackdownMgtService;
import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -42,6 +43,8 @@ import kr.xit.fims.framework.support.util.xml.XmlParseUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -57,6 +60,8 @@ public class FimsCrackdownMgtServiceBean extends AbstractServiceBean implements
@Value("#{prop['file.upload.temp.path']}") @Value("#{prop['file.upload.temp.path']}")
private String uploadTempPath; private String uploadTempPath;
@Resource(name = "xitFrameCodeService")
private XitFrameCodeService xitFrameCodeService;
private final FimsCrackdownMgtMapper mapper; private final FimsCrackdownMgtMapper mapper;
private final RtCrackdownMgtMapper rtCrackdownMgtMapper; private final RtCrackdownMgtMapper rtCrackdownMgtMapper;
@ -260,7 +265,7 @@ public class FimsCrackdownMgtServiceBean extends AbstractServiceBean implements
erppDTO.setRgtr(getUserInfo().getUniqId()); erppDTO.setRgtr(getUserInfo().getUniqId());
erppDTO.setSysSeCd(getUserInfo().getOrgnztId()); erppDTO.setSysSeCd(getUserInfo().getOrgnztId());
erppDTO.setSggCd(getUserInfo().getPstinstCode()); erppDTO.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
rtCrackdownMgtMapper.insertRtErpp(erppDTO); rtCrackdownMgtMapper.insertRtErpp(erppDTO);
// 시민신고인 경우 // 시민신고인 경우
@ -311,7 +316,7 @@ public class FimsCrackdownMgtServiceBean extends AbstractServiceBean implements
@Override @Override
public void addCtznSttemntCmplt(final FimsCrackdownDTO.CtznSttemntCmplt dto) { public void addCtznSttemntCmplt(final FimsCrackdownDTO.CtznSttemntCmplt dto) {
dto.setSggCd(getUserInfo().getPstinstCode()); dto.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
dto.setRgtr(getUserInfo().getUniqId()); dto.setRgtr(getUserInfo().getUniqId());
mapper.insertCtznSttemntCmplt(dto); mapper.insertCtznSttemntCmplt(dto);
} }
@ -412,7 +417,7 @@ public class FimsCrackdownMgtServiceBean extends AbstractServiceBean implements
String ansTxt = getAnswerText(mapper.selectCtznAnswerTmplInfo(ansReqDTO)); String ansTxt = getAnswerText(mapper.selectCtznAnswerTmplInfo(ansReqDTO));
CtznStmtDTO.Ans ansDTO = CtznStmtDTO.Ans.builder() CtznStmtDTO.Ans ansDTO = CtznStmtDTO.Ans.builder()
.sggCd(getUserInfo().getPstinstCode()) .sggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()))
.sysSeCd(getUserInfo().getOrgnztId()) .sysSeCd(getUserInfo().getOrgnztId())
.interfaceSeqN(saveDTO.getInterfaceSeqN()) .interfaceSeqN(saveDTO.getInterfaceSeqN())
.cvplProcessResult(ansTxt) .cvplProcessResult(ansTxt)

@ -255,6 +255,7 @@ public class CctvCrackdownDTO {
private String crdnId; private String crdnId;
private String linkId; private String linkId;
private String sysSeCd; private String sysSeCd;
private String inptSeCd;
private String erppId; private String erppId;
private String crdnSeCd; private String crdnSeCd;

@ -12,6 +12,8 @@ import java.util.stream.Collectors;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import kr.xit.fims.biz.ec.service.EcCctvCrackdownService; import kr.xit.fims.biz.ec.service.EcCctvCrackdownService;
import kr.xit.fims.framework.biz.cmm.dao.XitFrameCodeMapper;
import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.io.FileExistsException; import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
@ -38,6 +40,8 @@ import kr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -65,8 +69,12 @@ public class EcCctvCrackdownServiceBean extends AbstractServiceBean implements E
private final EcCtznSttemntMapper ctznSttemntMapper; private final EcCtznSttemntMapper ctznSttemntMapper;
private final RtCrackdownMgtMapper rtCrackdownMgtMapper; private final RtCrackdownMgtMapper rtCrackdownMgtMapper;
@Resource(name = "xitFrameCodeService")
private XitFrameCodeService xitFrameCodeService;
private final CmmFileService cmmFileService; private final CmmFileService cmmFileService;
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<CctvCrackdownDTO.ExtrlRegltCntc> findExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds) { public List<CctvCrackdownDTO.ExtrlRegltCntc> findExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds) {
@ -127,7 +135,8 @@ public class EcCctvCrackdownServiceBean extends AbstractServiceBean implements E
// data set // data set
CctvCrackdownDTO.ExtrlRegltCntc extrDTO = getExtrlRegltCntcDTO(txtNames[0], records); CctvCrackdownDTO.ExtrlRegltCntc extrDTO = getExtrlRegltCntcDTO(txtNames[0], records);
extrDTO.setSysSeCd(getUserInfo().getOrgnztId()); extrDTO.setSysSeCd(getUserInfo().getOrgnztId());
extrDTO.setSggCd(getUserInfo().getPstinstCode());
extrDTO.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
if(records.size() >= 3){ if(records.size() >= 3){
extrDTO.setCrdnSeCd(FimsConst.CrdnSeCd.CCTV_DRV.getCode()); extrDTO.setCrdnSeCd(FimsConst.CrdnSeCd.CCTV_DRV.getCode());
@ -183,7 +192,7 @@ public class EcCctvCrackdownServiceBean extends AbstractServiceBean implements E
CctvCrackdownDTO.ExtrlRegltCntc extrDTO = CctvCrackdownDTO.ExtrlRegltCntc CctvCrackdownDTO.ExtrlRegltCntc extrDTO = CctvCrackdownDTO.ExtrlRegltCntc
.builder() .builder()
.sysSeCd(getUserInfo().getOrgnztId()) .sysSeCd(getUserInfo().getOrgnztId())
.sggCd(getUserInfo().getPstinstCode()) .sggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()))
.vhrno(busOnlyDTO.getVhrno()) .vhrno(busOnlyDTO.getVhrno())
//.crndDongNm(mdInfos[1]) //.crndDongNm(mdInfos[1])
//.crdnPlc(mdInfos[2]) //.crdnPlc(mdInfos[2])

@ -11,6 +11,7 @@ import java.util.Map;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import kr.xit.fims.biz.ec.service.EcCtznSttemntService; import kr.xit.fims.biz.ec.service.EcCtznSttemntService;
import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -29,6 +30,8 @@ import kr.xit.fims.framework.support.util.xml.XmlParseUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -46,6 +49,9 @@ public class EcCtznSttemntServiceBean extends AbstractServiceBean implements EcC
private final EcCtznSttemntMapper mapper; private final EcCtznSttemntMapper mapper;
@Resource(name = "xitFrameCodeService")
private XitFrameCodeService xitFrameCodeService;
private final CmmFileService cmmFileService; private final CmmFileService cmmFileService;
@Override @Override
@ -184,7 +190,7 @@ public class EcCtznSttemntServiceBean extends AbstractServiceBean implements EcC
// 답변 테이블 insert(save) // 답변 테이블 insert(save)
dto.setSysSeCd(getUserInfo().getOrgnztId()); dto.setSysSeCd(getUserInfo().getOrgnztId());
dto.setSggCd(getUserInfo().getPstinstCode()); dto.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
dto.setRgtr(getUserInfo().getUniqId()); dto.setRgtr(getUserInfo().getUniqId());
mapper.saveEcCtznSttemntAnswer(dto); mapper.saveEcCtznSttemntAnswer(dto);

@ -18,6 +18,7 @@ import java.util.stream.Collectors;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import kr.xit.fims.biz.ec.service.EcNatlNewspaperService; import kr.xit.fims.biz.ec.service.EcNatlNewspaperService;
import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService;
import org.apache.commons.io.FileExistsException; import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
@ -47,6 +48,8 @@ import kr.xit.fims.framework.support.util.xml.XmlParseUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -60,6 +63,8 @@ public class EcNatlNewspaperServiceBean extends AbstractServiceBean implements E
@Value("#{prop['file.rcv.backup.root']}") @Value("#{prop['file.rcv.backup.root']}")
private String rcvBackupRoot; private String rcvBackupRoot;
@Resource(name = "xitFrameCodeService")
private XitFrameCodeService xitFrameCodeService;
private final EcNatlNewspaperMapper mapper; private final EcNatlNewspaperMapper mapper;
private final EcCtznSttemntMapper ctznSttemntMapper; private final EcCtznSttemntMapper ctznSttemntMapper;
@ -240,7 +245,7 @@ public class EcNatlNewspaperServiceBean extends AbstractServiceBean implements E
String reasonStr = xmlDto.getPetiReasonL(); String reasonStr = xmlDto.getPetiReasonL();
dto.setInterfaceSeqN(xmlDto.getInterfaceSeqN()); dto.setInterfaceSeqN(xmlDto.getInterfaceSeqN());
dto.setSggCd(getUserInfo().getPstinstCode()); dto.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
dto.setSysSeCd(getUserInfo().getOrgnztId()); dto.setSysSeCd(getUserInfo().getOrgnztId());
dto.setCvplSe(xmlDto.getPetiGubunC()); dto.setCvplSe(xmlDto.getPetiGubunC());
dto.setCvplReqstNo(xmlDto.getPetiNoC()); dto.setCvplReqstNo(xmlDto.getPetiNoC());
@ -296,7 +301,7 @@ public class EcNatlNewspaperServiceBean extends AbstractServiceBean implements E
dtlDto.setInterfaceSeqN(xmlDto.getInterfaceSeqN()); dtlDto.setInterfaceSeqN(xmlDto.getInterfaceSeqN());
dtlDto.setCtznSttemntDetailProcessSttus(FimsConst.CtznStmtDtlStsCode.UNPROCESSED.getCode()); dtlDto.setCtznSttemntDetailProcessSttus(FimsConst.CtznStmtDtlStsCode.UNPROCESSED.getCode());
dtlDto.setSysSeCd(getUserInfo().getOrgnztId()); dtlDto.setSysSeCd(getUserInfo().getOrgnztId());
dtlDto.setSggCd(getUserInfo().getPstinstCode()); dtlDto.setSggCd(xitFrameCodeService.instCdToSggCd(getUserInfo().getPstinstCode()));
dtlDto.setRgtr(getUserInfo().getUniqId()); dtlDto.setRgtr(getUserInfo().getUniqId());
dtlList.add(dtlDto); dtlList.add(dtlDto);
isFirst = false; isFirst = false;

@ -59,4 +59,7 @@ public interface XitFrameCodeMapper {
*/ */
public List<XitCodeVO> findGroupCodes(Map<String, String> m) throws SQLException; public List<XitCodeVO> findGroupCodes(Map<String, String> m) throws SQLException;
public String instCdToSggCd(String instCd) throws SQLException;
public String sggCdToInstCd(String sggCd) throws SQLException;
} }

@ -84,7 +84,23 @@ public interface XitFrameCodeService {
* @date: 2020. 4. 8. * @date: 2020. 4. 8.
*/ */
public List<XitCodeVO> findGroupCodes(String tableNm); public List<XitCodeVO> findGroupCodes(String tableNm);
/**
* <pre> : </pre>
* @param instCd
* @return String
* @author:
* @date: 2023. 5. 30.
*/
public String instCdToSggCd(String instCd);
/**
* <pre> : </pre>
* @param sggCd
* @return String
* @author:
* @date: 2023. 5. 30.
*/
public String sggCdToInstCd(String sggCd);
} }

@ -13,7 +13,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service(value = "xitFrameCodeService")
public class XitFrameCodeServiceBean extends AbstractServiceBean implements XitFrameCodeService{ public class XitFrameCodeServiceBean extends AbstractServiceBean implements XitFrameCodeService{
@Resource @Resource
@ -216,4 +216,26 @@ public class XitFrameCodeServiceBean extends AbstractServiceBean implements XitF
return result; return result;
} }
@Override
public String instCdToSggCd(String instCd) {
String result;
try {
result = xitFrameCodeMapper.instCdToSggCd(instCd);
} catch (SQLException e) {
throw new RuntimeException(String.format("시군구 코드 변환 실패: %s", e.getMessage()));
}
return result;
}
@Override
public String sggCdToInstCd(String sggCd) {
String result;
try {
result = xitFrameCodeMapper.sggCdToInstCd(sggCd);
} catch (SQLException e) {
throw new RuntimeException(String.format("시군구 코드 변환 실패: %s", e.getMessage()));
}
return result;
}
} }

@ -84,8 +84,16 @@
AND GROUP_ID LIKE #{groupId} AND GROUP_ID LIKE #{groupId}
</if> </if>
</select> </select>
<select id="instCdToSggCd" resultType="java.lang.String">
SELECT SGG_CD
FROM TB_SGG_INFO
WHERE INST_CD = #{instCd}
</select>
<select id="sggCdToInstCd" resultType="java.lang.String">
SELECT INST_CD
FROM TB_SGG_INFO
WHERE SGG_CD = #{sggCd}
</select>
</mapper> </mapper>

Loading…
Cancel
Save