pbnst 제외 커밋
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { getFectch } from "@/components/lib/api";
|
||||
import type { bdstAll } from "../rainReg";
|
||||
import { TEST_UUID, type bdstAll, type customRainBdst } from "../rainReg";
|
||||
import type { TableProps } from "../pbnstReg";
|
||||
import type { customHtdflBdst } from "../htdflReg";
|
||||
import type { customRswtBdst } from "../rswtReg";
|
||||
|
||||
type TableUpperProps = {
|
||||
id: string;
|
||||
@@ -33,6 +35,117 @@ type TableUpperProps = {
|
||||
const bdstBase: bdstAll[] = [];
|
||||
|
||||
|
||||
const isRainBdst = (data: any): data is customRainBdst=> {
|
||||
return data.reuseBuilding?.[0]?.rainyObj !== undefined;
|
||||
}
|
||||
|
||||
const isHtdflBdst = (data: any): data is customHtdflBdst=> {
|
||||
return data.reuseBuilding?.[0]?.htdflObj !== undefined;
|
||||
}
|
||||
|
||||
const isRswtBdst = (data: any): data is customRswtBdst =>{
|
||||
return data.reuseBuilding?.[0]?.rswtrObj !== undefined;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const makeRstr =(data:customRainBdst|customHtdflBdst|customRswtBdst) =>{
|
||||
data.rgtr = TEST_UUID;
|
||||
|
||||
let chData
|
||||
if(isRainBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
rgtr : TEST_UUID,
|
||||
rainyObj:{
|
||||
...item.rainyObj,
|
||||
rgtr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
|
||||
data.reuseBuilding=chData;
|
||||
}else if(isHtdflBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
rgtr : TEST_UUID,
|
||||
htdflObj:{
|
||||
...item.htdflObj,
|
||||
rgtr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
|
||||
data.reuseBuilding=chData;
|
||||
}else if (isRswtBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
rgtr : TEST_UUID,
|
||||
rswtrObj:{
|
||||
...item.rswtrObj,
|
||||
rgtr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
data.reuseBuilding=chData;
|
||||
}
|
||||
|
||||
if(data?.chgBuilding.length>0){
|
||||
const chRgtr = data.chgBuilding.map((item) =>({...item, rgtr:TEST_UUID}))
|
||||
data.chgBuilding =chRgtr;
|
||||
}
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
export const makeMdfr =(data:customRainBdst|customHtdflBdst|customRswtBdst) =>{
|
||||
data.mdfr = TEST_UUID;
|
||||
let chData
|
||||
if(isRainBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
mdfr : TEST_UUID,
|
||||
rainyObj:{
|
||||
...item.rainyObj,
|
||||
mdfr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
if(data?.chgBuilding.length>0){
|
||||
const chRgtr = data.chgBuilding.map((item) =>({...item, rgtr:TEST_UUID}))
|
||||
}
|
||||
|
||||
data.reuseBuilding=chData
|
||||
}else if(isHtdflBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
mdfr : TEST_UUID,
|
||||
htdflObj:{
|
||||
...item.htdflObj,
|
||||
mdfr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
data.reuseBuilding=chData;
|
||||
}else if (isRswtBdst(data)){
|
||||
chData = data.reuseBuilding.map((item) => ({
|
||||
...item,
|
||||
mdfr : TEST_UUID,
|
||||
rswtrObj:{
|
||||
...item.rswtrObj,
|
||||
mdfr:TEST_UUID
|
||||
}
|
||||
}));
|
||||
data.reuseBuilding=chData;
|
||||
}
|
||||
|
||||
if(data?.chgBuilding.length>0){
|
||||
const chMdfr = data.chgBuilding.map((item) =>({...item, mdfr:TEST_UUID}))
|
||||
data.chgBuilding =chMdfr;
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type bdstFulType = bdstState & bdstActions;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
|
||||
import { z } from "zod";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
|
||||
export const hdtflZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
@@ -13,7 +14,8 @@ export const hdtflZod = z.object({
|
||||
archChgPrmsnDt: z.date().default(() => new Date()).nullish() ,
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().nullish().default(0),
|
||||
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
reuseBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -37,7 +39,8 @@ export const hdtflZod = z.object({
|
||||
ruseFcltFlg: z.string().nullish().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
// htdflObj 매핑
|
||||
htdflObj: z
|
||||
.object({
|
||||
@@ -68,6 +71,8 @@ export const hdtflZod = z.object({
|
||||
clIonQnt: z.number().default(0),
|
||||
cdtnv: z.number().default(0),
|
||||
emsnExitTp: z.number().default(0),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
})
|
||||
.default({}),
|
||||
})
|
||||
@@ -80,6 +85,8 @@ export const hdtflZod = z.object({
|
||||
archChgPrmsnDt: z.coerce.date() ,
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
@@ -101,7 +108,7 @@ export type htdflReuseBuilding = {
|
||||
anlOperCst: number | undefined;
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
grntchBdstCertYn: string | undefined;
|
||||
grntchBdstCertYn?: string | undefined;
|
||||
grntchBdstCertYr: string | undefined;
|
||||
grntchBdstCertNo: string | undefined;
|
||||
grntchBdstCertGrd: string | undefined;
|
||||
@@ -112,14 +119,16 @@ export type htdflReuseBuilding = {
|
||||
bdstUsgCd: number | undefined;
|
||||
lawTrgtYn: string;
|
||||
htdflObj: htdflObj;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
};
|
||||
|
||||
export type htdflObj = {
|
||||
htdflFcltPk: number;
|
||||
bdstRuseFcltFk: number;
|
||||
etgtType: string;
|
||||
fclCpct: number | undefined;
|
||||
plwtYn: string;
|
||||
htdflFcltPk?: number;
|
||||
bdstRuseFcltFk?: number;
|
||||
etgtType?: string;
|
||||
fclCpct?: number | undefined;
|
||||
plwtYn?: string;
|
||||
orgwtWtritSpt: number | undefined;
|
||||
orgwtOcrnProcs: string;
|
||||
wtritEntrcTp: number | undefined;
|
||||
@@ -141,6 +150,8 @@ export type htdflObj = {
|
||||
clIonQnt: number | undefined;
|
||||
cdtnv: number | undefined;
|
||||
emsnExitTp: number | undefined;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
};
|
||||
|
||||
export type htdflFacState = {
|
||||
@@ -204,6 +215,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
},
|
||||
htdflUpdate: async (data: customHtdflBdst) => {
|
||||
try {
|
||||
const chData=await makeMdfr(data)
|
||||
const res = await putFectch("/drain/facility", data);
|
||||
if (res.ok) {
|
||||
alert(" 수정이 완료되었습니다.");
|
||||
@@ -227,6 +239,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
},
|
||||
htdflReg: async (data: customHtdflBdst) => {
|
||||
try {
|
||||
const chData=await makeRstr(data)
|
||||
const res = await postFectch("/drain/facility", data);
|
||||
if (res.ok) {
|
||||
|
||||
@@ -235,6 +248,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
|
||||
.json()
|
||||
.then((resData: any) => {
|
||||
const chPK = resData?.data?.bdstInfoPk;
|
||||
|
||||
const makeCh = resData.data.chgBuilding.map(
|
||||
(item: chgBuilding) => ({
|
||||
...item,
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { FormItem } from "@common/business_components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import type { UUID } from "crypto";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import type { customHtdflBdst } from "../htdflReg";
|
||||
import type { customRswtBdst } from "../rswtReg";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
|
||||
|
||||
export const TEST_UUID= '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e'
|
||||
|
||||
|
||||
export const rainZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
bdstInfoPk: z.number().optional(),
|
||||
ctpvCd: z.number().default(0),
|
||||
sggCd: z.number().default(0),
|
||||
daddr: z.string().default(""),
|
||||
@@ -15,6 +23,8 @@ export const rainZod = z.object({
|
||||
archChgPrmsnDt: z.coerce.date().nullish().default(null),
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
@@ -22,10 +32,10 @@ export const rainZod = z.object({
|
||||
bdstInfoFk:z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
operMngCd: z.string().optional().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
instlCstSprtAmt: z.number().nullish(),
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z.string()
|
||||
.max(4, "4자리 연도를 입력하세요")
|
||||
@@ -39,17 +49,23 @@ export const rainZod = z.object({
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
|
||||
rainyObj: z.object({
|
||||
bdstReuseFcltFk: z.number().nullish(),
|
||||
pntfColKnd: z.string().default(""),
|
||||
pntfColArea: z.number().default(0),
|
||||
dtfcltCpct: z.number().default(0),
|
||||
filtrTrtmfctCpct: z.number().default(0),
|
||||
filtrTrtmfctCpct: z.number().nullish().default(0),
|
||||
filtrTrtmfctYn: z.string().default(""),
|
||||
filtrTrtmfctPrs: z.string().default(""),
|
||||
annRnwtQty: z.number().default(0),
|
||||
oilqMeasMthd: z.string().default("").nullish()
|
||||
oilqMeasMthd: z.string().default("").nullish(),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
|
||||
|
||||
}).default({})
|
||||
})
|
||||
).default([]),
|
||||
@@ -60,6 +76,9 @@ export const rainZod = z.object({
|
||||
archChgPrmsnDt: z.coerce.date(),
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().nullish(),
|
||||
|
||||
})
|
||||
).default([])
|
||||
});
|
||||
@@ -67,22 +86,26 @@ export const rainZod = z.object({
|
||||
|
||||
|
||||
export type chgBuilding={
|
||||
bdstInfoFk: number|null,
|
||||
archChgPrmsnDt: Date,
|
||||
archChgArea: string,
|
||||
bdstChgNm: string
|
||||
bdstInfoFk?: number|null,
|
||||
archChgPrmsnDt?: Date,
|
||||
archChgArea?: string,
|
||||
bdstChgNm?: string
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
}
|
||||
|
||||
|
||||
export type bdstAll = {
|
||||
bdstInfoPk: number|null;
|
||||
bdstInfoPk?: number;
|
||||
ctpvCd: number;
|
||||
sggCd: number;
|
||||
bdstNm: string;
|
||||
daddr: string;
|
||||
frstArchPrmsnDt: Date;
|
||||
archArea: string;
|
||||
archArea: number;
|
||||
archChgArea: number;
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
reuseBuilding: rainReuseBuilding[];
|
||||
chgBuilding:chgBuilding[]
|
||||
};
|
||||
@@ -95,31 +118,35 @@ export type customRainBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
export type rainReuseBuilding = {
|
||||
lawTrgtYn: string|undefined;
|
||||
bdstUsgCd: number|undefined;
|
||||
bdstRuseFcltPk: number;
|
||||
bdstInfoFk: number;
|
||||
operMngCd: number;
|
||||
bdstRuseFcltPk?: number|null;
|
||||
bdstInfoFk: number|undefined;
|
||||
operMngCd?: number;
|
||||
anlOperCst: number;
|
||||
instlCmptnDt: Date|undefined;
|
||||
instlCst: number|undefined;
|
||||
instlCst: number;
|
||||
//archChgPrmsnDt: string;
|
||||
instlCstSprtYn: string|undefined;
|
||||
instlCstSprtAmt: number|undefined;
|
||||
instlCstSprtAmt?: number|undefined;
|
||||
grntchBdstCertYn: string|undefined;
|
||||
grntchBdstCertNo: string|undefined;
|
||||
grntchBdstCertGrd: string|undefined;
|
||||
grntchBdstCertYr: string|undefined;
|
||||
rainyObj: rainyObj | null;
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
rainyObj: rainyObj | null |undefined;
|
||||
};
|
||||
export type rainyObj = {
|
||||
bdstReuseFcltFk: number;
|
||||
pntfColKnd: string | undefined;
|
||||
pntfColArea: number | undefined;
|
||||
dtfcltCpct: number;
|
||||
filtrTrtmfctCpct: number | undefined;
|
||||
filtrTrtmfctYn: string | undefined;
|
||||
filtrTrtmfctPrs: string | undefined;
|
||||
annRnwtQty: number;
|
||||
oilqMeasMthd: string | undefined;
|
||||
bdstReuseFcltFk?: number|undefined;
|
||||
pntfColKnd?: string | undefined;
|
||||
pntfColArea?: number | undefined;
|
||||
dtfcltCpct?: number;
|
||||
filtrTrtmfctCpct?: number | undefined;
|
||||
filtrTrtmfctYn?: string | undefined;
|
||||
filtrTrtmfctPrs?: string | undefined;
|
||||
annRnwtQty?: number;
|
||||
oilqMeasMthd?: string | undefined;
|
||||
rgtr?:string|null,
|
||||
mdfr?:string|null,
|
||||
};
|
||||
|
||||
export type TableUpperProps = {
|
||||
@@ -156,9 +183,11 @@ const rainRes: customRainBdst[] = [];
|
||||
bdstNm: "",
|
||||
daddr: "",
|
||||
frstArchPrmsnDt:new Date(),
|
||||
archArea: "",
|
||||
archArea: 0,
|
||||
archChgArea: 0,
|
||||
bdstInfoPk: 0,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
reuseBuilding: [{
|
||||
rainyObj: {
|
||||
bdstReuseFcltFk: 0,
|
||||
@@ -169,7 +198,9 @@ const rainRes: customRainBdst[] = [];
|
||||
filtrTrtmfctYn: undefined,
|
||||
filtrTrtmfctPrs: undefined,
|
||||
annRnwtQty: 0,
|
||||
oilqMeasMthd: undefined
|
||||
oilqMeasMthd: undefined,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
},
|
||||
lawTrgtYn: undefined,
|
||||
bdstUsgCd: undefined,
|
||||
@@ -178,27 +209,30 @@ const rainRes: customRainBdst[] = [];
|
||||
operMngCd: 0,
|
||||
anlOperCst: 0,
|
||||
instlCmptnDt: undefined,
|
||||
instlCst: undefined,
|
||||
instlCst: 0,
|
||||
// archChgPrmsnDt: "",
|
||||
instlCstSprtYn: undefined,
|
||||
instlCstSprtAmt: undefined,
|
||||
grntchBdstCertYn: undefined,
|
||||
grntchBdstCertNo: undefined,
|
||||
grntchBdstCertGrd: undefined,
|
||||
grntchBdstCertYr: undefined
|
||||
grntchBdstCertYr: undefined,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
}],
|
||||
//추가됨
|
||||
chgBuilding:[{
|
||||
bdstInfoFk: 0,
|
||||
archChgPrmsnDt: new Date(),
|
||||
archChgArea: "-",
|
||||
bdstChgNm: ""
|
||||
bdstChgNm: "",
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const selectClass = "w-full h-full text-2xl";
|
||||
const selectYN = [
|
||||
{ text: "Y", val: "1" },
|
||||
@@ -236,6 +270,7 @@ export const rainFacStateExport: rainFacState = {
|
||||
|
||||
|
||||
|
||||
|
||||
const initFetch = async (txt:string|undefined) => {
|
||||
|
||||
const rainRes =await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
|
||||
@@ -292,7 +327,12 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
},
|
||||
rainReg: async (data: customRainBdst) => {
|
||||
try {
|
||||
const res = await postFectch("/reuseFc/rainyInfo", data);
|
||||
|
||||
const test =await makeRstr(data);
|
||||
|
||||
|
||||
console.log("test ", test)
|
||||
const res = await postFectch("/reuseFc/rainyInfo", test);
|
||||
if(res.ok){
|
||||
|
||||
if(data.chgBuilding.length > 0){
|
||||
@@ -334,8 +374,10 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
},
|
||||
rainUpdate: async (data: customRainBdst) => {
|
||||
try {
|
||||
console.log("data ", data)
|
||||
const res = await putFectch("/reuseFc/rainyInfo", data);
|
||||
|
||||
|
||||
const chData =await makeMdfr(data);
|
||||
const res = await putFectch("/reuseFc/rainyInfo", chData);
|
||||
console.log('rainUpdate', res);
|
||||
if(res.ok){
|
||||
alert(" 수정이 완료되었습니다.")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
import { rswtBdstType } from "@/app/store/common/code";
|
||||
|
||||
import { z } from "zod";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
|
||||
export const rswtZod = z.object({
|
||||
bdstInfoPk: z.number().nullish(),
|
||||
@@ -15,6 +16,8 @@ export const rswtZod = z.object({
|
||||
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
@@ -28,12 +31,12 @@ export const rswtZod = z.object({
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYn: z.string().default("N"),
|
||||
grntchBdstCertYr: z.string().max(4, "4자리 연도를 입력하세요")
|
||||
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
|
||||
.default(""),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
grntchBdstCertNo: z.string().nullish().default(""),
|
||||
grntchBdstCertGrd: z.string().nullish().default(""),
|
||||
|
||||
crgRdctYn: z.string().default(""),
|
||||
crgRdctBss: z.string().default(""),
|
||||
@@ -41,11 +44,13 @@ export const rswtZod = z.object({
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
|
||||
rswtrObj: z.object({
|
||||
bdstRuseFcltFk: z.number().nullish(),
|
||||
wtrUsqty: z.number().default(0),
|
||||
oblgTrgtWtrUsqty: z.number().default(0),
|
||||
oblgTrgtWtrUsqty: z.number().nullish().default(0),
|
||||
orgwtKndCd: z.string().default(""),
|
||||
filtrTrtmfctProcs: z.string().default(""),
|
||||
filtrTrtmfctUsgCd: z.string().default(""),
|
||||
@@ -53,7 +58,9 @@ export const rswtZod = z.object({
|
||||
altUswtrUtztnYn: z.string().default(""),
|
||||
altUswtrKndCd: z.string().default(""),
|
||||
altUswtrUtztnQnt: z.number().default(0),
|
||||
altUswtrIdntyMthdCd: z.string().default("")
|
||||
altUswtrIdntyMthdCd: z.string().default(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
}).default({})
|
||||
})
|
||||
).default([]),
|
||||
@@ -65,6 +72,8 @@ export const rswtZod = z.object({
|
||||
archChgPrmsnDt: z.coerce.date() ,
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
@@ -90,26 +99,30 @@ export type rswtReuseBuilding = {
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
bdstUsgCd: number | undefined;
|
||||
grntchBdstCertYn: string | undefined;
|
||||
grntchBdstCertNo: string | undefined;
|
||||
grntchBdstCertGrd: string | undefined;
|
||||
grntchBdstCertYr: string | undefined;
|
||||
grntchBdstCertYn: string ;
|
||||
grntchBdstCertNo?: string | undefined;
|
||||
grntchBdstCertGrd?: string | undefined;
|
||||
grntchBdstCertYr?: string | undefined;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
rswtrObj: rswtrObj | null;
|
||||
};
|
||||
export type rswtrObj = {
|
||||
bdstRuseFcltFk: number | undefined;
|
||||
wtrUsqty: number | undefined;
|
||||
oblgTrgtWtrUsqty: number | undefined;
|
||||
orgwtKndCd: string | undefined;
|
||||
filtrTrtmfctProcs: string | undefined;
|
||||
filtrTrtmfctUsgCd: string | undefined;
|
||||
rswtrUsqty: number;
|
||||
altUswtrUtztnYn: string;
|
||||
altUswtrKndCd: string;
|
||||
altUswtrUtztnQnt: number;
|
||||
altUswtrIdntyMthdCd: string;
|
||||
};
|
||||
|
||||
bdstRuseFcltFk?: number | undefined;
|
||||
wtrUsqty?: number | undefined;
|
||||
oblgTrgtWtrUsqty?: number ;
|
||||
orgwtKndCd?: string | undefined;
|
||||
filtrTrtmfctProcs?: string | undefined;
|
||||
filtrTrtmfctUsgCd?: string | undefined;
|
||||
rswtrUsqty?: number;
|
||||
altUswtrUtztnYn?: string;
|
||||
altUswtrKndCd?: string;
|
||||
altUswtrUtztnQnt?: number;
|
||||
|
||||
altUswtrIdntyMthdCd?: string;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
}
|
||||
|
||||
const rswtRes: customRswtBdst[] = [];
|
||||
|
||||
@@ -169,7 +182,8 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
},
|
||||
rswtUpdate: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", data);
|
||||
const chData=await makeMdfr(data)
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
@@ -189,7 +203,8 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
},
|
||||
rswtReg: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", data);
|
||||
const chData=await makeRstr(data)
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", chData);
|
||||
if(res.ok){
|
||||
if(data.chgBuilding.length > 0){
|
||||
await res
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
|
||||
const LOCAL_PORT = "3000";
|
||||
const DEV_PORT = "11080";
|
||||
|
||||
const DEV_PORT_NEW="8882"
|
||||
|
||||
const DEV_PORT_FO = "11082"; // common
|
||||
|
||||
export const LOCAL_URL_WR = `http://localhost:${LOCAL_PORT}/api/v1`;
|
||||
export const DEV_URL_WR = `http://con.mind-one.co.kr:${DEV_PORT}/api/v1`;
|
||||
|
||||
export const DEV_URL_FO = `http://con.mind-one.co.kr:${DEV_PORT_FO}/api/v1`;
|
||||
|
||||
|
||||
//export const DEV_URL_FO = `http://con.mind-one.co.kr:${DEV_PORT_FO}/api/v1`;
|
||||
export const DEV_URL_FO = `http://192.168.1.193:${DEV_PORT_NEW}/api/v1`;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
rainZod,
|
||||
selectClass,
|
||||
TEST_UUID,
|
||||
type customRainBdst,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { DatePicker, FormUi } from "@common/business_components";
|
||||
@@ -70,7 +71,7 @@ export function RainRegForm({
|
||||
function onSubmit(values: z.infer<typeof rainZod>) {
|
||||
|
||||
if (isModal) {
|
||||
// regRainForm.bdstInfoPk = null;
|
||||
|
||||
rainReg(values);
|
||||
} else {
|
||||
rainUpdate(values);
|
||||
|
||||
Reference in New Issue
Block a user