|
@@ -4,6 +4,7 @@ package com.oqpo.api.service.oper;
|
4
|
4
|
import com.oqpo.api.entity.oper.MainChartEntity;
|
5
|
5
|
import com.oqpo.api.mapper.oper.MainChartMapper;
|
6
|
6
|
import com.oqpo.api.service.CommonService;
|
|
7
|
+import com.oqpo.api.util.StringUtil;
|
7
|
8
|
import com.oqpo.api.web.dto.response.oper.mainchart.ChartResponse;
|
8
|
9
|
import lombok.extern.slf4j.Slf4j;
|
9
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -29,11 +30,20 @@ public class MainChartService extends CommonService {
|
29
|
30
|
return result;
|
30
|
31
|
}
|
31
|
32
|
|
32
|
|
- public ChartResponse selectPchOdrChart(String brandId, String storeId, String poType) throws Exception {
|
33
|
|
- MainChartEntity entity = mainChartMapper.selectPchOdrChart(brandId, storeId, poType);
|
|
33
|
+ public ChartResponse selectPchOdrChart(String brandId, String storeId, String spplyId, String poType) throws Exception {
|
|
34
|
+ String chartData = null;
|
34
|
35
|
|
35
|
|
- String chartData = "[ [' ', '요청', '진행', '취소'], [' ', " + entity.getPo20Val() + " , " + entity.getPo30Val() + " , " + entity.getPo99Val() + "] ]";
|
|
36
|
+ if (StringUtil.isEmpty(spplyId)) {
|
|
37
|
+ // 브랜드/매장
|
|
38
|
+ MainChartEntity entity = mainChartMapper.selectPchOdrChart(brandId, storeId, spplyId, poType);
|
|
39
|
+ chartData = "[ [' ', '요청', '진행', '취소'], [' ', " + entity.getPo20Val() + " , " + entity.getPo30Val() + " , " + entity.getPo99Val() + "] ]";
|
|
40
|
+ } else {
|
|
41
|
+ // 공급사
|
|
42
|
+ MainChartEntity entity = mainChartMapper.selectPchOdrChart(brandId, storeId, spplyId, poType); // 수주대상
|
|
43
|
+ MainChartEntity deliEntity = mainChartMapper.selectDeliChart(brandId, storeId, spplyId, poType, "DLV0", "dlv_reg_dt"); // 납품서생성 (납품서생성/납품생성일자 비교)
|
36
|
44
|
|
|
45
|
+ chartData = "[ [' ', '수주대상', '납품서생성'], [' ', " + entity.getPo20Val() + " , " + deliEntity.getDlvVal() + "] ]";
|
|
46
|
+ }
|
37
|
47
|
ChartResponse result = new ChartResponse();
|
38
|
48
|
result.setChartData(chartData);
|
39
|
49
|
return result;
|
|
@@ -85,4 +95,27 @@ public class MainChartService extends CommonService {
|
85
|
95
|
return result;
|
86
|
96
|
}
|
87
|
97
|
|
|
98
|
+ public ChartResponse selectDeliChart(String brandId, String storeId, String spplyId, String deliType) throws Exception {
|
|
99
|
+
|
|
100
|
+ String chartData = null;
|
|
101
|
+ if (!StringUtil.isEmpty(storeId)) {
|
|
102
|
+ // 매장 입고
|
|
103
|
+ MainChartEntity entity1 = mainChartMapper.selectDeliChart(brandId, storeId, spplyId, deliType, "DLV0", "dlv_sch_dt"); // 대기 (납품서생성/납품예정일자 비교)
|
|
104
|
+ MainChartEntity entity2 = mainChartMapper.selectDeliChart(brandId, storeId, spplyId, deliType, "DLV1", "dlv_cmplt_dt"); // 확인 (납품서완료/납품완료일자 비교)
|
|
105
|
+
|
|
106
|
+ chartData = "[ [' ', '대기', '확인'], [' ', " + entity1.getDlvVal() + " , " + entity2.getDlvVal() + "] ]";
|
|
107
|
+ } else if (!StringUtil.isEmpty(spplyId)) {
|
|
108
|
+ // 공급사 출고
|
|
109
|
+ // 출고 대상 : 납품서생성, 납품예정일자 비교
|
|
110
|
+ // 출고 확인 : 납품서완료, 납품완료일자 비교
|
|
111
|
+ MainChartEntity entity1 = mainChartMapper.selectDeliChart(brandId, storeId, spplyId, deliType, "DLV0", "dlv_sch_dt"); // 대기 (납품서생성/납품예정일자 비교)
|
|
112
|
+ MainChartEntity entity2 = mainChartMapper.selectDeliChart(brandId, storeId, spplyId, deliType, "DLV1", "dlv_cmplt_dt"); // 확인 (납품서완료/납품완료일자 비교)
|
|
113
|
+
|
|
114
|
+ chartData = "[ [' ', '대상', '확인'], [' ', " + entity1.getDlvVal() + " , " + entity2.getDlvVal() + "] ]";
|
|
115
|
+ }
|
|
116
|
+ ChartResponse result = new ChartResponse();
|
|
117
|
+ result.setChartData(chartData);
|
|
118
|
+ return result;
|
|
119
|
+ }
|
|
120
|
+
|
88
|
121
|
}
|