Commit f48bb5a1 authored by Quxl's avatar Quxl

x

parent 68f1c033
...@@ -123,6 +123,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -123,6 +123,7 @@ public class OrderServiceImpl implements OrderService {
if (commitMap != null && commitMap.size() > 0 && commitMap.get(0) != null && Util.objTo(commitMap.get(0).get("Status"), Integer.class) == 0 && Util.objTo(commitMap.get(commitMap.size()-1).get("Status"), Integer.class) == 0) { if (commitMap != null && commitMap.size() > 0 && commitMap.get(0) != null && Util.objTo(commitMap.get(0).get("Status"), Integer.class) == 0 && Util.objTo(commitMap.get(commitMap.size()-1).get("Status"), Integer.class) == 0) {
String sSalesOrderID = (String)commitMap.get(0).get("SalesOrderID"); String sSalesOrderID = (String)commitMap.get(0).get("SalesOrderID");
jdbcTemplate.update("update tSalesOrder set sFormID = ?, sEmail = ?, sSalesmanNO = ? where sSalesOrderID = ?", formId, email, salesmanNo, sSalesOrderID); jdbcTemplate.update("update tSalesOrder set sFormID = ?, sEmail = ?, sSalesmanNO = ? where sSalesOrderID = ?", formId, email, salesmanNo, sSalesOrderID);
this.sendWxMessage(sSalesOrderID);
return Rjx.jsonOk().setData(commitMap).toJson(); return Rjx.jsonOk().setData(commitMap).toJson();
} else { } else {
String errorMsg = ""; String errorMsg = "";
...@@ -265,7 +266,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -265,7 +266,7 @@ public class OrderServiceImpl implements OrderService {
Dialect dialect = jdbcTemplate.getDialect(); Dialect dialect = jdbcTemplate.getDialect();
Sql sqlDesc = dialect.argsInsert("tSalesOrderPay", map); Sql sqlDesc = dialect.argsInsert("tSalesOrderPay", map);
String sql = "if not exists (select * from tSalesOrderPay where sTransTraceNO = '" + sTransTraceNO + "') " + sqlDesc.getSql(); String sql = "if not exists (select * from tSalesOrderPay where sTransTraceNO = '" + sTransTraceNO + "') " + sqlDesc.getSql();
int count = jdbcTemplate.update(sql, sqlDesc.getArgs()); jdbcTemplate.update(sql, sqlDesc.getArgs());
jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?", sSalesOrderID); jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?", sSalesOrderID);
try { try {
jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'"); jdbcTemplate.executeMutil("exec Up_Ego_SplitOrderPrd '" + sSalesOrderID + "'");
...@@ -275,44 +276,6 @@ public class OrderServiceImpl implements OrderService { ...@@ -275,44 +276,6 @@ public class OrderServiceImpl implements OrderService {
} }
throw e; throw e;
} }
if(count > 0) {
TSalesOrder order = jdbcTemplate.queryForBean("select * from tSalesOrder where sSalesOrderID = ?", TSalesOrder.class, sSalesOrderID);
String salesmanNo = order.getsSalesmanNO();
String shopNo = order.getsShopNO();
BigDecimal totalAmount = order.getnTotalSaleAmount();
BigDecimal totalSaleQty = order.getnTotalSaleQty();
String payType = order.getsSalesOrderPayType();
Map<String, Object> salesman = null;
try {
salesman = jdbcTemplate.queryForMap("select * from tSalesman where sSalesmanNO = ?", salesmanNo);
} catch (EmptyResultDataAccessException e) {
e.printStackTrace();
}
if(salesman != null) {
Map<String, Object> shop = jdbcTemplate.queryForMap("select * from tShop where sShopNO = ?", shopNo);
String custNo = (String)shop.get("sCustNO");
String shopMemo = (String)shop.get("sMemo");
Map<String, Object> cust = jdbcTemplate.queryForMap("select * from tCustomer where sCustNO = ?", custNo);;
String custName = (String)cust.get("sCustName");
String sCompanyAccountID = (String)salesman.get("sCompanyAccountID");
WxMessage wxMessage = new WxMessage(sCompanyAccountID);
MiniprogramNotice notice = new MiniprogramNotice();
wxMessage.setMiniprogram_notice(notice);
notice.setDescription("当前时间");
notice.setTitle("认证审核通知");
notice.setPage("pages/ordermanage/detail/detail?SalesmanNO=" + salesmanNo + "&isShare=1&id=" + sSalesOrderID + "&isActive=0");
Map<Object, Object> params = new LinkedHashMap<Object, Object>();
params.put("订单状态", "待审核");
params.put("客户", custName);
params.put("订单金额", totalAmount);
params.put("商品数量", totalSaleQty);
params.put("支付方式", payType);
params.put("订单时间", DateUtil.format(new Date()));
params.put("备注", StringUtil.isBlank(shopMemo) ? " " : shopMemo);
notice.setContent_item(params);
wxService.sendMessage(wxMessage);
}
}
} }
@Override @Override
...@@ -547,6 +510,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -547,6 +510,7 @@ public class OrderServiceImpl implements OrderService {
list.add(dtl); list.add(dtl);
} }
jdbcTemplate.batchSave(list); jdbcTemplate.batchSave(list);
this.sendWxMessage(order.getsSalesOrderID());
return order.getsSalesOrderID(); return order.getsSalesOrderID();
} }
...@@ -704,7 +668,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -704,7 +668,7 @@ public class OrderServiceImpl implements OrderService {
String sqlUpdate = "update tZHCProject set nSalePaperQty = ?, nSaleQty = ?, nSaleAmount = ? where nProjectID = ?"; String sqlUpdate = "update tZHCProject set nSalePaperQty = ?, nSaleQty = ?, nSaleAmount = ? where nProjectID = ?";
jdbcTemplate.executeUpdate(sqlUpdate, nSalePaperQty, nSaleQty, nSaleAmount, nProjectID); jdbcTemplate.executeUpdate(sqlUpdate, nSalePaperQty, nSaleQty, nSaleAmount, nProjectID);
} }
this.sendWxMessage(order.getsSalesOrderID());
return order.getsSalesOrderID(); return order.getsSalesOrderID();
} }
...@@ -824,7 +788,7 @@ public class OrderServiceImpl implements OrderService { ...@@ -824,7 +788,7 @@ public class OrderServiceImpl implements OrderService {
dtl.setsSalesOrderID(sSalesOrderID); dtl.setsSalesOrderID(sSalesOrderID);
dtl.setsWarehouseNO(sWarehouseNO); dtl.setsWarehouseNO(sWarehouseNO);
jdbcTemplate.save(dtl); jdbcTemplate.save(dtl);
this.sendWxMessage(order.getsSalesOrderID());
return order.getsSalesOrderID(); return order.getsSalesOrderID();
} }
...@@ -890,4 +854,43 @@ public class OrderServiceImpl implements OrderService { ...@@ -890,4 +854,43 @@ public class OrderServiceImpl implements OrderService {
return jdbcTemplate.queryForList("select * from tSalesOrderDeliverSubDtl where nTag&1 = 0 and sAocOrderID = ?", aocOrderID); return jdbcTemplate.queryForList("select * from tSalesOrderDeliverSubDtl where nTag&1 = 0 and sAocOrderID = ?", aocOrderID);
} }
private void sendWxMessage(String sSalesOrderID) {
TSalesOrder order = jdbcTemplate.queryForBean("select * from tSalesOrder where sSalesOrderID = ?", TSalesOrder.class, sSalesOrderID);
String salesmanNo = order.getsSalesmanNO();
String shopNo = order.getsShopNO();
BigDecimal totalAmount = order.getnTotalSaleAmount();
BigDecimal totalSaleQty = order.getnTotalSaleQty();
String payType = order.getsSalesOrderPayType();
Map<String, Object> salesman = null;
try {
salesman = jdbcTemplate.queryForMap("select * from tSalesman where sSalesmanNO = ?", salesmanNo);
} catch (EmptyResultDataAccessException e) {
e.printStackTrace();
}
if(salesman != null) {
Map<String, Object> shop = jdbcTemplate.queryForMap("select * from tShop where sShopNO = ?", shopNo);
String custNo = (String)shop.get("sCustNO");
String shopMemo = (String)shop.get("sMemo");
Map<String, Object> cust = jdbcTemplate.queryForMap("select * from tCustomer where sCustNO = ?", custNo);;
String custName = (String)cust.get("sCustName");
String sCompanyAccountID = (String)salesman.get("sCompanyAccountID");
WxMessage wxMessage = new WxMessage(sCompanyAccountID);
MiniprogramNotice notice = new MiniprogramNotice();
wxMessage.setMiniprogram_notice(notice);
notice.setDescription("当前时间");
notice.setTitle("认证审核通知");
notice.setPage("pages/ordermanage/detail/detail?SalesmanNO=" + salesmanNo + "&isShare=1&id=" + sSalesOrderID + "&isActive=0");
Map<Object, Object> params = new LinkedHashMap<Object, Object>();
params.put("订单状态", "待审核");
params.put("客户", custName);
params.put("订单金额", totalAmount);
params.put("商品数量", totalSaleQty);
params.put("支付方式", payType);
params.put("订单时间", DateUtil.format(new Date()));
params.put("备注", StringUtil.isBlank(shopMemo) ? " " : shopMemo);
notice.setContent_item(params);
wxService.sendMessage(wxMessage);
}
}
} }
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