[BO] 임가현황 - 임가방문정보 작업 중
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
AND bat.is_deleted = false
|
||||
ORDER BY bat.created_at
|
||||
</select>
|
||||
|
||||
<select id="getBankAutoTransferExpenseRecords"
|
||||
@@ -78,5 +79,6 @@
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
AND bat.is_deleted = false
|
||||
ORDER BY bat.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -48,6 +48,7 @@
|
||||
AND ui_unit.id = di.unit_code
|
||||
WHERE di.daily_record_seq = #{recordSeq}
|
||||
AND di.is_deleted = false
|
||||
ORDER BY di.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyWorkRecords"
|
||||
@@ -89,6 +90,7 @@
|
||||
AND ui_harvest.id = dw.harvest_unit_code
|
||||
WHERE dw.daily_record_seq = #{recordSeq}
|
||||
AND dw.is_deleted = false
|
||||
ORDER BY dw.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyExpenseRecords"
|
||||
@@ -116,6 +118,7 @@
|
||||
AND ui_unit.id = de.unit_code
|
||||
WHERE de.daily_record_seq = #{recordSeq}
|
||||
AND de.is_deleted = false
|
||||
ORDER BY de.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyPowerRecords"
|
||||
@@ -130,6 +133,7 @@
|
||||
FROM daily_power dp
|
||||
WHERE dp.daily_record_seq = #{recordSeq}
|
||||
AND dp.is_deleted = false
|
||||
ORDER BY dp.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyForestryRecords"
|
||||
@@ -154,6 +158,7 @@
|
||||
AND ui_unit.id = df.unit_code
|
||||
WHERE df.daily_record_seq = #{recordSeq}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
|
||||
<select id="getDailyFarmingRecords"
|
||||
@@ -184,6 +189,7 @@
|
||||
AND ui_unit.id = df.unit_code
|
||||
WHERE df.daily_record_seq = #{recordSeq}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -68,5 +68,6 @@
|
||||
WHERE df.household_seq = #{householdSeq}
|
||||
AND df.month = #{recordMonth}
|
||||
AND df.is_deleted = false
|
||||
ORDER BY df.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -16,5 +16,7 @@
|
||||
FROM household_visit hv
|
||||
WHERE household_seq = #{householdSeq}
|
||||
AND TO_CHAR(visit_date, 'YYYYMM') = #{recordMonth}
|
||||
AND hv.is_deleted = false
|
||||
ORDER BY hv.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.tab.householdVisit.removeHouseholdVisitInfos.adapters.persistence.RemoveHouseholdVisitInfosMapper">
|
||||
<update id="removeHouseholdVisitInfos">
|
||||
/* removeHouseholdVisitInfos : 임가방문정보 삭제 */
|
||||
UPDATE household_visit
|
||||
SET <include refid="common.fields.DeleteBaseSet"/>
|
||||
WHERE id IN
|
||||
<foreach collection="removeIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.tab.householdVisit.saveHouseholdVisitInfo.adapters.persistence.SaveHouseholdVisitInfoMapper">
|
||||
<insert id="createHouseholdVisitInfo">
|
||||
/* createHouseholdVisitInfo : 임가방문정보 등록 */
|
||||
INSERT INTO household_visit
|
||||
(
|
||||
household_seq,
|
||||
visit_date,
|
||||
management_type,
|
||||
is_gift_sent,
|
||||
content,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{householdSeq},
|
||||
#{visitDate},
|
||||
#{managementType},
|
||||
#{isGiftSent},
|
||||
#{content},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateHouseholdVisitInfo">
|
||||
/* updateHouseholdVisitInfo : 임가방문정보 수정 */
|
||||
UPDATE household_visit
|
||||
SET
|
||||
visit_date = #{visitDate},
|
||||
management_type = #{managementType},
|
||||
is_gift_sent = #{isGiftSent},
|
||||
content = #{content},
|
||||
<include refid="common.fields.UpdateBaseSet"/>
|
||||
WHERE id = #{visitInfoId}
|
||||
</update>
|
||||
|
||||
<select id="findById" resultType="java.lang.Long">
|
||||
/* findById : 임가방문정보 조회 */
|
||||
SELECT id
|
||||
FROM household_visit
|
||||
WHERE id = #{id}
|
||||
AND is_deleted = false
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -380,7 +380,8 @@
|
||||
|
||||
// 현재 로그인한 유저의 역할
|
||||
const isResearcher = f.userRole.value === 'ROLE_RESEARCHER';
|
||||
const colspanLength = isResearcher ? 13 : 15;
|
||||
// const colspanLength = isResearcher ? 13 : 15; <!-- TODO : 2차 오픈 -->
|
||||
const colspanLength = isResearcher ? 10 : 12;
|
||||
|
||||
// 조사원일 경우 조사원이름, 번호 칼럼 hide
|
||||
$('.hide-role-researcher').toggle(!isResearcher);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<table class="type-form">
|
||||
<table class="type-form confirm">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
@@ -125,6 +125,7 @@
|
||||
// 임가방문정보 모달창 띄우기
|
||||
const showVisitInfoModal = (id) => {
|
||||
const f = document.reqVisitForm;
|
||||
f.householdSeq.value = householdSeq;
|
||||
|
||||
resetForm();
|
||||
|
||||
@@ -177,21 +178,22 @@
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
// ajaxUtil._ajaxMethod(
|
||||
// '/api/visitInfo/create',
|
||||
// JSON.stringify(dataOj),
|
||||
// (response) => { // 성공
|
||||
// alert("등록이 완료되었습니다.");
|
||||
// location.href = '/households';
|
||||
// },
|
||||
// function (code, rstData) {
|
||||
// if(code == 422) alert(rstData.responseText);
|
||||
// if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
// },
|
||||
// 'post',
|
||||
// 'json',
|
||||
// { handle422Type: 'alert' }
|
||||
// );
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/save',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("등록이 완료되었습니다.");
|
||||
document.querySelector(".modal-visit-info").ui.close();
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
},
|
||||
'post',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -215,11 +217,6 @@
|
||||
datepickerInstance.setDate(new Date(), { render: true });
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
const reqForm = document.reqForm;
|
||||
document.reqVisitForm.householdSeq.value = reqForm.householdSeq.value;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -10,7 +10,7 @@
|
||||
<h3></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" onclick="goDeleteVisitInfo();">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary" onclick="showVisitInfoModal();">
|
||||
@@ -68,7 +68,7 @@
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
<input type="checkbox" id="removeIds_${item.id}" name="removeIds" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
@@ -93,6 +93,37 @@
|
||||
'json'
|
||||
);
|
||||
}
|
||||
|
||||
// 임가방문정보 삭제
|
||||
const goDeleteVisitInfo = () => {
|
||||
const infoIds = $('input[name=removeIds]:checked');
|
||||
if(infoIds.length <= 0) {
|
||||
alert("임가방문정보를 선택해주세요.");
|
||||
return
|
||||
}
|
||||
|
||||
if(confirm("선택하신 내용을 삭제하시겠습니까? 삭제한 항목은 복구할 수 없습니다.")) {
|
||||
const f = document.reqForm;
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/remove',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("방문정보가 삭제되었습니다.");
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
},
|
||||
'delete',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -178,6 +178,10 @@
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
const householdSeq = document.reqForm.householdSeq.value;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 일계부 완료상태
|
||||
const statusInfoMap = {
|
||||
|
||||
Reference in New Issue
Block a user