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("mnfNo"))
.set("사용기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe")))
.set("수량", one.string("pceQy")+one.string("pceCoUnitNm"))
.set("수량", one.string("dsuseQy")+one.string("pceCoUnitNm"))
;
}).toList();

@ -43,7 +43,7 @@ public class DisposeResultReport extends HWPFormat {
.set("제품정보-최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm"))
.set("제품정보-제조번호", one.string("mnfNo"))
.set("제품정보-유효기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe")))
.set("폐기량-수량", one.string("pceQy")+one.string("pceCoUnitNm"))
.set("폐기량-수량", one.string("dsuseQy")+one.string("pceCoUnitNm"))
;
}).toList();
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.servlet.ModelAndView;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
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.JSON;
import cokr.xit.foundation.web.WebClient;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.ParseException;
@Controller
@RequestMapping(
@ -87,6 +86,11 @@ public class AddsNimsController extends ApplicationController {
setCmmCode("ADDS04", mav);
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())){
mav.addObject("dsuseReceptInfo", toJson(dsuseReceptInfo));
@ -144,6 +148,15 @@ public class AddsNimsController extends ApplicationController {
FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId());
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));
return mav
@ -229,10 +242,16 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> fileinfo = fileService.getFileList(
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", "");
} 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(
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<>();
for(DataObject dsuseimg : dsuseimgs) {
dsuseimgPaths.add(dsuseimg.string("FILE_PATH"));
@ -289,10 +318,16 @@ public class AddsNimsController extends ApplicationController {
List<DataObject> fileinfo = fileService.getFileList(
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", "");
} 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>
<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
WHERE A.USE_YN = 'Y'
AND B.USE_YN = 'Y'
AND A.SGG_CD = B.SGG_CD
AND A.INST_CD = B.INST_CD</sql>
FROM TB_SGG A LEFT OUTER JOIN TB_DEPT B
ON A.SGG_CD = B.SGG_CD AND A.INST_CD = B.INST_CD
AND A.USE_YN = 'Y' AND B.USE_YN = 'Y'</sql>
<select id="selectSggDepts" resultType="dataobject"><include refid="sggDepts" />
ORDER BY A.SGG_CD, A.INST_CD, DEPT_CD</select>

@ -72,12 +72,8 @@ SELECT USER_ID
, DEPT_NM
FROM TB_USER A
LEFT OUTER JOIN (
SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM
FROM TB_SGG A LEFT OUTER JOIN TB_DEPT B
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
<include refid="cokr.xit.base.user.dao.DepartmentMapper.sggDepts" />
) B ON ORG_ID = B.SGG_CD AND 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>
<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>
@ -94,9 +90,9 @@ SELECT USER_ID
<select id="getUser" parameterType="map" resultMap="userRow">/* 사용자 계정 가져오기(userMapper.getUser) */
SELECT *
FROM TB_USER
<where><if test="userID != null">AND USER_ID = #{userID}</if>
<if test="account != null">AND USER_ACNT = #{account}</if>
<if test="institute != null"> AND NSTT_CD = #{institute}</if></where></select>
<where><if test="userID != null"> AND USER_ID = #{userID}</if>
<if test="account != null"> AND USER_ACNT = #{account}</if>
<if test="orgID != null"> AND ORG_ID = #{orgID}</if></where></select>
<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>

@ -47,10 +47,11 @@
</div>
<div class="col-md-6">
<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">
<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>>
<option value="">기관 선택</option>
<option value="">시군구/기관 선택</option>
</select>
</div>
</div>
@ -174,7 +175,7 @@
<script type="text/javascript">
var sggDepts = new SggDeptControl();
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)
tags.push("<option value=\"\">등록된 기관정보가 없습니다.</option>")
document.querySelector("#infoPrefix-form select[name='institute']").innerHTML += tags.join("");
@ -202,6 +203,7 @@ infoPrefixControl.setInfo = obj => {
let password = $(this).prop("required", create);
let div = password.parent().parent().parent();
if (create) {
$("#infoPrefix-form *[name='orgID']").val("${orgID}");
$("#infoPrefix-form *[name='institute']").val("${institute}");
div.show();
} else
@ -265,6 +267,10 @@ async function initPassword() {
}
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});
}

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

Loading…
Cancel
Save