|
|
@@ -1,8 +1,26 @@
|
|
|
package com.uas.platform.b2b.service.impl;
|
|
|
|
|
|
-import com.uas.platform.b2b.dao.*;
|
|
|
+import com.uas.platform.b2b.dao.CommonDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyHisVendorsDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyLastOrderKeywordsDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyOrderDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyOrderItemDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyOrderKeywordsDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyOrdersLogDao;
|
|
|
+import com.uas.platform.b2b.dao.DeputyPaymentCompanyDao;
|
|
|
+import com.uas.platform.b2b.dao.PagingReleaseCountDao;
|
|
|
+import com.uas.platform.b2b.dao.VendorDao;
|
|
|
import com.uas.platform.b2b.mobile.dao.DeputyEnterpriseDao;
|
|
|
-import com.uas.platform.b2b.model.*;
|
|
|
+import com.uas.platform.b2b.model.DeputyEnterprise;
|
|
|
+import com.uas.platform.b2b.model.DeputyHisVendors;
|
|
|
+import com.uas.platform.b2b.model.DeputyLastOrderKeywords;
|
|
|
+import com.uas.platform.b2b.model.DeputyOrder;
|
|
|
+import com.uas.platform.b2b.model.DeputyOrderItem;
|
|
|
+import com.uas.platform.b2b.model.DeputyOrderKeywords;
|
|
|
+import com.uas.platform.b2b.model.DeputyOrdersLog;
|
|
|
+import com.uas.platform.b2b.model.DeputyPaymentCompany;
|
|
|
+import com.uas.platform.b2b.model.SearchFilter;
|
|
|
+import com.uas.platform.b2b.model.Vendor;
|
|
|
import com.uas.platform.b2b.service.DeputyOrderService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
@@ -36,10 +54,16 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
+/**
|
|
|
+ * 代采订单
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-11-07 15:35
|
|
|
+ */
|
|
|
@Service
|
|
|
public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
|
|
|
- private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
+ private final static UsageBufferedLogger LOGGER = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
|
|
|
@Autowired
|
|
|
private DeputyOrderItemDao deputyOrderItemDao;
|
|
|
@@ -97,7 +121,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行商品名称未填写");
|
|
|
}
|
|
|
-
|
|
|
// 编号
|
|
|
if (row.getCell(1) != null && row.getCell(1).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -105,7 +128,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行商品型号未填写");
|
|
|
}
|
|
|
-
|
|
|
// 规格
|
|
|
if (row.getCell(2) != null && row.getCell(2).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -113,7 +135,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行商品规格未填写");
|
|
|
}
|
|
|
-
|
|
|
// 品牌
|
|
|
if (row.getCell(3) != null && row.getCell(3).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(3).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -121,7 +142,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行商品品牌未填写");
|
|
|
}
|
|
|
-
|
|
|
// 数量
|
|
|
if (row.getCell(4) != null && row.getCell(4).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(4).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -129,7 +149,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行数量未填写");
|
|
|
}
|
|
|
-
|
|
|
// 单价
|
|
|
if (row.getCell(5) != null && row.getCell(5).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(5).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -137,7 +156,6 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行单价未填写");
|
|
|
}
|
|
|
-
|
|
|
// 订单单价
|
|
|
if (row.getCell(6) != null && row.getCell(6).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -148,13 +166,11 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
} else {
|
|
|
alters.add("第" + (r + 1) + "行订单单价未填写");
|
|
|
}
|
|
|
-
|
|
|
// 总价
|
|
|
if (row.getCell(7) != null && row.getCell(7).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(7).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
info.setTotalprice(Double.valueOf(row.getCell(7).getStringCellValue()));
|
|
|
}
|
|
|
-
|
|
|
// 备注
|
|
|
if (row.getCell(8) != null && row.getCell(8).getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
row.getCell(8).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
@@ -236,7 +252,7 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
}
|
|
|
if (items.get(0).getId() != null) {
|
|
|
map.put("id", items.get(0).getDeoid());
|
|
|
- logger.log("保存代采订单", "保存代采订单", "新增了一张代采订单");
|
|
|
+ LOGGER.log("保存代采订单", "保存代采订单", "新增了一张代采订单");
|
|
|
} else {
|
|
|
map.put("error", "订单保存失败");
|
|
|
}
|
|
|
@@ -380,9 +396,9 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
payCompany.setDepuseruu(SystemSession.getUser().getUserUU());
|
|
|
payCompany.setEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
if (payCompany.getId() == null) {
|
|
|
- logger.log("付款企业", "新增付款企业", SystemSession.getUser().getUserUU(), SystemSession.getUser().getIp());
|
|
|
+ LOGGER.log("付款企业", "新增付款企业", SystemSession.getUser().getUserUU(), SystemSession.getUser().getIp());
|
|
|
} else {
|
|
|
- logger.log("付款企业", "修改付款企业信息", SystemSession.getUser().getUserUU(), SystemSession.getUser().getIp());
|
|
|
+ LOGGER.log("付款企业", "修改付款企业信息", SystemSession.getUser().getUserUU(), SystemSession.getUser().getIp());
|
|
|
}
|
|
|
return deputyPaymentCompanyDao.save(payCompany);
|
|
|
}
|
|
|
@@ -391,7 +407,7 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
public void removePayCompany(Long id) {
|
|
|
try {
|
|
|
deputyPaymentCompanyDao.delete(id);
|
|
|
- logger.log("付款企业", "删除款企业信息(" + id + ")", SystemSession.getUser().getUserUU(),
|
|
|
+ LOGGER.log("付款企业", "删除款企业信息(" + id + ")", SystemSession.getUser().getUserUU(),
|
|
|
SystemSession.getUser().getIp());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -415,6 +431,7 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
|
|
|
ModelMap map = new ModelMap();
|
|
|
DeputyOrder order = deputyOrderDao.findOne(id);
|
|
|
if (order != null) {
|
|
|
+ LOGGER.log("代采订单", "删除代采订单[" + id + "], 单号[" + order.getSalecode() + "]");
|
|
|
if (!CollectionUtils.isEmpty(order.getDeputyOrderItems())) {
|
|
|
for (DeputyOrderItem item : order.getDeputyOrderItems()) {
|
|
|
try {
|