|
@@ -82,7 +82,7 @@ public class WebsitSalesLogic {
|
|
|
FieldUtils.materialParam(zfireParamBean, WebsitSalesVO.class, adminUser);
|
|
|
|
|
|
return materialMapper.websitSalesPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean,
|
|
|
- zfireParamBean.getGoodsName(),zfireParamBean.getGoodsSpecification(),zfireParamBean.getIsFilter());
|
|
|
+ zfireParamBean.getGoodsName(), zfireParamBean.getGoodsSpecification(), zfireParamBean.getIsFilter());
|
|
|
|
|
|
}
|
|
|
|
|
@@ -123,7 +123,7 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
|
|
|
if (bean.getFlag().equals(MaterialSalesFlagEnum.PAY_NOT_TAKE.getKey())
|
|
|
- || bean.getFlag().equals(MaterialSalesFlagEnum.PAY_TAKE.getKey()) ) {
|
|
|
+ || bean.getFlag().equals(MaterialSalesFlagEnum.PAY_TAKE.getKey())) {
|
|
|
WebsitSalesPayOrder order = websitSalesPayOrderService.lambdaQuery()
|
|
|
.eq(WebsitSalesPayOrder::getCompanyWechatId, sales.getCompanyWechatId())
|
|
|
.eq(WebsitSalesPayOrder::getWebsitId, sales.getWebsitId())
|
|
@@ -307,7 +307,7 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
|
|
|
item.setConvertQty(convertQty)
|
|
|
- .setConvertPrice(convertPrice);
|
|
|
+ .setConvertPrice(convertPrice);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -430,7 +430,7 @@ public class WebsitSalesLogic {
|
|
|
price = sales.getTotalAmount();
|
|
|
}
|
|
|
|
|
|
- if(Objects.nonNull(price)) {
|
|
|
+ if (Objects.nonNull(price)) {
|
|
|
|
|
|
if (price.compareTo(new BigDecimal("0")) == -1)
|
|
|
throw new RemoteServiceException("金额不能为负数");
|
|
@@ -440,7 +440,7 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
- websitGoodsMangerLogic.upManage(sales.getOrderEnginBaseId(),sales.getGoodsType());
|
|
|
+ websitGoodsMangerLogic.upManage(sales.getOrderEnginBaseId(), sales.getGoodsType());
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -457,7 +457,7 @@ public class WebsitSalesLogic {
|
|
|
throw new RemoteServiceException("销售单为\"" + flagEnum.getRemark() + "\"状态,不能确认提货");
|
|
|
}
|
|
|
|
|
|
- if ((sales.getIsImport() || sales.getOrderSource().equals(SourceSalesEnum.ONLINE.getKey())) && StringUtils.isBlank(storageId) ) {
|
|
|
+ if ((sales.getIsImport() || sales.getOrderSource().equals(SourceSalesEnum.ONLINE.getKey())) && StringUtils.isBlank(storageId)) {
|
|
|
throw new RemoteServiceException("请选择仓库");
|
|
|
}
|
|
|
Storage storage = null;
|
|
@@ -497,6 +497,7 @@ public class WebsitSalesLogic {
|
|
|
|
|
|
/**
|
|
|
* 改变支付方式 (师傅在线下单后改变现金)
|
|
|
+ *
|
|
|
* @param salesId
|
|
|
*/
|
|
|
public void changeCash(String salesId) {
|
|
@@ -556,11 +557,11 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
|
|
|
if (saleType.equals(WebsitSalesTypeEnum.ENGIN.getName()) && StringUtils.isBlank(orderEnginBaseId)) {
|
|
|
- throw new RemoteServiceException("请先选择工程基础资料");
|
|
|
+ throw new RemoteServiceException("请先选择工程基础资料");
|
|
|
}
|
|
|
List<WebsitSalesGoodsVO> goodsList;
|
|
|
if (type.getKey().equals(WebsitGoodsTypeEnum.M.getKey())) {
|
|
|
- goodsList = materialMapper.existStockGoods(companyId, websitId, type.getKey(), categoryId, goodsName, null);
|
|
|
+ goodsList = materialMapper.existStockGoods(companyId, websitId, type.getKey(), categoryId, goodsName, null, partType);
|
|
|
} else {
|
|
|
goodsList = materialMapper.notStockGoods(companyId, websitId, type.getKey(), goodsName);
|
|
|
}
|
|
@@ -649,7 +650,7 @@ public class WebsitSalesLogic {
|
|
|
|
|
|
|
|
|
public List<WebsitSalesGoodsVO> existStockGoodsList(String websitId, String categoryId, WebsitGoodsTypeEnum type,
|
|
|
- String goodsName, String goodsSpecification) {
|
|
|
+ String goodsName, String goodsSpecification, String partType) {
|
|
|
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
String companyId = "";
|
|
@@ -657,7 +658,7 @@ public class WebsitSalesLogic {
|
|
|
companyId = adminUser.getAdminCompanyWechat().getCompanyWechatId();
|
|
|
}
|
|
|
|
|
|
- List<WebsitSalesGoodsVO> goodsList = materialMapper.existStockGoods(companyId, websitId, type.getKey(), categoryId, goodsName,goodsSpecification);
|
|
|
+ List<WebsitSalesGoodsVO> goodsList = materialMapper.existStockGoods(companyId, websitId, type.getKey(), categoryId, goodsName, goodsSpecification, partType);
|
|
|
if (CollectionUtil.isNotEmpty(goodsList) && WebsitGoodsTypeEnum.P.getKey().equals(type.getKey())) {
|
|
|
for (WebsitSalesGoodsVO vo : goodsList) {
|
|
|
this.computeSalesPrice(companyId, vo);
|
|
@@ -732,10 +733,10 @@ public class WebsitSalesLogic {
|
|
|
.collect(Collectors.toMap(AdminWebsit::getName, Function.identity()));
|
|
|
|
|
|
Map<String, User> userMap = userList.stream()
|
|
|
- .collect(Collectors.toMap(User::getMobile, Function.identity(), (k1, k2) -> k2));
|
|
|
+ .collect(Collectors.toMap(User::getMobile, Function.identity(), (k1, k2) -> k2));
|
|
|
|
|
|
Map<String, User> existUserMap = userList.stream()
|
|
|
- .collect(Collectors.toMap(User::getUserId, Function.identity()));
|
|
|
+ .collect(Collectors.toMap(User::getUserId, Function.identity()));
|
|
|
|
|
|
Map<String, WebsitGoodsCategory> categoryMap = categoryList.stream()
|
|
|
.collect(Collectors.toMap(WebsitGoodsCategory::getCategoryId, Function.identity()));
|
|
@@ -772,19 +773,19 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
|
|
|
if (Objects.isNull(row.get(0))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 网点名称不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 网点名称不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(1))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 师傅联系电话不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 师傅联系电话不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(2))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 辅材名称不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 辅材名称不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(3))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 数量不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 数量不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(4))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 销售价格不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 销售价格不能为空");
|
|
|
}
|
|
|
// if (Objects.isNull(row.get(5))) {
|
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 销售时间不能为空");
|
|
@@ -799,15 +800,15 @@ public class WebsitSalesLogic {
|
|
|
String storageStr = (String) row.get(6);
|
|
|
|
|
|
if (!websitMap.containsKey(websitStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 网点名称不存在");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 网点名称不存在");
|
|
|
}
|
|
|
if (!userMap.containsKey(mobileStr)) {
|
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 师傅联系电话不存在");
|
|
|
if (StringUtils.isBlank(mobileStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 手机号不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 手机号不能为空");
|
|
|
}
|
|
|
if (StringUtils.isBlank(customerStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 客户名称不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 客户名称不能为空");
|
|
|
}
|
|
|
if (!userMap.containsKey(customerStr + mobileStr)) {
|
|
|
User user = new User();
|
|
@@ -818,30 +819,30 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
}
|
|
|
if (!goodsMap.containsKey(goodsNameStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 辅材名称不存在");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 辅材名称不存在");
|
|
|
}
|
|
|
BigDecimal qty;
|
|
|
try {
|
|
|
qty = new BigDecimal(qtyStr);
|
|
|
if (qty.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 请输入有效数量");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 请输入有效数量");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 数量转换异常");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 数量转换异常");
|
|
|
}
|
|
|
BigDecimal salesPrice;
|
|
|
try {
|
|
|
salesPrice = new BigDecimal(salesPriceStr);
|
|
|
if (qty.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 请输入有效销售价格");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 请输入有效销售价格");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 销售价格转换异常");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 销售价格转换异常");
|
|
|
}
|
|
|
|
|
|
ImportMaterialSalesBean bean = new ImportMaterialSalesBean();
|
|
|
|
|
|
- bean.setIndex(i+1);
|
|
|
+ bean.setIndex(i + 1);
|
|
|
bean.setAdminWebsit(websitMap.get(websitStr));
|
|
|
bean.setUser(userMap.containsKey(mobileStr) ? userMap.get(mobileStr) : userMap.get(customerStr + mobileStr));
|
|
|
bean.setGoods(goodsMap.get(goodsNameStr));
|
|
@@ -1050,7 +1051,8 @@ public class WebsitSalesLogic {
|
|
|
|
|
|
try {
|
|
|
goodsMap = websitGoods.stream()
|
|
|
- .collect(Collectors.toMap(WebsitGoods::getGoodsCode, Function.identity()));;
|
|
|
+ .collect(Collectors.toMap(WebsitGoods::getGoodsCode, Function.identity()));
|
|
|
+ ;
|
|
|
} catch (Exception e) {
|
|
|
throw new RemoteServiceException("系统里的配件编码信息有重复");
|
|
|
}
|
|
@@ -1098,16 +1100,16 @@ public class WebsitSalesLogic {
|
|
|
row.add("");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(0))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 网点名称不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 网点名称不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(1))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 师傅联系电话不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 师傅联系电话不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(2))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 配件编码不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 配件编码不能为空");
|
|
|
}
|
|
|
if (Objects.isNull(row.get(3))) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 数量不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 数量不能为空");
|
|
|
}
|
|
|
// if (Objects.isNull(row.get(4))) {
|
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 销售价格不能为空");
|
|
@@ -1125,15 +1127,15 @@ public class WebsitSalesLogic {
|
|
|
String storageStr = (String) row.get(5);
|
|
|
|
|
|
if (!websitMap.containsKey(websitStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 网点名称不存在");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 网点名称不存在");
|
|
|
}
|
|
|
if (!userMap.containsKey(mobileStr)) {
|
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 师傅联系电话不存在");
|
|
|
if (StringUtils.isBlank(mobileStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 手机号不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 手机号不能为空");
|
|
|
}
|
|
|
if (StringUtils.isBlank(customerStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 客户名称不能为空");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 客户名称不能为空");
|
|
|
}
|
|
|
if (!userMap.containsKey(customerStr + mobileStr)) {
|
|
|
User user = new User();
|
|
@@ -1144,16 +1146,16 @@ public class WebsitSalesLogic {
|
|
|
}
|
|
|
}
|
|
|
if (!goodsMap.containsKey(goodsNameStr)) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 配件编码不存在");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 配件编码不存在");
|
|
|
}
|
|
|
BigDecimal qty;
|
|
|
try {
|
|
|
qty = new BigDecimal(qtyStr);
|
|
|
if (qty.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 请输入有效数量");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 请输入有效数量");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 数量转换异常");
|
|
|
+ throw new RemoteServiceException("第" + (i + 1) + "行, 数量转换异常");
|
|
|
}
|
|
|
BigDecimal salesPrice;
|
|
|
// try {
|
|
@@ -1183,7 +1185,7 @@ public class WebsitSalesLogic {
|
|
|
|
|
|
ImportMaterialSalesBean bean = new ImportMaterialSalesBean();
|
|
|
|
|
|
- bean.setIndex(i+1);
|
|
|
+ bean.setIndex(i + 1);
|
|
|
bean.setAdminWebsit(websitMap.get(websitStr));
|
|
|
bean.setUser(userMap.containsKey(mobileStr) ? userMap.get(mobileStr) : userMap.get(customerStr + mobileStr));
|
|
|
bean.setGoods(goods);
|