외주요청파일서식 설정 저장 추가

main
이범준 8 months ago
parent 20956decd2
commit 79d8b2b94a

@ -0,0 +1,21 @@
package cokr.xit.fims.cmmn;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OutsourcingArtclStng extends AbstractEntity {
private String outsourcingFormId; //항목ID
private String artclOrdr; //항목순서
private String artclNm; //항목명
private String artclSz; //항목 바이트수
private String paddingDirection; //공백방향
private String formatting;
private String sggCd;
private String taskSeCd;
private String sndngSeCd;
}

@ -0,0 +1,20 @@
package cokr.xit.fims.cmmn;
import java.util.List;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OutsourcingForm extends AbstractEntity {
private String outsourcingBscId;
private String sggCd;
private String taskSeCd;
private String sndngSeCd;
private List<OutsourcingArtclStng> zipArtclStngList;
private String[] outsourcingFormIDs;
}

@ -4,6 +4,8 @@ import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.cmmn.OutsourcingArtclStng;
import cokr.xit.fims.cmmn.OutsourcingForm;
import cokr.xit.fims.cmmn.OutsourcingStngQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
@ -17,4 +19,10 @@ public interface OutsourcingStngMapper extends AbstractMapper {
*/
List<DataObject> selectArtclStngList(OutsourcingStngQuery query);
int updateArtclStng(OutsourcingArtclStng update);
int deleteArtclStng(OutsourcingForm outsourcingForm);
int insertArtclStng(OutsourcingArtclStng insert);
}

@ -10,6 +10,8 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.OutsourcingArtclStng;
import cokr.xit.fims.cmmn.OutsourcingForm;
import cokr.xit.fims.cmmn.OutsourcingStngQuery;
import cokr.xit.fims.cmmn.dao.OutsourcingStngMapper;
import cokr.xit.fims.cmmn.pdf.extraction.PredefinedSet;
@ -88,4 +90,49 @@ public class OutsourcingStngBean extends AbstractComponent {
return outsourcingStngMap;
}
/** .
* @param outsourcingForm
* @return
*/
public boolean saveOutsourcingArtclStng(OutsourcingForm outsourcingForm) {
try {
String userId = currentUser().getId();
List<OutsourcingArtclStng> outsourcingArtclStngList = outsourcingForm.getZipArtclStngList();
List<String> updateKeyList = new ArrayList<String>();
List<OutsourcingArtclStng> insertList = new ArrayList<OutsourcingArtclStng>();
if(outsourcingArtclStngList != null && !outsourcingArtclStngList.isEmpty()) {
List<OutsourcingArtclStng> updateList = outsourcingArtclStngList.stream().filter(item -> !ifEmpty(item.getOutsourcingFormId(), () -> "").equals("")).toList();
if(!updateList.isEmpty()) {
for(OutsourcingArtclStng update : updateList) {
update.setModifiedBy(userId);
outsourcingStngMapper.updateArtclStng(update);
updateKeyList.add(update.getOutsourcingFormId());
}
}
insertList = outsourcingArtclStngList.stream().filter(item -> ifEmpty(item.getOutsourcingFormId(), () -> "").equals("")).toList();
}
if(!updateKeyList.isEmpty()) {
outsourcingForm.setOutsourcingFormIDs(updateKeyList.toArray(new String[updateKeyList.size()]));
}
outsourcingForm.setModifiedBy(userId);
outsourcingStngMapper.deleteArtclStng(outsourcingForm);
if(!insertList.isEmpty()) {
for(OutsourcingArtclStng insert : insertList) {
insert.setCreatedBy(userId);
outsourcingStngMapper.insertArtclStng(insert);
}
}
} catch (Exception e) {
throw new RuntimeException("출력 설정 저장 중 오류가 발생하였습니다.");
}
return true;
}
}

@ -18,6 +18,7 @@ import cokr.xit.fims.cmmn.ExtrForm;
import cokr.xit.fims.cmmn.ExtrStngQuery;
import cokr.xit.fims.cmmn.OtptForm;
import cokr.xit.fims.cmmn.OtptStngQuery;
import cokr.xit.fims.cmmn.OutsourcingForm;
import cokr.xit.fims.cmmn.OutsourcingStngQuery;
import cokr.xit.fims.cmmn.service.StngService;
import cokr.xit.fims.cmmn.service.bean.ExtrStngBean;
@ -49,7 +50,8 @@ public class StngController extends ApplicationController {
getExtrStngInfo = "/020/info.do",
saveExtrStngInfo = "/020/save.do",
outsourcingStngMain = "/030/main.do",
getOutsourcingStngInfo = "/030/info.do"
getOutsourcingStngInfo = "/030/info.do",
saveOutsourcingStngInfo = "/030/save.do"
;
}
@ -322,4 +324,21 @@ public class StngController extends ApplicationController {
return mav;
}
/** .
* @return
*/
public ModelAndView saveOutsourcingStngInfo(OutsourcingForm outsourcingForm) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
//saved = outsourcingStngBean.saveBscStng(otptForm);
//if(saved) {
saved = outsourcingStngBean.saveOutsourcingArtclStng(outsourcingForm);
//}
mav.addObject("saved", saved);
return mav;
}
}

