견적서 BOM API 개발
This commit is contained in:
parent
1702e44a12
commit
5525a49fc6
@ -1,6 +1,7 @@
|
|||||||
package com.interplug.qcast.biz.displayItem;
|
package com.interplug.qcast.biz.displayItem;
|
||||||
|
|
||||||
import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest;
|
import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest;
|
||||||
|
import com.interplug.qcast.biz.displayItem.dto.ItemDetailResponse;
|
||||||
import com.interplug.qcast.biz.displayItem.dto.ItemResponse;
|
import com.interplug.qcast.biz.displayItem.dto.ItemResponse;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -37,7 +38,7 @@ public class DisplayItemController {
|
|||||||
@Operation(description = "제품 상세 정보를 조회한다.")
|
@Operation(description = "제품 상세 정보를 조회한다.")
|
||||||
@GetMapping("/item-detail")
|
@GetMapping("/item-detail")
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public ItemResponse getItemDetail(@RequestParam("itemId") String itemId) throws Exception {
|
public ItemDetailResponse getItemDetail(@RequestParam("itemId") String itemId) throws Exception {
|
||||||
return displayItemService.getItemDetail(itemId);
|
return displayItemService.getItemDetail(itemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,9 @@ public interface DisplayItemMapper {
|
|||||||
|
|
||||||
List<ItemResponse> getItemList(@Param("saleStoreId") String saleStoreId);
|
List<ItemResponse> getItemList(@Param("saleStoreId") String saleStoreId);
|
||||||
|
|
||||||
ItemResponse getItemDetail(@Param("itemId") String itemId);
|
ItemDetailResponse getItemDetail(@Param("itemId") String itemId);
|
||||||
|
|
||||||
|
List<ItemResponse> selectItemBomList(@Param("itemId") String itemId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 아이템 정보 동기화
|
* 아이템 정보 동기화
|
||||||
|
|||||||
@ -45,11 +45,18 @@ public class DisplayItemService {
|
|||||||
* @param itemId
|
* @param itemId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ItemResponse getItemDetail(String itemId) {
|
public ItemDetailResponse getItemDetail(String itemId) {
|
||||||
|
|
||||||
ItemResponse itemResponse = displayItemMapper.getItemDetail(itemId);
|
ItemDetailResponse itemDetailResponse = displayItemMapper.getItemDetail(itemId);
|
||||||
|
|
||||||
|
if (itemDetailResponse != null) {
|
||||||
|
// BOM 헤더 아이템인 경우 BOM List를 내려준다.
|
||||||
|
if ("ERLA".equals(itemDetailResponse.getItemCtgGr())) {
|
||||||
|
List<ItemResponse> itemBomList = displayItemMapper.selectItemBomList(itemId);
|
||||||
|
|
||||||
|
itemDetailResponse.setItemBomList(itemBomList);
|
||||||
|
}
|
||||||
|
|
||||||
if (itemResponse != null) {
|
|
||||||
// 견적특이사항 관련 데이터 셋팅
|
// 견적특이사항 관련 데이터 셋팅
|
||||||
String[] arrItemId = {itemId};
|
String[] arrItemId = {itemId};
|
||||||
|
|
||||||
@ -64,10 +71,10 @@ public class DisplayItemService {
|
|||||||
spnAttrCds += noteResponse.getCode();
|
spnAttrCds += noteResponse.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
itemResponse.setSpnAttrCds(spnAttrCds);
|
itemDetailResponse.setSpnAttrCds(spnAttrCds);
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemResponse;
|
return itemDetailResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.interplug.qcast.biz.displayItem.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ItemDetailResponse {
|
||||||
|
|
||||||
|
@Schema(description = "Itme Id")
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
|
@Schema(description = "Item No")
|
||||||
|
private String itemNo;
|
||||||
|
|
||||||
|
@Schema(description = "Item Name")
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
@Schema(description = "Goods No")
|
||||||
|
private String goodsNo;
|
||||||
|
|
||||||
|
@Schema(description = "Unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "Specification")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
@Schema(description = "pnow_w")
|
||||||
|
private String pnowW;
|
||||||
|
|
||||||
|
@Schema(description = "Item Group")
|
||||||
|
private String itemGroup;
|
||||||
|
|
||||||
|
@Schema(description = "Module Flag")
|
||||||
|
private String moduleFlg;
|
||||||
|
|
||||||
|
@Schema(description = "PKG Material Flag")
|
||||||
|
private String pkgMaterialFlg;
|
||||||
|
|
||||||
|
@Schema(description = "File Upload Flag")
|
||||||
|
private String fileUploadFlg;
|
||||||
|
|
||||||
|
@Schema(description = "Sale Price")
|
||||||
|
private String salePrice;
|
||||||
|
|
||||||
|
@Schema(description = "Item Ctg Group")
|
||||||
|
private String itemCtgGr;
|
||||||
|
|
||||||
|
@Schema(description = "견적 특이사항 코드")
|
||||||
|
private String spnAttrCds;
|
||||||
|
|
||||||
|
@Schema(description = "Bom 목록")
|
||||||
|
List<ItemResponse> itemBomList;
|
||||||
|
}
|
||||||
@ -42,6 +42,12 @@ public class ItemResponse {
|
|||||||
@Schema(description = "Sale Price")
|
@Schema(description = "Sale Price")
|
||||||
private String salePrice;
|
private String salePrice;
|
||||||
|
|
||||||
|
@Schema(description = "Item Ctg Group")
|
||||||
|
private String itemCtgGr;
|
||||||
|
|
||||||
|
@Schema(description = "Bom Amount")
|
||||||
|
private String bomAmount;
|
||||||
|
|
||||||
@Schema(description = "견적 특이사항 코드")
|
@Schema(description = "견적 특이사항 코드")
|
||||||
private String spnAttrCds;
|
private String spnAttrCds;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,9 @@ public interface EstimateMapper {
|
|||||||
// 아이템 마스터 목록 조회
|
// 아이템 마스터 목록 조회
|
||||||
public List<ItemResponse> selectItemMasterList(EstimateRequest estimateRequest);
|
public List<ItemResponse> selectItemMasterList(EstimateRequest estimateRequest);
|
||||||
|
|
||||||
|
// 아이템 마스터 BOM 목록 조회
|
||||||
|
public List<ItemResponse> selectItemMasterBomList(String itemId);
|
||||||
|
|
||||||
// 견적서 지붕재 인증용량 조회
|
// 견적서 지붕재 인증용량 조회
|
||||||
public String selectEstimateRoofCertVolKw(EstimateRequest estimateRequest);
|
public String selectEstimateRoofCertVolKw(EstimateRequest estimateRequest);
|
||||||
|
|
||||||
|
|||||||
@ -345,10 +345,13 @@ public class EstimateService {
|
|||||||
estimateRequest.setArrItemId(arrItemId);
|
estimateRequest.setArrItemId(arrItemId);
|
||||||
// 아이템의 마스터 정보 및 정가 정보 조회
|
// 아이템의 마스터 정보 및 정가 정보 조회
|
||||||
List<ItemResponse> itemResponseList = estimateMapper.selectItemMasterList(estimateRequest);
|
List<ItemResponse> itemResponseList = estimateMapper.selectItemMasterList(estimateRequest);
|
||||||
|
// BOM 정보 목록
|
||||||
|
List<ItemRequest> estimateBomList = new ArrayList<ItemRequest>();
|
||||||
|
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for (ItemRequest itemRequest : itemList) {
|
for (ItemRequest itemRequest : itemList) {
|
||||||
itemRequest.setDispOrder(String.valueOf(j++));
|
int dispOrder = 100 * j++;
|
||||||
|
itemRequest.setDispOrder(String.valueOf(dispOrder));
|
||||||
|
|
||||||
for (ItemResponse itemResponse : itemResponseList) {
|
for (ItemResponse itemResponse : itemResponseList) {
|
||||||
if (itemRequest.getItemId().equals(itemResponse.getItemId())) {
|
if (itemRequest.getItemId().equals(itemResponse.getItemId())) {
|
||||||
@ -362,11 +365,52 @@ public class EstimateService {
|
|||||||
itemRequest.setFileUploadFlg(itemResponse.getFileUploadFlg());
|
itemRequest.setFileUploadFlg(itemResponse.getFileUploadFlg());
|
||||||
itemRequest.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
|
itemRequest.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
|
||||||
itemRequest.setItemGroup(itemResponse.getItemGroup());
|
itemRequest.setItemGroup(itemResponse.getItemGroup());
|
||||||
|
itemRequest.setItemCtgGr(itemResponse.getItemCtgGr());
|
||||||
itemRequest.setPartAdd("0");
|
itemRequest.setPartAdd("0");
|
||||||
itemRequest.setDelFlg("0");
|
itemRequest.setDelFlg("0");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 아이템 BOM Header인 경우 컴포넌트 등록 처리
|
||||||
|
if ("ERLA".equals(itemRequest.getItemCtgGr())) {
|
||||||
|
List<ItemResponse> itemBomList =
|
||||||
|
estimateMapper.selectItemMasterBomList(itemRequest.getItemId());
|
||||||
|
|
||||||
|
int k = 1;
|
||||||
|
for (ItemResponse itemResponse : itemBomList) {
|
||||||
|
ItemRequest bomItem = new ItemRequest();
|
||||||
|
|
||||||
|
bomItem.setPaDispOrder(String.valueOf(dispOrder));
|
||||||
|
bomItem.setDispOrder(String.valueOf(dispOrder + k++));
|
||||||
|
bomItem.setItemId(itemResponse.getItemId());
|
||||||
|
bomItem.setItemNo(itemResponse.getItemNo());
|
||||||
|
bomItem.setItemName(itemResponse.getItemName());
|
||||||
|
bomItem.setUnit(itemResponse.getUnit());
|
||||||
|
bomItem.setPnowW(itemResponse.getPnowW());
|
||||||
|
bomItem.setSpecification(itemResponse.getPnowW());
|
||||||
|
bomItem.setAmount(
|
||||||
|
String.valueOf(
|
||||||
|
Integer.parseInt(itemResponse.getBomAmount())
|
||||||
|
* Integer.parseInt(itemRequest.getAmount())));
|
||||||
|
bomItem.setBomAmount(itemResponse.getBomAmount());
|
||||||
|
bomItem.setUnitPrice(itemResponse.getSalePrice());
|
||||||
|
bomItem.setSalePrice(itemResponse.getSalePrice());
|
||||||
|
bomItem.setFileUploadFlg(itemResponse.getFileUploadFlg());
|
||||||
|
bomItem.setPkgMaterialFlg(itemResponse.getPkgMaterialFlg());
|
||||||
|
bomItem.setItemGroup(itemResponse.getItemGroup());
|
||||||
|
bomItem.setItemCtgGr(itemResponse.getItemCtgGr());
|
||||||
|
bomItem.setPartAdd("0");
|
||||||
|
bomItem.setDelFlg("0");
|
||||||
|
|
||||||
|
estimateBomList.add(bomItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BOM 컴포넌트 추가
|
||||||
|
for (ItemRequest estimateBom : estimateBomList) {
|
||||||
|
itemList.add(estimateBom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [4]. 견적특이사항 관련 데이터 셋팅
|
// [4]. 견적특이사항 관련 데이터 셋팅
|
||||||
@ -438,6 +482,11 @@ public class EstimateService {
|
|||||||
String moduleModel = "";
|
String moduleModel = "";
|
||||||
String pcTypeNo = "";
|
String pcTypeNo = "";
|
||||||
for (ItemRequest itemRequest : itemList) {
|
for (ItemRequest itemRequest : itemList) {
|
||||||
|
if (StringUtils.isEmpty(itemRequest.getDispOrder())) {
|
||||||
|
throw new QcastException(
|
||||||
|
ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Display Order"));
|
||||||
|
}
|
||||||
if (StringUtils.isEmpty(itemRequest.getItemId())) {
|
if (StringUtils.isEmpty(itemRequest.getItemId())) {
|
||||||
throw new QcastException(
|
throw new QcastException(
|
||||||
ErrorCode.INVALID_INPUT_VALUE,
|
ErrorCode.INVALID_INPUT_VALUE,
|
||||||
@ -516,12 +565,12 @@ public class EstimateService {
|
|||||||
|
|
||||||
// 견적서 아이템 신규 추가
|
// 견적서 아이템 신규 추가
|
||||||
String hisNo = estimateMapper.selectEstimateItemHisNo(estimateRequest); // 아이템 히스토리 번호 조회
|
String hisNo = estimateMapper.selectEstimateItemHisNo(estimateRequest); // 아이템 히스토리 번호 조회
|
||||||
int j = 1, k = 1;
|
|
||||||
for (ItemRequest itemRequest : itemList) {
|
for (ItemRequest itemRequest : itemList) {
|
||||||
itemRequest.setHisNo(hisNo);
|
itemRequest.setHisNo(hisNo);
|
||||||
itemRequest.setObjectNo(estimateRequest.getObjectNo());
|
itemRequest.setObjectNo(estimateRequest.getObjectNo());
|
||||||
itemRequest.setPlanNo(estimateRequest.getPlanNo());
|
itemRequest.setPlanNo(estimateRequest.getPlanNo());
|
||||||
itemRequest.setDispOrder(String.valueOf(k++));
|
itemRequest.setBomAmount(
|
||||||
|
!StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0");
|
||||||
itemRequest.setPartAdd(
|
itemRequest.setPartAdd(
|
||||||
!StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0");
|
!StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0");
|
||||||
itemRequest.setItemChangeFlg(
|
itemRequest.setItemChangeFlg(
|
||||||
@ -533,8 +582,6 @@ public class EstimateService {
|
|||||||
estimateMapper.insertEstimateItemHis(itemRequest);
|
estimateMapper.insertEstimateItemHis(itemRequest);
|
||||||
|
|
||||||
if (!"1".equals(itemRequest.getDelFlg())) {
|
if (!"1".equals(itemRequest.getDelFlg())) {
|
||||||
itemRequest.setDispOrder(String.valueOf(j++));
|
|
||||||
|
|
||||||
estimateMapper.insertEstimateItem(itemRequest);
|
estimateMapper.insertEstimateItem(itemRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -738,6 +785,10 @@ public class EstimateService {
|
|||||||
for (ItemResponse itemResponse : estimateItemList) {
|
for (ItemResponse itemResponse : estimateItemList) {
|
||||||
itemResponse.setNo(String.valueOf(j++));
|
itemResponse.setNo(String.valueOf(j++));
|
||||||
|
|
||||||
|
System.out.println(">>>>>>>>>" + itemResponse.getSalePrice());
|
||||||
|
System.out.println(">>>>>>>>>" + itemResponse.getAmount());
|
||||||
|
System.out.println(">>>>>>>>>" + itemResponse.getSaleTotPrice());
|
||||||
|
|
||||||
// 문자열 통화로 변환 처리
|
// 문자열 통화로 변환 처리
|
||||||
itemResponse.setSalePrice(
|
itemResponse.setSalePrice(
|
||||||
String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice())));
|
String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice())));
|
||||||
@ -902,26 +953,29 @@ public class EstimateService {
|
|||||||
// 아이템 단가 합산
|
// 아이템 단가 합산
|
||||||
itemResponse.setSaleTotPrice(String.valueOf(salePrice.multiply(amount)));
|
itemResponse.setSaleTotPrice(String.valueOf(salePrice.multiply(amount)));
|
||||||
|
|
||||||
// YJSS인 경우 (PKG 단가 * 모듈용량) + 패키지 제외상품 총 합산
|
// 컴포넌트는 제외하고 계산
|
||||||
// YJOD인 경우 모든 아이템의 총 합산
|
if (StringUtils.isEmpty(itemResponse.getPaDispOrder())) {
|
||||||
if ("YJSS".equals(estimateType)) {
|
// YJSS인 경우 (PKG 단가 * 모듈용량) + 패키지 제외상품 총 합산
|
||||||
if ("1".equals(itemResponse.getPkgMaterialFlg())) { // 패키지 제외상품 여부(1)
|
// YJOD인 경우 모든 아이템의 총 합산
|
||||||
supplyPrice = supplyPrice.add(salePrice.multiply(amount));
|
if ("YJSS".equals(estimateType)) {
|
||||||
|
if ("1".equals(itemResponse.getPkgMaterialFlg())) { // 패키지 제외상품 여부(1)
|
||||||
|
supplyPrice = supplyPrice.add(salePrice.multiply(amount));
|
||||||
|
} else {
|
||||||
|
if ("1".equals(itemResponse.getModuleFlg())) {
|
||||||
|
totVol = totVol.add(pnowW.multiply(amount));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ("1".equals(itemResponse.getModuleFlg())) {
|
if ("1".equals(itemResponse.getModuleFlg())) {
|
||||||
totVol = totVol.add(pnowW.multiply(amount));
|
totVol = totVol.add(pnowW.multiply(amount));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
supplyPrice = supplyPrice.add(salePrice.multiply(amount));
|
||||||
if ("1".equals(itemResponse.getModuleFlg())) {
|
|
||||||
totVol = totVol.add(pnowW.multiply(amount));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
supplyPrice = supplyPrice.add(salePrice.multiply(amount));
|
// 주문수량 더하기
|
||||||
|
totAmount = totAmount.add(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 주문수량 더하기
|
|
||||||
totAmount = totAmount.add(amount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("YJSS".equals(estimateType)) {
|
if ("YJSS".equals(estimateType)) {
|
||||||
|
|||||||
@ -20,9 +20,12 @@ public class ItemRequest {
|
|||||||
@Schema(description = "아이템 ID")
|
@Schema(description = "아이템 ID")
|
||||||
private String itemId;
|
private String itemId;
|
||||||
|
|
||||||
@Schema(description = "정렬순서")
|
@Schema(description = "정렬번호")
|
||||||
private String dispOrder;
|
private String dispOrder;
|
||||||
|
|
||||||
|
@Schema(description = "부모 정렬번호")
|
||||||
|
private String paDispOrder;
|
||||||
|
|
||||||
@Schema(description = "아이템 번호")
|
@Schema(description = "아이템 번호")
|
||||||
private String itemNo;
|
private String itemNo;
|
||||||
|
|
||||||
@ -38,6 +41,9 @@ public class ItemRequest {
|
|||||||
@Schema(description = "수량")
|
@Schema(description = "수량")
|
||||||
private String amount;
|
private String amount;
|
||||||
|
|
||||||
|
@Schema(description = "BOM 수량")
|
||||||
|
private String bomAmount;
|
||||||
|
|
||||||
@Schema(description = "변경수량")
|
@Schema(description = "변경수량")
|
||||||
private String amountChange;
|
private String amountChange;
|
||||||
|
|
||||||
@ -71,6 +77,9 @@ public class ItemRequest {
|
|||||||
@Schema(description = "아이템 그룹코드")
|
@Schema(description = "아이템 그룹코드")
|
||||||
private String itemGroup;
|
private String itemGroup;
|
||||||
|
|
||||||
|
@Schema(description = "아이템 CTG 그룹코드")
|
||||||
|
private String itemCtgGr;
|
||||||
|
|
||||||
@Schema(description = "히스토리 번호")
|
@Schema(description = "히스토리 번호")
|
||||||
private String hisNo;
|
private String hisNo;
|
||||||
|
|
||||||
|
|||||||
@ -14,9 +14,12 @@ public class ItemResponse {
|
|||||||
@Schema(description = "플랜번호")
|
@Schema(description = "플랜번호")
|
||||||
private String planNo;
|
private String planNo;
|
||||||
|
|
||||||
@Schema(description = "노출번호")
|
@Schema(description = "정렬번호")
|
||||||
private String dispOrder;
|
private String dispOrder;
|
||||||
|
|
||||||
|
@Schema(description = "부모 정렬번호")
|
||||||
|
private String paDispOrder;
|
||||||
|
|
||||||
@Schema(description = "번호")
|
@Schema(description = "번호")
|
||||||
private String no;
|
private String no;
|
||||||
|
|
||||||
@ -38,6 +41,9 @@ public class ItemResponse {
|
|||||||
@Schema(description = "수량")
|
@Schema(description = "수량")
|
||||||
private String amount;
|
private String amount;
|
||||||
|
|
||||||
|
@Schema(description = "BOM 수량")
|
||||||
|
private String bomAmount;
|
||||||
|
|
||||||
@Schema(description = "단가")
|
@Schema(description = "단가")
|
||||||
private String salePrice;
|
private String salePrice;
|
||||||
|
|
||||||
@ -65,6 +71,9 @@ public class ItemResponse {
|
|||||||
@Schema(description = "아이템 그룹코드")
|
@Schema(description = "아이템 그룹코드")
|
||||||
private String itemGroup;
|
private String itemGroup;
|
||||||
|
|
||||||
|
@Schema(description = "아이템 CTG 그룹코드")
|
||||||
|
private String itemCtgGr;
|
||||||
|
|
||||||
@Schema(description = "모듈여부")
|
@Schema(description = "모듈여부")
|
||||||
private String moduleFlg;
|
private String moduleFlg;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
ORDER BY TT.DISP_ORDER
|
ORDER BY TT.DISP_ORDER
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getItemDetail" parameterType="String" resultType="com.interplug.qcast.biz.displayItem.dto.ItemResponse" >
|
<select id="getItemDetail" parameterType="String" resultType="com.interplug.qcast.biz.displayItem.dto.ItemDetailResponse" >
|
||||||
/* sqlid : com.interplug.qcast.displayItem.getItemDetail */
|
/* sqlid : com.interplug.qcast.displayItem.getItemDetail */
|
||||||
SELECT
|
SELECT
|
||||||
MI.ITEM_ID
|
MI.ITEM_ID
|
||||||
@ -96,6 +96,7 @@
|
|||||||
, MI.MODULE_FLG
|
, MI.MODULE_FLG
|
||||||
, MI.PKG_MATERIAL_FLG
|
, MI.PKG_MATERIAL_FLG
|
||||||
, MI.FILE_UPLOAD_FLG
|
, MI.FILE_UPLOAD_FLG
|
||||||
|
, MI.ITEM_CTG_GR
|
||||||
, ISNULL(MPPM.SALE_PRICE, '0') AS SALE_PRICE
|
, ISNULL(MPPM.SALE_PRICE, '0') AS SALE_PRICE
|
||||||
FROM M_ITEM MI
|
FROM M_ITEM MI
|
||||||
LEFT OUTER JOIN M_PRICE_PATTERN_MONEY MPPM
|
LEFT OUTER JOIN M_PRICE_PATTERN_MONEY MPPM
|
||||||
@ -105,6 +106,30 @@
|
|||||||
AND MI.ITEM_ID = #{itemId}
|
AND MI.ITEM_ID = #{itemId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectItemBomList" parameterType="String" resultType="com.interplug.qcast.biz.displayItem.dto.ItemResponse" >
|
||||||
|
/* sqlid : com.interplug.qcast.displayItem.selectItemBomList */
|
||||||
|
SELECT
|
||||||
|
PI.ITEM_ID
|
||||||
|
, PI.AMOUNT AS BOM_AMOUNT
|
||||||
|
, MI.ITEM_NO
|
||||||
|
, MI.ITEM_NAME
|
||||||
|
, MI.GOODS_NO
|
||||||
|
, MI.UNIT
|
||||||
|
, MI.PNOW_W AS SPECIFICATION
|
||||||
|
, MI.PNOW_W
|
||||||
|
, MI.ITEM_GROUP
|
||||||
|
, MI.MODULE_FLG
|
||||||
|
, MI.PKG_MATERIAL_FLG
|
||||||
|
, MI.FILE_UPLOAD_FLG
|
||||||
|
, MI.ITEM_CTG_GR
|
||||||
|
, '0' AS SALE_PRICE
|
||||||
|
FROM M_PACKAGE_ITEM PI WITH (NOLOCK)
|
||||||
|
INNER JOIN M_ITEM MI WITH (NOLOCK)
|
||||||
|
ON PI.ITEM_ID = MI.ITEM_ID
|
||||||
|
WHERE PI.PACKAGE_ITEM_ID = #{itemId}
|
||||||
|
AND MI.DEL_FLG = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="setItemSyncSave" parameterType="com.interplug.qcast.biz.displayItem.dto.ItemSyncResponse" >
|
<insert id="setItemSyncSave" parameterType="com.interplug.qcast.biz.displayItem.dto.ItemSyncResponse" >
|
||||||
/* sqlid : com.interplug.qcast.displayItem.setItemSyncSave */
|
/* sqlid : com.interplug.qcast.displayItem.setItemSyncSave */
|
||||||
MERGE M_ITEM AS A
|
MERGE M_ITEM AS A
|
||||||
|
|||||||
@ -169,12 +169,14 @@
|
|||||||
PE.OBJECT_NO
|
PE.OBJECT_NO
|
||||||
, PE.PLAN_NO
|
, PE.PLAN_NO
|
||||||
, PE.DISP_ORDER
|
, PE.DISP_ORDER
|
||||||
|
, PE.PA_DISP_ORDER
|
||||||
, PE.ITEM_ID
|
, PE.ITEM_ID
|
||||||
, PE.ITEM_NO
|
, PE.ITEM_NO
|
||||||
, PE.ITEM_NAME
|
, PE.ITEM_NAME
|
||||||
, PE.UNIT
|
, PE.UNIT
|
||||||
, PE.SPECIFICATION
|
, PE.SPECIFICATION
|
||||||
, PE.AMOUNT
|
, PE.AMOUNT
|
||||||
|
, PE.BOM_AMOUNT
|
||||||
, PE.UNIT_PRICE
|
, PE.UNIT_PRICE
|
||||||
, PE.SALE_PRICE
|
, PE.SALE_PRICE
|
||||||
, PE.FILE_UPLOAD_FLG
|
, PE.FILE_UPLOAD_FLG
|
||||||
@ -204,6 +206,7 @@
|
|||||||
, I.ITEM_GROUP
|
, I.ITEM_GROUP
|
||||||
, I.PKG_MATERIAL_FLG
|
, I.PKG_MATERIAL_FLG
|
||||||
, I.FILE_UPLOAD_FLG
|
, I.FILE_UPLOAD_FLG
|
||||||
|
, I.ITEM_CTG_GR
|
||||||
, ISNULL(PPM.SALE_PRICE, '0') AS SALE_PRICE
|
, ISNULL(PPM.SALE_PRICE, '0') AS SALE_PRICE
|
||||||
FROM M_ITEM I WITH (NOLOCK)
|
FROM M_ITEM I WITH (NOLOCK)
|
||||||
LEFT OUTER JOIN M_PRICE_PATTERN_MONEY PPM
|
LEFT OUTER JOIN M_PRICE_PATTERN_MONEY PPM
|
||||||
@ -215,6 +218,27 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectItemMasterBomList" parameterType="String" resultType="com.interplug.qcast.biz.estimate.dto.ItemResponse">
|
||||||
|
/* sqlid : com.interplug.qcast.displayItem.selectItemBomList */
|
||||||
|
SELECT
|
||||||
|
PI.ITEM_ID
|
||||||
|
, PI.AMOUNT AS BOM_AMOUNT
|
||||||
|
, I.ITEM_NO
|
||||||
|
, I.ITEM_NAME
|
||||||
|
, I.UNIT
|
||||||
|
, I.PNOW_W
|
||||||
|
, I.ITEM_GROUP
|
||||||
|
, I.PKG_MATERIAL_FLG
|
||||||
|
, I.FILE_UPLOAD_FLG
|
||||||
|
, I.ITEM_CTG_GR
|
||||||
|
, '0' AS SALE_PRICE
|
||||||
|
FROM M_PACKAGE_ITEM PI WITH (NOLOCK)
|
||||||
|
INNER JOIN M_ITEM I WITH (NOLOCK)
|
||||||
|
ON PI.ITEM_ID = I.ITEM_ID
|
||||||
|
WHERE PI.PACKAGE_ITEM_ID = #{itemId}
|
||||||
|
AND I.DEL_FLG = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectEstimateRoofCertVolKw" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="String">
|
<select id="selectEstimateRoofCertVolKw" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="String">
|
||||||
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateRoofCertVolKw */
|
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateRoofCertVolKw */
|
||||||
SELECT
|
SELECT
|
||||||
@ -522,12 +546,16 @@
|
|||||||
OBJECT_NO
|
OBJECT_NO
|
||||||
, PLAN_NO
|
, PLAN_NO
|
||||||
, DISP_ORDER
|
, DISP_ORDER
|
||||||
|
<if test='paDispOrder != null and paDispOrder != ""'>
|
||||||
|
, PA_DISP_ORDER
|
||||||
|
</if>
|
||||||
, ITEM_ID
|
, ITEM_ID
|
||||||
, ITEM_NO
|
, ITEM_NO
|
||||||
, ITEM_NAME
|
, ITEM_NAME
|
||||||
, UNIT
|
, UNIT
|
||||||
, SPECIFICATION
|
, SPECIFICATION
|
||||||
, AMOUNT
|
, AMOUNT
|
||||||
|
, BOM_AMOUNT
|
||||||
<if test='amountChange != null and amountChange != ""'>
|
<if test='amountChange != null and amountChange != ""'>
|
||||||
, AMOUNT_CHANGE
|
, AMOUNT_CHANGE
|
||||||
</if>
|
</if>
|
||||||
@ -536,22 +564,26 @@
|
|||||||
, LAST_EDIT_USER
|
, LAST_EDIT_USER
|
||||||
, UNIT_PRICE
|
, UNIT_PRICE
|
||||||
, SALE_PRICE
|
, SALE_PRICE
|
||||||
, FILE_UPLOAD_FLG
|
|
||||||
, PKG_MATERIAL_FLG
|
|
||||||
<if test='specialNoteCd != null and specialNoteCd != ""'>
|
<if test='specialNoteCd != null and specialNoteCd != ""'>
|
||||||
, SPECIAL_NOTE_CD
|
, SPECIAL_NOTE_CD
|
||||||
</if>
|
</if>
|
||||||
|
, FILE_UPLOAD_FLG
|
||||||
|
, PKG_MATERIAL_FLG
|
||||||
, ITEM_CHANGE_FLG
|
, ITEM_CHANGE_FLG
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{objectNo}
|
#{objectNo}
|
||||||
, #{planNo}
|
, #{planNo}
|
||||||
, #{dispOrder}
|
, #{dispOrder}
|
||||||
|
<if test='paDispOrder != null and paDispOrder != ""'>
|
||||||
|
, #{paDispOrder}
|
||||||
|
</if>
|
||||||
, #{itemId}
|
, #{itemId}
|
||||||
, #{itemNo}
|
, #{itemNo}
|
||||||
, #{itemName}
|
, #{itemName}
|
||||||
, #{unit}
|
, #{unit}
|
||||||
, #{specification}
|
, #{specification}
|
||||||
, #{amount}
|
, #{amount}
|
||||||
|
, #{bomAmount}
|
||||||
<if test='amountChange != null and amountChange != ""'>
|
<if test='amountChange != null and amountChange != ""'>
|
||||||
, #{amountChange}
|
, #{amountChange}
|
||||||
</if>
|
</if>
|
||||||
@ -560,11 +592,11 @@
|
|||||||
, #{userId}
|
, #{userId}
|
||||||
, #{unitPrice}
|
, #{unitPrice}
|
||||||
, #{salePrice}
|
, #{salePrice}
|
||||||
, #{fileUploadFlg}
|
|
||||||
, #{pkgMaterialFlg}
|
|
||||||
<if test='specialNoteCd != null and specialNoteCd != ""'>
|
<if test='specialNoteCd != null and specialNoteCd != ""'>
|
||||||
, #{specialNoteCd}
|
, #{specialNoteCd}
|
||||||
</if>
|
</if>
|
||||||
|
, #{fileUploadFlg}
|
||||||
|
, #{pkgMaterialFlg}
|
||||||
, #{itemChangeFlg}
|
, #{itemChangeFlg}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user