|
|
@@ -24,6 +24,7 @@ import com.style24.admin.support.security.session.TsaSession;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.persistence.TsaPageRequest;
|
|
|
import com.style24.persistence.domain.Color;
|
|
|
+import com.style24.persistence.domain.Goods;
|
|
|
import com.style24.persistence.domain.GoodsSearch;
|
|
|
import com.style24.persistence.domain.Itemkind;
|
|
|
import com.style24.persistence.domain.NotiInfo;
|
|
|
@@ -32,6 +33,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
+import com.gagaframework.web.rest.server.GagaResponseStatus;
|
|
|
import com.gagaframework.web.util.GagaDateUtil;
|
|
|
import com.gagaframework.web.util.GagaFileUtil;
|
|
|
|
|
|
@@ -371,6 +373,100 @@ public class TsaGoodsController extends TsaBaseController {
|
|
|
return GagaFileUtil.writeFile(request, excelFilenameWithPath);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 상품 수정 항목 일괄변경
|
|
|
+ *
|
|
|
+ * @param goods
|
|
|
+ * @return
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 01. 17
|
|
|
+ */
|
|
|
+ @PostMapping("/state/update")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap updateGoodsState(@RequestBody Goods goods) {
|
|
|
+
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode()); // 200
|
|
|
+ result.set("procJob", goods.getProcJob());
|
|
|
+ // result.set("message", message.getMessage("SUCC_0001"));
|
|
|
+
|
|
|
+ String returnGoods = "";
|
|
|
+ String resultFlag = "SUCC";
|
|
|
+
|
|
|
+ if (!"0000".equals(TsaSession.getInfo().getRoleCd()) && !"A000".equals(TsaSession.getInfo().getRoleCd())
|
|
|
+ && !"A001".equals(TsaSession.getInfo().getRoleCd()) && !"A100".equals(TsaSession.getInfo().getRoleCd())
|
|
|
+ && !"A101".equals(TsaSession.getInfo().getRoleCd())) {
|
|
|
+ throw new IllegalStateException("권한이 없습니다.");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 상품 상태 변경일 경우 체크
|
|
|
+ if ("goodsStat".equals(goods.getProcJob()) && ("40".equals(goods.getGoodsStat()) || "90".equals(goods.getGoodsStat()))) {
|
|
|
+
|
|
|
+ // 이미지
|
|
|
+ Collection<Goods> goodsList = goodsService.getGoodsImgsYn(goods);
|
|
|
+
|
|
|
+ for (Goods tmpGoods : goodsList) {
|
|
|
+ if ("N".equals(tmpGoods.getGoodsImageYn())) {
|
|
|
+ returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+ } else {
|
|
|
+
|
|
|
+ // 택가/판매가 입력 여부 확인
|
|
|
+ Goods dataGoods = goodsService.getGoods(tmpGoods);
|
|
|
+ if (dataGoods == null) {
|
|
|
+ returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (dataGoods.getListPrice() <= 0 || dataGoods.getCurrPrice() <= 0) {
|
|
|
+ returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 사이즈 등록 여부 확인
|
|
|
+// Stock stock = new Stock();
|
|
|
+// stock.setGoodsCd(tmpGoods.getGoodsCd());
|
|
|
+// int stockCnt = goodsService.getGoodsSizeCount(stock);
|
|
|
+// if (stockCnt <= 0) {
|
|
|
+// returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+
|
|
|
+ //고시정보
|
|
|
+// GoodsNotiInfo goodsNotiInfo = new GoodsNotiInfo();
|
|
|
+// goodsNotiInfo.setGoodsCd(tmpGoods.getGoodsCd());
|
|
|
+// goodsNotiInfo.setSupplyCompCd(tmpGoods.getSupplyCompCd());
|
|
|
+// goodsNotiInfo.setNiClsfCd(tmpGoods.getNiClsfCd());
|
|
|
+// Collection<GoodsNotiInfo> goodsNotiInfoList = goodsService.getGoodsNotiInfoList(goodsNotiInfo);
|
|
|
+// if (goodsNotiInfoList == null || goodsNotiInfoList.isEmpty()) {
|
|
|
+// returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+// } else {
|
|
|
+// for (GoodsNotiInfo tmpGoodsNotiInfo : goodsNotiInfoList) {
|
|
|
+// if ("Y".equals(tmpGoodsNotiInfo.getReqYn()) || "Y".equals(tmpGoodsNotiInfo.getDispYn())) {
|
|
|
+// if (StringUtils.isEmpty(tmpGoodsNotiInfo.getNiContent())) {
|
|
|
+// returnGoods += tmpGoods.getGoodsCd() + ",";
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (returnGoods.length() > 0) {
|
|
|
+ returnGoods = returnGoods.substring(0, returnGoods.lastIndexOf(","));
|
|
|
+ returnGoods = returnGoods.replaceAll(",", ",<br/>");
|
|
|
+ resultFlag = "FAIL";
|
|
|
+ result.set("resultFlag", resultFlag);
|
|
|
+ result.set("returnGoods", returnGoods);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ goodsService.updateGoodsState(goods);
|
|
|
+
|
|
|
+ result.set("resultFlag", resultFlag);
|
|
|
+ result.set("returnGoods", returnGoods);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 상품 대량 등록 화면
|
|
|
*
|