Commit c42fa157 authored by Quxl's avatar Quxl

x

parent d14cfab1
...@@ -194,10 +194,8 @@ public class GoodsController { ...@@ -194,10 +194,8 @@ public class GoodsController {
@ApiOperation("商品详情") @ApiOperation("商品详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "goodsID", dataType = "String", required = true, value = "商品编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "goodsId", dataType = "String", required = true, value = "商品编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "contractNO", dataType = "String", required = false, value = "合同编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "contractNo", dataType = "String", required = false, value = "合同编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "custNO", dataType = "String", required = true, value = "用户账号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "shopNO", dataType = "String", required = true, value = "店铺编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
...@@ -205,24 +203,19 @@ public class GoodsController { ...@@ -205,24 +203,19 @@ public class GoodsController {
}) })
@RequestMapping(value = "/goodsDetail",method=RequestMethod.GET) @RequestMapping(value = "/goodsDetail",method=RequestMethod.GET)
public String goodsDetail(HttpServletRequest request, HttpServletResponse response) { public String goodsDetail(String goodsId, String contractNo, String terminal, String langID, HttpServletRequest request, HttpServletResponse response) {
Map<String,Object> params=new HashMap<>(); Map<String,Object> params=new HashMap<>();
params.put("custNO", request.getParameter("custNO")); params.put("goodsId", goodsId);
params.put("shopNO", request.getParameter("shopNO")==null?"":request.getParameter("shopNO")); params.put("contractNo", contractNo);
params.put("goodsID", request.getParameter("goodsID")==null?"":request.getParameter("goodsID")); params.put("langID", langID);
params.put("contractNO", request.getParameter("contractNO")==null?"":request.getParameter("contractNO")); params.put("terminal", terminal);
params.put("langID", request.getParameter("langID")==null?936:request.getParameter("langID"));
params.put("terminal", request.getParameter("terminal")==null?"":request.getParameter("terminal"));
return goodsService.goodsDetail(params); return goodsService.goodsDetail(params);
} }
@ApiOperation("批量查询商品价格 (参数为json对象)") @ApiOperation("批量查询商品价格 (参数为json对象)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "String", required = false, value = "JSON格式", defaultValue = "{\"goodsList\": [\"10\",\"12\"],\"custNO\": \"15996801133\",\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": 936}"), @ApiImplicitParam(paramType = "query", dataType = "String", required = false, value = "JSON格式", defaultValue = "{\"goodsList\": [\"10\",\"12\"],\"custNO\": \"15996801133\",\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": 936}"),
}) })
@RequestMapping(value = "/queryGoodsPrice",method=RequestMethod.POST,produces = "application/json") @RequestMapping(value = "/queryGoodsPrice",method=RequestMethod.POST,produces = "application/json")
public String queryGoodsPrice(HttpServletRequest request, HttpServletResponse response) { public String queryGoodsPrice(HttpServletRequest request, HttpServletResponse response) {
......
...@@ -28,7 +28,6 @@ import com.egolm.shop.service.GoodsService; ...@@ -28,7 +28,6 @@ import com.egolm.shop.service.GoodsService;
import com.egolm.shop.service.SolrGoodsService; import com.egolm.shop.service.SolrGoodsService;
import com.egolm.shop.service.UserService; import com.egolm.shop.service.UserService;
import com.egolm.shop.util.I18NUtils; import com.egolm.shop.util.I18NUtils;
import com.egolm.shop.util.ShopContstrant;
@Service @Service
public class GoodsServiceImpl implements GoodsService { public class GoodsServiceImpl implements GoodsService {
private static final Log logger = LogFactory.getLog(GoodsServiceImpl.class); private static final Log logger = LogFactory.getLog(GoodsServiceImpl.class);
...@@ -368,26 +367,12 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -368,26 +367,12 @@ public class GoodsServiceImpl implements GoodsService {
*/ */
@Override @Override
public String goodsDetail(Map<String, Object> map) { public String goodsDetail(Map<String, Object> map) {
String custNO=(String) map.get("custNO"); String goodsId=(String) map.get("goodsId");
String shopNO=(String) map.get("shopNO"); String contractNo=(String) map.get("contractNo");
String terminal=(String) map.get("terminal"); String sql = "select * from tAgentContractGoods where sContractNO = ? and nGoodsID = ?";
String goodsID=(String) map.get("goodsID"); Map<String, Object> detail = jdbcTemplate.queryForMap(sql, contractNo, goodsId);
String contractNO=(String) map.get("contractNO"); List<Map<String,Object>> picList = goodsPicList(goodsId, contractNo);
TCustomer customer = userService.getCustomer(custNO,shopNO); return Rjx.jsonOk().set("goodsDetail", detail).set("imgGroup", picList).toJson();
String goodsInfoSql = GoodsSql.goodsInfoSql(customer,map);
jdbcTemplate.setDialect(new SqlServerDialect());
//正式用户保存浏览记录
if(!customer.getsCustLeveTypeID().equals(ShopContstrant.GUEST_LEVEL_TYPE_ID)) {
commonService.saveViewHistory(customer.gettShops().get(0).getsOrgNO(), terminal, shopNO, "1", goodsID);
}
Map<String,Object> goodsDetailMap = jdbcTemplate.queryForMap(goodsInfoSql);
//获取商品图片
List<Map<String,Object>> picList = goodsPicList(goodsID, contractNO);
return Rjx.jsonOk().set("goodsDetail", goodsDetailMap).set("imgGroup", picList).toJson();
} }
......
...@@ -9,95 +9,6 @@ import com.egolm.shop.util.ShopContstrant; ...@@ -9,95 +9,6 @@ import com.egolm.shop.util.ShopContstrant;
public class GoodsSql { public class GoodsSql {
/**
* 查询商品详情
* @Title: goodsInfoSql
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param: @param customer
* @param: @param shop
* @param: @param goodsID
* @param: @return
* @return: String
* @throws
*/
public static String goodsInfoSql(TCustomer customer,Map<String, Object> map) {
String goodsID=(String) map.get("goodsID");
String contractNO=(String) map.get("contractNO");
TShop tshop = customer.gettShops().get(0);
String goodInfoSql = "";
if(customer.getsCustLeveTypeID().equals(ShopContstrant.GUEST_LEVEL_TYPE_ID)) { //游客
goodInfoSql="SELECT TOP 1 "
+ " goodsID = g.nGoodsID, "
+ " goodsNO = g.sGoodsNO, "
+ " goodsName = g.sGoodsDesc, "
+ " contractNO = g.sAgentContractNO, "
+ " agentName=g.sAgentName,"
+ " categoryID = g.sCategoryNO, "
+ " tag=g.nTag, "
+ " barcode = g.sMainBarcode, "
+ " brandID = g.sBrandID, "
+ " brand = g.sBrand, "
+ " spec = g.sSpec, "
+ " minSaleQty = g.nMinSaleQty, "
+ " saleUnits = g.nSaleUnits, "
+ " orderUnits = g.nSaleUnits, "
+ " goodsUnit = g.sMarketUnit, "
+ " agentUnit = g.sUnit, "
+ " marketPrice = g.nMarketPrice, "
+ " salePrice = g.nSalePrice, "
+ " realSalePrice =g.nRealSalePrice, "
+ " DCPriority = g.nDCPriority, "
+ " stock = g.nStockQty, "
+ " imgPath = g.sURL, "
+ " flavor = g.Flavor,"
+ " caseUnits=g.nCaseUnits"
+ " FROM "
+ " V_DistrictGoods g "
+ " WHERE "
+ " g.nGoodsID = " + goodsID + " "
+ " AND g.sDistrictID='"+tshop.getsDistrictID()+"' AND (g.sOrgNO='"+tshop.getsOrgNO()+"' or g.sOrgNO='china') "
+ " AND g.nTag&1=0 "
;
}else {
goodInfoSql="SELECT TOP 1 "
+ " goodsID = g.nGoodsID, "
+ " goodsNO = g.sGoodsNO, "
+ " goodsName = g.sGoodsDesc, "
+ " contractNO = g.sAgentContractNO, "
+ " agentName=g.sAgentName,"
+ " categoryID = g.sCategoryNO, "
+ " tag=g.nTag, "
+ " barcode = g.sMainBarcode, "
+ " brandID = g.sBrandID, "
+ " brand = g.sBrand, "
+ " spec = g.sSpec, "
+ " minSaleQty = g.nMinSaleQty, "
+ " saleUnits = g.nSaleUnits, "
+ " orderUnits = g.nSaleUnits, "
+ " goodsUnit = g.sMarketUnit, "
+ " agentUnit = g.sUnit, "
+ " marketPrice = g.nMarketPrice, "
+ " salePrice = g.nSalePrice, "
+ " realSalePrice =g.nRealSalePrice, "
+ " DCPriority = g.nDCPriority, "
+ " stock = g.nStockQty, "
+ " imgPath = g.sURL, "
+ " flavor = g.Flavor,"
+ " caseUnits=g.nCaseUnits"
+ " FROM "
+ " V_CategoryGoods g "
+ " WHERE "
+ " g.nGoodsID = " + goodsID + " "
+ " AND g.sShopNO = '" + tshop.getsShopNO() + "' "
+ " AND g.nTag&1=0 "
;
}
if(StringUtil.isNotEmpty(contractNO)){
goodInfoSql += " AND g.sAgentContractNO='"+contractNO+"' ";
}
return goodInfoSql;
}
/** /**
* 商品价格SQL * 商品价格SQL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment