Commit 190b51f6 authored by Quxl's avatar Quxl

x

parent a8083e54
......@@ -163,7 +163,8 @@ public class GoodsController {
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true),
@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 = true, value = "合同编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "custTypeId", dataType = "String", required = false, value = "合同编号", defaultValue = ""),
@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 = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
......@@ -171,11 +172,12 @@ public class GoodsController {
})
@RequestMapping(value = "/goodsDetail",method=RequestMethod.GET)
public String goodsDetail(String orgNo, String goodsId, String contractNo, String terminal, String langID, HttpServletRequest request, HttpServletResponse response) {
public String goodsDetail(String orgNo, String goodsId, String contractNo, String custTypeId, String terminal, String langID, HttpServletRequest request, HttpServletResponse response) {
Map<String,Object> params=new HashMap<>();
params.put("orgNo", orgNo);
params.put("goodsId", goodsId);
params.put("contractNo", contractNo);
params.put("contractNo", contractNo);
params.put("custTypeId", custTypeId);
params.put("langID", langID);
params.put("terminal", terminal);
return goodsService.goodsDetail(params);
......
......@@ -169,10 +169,16 @@ public class GoodsServiceImpl implements GoodsService {
String orgNo = (String)map.get("orgNo");
String goodsId=(String) map.get("goodsId");
String contractNo=(String) map.get("contractNo");
String sql = "select * from V_OrgGoods where sOrgNO = ? and sAgentContractNO = ? and nGoodsID = ?";
String custTypeId=(String) map.get("custTypeId");
String gSql = "select t.*, ap.nRealSalePrice nApSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = ? and t.sAgentContractNO = ? and t.nGoodsID = ?";
Map<String, Object> detail = null;
try {
detail = jdbcTemplate.queryForMap(sql, orgNo, contractNo, goodsId);
detail = jdbcTemplate.queryForMap(gSql, custTypeId, orgNo, contractNo, goodsId);
BigDecimal nApSalePrice = (BigDecimal) detail.get("nApSalePrice");
if(nApSalePrice != null) {
detail.put("nRealSalePrice", nApSalePrice);
}
} catch (EmptyResultDataAccessException e) {
throw new XException("商品已下架");
}
......
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