Leeyh1121 5 months ago
commit edb2cc4c93

@ -143,7 +143,7 @@ public class DisposeProcessDetails extends HWPFormat {
.set("최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm")) .set("최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm"))
.set("제조번호", one.string("mnfNo")) .set("제조번호", one.string("mnfNo"))
.set("사용기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe"))) .set("사용기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe")))
.set("수량", one.string("pceQy")+one.string("pceCoUnitNm")) .set("수량", one.string("dsuseQy")+one.string("pceCoUnitNm"))
; ;
}).toList(); }).toList();

@ -43,7 +43,7 @@ public class DisposeResultReport extends HWPFormat {
.set("제품정보-최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm")) .set("제품정보-최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm"))
.set("제품정보-제조번호", one.string("mnfNo")) .set("제품정보-제조번호", one.string("mnfNo"))
.set("제품정보-유효기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe"))) .set("제품정보-유효기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe")))
.set("폐기량-수량", one.string("pceQy")+one.string("pceCoUnitNm")) .set("폐기량-수량", one.string("dsuseQy")+one.string("pceCoUnitNm"))
; ;
}).toList(); }).toList();
writer.table(0, 3, 1).setValues(list); writer.table(0, 3, 1).setValues(list);

@ -15,9 +15,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ParseException;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
@ -45,6 +42,8 @@ import cokr.xit.base.web.ApplicationController;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.data.JSON; import cokr.xit.foundation.data.JSON;
import cokr.xit.foundation.web.WebClient; import cokr.xit.foundation.web.WebClient;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ParseException;
@Controller @Controller
@RequestMapping( @RequestMapping(
@ -87,6 +86,11 @@ public class AddsNimsController extends ApplicationController {
setCmmCode("ADDS04", mav); setCmmCode("ADDS04", mav);
List<DataObject> fileInfo = new ArrayList<DataObject>(); List<DataObject> fileInfo = new ArrayList<DataObject>();
if(fileInfo == null) { fileInfo = new ArrayList<DataObject>();}
fileInfo = fileInfo.stream()
.filter((item) -> item.string("USE_YN").equals("Y"))
.sorted((item1, item2) -> item1.string("SUB_TYPE").compareTo(item2.string("SUB_TYPE")))
.toList();
if(!isEmpty(dsuseReceptInfo) && !isEmpty(dsuseReceptInfo.getDscdmngId())){ if(!isEmpty(dsuseReceptInfo) && !isEmpty(dsuseReceptInfo.getDscdmngId())){
mav.addObject("dsuseReceptInfo", toJson(dsuseReceptInfo)); mav.addObject("dsuseReceptInfo", toJson(dsuseReceptInfo));
@ -144,6 +148,15 @@ public class AddsNimsController extends ApplicationController {
FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId()); FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId());
List<DataObject> fileInfos = fileService.getFileList(fileQuery); List<DataObject> fileInfos = fileService.getFileList(fileQuery);
if(fileInfos == null) { fileInfos = new ArrayList<DataObject>(); }
fileInfos = fileInfos.stream()
.filter((item) -> item.string("USE_YN").equals("Y"))
.sorted((item1, item2) -> {
int a = item1.number("SRT_ORD").intValue();
int b = item2.number("SRT_ORD").intValue();
return (a < b) ? -1 : ((a == b) ? 0 : 1);
})
.toList();
mav.addObject("fileInfos", toJson(fileInfos)); mav.addObject("fileInfos", toJson(fileInfos));
return mav return mav
@ -229,10 +242,16 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> fileinfo = fileService.getFileList( List<DataObject> fileinfo = fileService.getFileList(
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType) new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
); );
if(fileinfo == null || fileinfo.isEmpty()) { if(fileinfo == null) { fileinfo = new ArrayList<DataObject>(); }
fileinfo = fileinfo.stream()
.filter((item) -> item.string("USE_YN").equals("Y"))
.sorted((item1, item2) -> item1.string("FILE_ID").compareTo(item2.string("FILE_ID")))
.toList();
if(fileinfo.isEmpty()) {
data.put("filePath", ""); data.put("filePath", "");
} else { } else {
data.put("filePath", fileinfo.get(0).string("FILE_PATH")); data.put("filePath", fileinfo.get(fileinfo.size()-1).string("FILE_PATH"));
} }
} }
@ -277,6 +296,16 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> dsuseimgs = fileService.getFileList( List<DataObject> dsuseimgs = fileService.getFileList(
new FileQuery().setInfoType("110").setInfoKeys(dataForDoc.get(0).string("dscdmngId")) new FileQuery().setInfoType("110").setInfoKeys(dataForDoc.get(0).string("dscdmngId"))
); );
if(dsuseimgs == null) { dsuseimgs = new ArrayList<DataObject>(); }
dsuseimgs = dsuseimgs.stream()
.filter((item) -> item.string("USE_YN").equals("Y"))
.sorted((item1, item2) -> {
int a = item1.number("SRT_ORD").intValue();
int b = item2.number("SRT_ORD").intValue();
return (a < b) ? -1 : ((a == b) ? 0 : 1);
})
.toList();
List<String> dsuseimgPaths = new ArrayList<>(); List<String> dsuseimgPaths = new ArrayList<>();
for(DataObject dsuseimg : dsuseimgs) { for(DataObject dsuseimg : dsuseimgs) {
dsuseimgPaths.add(dsuseimg.string("FILE_PATH")); dsuseimgPaths.add(dsuseimg.string("FILE_PATH"));
@ -289,10 +318,16 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> fileinfo = fileService.getFileList( List<DataObject> fileinfo = fileService.getFileList(
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType) new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
); );
if(fileinfo == null || fileinfo.isEmpty()) { if(fileinfo == null) { fileinfo = new ArrayList<DataObject>(); }
fileinfo = fileinfo.stream()
.filter((item) -> item.string("USE_YN").equals("Y"))
.sorted((item1, item2) -> item1.string("FILE_ID").compareTo(item2.string("FILE_ID")))
.toList();
if(fileinfo.isEmpty()) {
data.put("filePath", ""); data.put("filePath", "");
} else { } else {
data.put("filePath", fileinfo.get(0).string("FILE_PATH")); data.put("filePath", fileinfo.get(fileinfo.size()-1).string("FILE_PATH"));
} }
} }