@ -12,6 +12,7 @@ import cokr.xit.fims.cmmn.ExtrForm;
import cokr.xit.fims.cmmn.ExtrStngQuery;
import cokr.xit.fims.cmmn.OtptForm;
import cokr.xit.fims.cmmn.OtptStngQuery;
import cokr.xit.fims.cmmn.OutsourcingForm;
import cokr.xit.fims.cmmn.OutsourcingStngQuery;
import cokr.xit.fims.cmmn.PrintOption;
import cokr.xit.fims.crdn.Crdn;
@ -833,5 +834,11 @@ public class CmnController {
public ModelAndView getOutsourcingStngInfo(OutsourcingStngQuery outsourcingStngQuery) {
return super.getOutsourcingStngInfo(outsourcingStngQuery);
}
@Override
@RequestMapping(name="외주요청파일 서식 설정 정보 저장", value=METHOD_URL.saveOutsourcingStngInfo)
public ModelAndView saveOutsourcingStngInfo(OutsourcingForm outsourcingForm) {
return super.saveOutsourcingStngInfo(outsourcingForm);
}
}
}

@ -21,4 +21,71 @@ SELECT OUTSOURCING_FORM_ID
ORDER BY ARTCL_ORDR
</select>
<insert id="insertArtclStng" parameterType="cokr.xit.fims.cmmn.OutsourcingArtclStng">
/* 외주요청파일서식 설정 등록(outsourcingStngMapper.insertArtclStng) */
<selectKey resultType="string" keyProperty="outsourcingFormId" keyColumn="NEW_ID" order="BEFORE">
SELECT
LPAD(CAST(IFNULL(MAX(OUTSOURCING_FORM_ID) + 1, 1) AS INT), 10, '0')
AS NEW_ID
FROM TB_OUTSOURCING_FORM_STNG
</selectKey>
INSERT
INTO TB_OUTSOURCING_FORM_STNG (
OUTSOURCING_FORM_ID
, SGG_CD
, TASK_SE_CD
, SNDNG_SE_CD
, ARTCL_ORDR
, ARTCL_NM
, ARTCL_SZ
, PADDING_DIRECTION
, FORMATTING
, USE_YN
, REG_DT
, RGTR
) VALUES (
#{outsourcingFormId}
, #{sggCd}
, #{taskSeCd}
, #{sndngSeCd}
, #{artclOrdr}
, #{artclNm}
, #{artclSz}
, #{paddingDirection}
, #{formatting}
, 'Y'
, <include refid="utility.now" />
, #{createdBy}
)
</insert>
<update id="updateArtclStng" parameterType="cokr.xit.fims.cmmn.OutsourcingArtclStng">
/* 외주요청파일서식 설정 수정(outsourcingStngMapper.updateArtclStng) */
UPDATE TB_OUTSOURCING_FORM_STNG
SET ARTCL_ORDR = #{artclOrdr}
, ARTCL_NM = #{artclNm}
, ARTCL_SZ = #{artclSz}
, PADDING_DIRECTION = #{paddingDirection}
, FORMATTING = #{formatting}
, MDFCN_DT = <include refid="utility.now" />
, MDFR = #{modifiedBy}
WHERE OUTSOURCING_FORM_ID = #{outsourcingFormId}
AND USE_YN = 'Y'
</update>
<update id="deleteArtclStng" parameterType="cokr.xit.fims.cmmn.OutsourcingForm">
/* 외주요청파일서식 설정 삭제(outsourcingStngMapper.deleteArtclStng) */
UPDATE TB_OUTSOURCING_FORM_STNG
SET USE_YN = 'N'
, MDFCN_DT = <include refid="utility.now" />
, MDFR = #{modifiedBy}
WHERE SGG_CD = #{sggCd}
AND TASK_SE_CD = #{taskSeCd}
AND SNDNG_SE_CD = #{sndngSeCd}
AND USE_YN = 'Y'
<if test='outsourcingFormIDs != null'>
AND OUTSOURCING_FORM_ID NOT IN (<foreach collection="outsourcingFormIDs" item="OUTSOURCING_FORM_ID" separator=",">#{OUTSOURCING_FORM_ID}</foreach>)
</if>
</update>
</mapper>

@ -250,7 +250,7 @@ $(document).ready(function(){
var components = "<option value='' data-component-type=''>선택</option>";
for(var i=0; i < predefinedSetList.length; i++){
var p = predefinedSetList[i];
components += "<option value='"+p.predefinedArtclNm+"' >"+p.predefinedSetList+"</option>";
components += "<option value='"+p.extrArtclNm+"' >"+p.extrArtclDscrp+"</option>";
}
var template = document.getElementById("found--${pageName}").innerHTML;
template = template.replace(/{OUTSOURCING_FORM_ID}/gi, "");
@ -300,11 +300,11 @@ $(document).ready(function(){
var row = {};
row.outsourcingFormId = this.dataset.key;
row.artclNm = $($P.fnGetElement(this,"artclNm")).val();
row.artclOrdr = $($P.fnGetElement(this,"artclOrdr")).val();
row.artclNm = $($P.fnGetElement(this,"artclNm")).val();
row.artclSz = $($P.fnGetElement(this,"artclSz")).val();
row.paddingDirection = $($P.fnGetElement(this,"paddingDirection")).val();
row.formatting = $($P.fnGetElement(this,"formatting")).val();
row.sggCd = formData.get("sggCd");
row.taskSeCd = formData.get("taskSeCd");

Loading…
Cancel
Save