|
@@ -2,6 +2,7 @@ package com.gree.mall.manager.logic.material.base;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
@@ -11,6 +12,7 @@ import com.gree.mall.manager.bean.material.base.WebsitGoodsBean;
|
|
import com.gree.mall.manager.bean.material.base.WebsitGoodsMVO;
|
|
import com.gree.mall.manager.bean.material.base.WebsitGoodsMVO;
|
|
import com.gree.mall.manager.bean.material.base.WebsitGoodsPVO;
|
|
import com.gree.mall.manager.bean.material.base.WebsitGoodsPVO;
|
|
import com.gree.mall.manager.commonmapper.MaterialMapper;
|
|
import com.gree.mall.manager.commonmapper.MaterialMapper;
|
|
|
|
+import com.gree.mall.manager.constant.Constant;
|
|
import com.gree.mall.manager.enums.material.JudgeEnum;
|
|
import com.gree.mall.manager.enums.material.JudgeEnum;
|
|
import com.gree.mall.manager.enums.material.NormTypeEnum;
|
|
import com.gree.mall.manager.enums.material.NormTypeEnum;
|
|
import com.gree.mall.manager.enums.material.StateEnum;
|
|
import com.gree.mall.manager.enums.material.StateEnum;
|
|
@@ -142,9 +144,7 @@ public class WebsitGoodsLogic {
|
|
|
|
|
|
WebsitGoods goods = new WebsitGoods();
|
|
WebsitGoods goods = new WebsitGoods();
|
|
BeanUtils.copyProperties(bean, goods);
|
|
BeanUtils.copyProperties(bean, goods);
|
|
- // 库存单位与销售单位一致
|
|
|
|
- goods.setGoodsSalesUnit(goods.getGoodsStockUnit());
|
|
|
|
-// goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
|
|
|
|
+
|
|
if (StringUtils.isBlank(goods.getNormType())) {
|
|
if (StringUtils.isBlank(goods.getNormType())) {
|
|
goods.setNormType(NormTypeEnum.M.getKey());
|
|
goods.setNormType(NormTypeEnum.M.getKey());
|
|
}
|
|
}
|
|
@@ -162,7 +162,9 @@ public class WebsitGoodsLogic {
|
|
// 检查辅材名称、配件代码唯一
|
|
// 检查辅材名称、配件代码唯一
|
|
this.checkMaterialUnique(goods);
|
|
this.checkMaterialUnique(goods);
|
|
|
|
|
|
-
|
|
|
|
|
|
+ if (goods.getGoodsType().equals(WebsitGoodsTypeEnum.M.getKey())) {
|
|
|
|
+ goods.setGoodsId(commonLogic.generateMaterialNo(goods.getCompanyWechatId(), Constant.FC, Constant.FC, 11));
|
|
|
|
+ }
|
|
goods.insert();
|
|
goods.insert();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,21 +189,28 @@ public class WebsitGoodsLogic {
|
|
}
|
|
}
|
|
|
|
|
|
private void stockUnitEmptyAdd(WebsitGoods goods) {
|
|
private void stockUnitEmptyAdd(WebsitGoods goods) {
|
|
- if (StringUtils.isNotBlank(goods.getGoodsStockUnit())) {
|
|
|
|
|
|
+ if (goods.getGoodsType().equals(WebsitGoodsTypeEnum.M.getKey())) {
|
|
|
|
+ if (StringUtils.isBlank(goods.getGoodsStockUnit())) {
|
|
|
|
+ throw new RemoteServiceException("库存单位不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(goods.getGoodsSalesUnit())) {
|
|
|
|
+ throw new RemoteServiceException("销售单位不能为空");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- String type = goods.getGoodsType().equals(WebsitGoodsTypeEnum.M.getKey()) ? "ASSIST_UNIT" : "PARTS_UNIT";
|
|
|
|
- Integer count = sysDictCompanyService.lambdaQuery()
|
|
|
|
- .eq(SysDictCompany::getDictType, type)
|
|
|
|
- .eq(SysDictCompany::getDictValue, goods.getGoodsStockUnit())
|
|
|
|
- .count();
|
|
|
|
|
|
+ String type = goods.getGoodsType().equals(WebsitGoodsTypeEnum.M.getKey()) ? "ASSIST_UNIT" : "PARTS_UNIT";
|
|
|
|
+ Integer count = sysDictCompanyService.lambdaQuery()
|
|
|
|
+ .eq(SysDictCompany::getDictType, type)
|
|
|
|
+ .eq(SysDictCompany::getDictValue, goods.getGoodsStockUnit())
|
|
|
|
+ .count();
|
|
|
|
|
|
- if (count == 0) {
|
|
|
|
- SysDictCompany company = new SysDictCompany();
|
|
|
|
- company.setDictType(type)
|
|
|
|
- .setDictValue(goods.getGoodsStockUnit());
|
|
|
|
- sysDictCompanyLogic.saveOpenDict(company);
|
|
|
|
- }
|
|
|
|
|
|
+ if (count == 0) {
|
|
|
|
+ SysDictCompany company = new SysDictCompany();
|
|
|
|
+ company.setDictType(type)
|
|
|
|
+ .setDictValue(goods.getGoodsStockUnit());
|
|
|
|
+ sysDictCompanyLogic.saveOpenDict(company);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void handlePartsInfo(HttpServletRequest request, WebsitGoods goods, WebsitGoodsBean bean) {
|
|
private void handlePartsInfo(HttpServletRequest request, WebsitGoods goods, WebsitGoodsBean bean) {
|
|
@@ -273,44 +282,44 @@ public class WebsitGoodsLogic {
|
|
if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getNormAmount())) {
|
|
if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getNormAmount())) {
|
|
throw new RemoteServiceException("收费标准不能为空");
|
|
throw new RemoteServiceException("收费标准不能为空");
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (Objects.isNull(goods.getSelfWorkerAmount())) {
|
|
|
|
- if (goods.getNormType().equals(NormTypeEnum.M.getKey())) {
|
|
|
|
- throw new RemoteServiceException("自有库存师傅分账金额不能为空");
|
|
|
|
- } else {
|
|
|
|
- throw new RemoteServiceException("师傅分账比例不能为空");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+//
|
|
|
|
+// if (Objects.isNull(goods.getSelfWorkerAmount())) {
|
|
|
|
+// if (goods.getNormType().equals(NormTypeEnum.M.getKey())) {
|
|
|
|
+// throw new RemoteServiceException("自有库存师傅分账金额不能为空");
|
|
|
|
+// } else {
|
|
|
|
+// throw new RemoteServiceException("师傅分账比例不能为空");
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
// if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getOutWorkerAmount())) {
|
|
// if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getOutWorkerAmount())) {
|
|
// throw new RemoteServiceException("外购配件师傅分账金额不能为空");
|
|
// throw new RemoteServiceException("外购配件师傅分账金额不能为空");
|
|
// }
|
|
// }
|
|
|
|
|
|
// 检查收费标准和分账金额
|
|
// 检查收费标准和分账金额
|
|
- BigDecimal selWorkerAmount = BigDecimal.ZERO;
|
|
|
|
|
|
+ BigDecimal selWorkerAmount = goods.getNormAmount();
|
|
BigDecimal selWebsitAmount = BigDecimal.ZERO;
|
|
BigDecimal selWebsitAmount = BigDecimal.ZERO;
|
|
// BigDecimal outWorkerAmount = BigDecimal.ZERO;
|
|
// BigDecimal outWorkerAmount = BigDecimal.ZERO;
|
|
// BigDecimal outWebsitAmount = BigDecimal.ZERO;
|
|
// BigDecimal outWebsitAmount = BigDecimal.ZERO;
|
|
- if (goods.getNormType().equals(NormTypeEnum.M.getKey())) {
|
|
|
|
- if (goods.getSelfWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
-
|
|
|
|
- if (goods.getSelfWorkerAmount().compareTo(goods.getNormAmount()) > 0) {
|
|
|
|
- throw new RemoteServiceException("自有库存师傅分账金额不能大于收费标准");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- selWorkerAmount = goods.getSelfWorkerAmount();
|
|
|
|
- selWebsitAmount = goods.getNormAmount().subtract(selWorkerAmount);
|
|
|
|
- } else {
|
|
|
|
- selWebsitAmount = goods.getNormAmount();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- if (goods.getSelfWorkerAmount().add(goods.getSelfWebsitAmount()).compareTo(BigDecimal.valueOf(100)) > 0) {
|
|
|
|
- throw new RemoteServiceException("分账比例不能大于100%");
|
|
|
|
- }
|
|
|
|
- selWorkerAmount = goods.getSelfWorkerAmount();
|
|
|
|
- selWebsitAmount = goods.getSelfWebsitAmount();
|
|
|
|
- }
|
|
|
|
|
|
+// if (goods.getNormType().equals(NormTypeEnum.M.getKey())) {
|
|
|
|
+// if (goods.getSelfWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
+//
|
|
|
|
+// if (goods.getSelfWorkerAmount().compareTo(goods.getNormAmount()) > 0) {
|
|
|
|
+// throw new RemoteServiceException("自有库存师傅分账金额不能大于收费标准");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// selWorkerAmount = goods.getSelfWorkerAmount();
|
|
|
|
+// selWebsitAmount = goods.getNormAmount().subtract(selWorkerAmount);
|
|
|
|
+// } else {
|
|
|
|
+// selWebsitAmount = goods.getNormAmount();
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// } else {
|
|
|
|
+// if (goods.getSelfWorkerAmount().add(goods.getSelfWebsitAmount()).compareTo(BigDecimal.valueOf(100)) > 0) {
|
|
|
|
+// throw new RemoteServiceException("分账比例不能大于100%");
|
|
|
|
+// }
|
|
|
|
+// selWorkerAmount = goods.getSelfWorkerAmount();
|
|
|
|
+// selWebsitAmount = goods.getSelfWebsitAmount();
|
|
|
|
+// }
|
|
|
|
|
|
// if (Objects.nonNull(goods.getOutWorkerAmount())
|
|
// if (Objects.nonNull(goods.getOutWorkerAmount())
|
|
// && goods.getOutWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
// && goods.getOutWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
@@ -345,9 +354,6 @@ public class WebsitGoodsLogic {
|
|
BeanUtils.copyProperties(bean, goods);
|
|
BeanUtils.copyProperties(bean, goods);
|
|
goods.setCompanyWechatId(oldGoods.getCompanyWechatId())
|
|
goods.setCompanyWechatId(oldGoods.getCompanyWechatId())
|
|
.setCompanyWechatName(oldGoods.getCompanyWechatName());
|
|
.setCompanyWechatName(oldGoods.getCompanyWechatName());
|
|
- // 库存单位与销售单位一致
|
|
|
|
- goods.setGoodsSalesUnit(goods.getGoodsStockUnit());
|
|
|
|
-// goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(goods.getGoodsCategoryId())) {
|
|
if (StringUtils.isNotBlank(goods.getGoodsCategoryId())) {
|
|
WebsitGoodsCategory category = websitGoodsCategoryService.getById(goods.getGoodsCategoryId());
|
|
WebsitGoodsCategory category = websitGoodsCategoryService.getById(goods.getGoodsCategoryId());
|
|
@@ -406,16 +412,16 @@ public class WebsitGoodsLogic {
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
CommonUtils.initList2(row, 12);
|
|
CommonUtils.initList2(row, 12);
|
|
- if (row.size() < 7) {
|
|
|
|
|
|
+ if (row.size() < 8) {
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
}
|
|
}
|
|
- if (row.size() < 8) {
|
|
|
|
|
|
+ if (row.size() < 9) {
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
}
|
|
}
|
|
- if (row.size() < 9) {
|
|
|
|
|
|
+ if (row.size() < 10) {
|
|
row.add(null);
|
|
row.add(null);
|
|
}
|
|
}
|
|
if (Objects.isNull(row.get(0))) {
|
|
if (Objects.isNull(row.get(0))) {
|
|
@@ -428,12 +434,18 @@ public class WebsitGoodsLogic {
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 辅材名称不能为空");
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 辅材名称不能为空");
|
|
}
|
|
}
|
|
if (Objects.isNull(row.get(3))) {
|
|
if (Objects.isNull(row.get(3))) {
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 单位不能为空");
|
|
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 库存单位不能为空");
|
|
}
|
|
}
|
|
if (Objects.isNull(row.get(4))) {
|
|
if (Objects.isNull(row.get(4))) {
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 采购价格不能为空");
|
|
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 销售单位不能为空");
|
|
}
|
|
}
|
|
if (Objects.isNull(row.get(5))) {
|
|
if (Objects.isNull(row.get(5))) {
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 销售单位不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(row.get(6))) {
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 采购价格不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(row.get(7))) {
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 销售价格不能为空");
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 销售价格不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -441,13 +453,14 @@ public class WebsitGoodsLogic {
|
|
String categoryStr = (String) row.get(1);
|
|
String categoryStr = (String) row.get(1);
|
|
String goodsNameStr = (String) row.get(2);
|
|
String goodsNameStr = (String) row.get(2);
|
|
String unitStr = (String) row.get(3);
|
|
String unitStr = (String) row.get(3);
|
|
- String costStr = (String) row.get(4);
|
|
|
|
- String salesStr = (String) row.get(5);
|
|
|
|
- String goodsCodeStr = (String) row.get(6);
|
|
|
|
- String specificationStr = (String) row.get(7);
|
|
|
|
- String remark = (String) row.get(8);
|
|
|
|
- String manageWorkerStock = (String) row.get(9);
|
|
|
|
- String salesConvertQty = (String) row.get(9);
|
|
|
|
|
|
+ String saleUnitStr = (String) row.get(4);
|
|
|
|
+ String costStr = (String) row.get(5);
|
|
|
|
+ String salesStr = (String) row.get(6);
|
|
|
|
+ String goodsCodeStr = (String) row.get(7);
|
|
|
|
+ String specificationStr = (String) row.get(8);
|
|
|
|
+ String remark = (String) row.get(9);
|
|
|
|
+ String manageWorkerStock = (String) row.get(10);
|
|
|
|
+ String salesConvertQty = (String) row.get(11);
|
|
|
|
|
|
if (!treeMap.containsKey(parentCategoryStr)) {
|
|
if (!treeMap.containsKey(parentCategoryStr)) {
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 大类信息不存在");
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 大类信息不存在");
|
|
@@ -475,7 +488,11 @@ public class WebsitGoodsLogic {
|
|
}
|
|
}
|
|
|
|
|
|
if (!unitList.contains(unitStr)) {
|
|
if (!unitList.contains(unitStr)) {
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 单位信息不存在");
|
|
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 库存单位信息不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!unitList.contains(saleUnitStr)) {
|
|
|
|
+ throw new RemoteServiceException("第" + (i+1) + "行, 销售单位信息不存在");
|
|
}
|
|
}
|
|
|
|
|
|
WebsitGoods goods = new WebsitGoods();
|
|
WebsitGoods goods = new WebsitGoods();
|
|
@@ -492,9 +509,8 @@ public class WebsitGoodsLogic {
|
|
goods.setCost(new BigDecimal(costStr));
|
|
goods.setCost(new BigDecimal(costStr));
|
|
goods.setMarketPrice(new BigDecimal(salesStr));
|
|
goods.setMarketPrice(new BigDecimal(salesStr));
|
|
|
|
|
|
- // 库存单位与销售单位一致
|
|
|
|
- goods.setGoodsStockUnit(unitStr);
|
|
|
|
- goods.setGoodsSalesUnit(unitStr);
|
|
|
|
|
|
+ goods.setGoodsStockUnit(StrUtil.trim(unitStr));
|
|
|
|
+ goods.setGoodsSalesUnit(StrUtil.trim(saleUnitStr));
|
|
if (StringUtils.isBlank(manageWorkerStock) || manageWorkerStock.equals(JudgeEnum.YES.getRemark())) {
|
|
if (StringUtils.isBlank(manageWorkerStock) || manageWorkerStock.equals(JudgeEnum.YES.getRemark())) {
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
} else {
|
|
} else {
|
|
@@ -525,6 +541,10 @@ public class WebsitGoodsLogic {
|
|
this.checkMaterialUnique(goods);
|
|
this.checkMaterialUnique(goods);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ for (WebsitGoods goods : goodsList) {
|
|
|
|
+ goods.setGoodsId(commonLogic.generateMaterialNo(goods.getCompanyWechatId(), Constant.FC, Constant.FC, 11));
|
|
|
|
+ }
|
|
|
|
+
|
|
websitGoodsService.saveBatch(goodsList);
|
|
websitGoodsService.saveBatch(goodsList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -565,11 +585,11 @@ public class WebsitGoodsLogic {
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
CommonUtils.initList2(row, 11);
|
|
CommonUtils.initList2(row, 11);
|
|
- if (row.size() < 8) {
|
|
|
|
|
|
+ if (row.size() < 7) {
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
row.add(null);
|
|
}
|
|
}
|
|
- if (row.size() < 9) {
|
|
|
|
|
|
+ if (row.size() < 8) {
|
|
row.add(null);
|
|
row.add(null);
|
|
}
|
|
}
|
|
if (Objects.isNull(row.get(0))) {
|
|
if (Objects.isNull(row.get(0))) {
|
|
@@ -590,9 +610,9 @@ public class WebsitGoodsLogic {
|
|
if (Objects.isNull(row.get(5))) {
|
|
if (Objects.isNull(row.get(5))) {
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 适用产品大类不能为空");
|
|
throw new RemoteServiceException("第" + (i+1) + "行, 适用产品大类不能为空");
|
|
}
|
|
}
|
|
- if (Objects.isNull(row.get(6))) {
|
|
|
|
- throw new RemoteServiceException("第" + (i+1) + "行, 自有库存师傅分账金额不能为空");
|
|
|
|
- }
|
|
|
|
|
|
+// if (Objects.isNull(row.get(6))) {
|
|
|
|
+// throw new RemoteServiceException("第" + (i+1) + "行, 自有库存师傅分账金额不能为空");
|
|
|
|
+// }
|
|
// if (Objects.isNull(row.get(7))) {
|
|
// if (Objects.isNull(row.get(7))) {
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 外购库存师傅分账金额不能为空");
|
|
// throw new RemoteServiceException("第" + (i+1) + "行, 外购库存师傅分账金额不能为空");
|
|
// }
|
|
// }
|
|
@@ -603,10 +623,10 @@ public class WebsitGoodsLogic {
|
|
String normAmountStr = (String) row.get(3);
|
|
String normAmountStr = (String) row.get(3);
|
|
String brandStr = (String) row.get(4);
|
|
String brandStr = (String) row.get(4);
|
|
String categoryStr = (String) row.get(5);
|
|
String categoryStr = (String) row.get(5);
|
|
- String selfAmountStr = (String) row.get(6);
|
|
|
|
- String partType = (String) row.get(7);
|
|
|
|
- String goodsCodeStr = (String) row.get(8);
|
|
|
|
- String remark = (String) row.get(9);
|
|
|
|
|
|
+// String selfAmountStr = (String) row.get(6);
|
|
|
|
+ String partType = (String) row.get(6);
|
|
|
|
+ String goodsCodeStr = (String) row.get(7);
|
|
|
|
+ String remark = (String) row.get(8);
|
|
|
|
|
|
// Integer count = websitGoodsService.lambdaQuery()
|
|
// Integer count = websitGoodsService.lambdaQuery()
|
|
// .eq(WebsitGoods::getCompanyWechatId, companyWechatId)
|
|
// .eq(WebsitGoods::getCompanyWechatId, companyWechatId)
|
|
@@ -646,12 +666,12 @@ public class WebsitGoodsLogic {
|
|
}
|
|
}
|
|
|
|
|
|
BigDecimal normAmount = new BigDecimal(normAmountStr);
|
|
BigDecimal normAmount = new BigDecimal(normAmountStr);
|
|
- BigDecimal selfAmount = new BigDecimal(selfAmountStr);
|
|
|
|
|
|
+// BigDecimal selfAmount = new BigDecimal(selfAmountStr);
|
|
// BigDecimal outAmount = new BigDecimal(outAmountStr);
|
|
// BigDecimal outAmount = new BigDecimal(outAmountStr);
|
|
-
|
|
|
|
- if (selfAmount.compareTo(normAmount) > 0) {
|
|
|
|
- throw new RemoteServiceException("第" + (i + 1) + "行, 自有库存师傅分账金额不能大于收费标准");
|
|
|
|
- }
|
|
|
|
|
|
+//
|
|
|
|
+// if (selfAmount.compareTo(normAmount) > 0) {
|
|
|
|
+// throw new RemoteServiceException("第" + (i + 1) + "行, 自有库存师傅分账金额不能大于收费标准");
|
|
|
|
+// }
|
|
|
|
|
|
if (!"空调-冰箱-生活电器".contains(partType)) {
|
|
if (!"空调-冰箱-生活电器".contains(partType)) {
|
|
throw new RemoteServiceException("第" + (i + 1) + "行, 配件类型错误");
|
|
throw new RemoteServiceException("第" + (i + 1) + "行, 配件类型错误");
|
|
@@ -668,8 +688,8 @@ public class WebsitGoodsLogic {
|
|
goods.setRemark(remark);
|
|
goods.setRemark(remark);
|
|
goods.setMarketPrice(new BigDecimal(salesStr));
|
|
goods.setMarketPrice(new BigDecimal(salesStr));
|
|
goods.setNormAmount(normAmount);
|
|
goods.setNormAmount(normAmount);
|
|
- goods.setSelfWorkerAmount(selfAmount);
|
|
|
|
- goods.setSelfWebsitAmount(normAmount.subtract(selfAmount));
|
|
|
|
|
|
+ goods.setSelfWorkerAmount(normAmount);
|
|
|
|
+// goods.setSelfWebsitAmount(normAmount.subtract(selfAmount));
|
|
// goods.setOutWorkerAmount(outAmount);
|
|
// goods.setOutWorkerAmount(outAmount);
|
|
// goods.setOutWebsitAmount(normAmount.subtract(outAmount));
|
|
// goods.setOutWebsitAmount(normAmount.subtract(outAmount));
|
|
goods.setBrandRelaName(brandStr);
|
|
goods.setBrandRelaName(brandStr);
|
|
@@ -677,8 +697,8 @@ public class WebsitGoodsLogic {
|
|
|
|
|
|
|
|
|
|
// 库存单位与销售单位一致
|
|
// 库存单位与销售单位一致
|
|
- goods.setGoodsStockUnit(unitStr);
|
|
|
|
- goods.setGoodsSalesUnit(unitStr);
|
|
|
|
|
|
+ goods.setGoodsStockUnit(StrUtil.trim(unitStr));
|
|
|
|
+ goods.setGoodsSalesUnit(StrUtil.trim(unitStr));
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
goods.setNormType(NormTypeEnum.M.getKey());
|
|
goods.setNormType(NormTypeEnum.M.getKey());
|
|
goods.setPartType(partType);
|
|
goods.setPartType(partType);
|
|
@@ -775,8 +795,8 @@ public class WebsitGoodsLogic {
|
|
|
|
|
|
|
|
|
|
// 库存单位与销售单位一致
|
|
// 库存单位与销售单位一致
|
|
- goods.setGoodsStockUnit(unitStr);
|
|
|
|
- goods.setGoodsSalesUnit(unitStr);
|
|
|
|
|
|
+ goods.setGoodsStockUnit(StrUtil.trim(unitStr));
|
|
|
|
+ goods.setGoodsSalesUnit(StrUtil.trim(unitStr));
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
goods.setManageWorkerStock(JudgeEnum.YES.getKey());
|
|
goods.setNormType(NormTypeEnum.S.getKey());
|
|
goods.setNormType(NormTypeEnum.S.getKey());
|
|
|
|
|