@ -53,11 +53,9 @@
<include refid="utility.orderBy" /></select> <include refid="utility.orderBy" /></select>
<sql id="sggDepts">SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM <sql id="sggDepts">SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM
FROM TB_SGG A, TB_DEPT B FROM TB_SGG A LEFT OUTER JOIN TB_DEPT B
WHERE A.USE_YN = 'Y' ON A.SGG_CD = B.SGG_CD AND A.INST_CD = B.INST_CD
AND B.USE_YN = 'Y' AND A.USE_YN = 'Y' AND B.USE_YN = 'Y'</sql>
AND A.SGG_CD = B.SGG_CD
AND A.INST_CD = B.INST_CD</sql>
<select id="selectSggDepts" resultType="dataobject"><include refid="sggDepts" /> <select id="selectSggDepts" resultType="dataobject"><include refid="sggDepts" />
ORDER BY A.SGG_CD, A.INST_CD, DEPT_CD</select> ORDER BY A.SGG_CD, A.INST_CD, DEPT_CD</select>

@ -72,12 +72,8 @@ SELECT USER_ID
, DEPT_NM , DEPT_NM
FROM TB_USER A FROM TB_USER A
LEFT OUTER JOIN ( LEFT OUTER JOIN (
SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM <include refid="cokr.xit.base.user.dao.DepartmentMapper.sggDepts" />
FROM TB_SGG A LEFT OUTER JOIN TB_DEPT B ) B ON ORG_ID = B.SGG_CD AND A.NSTT_CD = B.INST_CD AND A.DEPT_CD = B.DEPT_CD
ON A.SGG_CD = B.SGG_CD
AND A.INST_CD = B.INST_CD
AND A.USE_YN = 'Y' AND B.USE_YN = 'Y'
) B ON A.NSTT_CD = B.INST_CD AND A.DEPT_CD = B.DEPT_CD
<where><if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if> <where><if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if>
<if test="userIDs != null">USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if> <if test="userIDs != null">USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
<if test="status == null and userIDs == null">AND STTS != 'D'</if> <if test="status == null and userIDs == null">AND STTS != 'D'</if>
@ -96,7 +92,7 @@ SELECT *
FROM TB_USER FROM TB_USER
<where><if test="userID != null"> AND USER_ID = #{userID}</if> <where><if test="userID != null"> AND USER_ID = #{userID}</if>
<if test="account != null"> AND USER_ACNT = #{account}</if> <if test="account != null"> AND USER_ACNT = #{account}</if>
<if test="institute != null"> AND NSTT_CD = #{institute}</if></where></select> <if test="orgID != null"> AND ORG_ID = #{orgID}</if></where></select>
<insert id="insertUser" parameterType="cokr.xit.base.user.ManagedUser">/* 사용자 정보 등록(userMapper.insertUser) */ <insert id="insertUser" parameterType="cokr.xit.base.user.ManagedUser">/* 사용자 정보 등록(userMapper.insertUser) */
<selectKey resultType="string" keyProperty="id" keyColumn="NEW_ID" order="BEFORE">SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER</selectKey> <selectKey resultType="string" keyProperty="id" keyColumn="NEW_ID" order="BEFORE">SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER</selectKey>

