从接口实现销售价每个客户不同的价格
This commit is contained in:
@@ -457,6 +457,7 @@ public class MaterialController {
|
||||
@GetMapping(value = "/getMaterialByBarCode")
|
||||
@ApiOperation(value = "根据条码查询商品信息")
|
||||
public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode,
|
||||
@RequestParam(value = "organId", required = false) Long organId,
|
||||
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||
@RequestParam("mpList") String mpList,
|
||||
@RequestParam(required = false, value = "prefixNo") String prefixNo,
|
||||
@@ -483,7 +484,12 @@ public class MaterialController {
|
||||
mvo.setBillPrice(mvo.getPurchaseDecimal());
|
||||
} else if ("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) {
|
||||
//销售价
|
||||
mvo.setBillPrice(mvo.getWholesaleDecimal());
|
||||
if(organId == null) {
|
||||
mvo.setBillPrice(mvo.getWholesaleDecimal());
|
||||
} else {
|
||||
//查询最后一单的销售价,实现不同的客户不同的销售价
|
||||
mvo.setBillPrice(depotItemService.getLastUnitPriceByParam(organId, mvo.getMeId(), prefixNo));
|
||||
}
|
||||
}
|
||||
//仓库id
|
||||
if (depotId == null) {
|
||||
|
||||
@@ -233,4 +233,10 @@ public interface DepotItemMapperEx {
|
||||
BigDecimal getCurrentStockByParam(
|
||||
@Param("depotId") Long depotId,
|
||||
@Param("mId") Long mId);
|
||||
|
||||
BigDecimal getLastUnitPriceByParam(
|
||||
@Param("organId") Long organId,
|
||||
@Param("meId") Long meId,
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType);
|
||||
}
|
||||
|
||||
@@ -1195,4 +1195,23 @@ public class DepotItemService {
|
||||
map.put("rows", arr);
|
||||
return map;
|
||||
}
|
||||
|
||||
public BigDecimal getLastUnitPriceByParam(Long organId, Long meId, String prefixNo) {
|
||||
String type = "";
|
||||
String subType = "";
|
||||
if("XSDD".equals(prefixNo)) {
|
||||
type = "其它";
|
||||
subType = "销售订单";
|
||||
} else if("XSCK".equals(prefixNo)) {
|
||||
type = "出库";
|
||||
subType = "销售";
|
||||
} else if("XSTH".equals(prefixNo)) {
|
||||
type = "入库";
|
||||
subType = "销售退货";
|
||||
} else if("QTCK".equals(prefixNo)) {
|
||||
type = "出库";
|
||||
subType = "其它";
|
||||
}
|
||||
return depotItemMapperEx.getLastUnitPriceByParam(organId, meId, type, subType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user