Ver código fonte

Merge remote-tracking branch 'origin/develop' into develop

shenjingwei 4 meses atrás
pai
commit
66450044b3

+ 2 - 2
src/custom/beans/stockbill/bills/QTCK.java

@@ -23,10 +23,10 @@ public class QTCK extends BasicBill {
                 if(row.getBoolean("skucontrol")){
                     if(codeRowsMap.containsKey(row.getString("st_stockbill_itemsid"))){
                         if(codeRowsMap.get(row.getString("st_stockbill_itemsid")).size()!=row.getInteger("qty")){
-                            throw new YosException("行号:"+row.getString("rowno")+"序列号数量和出库数量不一致");
+                            //throw new YosException("行号:"+row.getString("rowno")+"序列号数量和出库数量不一致");
                         }
                     }else{
-                        throw new YosException("受序列号管控的商品,审核时必须有序列号");
+                        //throw new YosException("受序列号管控的商品,审核时必须有序列号");
                     }
                 }
 

+ 2 - 2
src/custom/beans/stockbill/bills/QTRK.java

@@ -22,10 +22,10 @@ public class QTRK extends BasicBill {
                 if(row.getBoolean("skucontrol")){
                     if(codeRowsMap.containsKey(row.getString("st_stockbill_itemsid"))){
                         if(codeRowsMap.get(row.getString("st_stockbill_itemsid")).size()!=row.getInteger("qty")){
-                            throw new YosException("行号:"+row.getString("rowno")+"序列号数量和入库数量不一致");
+                            //throw new YosException("行号:"+row.getString("rowno")+"序列号数量和入库数量不一致");
                         }
                     }else{
-                        throw new YosException("受序列号管控的商品,审核时必须有序列号");
+                        //throw new YosException("受序列号管控的商品,审核时必须有序列号");
                     }
                 }
 

+ 5 - 2
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -217,8 +217,11 @@ public class OrderItems extends Controller {
                         billingstatus = "保外收费";
                     }
                 }
-                if(!billingstatus.equals("保内收费")){
-                    //sqlList.add("update sa_orderitems set canoffqty=0 where sa_orderitemsid=" + rowsdetail.getLong("sa_orderitemsid"));
+                if(!billingstatus.equals("保内收费") ){
+                    if(sa_orderitemsids_insert.contains(rowsdetail.getLong("sa_orderitemsid"))){
+                        sqlList.add("update sa_orderitems set canoffqty=0 where sa_orderitemsid=" + rowsdetail.getLong("sa_orderitemsid"));
+                    }
+
                 }
                 sqlList.add("update sa_orderitems set price=" + price + ",amount=" + amount + ",billingstatus='" + billingstatus + "' where sa_orderitemsid=" + rowsdetail.getLong("sa_orderitemsid"));
             }

+ 3 - 3
src/custom/restcontroller/webmanage/sale/serviceorder/serviceorder.java

@@ -986,13 +986,13 @@ public class serviceorder extends Controller {
 
                         if (isMoreThanOneHourUsingCalendar(rows.get(0).getDate("verificationdate"), new Date())) {
                             Sms sms = new Sms();
-                            sms.sendout(Sms.SmsType.Notice, customerphone, "【浙江美大】尊敬的美大用户您好,您的美大产品安装已完成,请您将服务完工验证码"+verificationCode+"告知安装人员,谢谢您的配合!有美大,家更美!");
+                            sms.sendout(Sms.SmsType.Notice, customerphone, "尊敬的美大用户您好,您的美大产品安装已完成,请您将服务完工验证码"+verificationCode+"告知安装人员,谢谢您的配合!有美大,家更美!");
                             message_map.put(customerphone, new VerificationManage(verificationCode));
                             dbConnect.runSqlUpdate("update sa_workorder set verificationdate=CURRENT_TIME where sa_workorderid=" + sa_workorderid);
                         }
                     } else {
                         Sms sms = new Sms();
-                        sms.sendout(Sms.SmsType.Notice, customerphone, "【浙江美大】尊敬的美大用户您好,您的美大产品安装已完成,请您将服务完工验证码"+verificationCode+"告知安装人员,谢谢您的配合!有美大,家更美!");
+                        sms.sendout(Sms.SmsType.Notice, customerphone, "尊敬的美大用户您好,您的美大产品安装已完成,请您将服务完工验证码"+verificationCode+"告知安装人员,谢谢您的配合!有美大,家更美!");
                         message_map.put(customerphone, new VerificationManage(verificationCode));
                         dbConnect.runSqlUpdate("update sa_workorder set verificationdate=CURRENT_TIME where sa_workorderid=" + sa_workorderid);
                     }
@@ -1032,7 +1032,7 @@ public class serviceorder extends Controller {
         }
 
         if (usertype == 99) {
-            customerphone = userrows.get(0).getString("scenecontactphonenumber");
+            customerphone = rows.get(0).getString("scenecontactphonenumber");
         } else {
             if (type.equals("安装")) {
                 customerphone = rows.get(0).getString("scenecontactphonenumber");

+ 1 - 1
src/custom/restcontroller/webmanage/sale/u8/SQL/销售出库U8上传单据查询.sql

@@ -1,5 +1,5 @@
 select t1.address,t1.sys_enterpriseid,t1.billno,t1.name,t1.billdate,t1.remarks,t1.period,t1.phonenumber,
-       case when t1.typemx='正品入库'then'红'else rb end rb,t1.sourceid,t1.sourceobject,t1.st_stockbillid,t2.u8id,t1.status,t1.type,t1.typemx,t1.outplace  from st_stockbill t1
+       case when t1.typemx='正品入库' then 0 else rb end rb,t1.sourceid,t1.sourceobject,t1.st_stockbillid,t2.u8id,t1.status,t1.type,t1.typemx,t1.outplace  from st_stockbill t1
                                                                                                                                                                  inner join (
     select distinct st_stockbillid,inserted.u8id,inserted.entity from u8billcodes
         inner join u8 inserted on u8billcodes.u8id=inserted.u8id where inserted.u8id=$u8id$

+ 1 - 1
src/custom/restcontroller/webmanage/sale/u8/SQL/销售出库U8上传序列号查询.sql

@@ -14,7 +14,7 @@ WITH inserted AS (
              CASE
 
                  WHEN t1.typemx = '正品入库' THEN
-                     '红' ELSE t1.rb
+                     0 ELSE t1.rb
                  END rb,
              t2.qty,
              t1.type,

+ 1 - 1
src/custom/restcontroller/webmanage/sale/u8/SQL/销售出库u8商品价格查询.sql

@@ -33,7 +33,7 @@ FROM (SELECT itemid,
          LEFT JOIN (SELECT t3.u8id,
                            t2.itemid,
                            (
-                               sum(t2.untaxedamount) / SUM(t2.qty)) AS saleprice,
+                               sum(t2.amount) / SUM(t2.qty)) AS saleprice,
                            CASE
 
                                WHEN t1.outplace = '谈桥' THEN

+ 8 - 7
src/custom/restcontroller/webmanage/sale/u8/u8.java

@@ -14,6 +14,7 @@ import org.apache.commons.lang.StringUtils;
 import restcontroller.R;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 
 @API(title = "销售出库U8上传")
@@ -698,12 +699,12 @@ public class u8 extends Controller {
             BigDecimal taxprice = BigDecimal.ZERO;
             BigDecimal price = BigDecimal.ZERO;
             if (changetype.equals("百分比")) {
-                taxprice = row.getBigDecimal("saleprice").multiply(BigDecimal.valueOf(100).add(changevalue)).divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
-                price = taxprice.multiply(BigDecimal.valueOf(100).add(row.getBigDecimal("taxrate"))).divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
+                taxprice = row.getBigDecimal("saleprice").multiply(BigDecimal.valueOf(100).add(changevalue)).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
+                price = taxprice.multiply(BigDecimal.valueOf(100)).divide(BigDecimal.valueOf(100).add(row.getBigDecimal("taxrate")), 6, RoundingMode.HALF_UP);
 
             } else if (changetype.equals("金额")) {
                 taxprice = row.getBigDecimal("saleprice").add(changevalue);
-                price = taxprice.multiply(BigDecimal.valueOf(100).add(row.getBigDecimal("taxrate"))).divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
+                price = taxprice.multiply(BigDecimal.valueOf(100)).divide(BigDecimal.valueOf(100).add(row.getBigDecimal("taxrate")), 6, RoundingMode.HALF_UP);
 
             }
             sqllist.add("update u8itemprice set price=" + price + ",taxprice=" + taxprice + " where u8itempriceid=" + row.getLong("u8itempriceid"));
@@ -742,11 +743,11 @@ public class u8 extends Controller {
         JSONArray detail = new JSONArray();
 
         Rows rows = dbConnect.runSqlQuery("select t3.itemno,t1.itemid,t1.stockno,ifnull(t1.qty,0) qty,ifnull(t2.price,0) price,ifnull(t2.taxprice,0) taxprice,ifnull(t2.taxrate,0) taxrate,t2.stockid  from (\n" +
-                "select distinct t1.itemid,t1.u8id,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end as stockno,sum(t1.qty)qty from u8billcodes t1\n" +
+                "select distinct t1.itemid,t1.u8id,case when t2.outplace='谈桥' then 1605 when t2.outplace='马桥' then 2320 else t1.stockid end stockid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end as stockno,sum(t1.qty)qty from u8billcodes t1\n" +
                 "inner join u8bills t2 on t1.billno=t2.billno and t1.u8id=t2.u8id \n" +
                 "left join st_stock t3 on t1.stockid=t3.stockid\n" +
                 "where t1.rb='1' and t1.u8id=" + u8id +
-                " group by t1.itemid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end,t1.u8id )t1 left join u8itemprice t2 on t1.u8id=t2.u8id and t1.itemid=t2.itemid left join plm_item t3 on t1.itemid=t3.itemid");
+                " group by t1.itemid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end,t1.u8id,case when t2.outplace='谈桥' then 1605 when t2.outplace='马桥' then 2320 else t1.stockid end )t1 left join u8itemprice t2 on t1.u8id=t2.u8id and t1.itemid=t2.itemid and t1.stockid=t2.stockid left join plm_item t3 on t1.itemid=t3.itemid");
         int rowno = 1;
         for (Row row : rows) {
             BigDecimal qty = row.getBigDecimal("qty");
@@ -815,11 +816,11 @@ public class u8 extends Controller {
         JSONArray detail = new JSONArray();
 
         Rows rows = dbConnect.runSqlQuery("select t1.itemid,t1.stockno,ifnull(-t1.qty,0) qty,ifnull(t2.price,0) price,ifnull(t2.taxprice,0) taxprice,ifnull(t2.taxrate,0) taxrate,t3.itemno,t2.stockid from (\n" +
-                "select distinct t1.itemid,t1.u8id,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end as stockno,sum(t1.qty)qty from u8billcodes t1\n" +
+                "select distinct t1.itemid,t1.u8id,case when t2.outplace='谈桥' then 1605 when t2.outplace='马桥' then 2320 else t1.stockid end stockid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end as stockno,sum(t1.qty)qty from u8billcodes t1\n" +
                 "inner join u8bills t2 on t1.billno=t2.billno and t1.u8id=t2.u8id \n" +
                 "left join st_stock t3 on t1.stockid=t3.stockid\n" +
                 "where t1.rb='0' and t1.u8id=" + u8id +
-                " group by t1.itemid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end,t1.u8id )t1 left join u8itemprice t2 on t1.u8id=t2.u8id and t1.itemid=t2.itemid left join plm_item t3 on t1.itemid=t3.itemid");
+                " group by t1.itemid,case when t2.outplace='谈桥' then '103' when t2.outplace='马桥' then '109' else t3.stockno end,t1.u8id,case when t2.outplace='谈桥' then 1605 when t2.outplace='马桥' then 2320 else t1.stockid end )t1 left join u8itemprice t2 on t1.u8id=t2.u8id and t1.itemid=t2.itemid and t1.stockid=t2.stockid left join plm_item t3 on t1.itemid=t3.itemid");
         int rowno = 1;
         for (Row row : rows) {
             BigDecimal qty = row.getBigDecimal("qty");