Prechádzať zdrojové kódy

Merge branch 'develop' into develop-green

hu 3 týždňov pred
rodič
commit
5a8e111ad9

+ 46 - 46
src/custom/restcontroller/webmanage/lsak3/stockbill/stockbill.java

@@ -91,7 +91,7 @@ public class stockbill extends Controller {
 
             siteid = "lsa";
 
-            Long sa_cashbillid = 0L;
+//            Long sa_cashbillid = 0L;
 
             Rows stockbillRows = dbConnect.runSqlQuery("select * from st_stockbill where siteid='lsa' and status='审核' and billno='" + fbillnum + "'");
             Long st_stockbillid = 0L;
@@ -217,19 +217,19 @@ public class stockbill extends Controller {
                     String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
                     String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
                     if (!StringUtils.isBlank(icstockbillrebateaccount) && !StringUtils.isBlank(icstockbillrebaterate1)) {
-                        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
-                        //经销商返利
-                        BigDecimal rebateamount = icstockbillrebaterate.multiply(amountTotal);
-                        System.out.println(rebateamount);
-                        CashbillEntity entity = new CashbillEntity();
-                        entity.setAmount(rebateamount);
-                        entity.setOwnerid(st_stockbillid);
-                        entity.setOwnertable("st_stockbill");
-                        entity.setSource("");
-                        entity.setRemarks("销售出库单" + fbillnum + "返利");
-                        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
-                        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
-                        sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
+//                        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
+//                        //经销商返利
+//                        BigDecimal rebateamount = icstockbillrebaterate.multiply(amountTotal);
+//                        System.out.println(rebateamount);
+//                        CashbillEntity entity = new CashbillEntity();
+//                        entity.setAmount(rebateamount);
+//                        entity.setOwnerid(st_stockbillid);
+//                        entity.setOwnertable("st_stockbill");
+//                        entity.setSource("");
+//                        entity.setRemarks("销售出库单" + fbillnum + "返利");
+//                        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
+//                        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
+//                        sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
                     }
 
 
@@ -250,22 +250,22 @@ public class stockbill extends Controller {
                         billamount = billamount.add(row.getBigDecimal("amount").abs().negate());
                     }
 
-                    //返利比例
-                    String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
-                    String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
-                    BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
-                    //经销商返利
-                    BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
-
-                    CashbillEntity entity = new CashbillEntity();
-                    entity.setAmount(rebateamount);
-                    entity.setOwnerid(stockbillRows.get(0).getLong("st_stockbillid"));
-                    entity.setOwnertable("st_stockbill");
-                    entity.setSource("");
-                    entity.setRemarks("销售出库单" + fbillnum + "反返利");
-                    JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
-                    sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
-                    sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
+//                    //返利比例
+//                    String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
+//                    String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
+//                    BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
+//                    //经销商返利
+//                    BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
+//
+//                    CashbillEntity entity = new CashbillEntity();
+//                    entity.setAmount(rebateamount);
+//                    entity.setOwnerid(stockbillRows.get(0).getLong("st_stockbillid"));
+//                    entity.setOwnertable("st_stockbill");
+//                    entity.setSource("");
+//                    entity.setRemarks("销售出库单" + fbillnum + "反返利");
+//                    JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
+//                    sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
+//                    sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
                     /**
                      * 更新发货单数量
                      */
@@ -294,21 +294,21 @@ public class stockbill extends Controller {
                     }
 
                     //返利比例
-                    String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
-                    String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
-                    BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
-                    //经销商返利
-                    BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
-
-                    CashbillEntity entity = new CashbillEntity();
-                    entity.setAmount(rebateamount);
-                    entity.setOwnerid(stockbillRows.get(0).getLong("st_stockbillid"));
-                    entity.setOwnertable("st_stockbill");
-                    entity.setSource("");
-                    entity.setRemarks("销售出库单" + fbillnum + "反返利");
-                    JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
-                    sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
-                    sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
+//                    String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
+//                    String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
+//                    BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
+//                    //经销商返利
+//                    BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
+//
+//                    CashbillEntity entity = new CashbillEntity();
+//                    entity.setAmount(rebateamount);
+//                    entity.setOwnerid(stockbillRows.get(0).getLong("st_stockbillid"));
+//                    entity.setOwnertable("st_stockbill");
+//                    entity.setSource("");
+//                    entity.setRemarks("销售出库单" + fbillnum + "反返利");
+//                    JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
+//                    sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
+//                    sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
                     /**
                      * 更新发货单数量
                      */
@@ -328,7 +328,7 @@ public class stockbill extends Controller {
             dbConnect.runSqlUpdate(sqlList);
 
 
-            Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
+//            Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
             if (stockbillRows.isEmpty() && "0".equals(isdelete) && "审核".equals(fstatus)) {
                 ArrayList<Long> userIdList = dbConnect.runSqlQuery("select userid from sys_enterprise_hr where siteid='" + siteid + "' and sys_enterpriseid=" + sys_enterpriseid).toArrayList("userid", new ArrayList<>());
                 Executor.sendEml(this, "stocck_check", st_stockbillid, siteid, userIdList);

+ 37 - 37
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -173,22 +173,22 @@ public class stockbill extends Controller {
         }
 
         //返利比例
-        String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
-        long res = Long.valueOf(icstockbillrebateaccount).longValue();
-        String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
-        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
-        //经销商返利
-        BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
-
-        CashbillEntity entity = new CashbillEntity();
-        entity.setAmount(rebateamount);
-        entity.setOwnerid(st_stockbillid);
-        entity.setOwnertable("st_stockbill");
-        entity.setSource("");
-        entity.setRemarks("销售出库单" + rows.get(0).getString("billno") + "返利");
-        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
-        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
-        Long sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
+//        String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
+//        long res = Long.valueOf(icstockbillrebateaccount).longValue();
+//        String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
+//        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
+//        //经销商返利
+//        BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
+//
+//        CashbillEntity entity = new CashbillEntity();
+//        entity.setAmount(rebateamount);
+//        entity.setOwnerid(st_stockbillid);
+//        entity.setOwnertable("st_stockbill");
+//        entity.setSource("");
+//        entity.setRemarks("销售出库单" + rows.get(0).getString("billno") + "返利");
+//        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
+//        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
+//        Long sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
 
         SQLFactory sqlFactoryupdate = new SQLFactory(this, "出入库单审核");
         sqlFactoryupdate.addParameter("siteid", siteid);
@@ -198,7 +198,7 @@ public class stockbill extends Controller {
         sqlList.add(DataContrlLog.createLog(this, "st_stockbill", st_stockbillid, "审核", "出入库单审核成功").getSQL());
         dbConnect.runSqlUpdate(sqlList);
 
-        Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
+//        Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
         return getSucReturnObject().toString();
 
     }
@@ -232,25 +232,25 @@ public class stockbill extends Controller {
         }
 
         //返利比例
-        String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
-        long res = Long.valueOf(icstockbillrebateaccount).longValue();
-        String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
-        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
-        //经销商返利
-        BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
-
-        CashbillEntity entity = new CashbillEntity();
-        entity.setAmount(rebateamount);
-        entity.setOwnerid(st_stockbillid);
-        entity.setOwnertable("st_stockbill");
-        entity.setSource("");
-        entity.setRemarks("销售出库单" + rows.get(0).getString("billno") + "返利");
-        if (!Accountbalance.judgeBalance(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), rebateamount)) {
-            return getErrReturnObject().setErrMsg("账户余额不足,还差" + Accountbalance.InsufficientBalance(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), rebateamount) + "元!").toString();
-        }
-        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
-        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
-        Long sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
+//        String icstockbillrebateaccount = Parameter.get(siteid, "icstockbillrebateaccount"); //经销商销售出库单返利账户
+//        long res = Long.valueOf(icstockbillrebateaccount).longValue();
+//        String icstockbillrebaterate1 = Parameter.get(siteid, "icstockbillrebaterate"); //销售出库单返利比例
+//        BigDecimal icstockbillrebaterate = new BigDecimal(icstockbillrebaterate1);
+//        //经销商返利
+//        BigDecimal rebateamount = icstockbillrebaterate.multiply(billamount);
+//
+//        CashbillEntity entity = new CashbillEntity();
+//        entity.setAmount(rebateamount);
+//        entity.setOwnerid(st_stockbillid);
+//        entity.setOwnertable("st_stockbill");
+//        entity.setSource("");
+//        entity.setRemarks("销售出库单" + rows.get(0).getString("billno") + "返利");
+//        if (!Accountbalance.judgeBalance(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), rebateamount)) {
+//            return getErrReturnObject().setErrMsg("账户余额不足,还差" + Accountbalance.InsufficientBalance(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), rebateamount) + "元!").toString();
+//        }
+//        JSONObject cashbillIncome = Accountbalance.createCashbillIncome(this, sys_enterpriseid, Long.valueOf(icstockbillrebateaccount).longValue(), entity, true, false);
+//        sqlList.addAll(cashbillIncome.getJSONArray("sqlList").toJavaList(String.class));
+//        Long sa_cashbillid = cashbillIncome.getLong("sa_cashbillid");
 
         SQLFactory sqlFactoryupdate = new SQLFactory(this, "出入库单反审核");
         sqlFactoryupdate.addParameter("siteid", siteid);
@@ -260,7 +260,7 @@ public class stockbill extends Controller {
         sqlList.add(DataContrlLog.createLog(this, "st_stockbill", st_stockbillid, "反审核", "出入库单反审核成功").getSQL());
         dbConnect.runSqlUpdate(sqlList);
 
-        Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
+//        Accountbalance.remindSend(this, sys_enterpriseid, sa_cashbillid);
         return getSucReturnObject().toString();
     }