@ -47,10 +47,11 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="institute">기관</label> <label class="col-sm-3 col-form-label text-sm-end" for="institute">시군구/기관</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input name="orgID" data-map="ORG_ID" type="hidden">
<select name="institute" data-map="NSTT_CD" class="form-control" onchange="setDepts(this.value);"<c:if test='${!admin}'> disabled</c:if>> <select name="institute" data-map="NSTT_CD" class="form-control" onchange="setDepts(this.value);"<c:if test='${!admin}'> disabled</c:if>>
<option value="">기관 선택</option> <option value="">시군구/기관 선택</option>
</select> </select>
</div> </div>
</div> </div>
@ -174,7 +175,7 @@
<script type="text/javascript"> <script type="text/javascript">
var sggDepts = new SggDeptControl(); var sggDepts = new SggDeptControl();
sggDepts.sggs.onDatasetChange = obj => { sggDepts.sggs.onDatasetChange = obj => {
let tags = sggDepts.sggs.dataset.inStrings("<option value=\"{INST_CD}\">{INST_NM}</option>"); let tags = sggDepts.sggs.dataset.inStrings("<option value=\"{INST_CD}\">{SGG_NM}/{INST_NM}</option>");
if (tags.length < 1) if (tags.length < 1)
tags.push("<option value=\"\">등록된 기관정보가 없습니다.</option>") tags.push("<option value=\"\">등록된 기관정보가 없습니다.</option>")
document.querySelector("#infoPrefix-form select[name='institute']").innerHTML += tags.join(""); document.querySelector("#infoPrefix-form select[name='institute']").innerHTML += tags.join("");
@ -202,6 +203,7 @@ infoPrefixControl.setInfo = obj => {
let password = $(this).prop("required", create); let password = $(this).prop("required", create);
let div = password.parent().parent().parent(); let div = password.parent().parent().parent();
if (create) { if (create) {
$("#infoPrefix-form *[name='orgID']").val("${orgID}");
$("#infoPrefix-form *[name='institute']").val("${institute}"); $("#infoPrefix-form *[name='institute']").val("${institute}");
div.show(); div.show();
} else } else
@ -265,6 +267,10 @@ async function initPassword() {
} }
function setDepts(instCode) { function setDepts(instCode) {
let found = sggDepts.sggs.dataset._items.filter(item => item.data.INST_CD == instCode);
found = found.length > 0 ? found[0].data : {};
document.querySelector("input[name='orgID']").value = found.SGG_CD;
sggDepts.getDepts({instCode: instCode}); sggDepts.getDepts({instCode: instCode});
} }

@ -56,11 +56,11 @@
<div class="w-px-400 mx-auto"> <div class="w-px-400 mx-auto">
<div id="formAuthentication" class="mb-3"> <div id="formAuthentication" class="mb-3">
<c:if test="${multipleSggs}"><div class="mb-3"> <c:if test="${multipleSggs}"><div class="mb-3">
<label for="institute" class="form-label">기관</label> <label for="orgID" class="form-label">시군구</label>
<select id="institute" class="form-control"> <select id="orgID" class="form-control">
</select> </select>
</div></c:if> </div></c:if>
<c:if test="${!multipleSggs}"><input id="institute" type="hidden" /></c:if> <c:if test="${!multipleSggs}"><input id="orgID" type="hidden" /></c:if>
<div class="mb-3"> <div class="mb-3">
<label for="userId" class="form-label">아이디</label> <label for="userId" class="form-label">아이디</label>
<input id="userId" type="text" value="${cookie['userAccount'].getValue()}" required class="form-control" placeholder="아이디를 입력하십시오." autofocus /> <input id="userId" type="text" value="${cookie['userAccount'].getValue()}" required class="form-control" placeholder="아이디를 입력하십시오." autofocus />
@ -99,13 +99,13 @@
${functions} ${functions}
<c:if test="${multipleSggs}">let sggs = new Dataset({ <c:if test="${multipleSggs}">let sggs = new Dataset({
keymapper: row => row.INST_CD, keymapper: row => row.SGG_CD,
onDatasetChange: obj => { onDatasetChange: obj => {
document.querySelector("#institute").innerHTML = sggs.inStrings("<option value=\"{INST_CD}\">{INST_NM}</option>"); document.querySelector("#orgID").innerHTML = sggs.inStrings("<option value=\"{SGG_CD}\">{SGG_NM}</option>");
} }
}); });
sggs.setData(${sggs});</c:if> sggs.setData(${sggs});</c:if>
<c:if test="${!multipleSggs}">document.querySelector("#institute").value = ${sggs}[0].INST_CD;</c:if> <c:if test="${!multipleSggs}">document.querySelector("#orgID").value = ${sggs}[0].SGG_CD;</c:if>
function login() { function login() {
if (!$("#formAuthentication input").validInputs()) return; if (!$("#formAuthentication input").validInputs()) return;
@ -113,7 +113,7 @@ function login() {
var params = { var params = {
account:$("#userId").val(), account:$("#userId").val(),
password:$("#password").val(), password:$("#password").val(),
institute: $("#institute").val(), orgID: $("#orgID").val(),
rememberCredentials: $("#remember").prop("checked") rememberCredentials: $("#remember").prop("checked")
}; };
ajax.post({ ajax.post({
@ -140,7 +140,7 @@ $(function(){
if ($("#userId").val()) if ($("#userId").val())
$("#password").focus(); $("#password").focus();
let input = document.querySelector("#institute"), let input = document.querySelector("#orgID"),
stored = "${cookie['userInstitute'].getValue()}"; stored = "${cookie['userInstitute'].getValue()}";
if (stored) if (stored)
input.value = stored; input.value = stored;

Loading…
Cancel
Save