diff --git a/ssjygl-xsct-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java b/ssjygl-xsct-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java index e6685db..d4b18b8 100644 --- a/ssjygl-xsct-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java +++ b/ssjygl-xsct-common/src/main/java/com/cowr/ssjygl/stat/sale/OrderStatService.java @@ -552,7 +552,7 @@ public class OrderStatService { " select t.id, t.product_id, count(*) as orderCount, sum(t.total_price) as totalPrice, sum(t.weight) as weight\n" + " from (\n" + " select t.supermarket_id as id, t.paid, t.total_price, t.weight, t.product_id\n" + - " from order_temp t LEFT JOIN supermarket s on t.supermarket_id = s.id\n" + + " from order_temp t LEFT JOIN supermarket s on t.supermarket_id = s.id AND s.type = 0\n" + " where t.state = 5 \n" + // " and t.create_time like ? \n" + " and t.create_time between ? and ? \n" + @@ -604,39 +604,37 @@ public class OrderStatService { // 查询取土场站订单信息 List sale_list = Db.find("SELECT \n" + - "\tg.sandfarm_id," + + " g.sandfarm_id," + " s.name sandfarm_name,\n" + " ifnull( sum( CASE WHEN g.supermarket_id = 1 THEN g.count END ), 0 ) xsl_1,\n" + " ifnull( sum( CASE WHEN g.supermarket_id = 1 THEN g.weight END ), 0 ) xse_1,\n" + " ifnull( sum( CASE WHEN g.supermarket_id = 1 THEN g.source_weight END ), 0 ) xss_1,\n" + - " ifnull( sum( CASE WHEN g.supermarket_id = 4 THEN g.count END ), 0 ) xsl_4,\n" + - " ifnull( sum( CASE WHEN g.supermarket_id = 4 THEN g.weight END ), 0 ) xse_4,\n" + - " ifnull( sum( CASE WHEN g.supermarket_id = 4 THEN g.source_weight END ), 0 ) xss_4,\n" + " ifnull( sum( g.weight), 0 ) weight\n" + - " FROM (\n" + + " FROM supermarket s " + + " LEFT JOIN (\n" + "SELECT\n" + - "\tt.supermarket_id,\n" + - "\tso.NAME out_name,\n" + - "\tt.sandfarm_id,\n" + - "\tsi.NAME in_name,\n" + - "\tcount( t.sn ) count,\n" + - "\tsum( t.weight ) weight,\n" + - "\tsum( t.source_weight ) source_weight \n" + + " t.supermarket_id,\n" + + " so.NAME out_name,\n" + + " t.sandfarm_id,\n" + + " si.NAME in_name,\n" + + " count( t.sn ) count,\n" + + " sum( t.weight ) weight,\n" + + " sum( t.source_weight ) source_weight \n" + "FROM\n" + - "\torder_transfer t\n" + - "\tLEFT JOIN supermarket so ON t.sandfarm_id = so.id \n" + - "\tAND so.del = 0\n" + - "\tLEFT JOIN supermarket si ON t.supermarket_id = si.id \n" + - "\tAND si.del = 0 \n" + + " order_transfer t\n" + + " LEFT JOIN supermarket so ON t.sandfarm_id = so.id \n" + + " AND so.del = 0\n" + + " LEFT JOIN supermarket si ON t.supermarket_id = si.id \n" + + " AND si.del = 0 \n" + "WHERE\n" + - "\tt.state = 5 " + - "\tAND t.create_time >= ? \n" + - "\tAND t.create_time <= ? \n" + + " t.state = 5 " + + " AND t.create_time >= ? \n" + + " AND t.create_time <= ? \n" + "GROUP BY\n" + - "\tsandfarm_id,\n" + - "\tsupermarket_id\n" + - ") g" + - " LEFT JOIN supermarket s ON s.id = g.sandfarm_id" + + " sandfarm_id,\n" + + " supermarket_id\n" + + ") g ON s.id = g.sandfarm_id " + + " where s.type = 1" + " GROUP BY g.sandfarm_id" + " ORDER BY g.sandfarm_id", stm,etm); @@ -645,9 +643,6 @@ public class OrderStatService { double all_xsl_1 = 0.0; double all_xse_1 = 0.0; double all_xss_1 = 0.0; - double all_xsl_4 = 0.0; - double all_xse_4 = 0.0; - double all_xss_4 = 0.0; double all_weight = 0.0; for (Record record : sale_list) { @@ -655,9 +650,6 @@ public class OrderStatService { all_xsl_1 += DataUtil.getDefaultByRecord(record, "xsl_1"); all_xse_1 += DataUtil.getDefaultByRecord(record, "xse_1"); all_xss_1 += DataUtil.getDefaultByRecord(record, "xss_1"); - all_xsl_4 += DataUtil.getDefaultByRecord(record, "xsl_4"); - all_xse_4 += DataUtil.getDefaultByRecord(record, "xse_4"); - all_xss_4 += DataUtil.getDefaultByRecord(record, "xss_4"); all_weight += DataUtil.getDefaultByRecord(record, "weight"); } @@ -667,9 +659,6 @@ public class OrderStatService { record.set("xsl_1", all_xsl_1); record.set("xse_1", all_xse_1); record.set("xss_1", all_xss_1); - record.set("xsl_4", all_xsl_4); - record.set("xse_4", all_xse_4); - record.set("xss_4", all_xss_4); record.set("weight", all_weight); sale_list.add(record); @@ -3652,30 +3641,31 @@ public class OrderStatService { " ifnull(sum(g.presell_amount), 0) total_presell_amount,\n" + " ifnull(sum(g.pug_amount), 0) total_presell_pug,\n" + " ifnull(sum(g.weight), 0) total_weight,\n" + - " ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.presell_amount end), 0) xsl_1,\n" + - " ifnull(sum(case when g.supermarket_id = 2 then g.presell_amount end), 0) xsl_2,\n" + - " ifnull(sum(case when g.supermarket_id = 3 then g.presell_amount end), 0) xsl_3,\n" + - " ifnull(sum(case when g.supermarket_id = 4 then g.presell_amount end), 0) xsl_4,\n" + - " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.presell_amount end), 0) xsl_5,\n" + - " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.presell_amount end), 0) xsl_6,\n" + - " ifnull(sum(case when g.supermarket_id = 11 then g.presell_amount end), 0) xsl_11,\n" + - " ifnull(sum(case when g.supermarket_id = 12 then g.presell_amount end), 0) xsl_12,\n" + - " ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.pug_amount end), 0) xse_1,\n" + - " ifnull(sum(case when g.supermarket_id = 2 then g.pug_amount end), 0) xse_2,\n" + - " ifnull(sum(case when g.supermarket_id = 3 then g.pug_amount end), 0) xse_3,\n" + - " ifnull(sum(case when g.supermarket_id = 4 then g.pug_amount end), 0) xse_4,\n" + - " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.pug_amount end), 0) xse_5,\n" + - " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.pug_amount end), 0) xse_6,\n" + - " ifnull(sum(case when g.supermarket_id = 11 then g.pug_amount end), 0) xse_11, \n" + - " ifnull(sum(case when g.supermarket_id = 12 then g.pug_amount end), 0) xse_12, \n" + - " ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.weight end), 0) xsw_1,\n" + - " ifnull(sum(case when g.supermarket_id = 2 then g.weight end), 0) xsw_2,\n" + - " ifnull(sum(case when g.supermarket_id = 3 then g.weight end), 0) xsw_3,\n" + - " ifnull(sum(case when g.supermarket_id = 4 then g.weight end), 0) xsw_4,\n" + - " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.weight end), 0) xsw_5,\n" + - " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.weight end), 0) xsw_6,\n" + - " ifnull(sum(case when g.supermarket_id = 11 then g.weight end), 0) xsw_11,\n" + - " ifnull(sum(case when g.supermarket_id = 12 then g.weight end), 0) xsw_12\n" + + " ifnull(sum(case when g.supermarket_id = 1 then g.presell_amount end), 0) xsl_1,\n" + +// " ifnull(sum(case when g.supermarket_id = 2 then g.presell_amount end), 0) xsl_2,\n" + +// " ifnull(sum(case when g.supermarket_id = 3 then g.presell_amount end), 0) xsl_3,\n" + +// " ifnull(sum(case when g.supermarket_id = 4 then g.presell_amount end), 0) xsl_4,\n" + +// " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.presell_amount end), 0) xsl_5,\n" + +// " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.presell_amount end), 0) xsl_6,\n" + +// " ifnull(sum(case when g.supermarket_id = 11 then g.presell_amount end), 0) xsl_11,\n" + +// " ifnull(sum(case when g.supermarket_id = 12 then g.presell_amount end), 0) xsl_12,\n" + + " ifnull(sum(case when g.supermarket_id = 1 then g.pug_amount end), 0) xse_1,\n" + +// " ifnull(sum(case when g.supermarket_id = 2 then g.pug_amount end), 0) xse_2,\n" + +// " ifnull(sum(case when g.supermarket_id = 3 then g.pug_amount end), 0) xse_3,\n" + +// " ifnull(sum(case when g.supermarket_id = 4 then g.pug_amount end), 0) xse_4,\n" + +// " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.pug_amount end), 0) xse_5,\n" + +// " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.pug_amount end), 0) xse_6,\n" + +// " ifnull(sum(case when g.supermarket_id = 11 then g.pug_amount end), 0) xse_11, \n" + +// " ifnull(sum(case when g.supermarket_id = 12 then g.pug_amount end), 0) xse_12, \n" + + " ifnull(sum(case when g.supermarket_id = 1 then g.weight end), 0) xsw_1" + +// ",\n" + +// " ifnull(sum(case when g.supermarket_id = 2 then g.weight end), 0) xsw_2,\n" + +// " ifnull(sum(case when g.supermarket_id = 3 then g.weight end), 0) xsw_3,\n" + +// " ifnull(sum(case when g.supermarket_id = 4 then g.weight end), 0) xsw_4,\n" + +// " ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.weight end), 0) xsw_5,\n" + +// " ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.weight end), 0) xsw_6,\n" + +// " ifnull(sum(case when g.supermarket_id = 11 then g.weight end), 0) xsw_11,\n" + +// " ifnull(sum(case when g.supermarket_id = 12 then g.weight end), 0) xsw_12\n" + " from (\n" + " select a.customer_id, a.supermarket_id, sum(a.presell_amount) presell_amount, sum(a.pug_amount) pug_amount, sum(a.weight) weight from (\n" + " select t.customer_id, t.supermarket_id, sum(t.presell_amount) presell_amount, 0 pug_amount, 0 weight from presell_order t\n" + @@ -3703,29 +3693,29 @@ public class OrderStatService { double all_total_presell_pug = 0.0; double all_total_weight = 0.0; double all_xsl_1 = 0.0; - double all_xsl_2 = 0.0; - double all_xsl_3 = 0.0; - double all_xsl_4 = 0.0; - double all_xsl_5 = 0.0; - double all_xsl_6 = 0.0; - double all_xsl_11 = 0.0; - double all_xsl_12 = 0.0; +// double all_xsl_2 = 0.0; +// double all_xsl_3 = 0.0; +// double all_xsl_4 = 0.0; +// double all_xsl_5 = 0.0; +// double all_xsl_6 = 0.0; +// double all_xsl_11 = 0.0; +// double all_xsl_12 = 0.0; double all_xse_1 = 0.0; - double all_xse_2 = 0.0; - double all_xse_3 = 0.0; - double all_xse_4 = 0.0; - double all_xse_5 = 0.0; - double all_xse_6 = 0.0; - double all_xse_11 = 0.0; - double all_xse_12 = 0.0; +// double all_xse_2 = 0.0; +// double all_xse_3 = 0.0; +// double all_xse_4 = 0.0; +// double all_xse_5 = 0.0; +// double all_xse_6 = 0.0; +// double all_xse_11 = 0.0; +// double all_xse_12 = 0.0; double all_xsw_1 = 0.0; - double all_xsw_2 = 0.0; - double all_xsw_3 = 0.0; - double all_xsw_4 = 0.0; - double all_xsw_5 = 0.0; - double all_xsw_6 = 0.0; - double all_xsw_11 = 0.0; - double all_xsw_12 = 0.0; +// double all_xsw_2 = 0.0; +// double all_xsw_3 = 0.0; +// double all_xsw_4 = 0.0; +// double all_xsw_5 = 0.0; +// double all_xsw_6 = 0.0; +// double all_xsw_11 = 0.0; +// double all_xsw_12 = 0.0; for (int i = 0; i < list.size(); i++) { Record r = list.get(i); @@ -3734,29 +3724,29 @@ public class OrderStatService { double total_presell_pug = DataUtil.getDefaultByRecord(r, "total_presell_pug"); double total_weight = DataUtil.getDefaultByRecord(r, "total_weight"); double xsl_1 = DataUtil.getDefaultByRecord(r, "xsl_1"); - double xsl_2 = DataUtil.getDefaultByRecord(r, "xsl_2"); - double xsl_3 = DataUtil.getDefaultByRecord(r, "xsl_3"); - double xsl_4 = DataUtil.getDefaultByRecord(r, "xsl_4"); - double xsl_5 = DataUtil.getDefaultByRecord(r, "xsl_5"); - double xsl_6 = DataUtil.getDefaultByRecord(r, "xsl_6"); - double xsl_11 = DataUtil.getDefaultByRecord(r, "xsl_11"); - double xsl_12 = DataUtil.getDefaultByRecord(r, "xsl_12"); +// double xsl_2 = DataUtil.getDefaultByRecord(r, "xsl_2"); +// double xsl_3 = DataUtil.getDefaultByRecord(r, "xsl_3"); +// double xsl_4 = DataUtil.getDefaultByRecord(r, "xsl_4"); +// double xsl_5 = DataUtil.getDefaultByRecord(r, "xsl_5"); +// double xsl_6 = DataUtil.getDefaultByRecord(r, "xsl_6"); +// double xsl_11 = DataUtil.getDefaultByRecord(r, "xsl_11"); +// double xsl_12 = DataUtil.getDefaultByRecord(r, "xsl_12"); double xse_1 = DataUtil.getDefaultByRecord(r, "xse_1"); - double xse_2 = DataUtil.getDefaultByRecord(r, "xse_2"); - double xse_3 = DataUtil.getDefaultByRecord(r, "xse_3"); - double xse_4 = DataUtil.getDefaultByRecord(r, "xse_4"); - double xse_5 = DataUtil.getDefaultByRecord(r, "xse_5"); - double xse_6 = DataUtil.getDefaultByRecord(r, "xse_6"); - double xse_11 = DataUtil.getDefaultByRecord(r, "xse_11"); - double xse_12 = DataUtil.getDefaultByRecord(r, "xse_12"); +// double xse_2 = DataUtil.getDefaultByRecord(r, "xse_2"); +// double xse_3 = DataUtil.getDefaultByRecord(r, "xse_3"); +// double xse_4 = DataUtil.getDefaultByRecord(r, "xse_4"); +// double xse_5 = DataUtil.getDefaultByRecord(r, "xse_5"); +// double xse_6 = DataUtil.getDefaultByRecord(r, "xse_6"); +// double xse_11 = DataUtil.getDefaultByRecord(r, "xse_11"); +// double xse_12 = DataUtil.getDefaultByRecord(r, "xse_12"); double xsw_1 = DataUtil.getDefaultByRecord(r, "xsw_1"); - double xsw_2 = DataUtil.getDefaultByRecord(r, "xsw_2"); - double xsw_3 = DataUtil.getDefaultByRecord(r, "xsw_3"); - double xsw_4 = DataUtil.getDefaultByRecord(r, "xsw_4"); - double xsw_5 = DataUtil.getDefaultByRecord(r, "xsw_5"); - double xsw_6 = DataUtil.getDefaultByRecord(r, "xsw_6"); - double xsw_11 = DataUtil.getDefaultByRecord(r, "xsw_11"); - double xsw_12 = DataUtil.getDefaultByRecord(r, "xsw_12"); +// double xsw_2 = DataUtil.getDefaultByRecord(r, "xsw_2"); +// double xsw_3 = DataUtil.getDefaultByRecord(r, "xsw_3"); +// double xsw_4 = DataUtil.getDefaultByRecord(r, "xsw_4"); +// double xsw_5 = DataUtil.getDefaultByRecord(r, "xsw_5"); +// double xsw_6 = DataUtil.getDefaultByRecord(r, "xsw_6"); +// double xsw_11 = DataUtil.getDefaultByRecord(r, "xsw_11"); +// double xsw_12 = DataUtil.getDefaultByRecord(r, "xsw_12"); Record rec = new Record(); rec.set("inx", i + 1); @@ -3765,26 +3755,26 @@ public class OrderStatService { rec.set("total_presell_pug", total_presell_pug); rec.set("total_weight", total_weight); rec.set("xsl_1", xsl_1); - rec.set("xsl_2", xsl_2); - rec.set("xsl_3", xsl_3); - rec.set("xsl_4", xsl_4); - rec.set("xsl_5", xsl_5); - rec.set("xsl_6", xsl_6); - rec.set("xsl_11", xsl_11); +// rec.set("xsl_2", xsl_2); +// rec.set("xsl_3", xsl_3); +// rec.set("xsl_4", xsl_4); +// rec.set("xsl_5", xsl_5); +// rec.set("xsl_6", xsl_6); +// rec.set("xsl_11", xsl_11); rec.set("xse_1", xse_1); - rec.set("xse_2", xse_2); - rec.set("xse_3", xse_3); - rec.set("xse_4", xse_4); - rec.set("xse_5", xse_5); - rec.set("xse_6", xse_6); - rec.set("xse_11", xse_11); +// rec.set("xse_2", xse_2); +// rec.set("xse_3", xse_3); +// rec.set("xse_4", xse_4); +// rec.set("xse_5", xse_5); +// rec.set("xse_6", xse_6); +// rec.set("xse_11", xse_11); rec.set("xsw_1", xsw_1); - rec.set("xsw_2", xsw_2); - rec.set("xsw_3", xsw_3); - rec.set("xsw_4", xsw_4); - rec.set("xsw_5", xsw_5); - rec.set("xsw_6", xsw_6); - rec.set("xsw_11", xsw_11); +// rec.set("xsw_2", xsw_2); +// rec.set("xsw_3", xsw_3); +// rec.set("xsw_4", xsw_4); +// rec.set("xsw_5", xsw_5); +// rec.set("xsw_6", xsw_6); +// rec.set("xsw_11", xsw_11); ret.add(rec); @@ -3792,29 +3782,29 @@ public class OrderStatService { all_total_presell_pug += total_presell_pug; all_total_weight += total_weight; all_xsl_1 += xsl_1; - all_xsl_2 += xsl_2; - all_xsl_3 += xsl_3; - all_xsl_4 += xsl_4; - all_xsl_5 += xsl_5; - all_xsl_6 += xsl_6; - all_xsl_11 += xsl_11; - all_xsl_12 += xsl_12; +// all_xsl_2 += xsl_2; +// all_xsl_3 += xsl_3; +// all_xsl_4 += xsl_4; +// all_xsl_5 += xsl_5; +// all_xsl_6 += xsl_6; +// all_xsl_11 += xsl_11; +// all_xsl_12 += xsl_12; all_xse_1 += xse_1; - all_xse_2 += xse_2; - all_xse_3 += xse_3; - all_xse_4 += xse_4; - all_xse_5 += xse_5; - all_xse_6 += xse_6; - all_xse_11 += xse_11; - all_xse_12 += xse_12; +// all_xse_2 += xse_2; +// all_xse_3 += xse_3; +// all_xse_4 += xse_4; +// all_xse_5 += xse_5; +// all_xse_6 += xse_6; +// all_xse_11 += xse_11; +// all_xse_12 += xse_12; all_xsw_1 += xsw_1; - all_xsw_2 += xsw_2; - all_xsw_3 += xsw_3; - all_xsw_4 += xsw_4; - all_xsw_5 += xsw_5; - all_xsw_6 += xsw_6; - all_xsw_11 += xsw_11; - all_xsw_12 += xsw_12; +// all_xsw_2 += xsw_2; +// all_xsw_3 += xsw_3; +// all_xsw_4 += xsw_4; +// all_xsw_5 += xsw_5; +// all_xsw_6 += xsw_6; +// all_xsw_11 += xsw_11; +// all_xsw_12 += xsw_12; } Record r = new Record(); @@ -3824,28 +3814,28 @@ public class OrderStatService { r.set("total_presell_pug", all_total_presell_pug); r.set("total_weight", all_total_weight); r.set("xsl_1", all_xsl_1); - r.set("xsl_2", all_xsl_2); - r.set("xsl_3", all_xsl_3); - r.set("xsl_4", all_xsl_4); - r.set("xsl_5", all_xsl_5); - r.set("xsl_6", all_xsl_6); - r.set("xsl_11", all_xsl_11); +// r.set("xsl_2", all_xsl_2); +// r.set("xsl_3", all_xsl_3); +// r.set("xsl_4", all_xsl_4); +// r.set("xsl_5", all_xsl_5); +// r.set("xsl_6", all_xsl_6); +// r.set("xsl_11", all_xsl_11); r.set("xse_1", all_xse_1); - r.set("xse_2", all_xse_2); - r.set("xse_3", all_xse_3); - r.set("xse_4", all_xse_4); - r.set("xse_5", all_xse_5); - r.set("xse_6", all_xse_6); - r.set("xse_11", all_xse_11); - r.set("xse_12", all_xse_12); +// r.set("xse_2", all_xse_2); +// r.set("xse_3", all_xse_3); +// r.set("xse_4", all_xse_4); +// r.set("xse_5", all_xse_5); +// r.set("xse_6", all_xse_6); +// r.set("xse_11", all_xse_11); +// r.set("xse_12", all_xse_12); r.set("xsw_1", all_xsw_1); - r.set("xsw_2", all_xsw_2); - r.set("xsw_3", all_xsw_3); - r.set("xsw_4", all_xsw_4); - r.set("xsw_5", all_xsw_5); - r.set("xsw_6", all_xsw_6); - r.set("xsw_11", all_xsw_11); - r.set("xsw_12", all_xsw_12); +// r.set("xsw_2", all_xsw_2); +// r.set("xsw_3", all_xsw_3); +// r.set("xsw_4", all_xsw_4); +// r.set("xsw_5", all_xsw_5); +// r.set("xsw_6", all_xsw_6); +// r.set("xsw_11", all_xsw_11); +// r.set("xsw_12", all_xsw_12); ret.add(r); diff --git a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/customer/contractsigned/CustomerContractSignedService.java b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/customer/contractsigned/CustomerContractSignedService.java index 2f17442..3504e4a 100644 --- a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/customer/contractsigned/CustomerContractSignedService.java +++ b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/customer/contractsigned/CustomerContractSignedService.java @@ -87,6 +87,22 @@ public class CustomerContractSignedService extends BaseService { } public Result save(CustomerContractSigned model, Sysuser sysuser, UploadFile uploadFile) { + Integer type = model.getType(); + if (type == null) { + return Result.failed(false, "type不能为空"); + } + if (type == 0){ // 公司 + List list = CustomerContractSigned.dao.find("select * from customer_contract_signed where type = 0 and del = 0 and state = 1"); + if (!list.isEmpty()){ + return Result.failed(false, "已有正在生效的电子签字"); + } + } + if (type == 1){ // 公司 + List list = CustomerContractSigned.dao.find("select * from customer_contract_signed where type = 0 and del = 0 and state = 1 and create_id = ?", sysuser.getId()); + if (!list.isEmpty()){ + return Result.failed(false, "已有正在生效的电子签字"); + } + } model.setCreateId(sysuser.getId()); model.setCreateName(sysuser.getName()); @@ -147,6 +163,24 @@ public class CustomerContractSignedService extends BaseService { model.setCreateId(sysuser.getId()); model.setCreateName(sysuser.getName()); + Integer type = model.getType(); + if (type == null) { + return Result.failed(false, "type不能为空"); + } + if (type == 0){ // 公司 + List list = CustomerContractSigned.dao.find("select * from customer_contract_signed where type = 0 and del = 0 and state = 1 and id = ?",model.getId()); + if (!list.isEmpty()){ + return Result.failed(false, "已有正在生效的电子签字"); + } + } + if (type == 1){ // 公司 + List list = CustomerContractSigned.dao.find("select * from customer_contract_signed where type = 0 and del = 0 and state = 1 and create_id = ? and id = ?" + , sysuser.getId(),model.getId()); + if (!list.isEmpty()){ + return Result.failed(false, "已有正在生效的电子签字"); + } + } + Record r = new Record(); File file = uploadFile.getFile(); String htmlStr = Word2HtmlStr.conver(file); diff --git a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/jobs/CheckUndonOrderclusterJob.java b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/jobs/CheckUndonOrderclusterJob.java index e50746d..0f849db 100644 --- a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/jobs/CheckUndonOrderclusterJob.java +++ b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/jobs/CheckUndonOrderclusterJob.java @@ -1,21 +1,19 @@ package com.cowr.service.ssjygl.jobs; import com.cowr.common.enums.OrderStateEnum; -import com.cowr.common.view.Result; import com.cowr.model.Ordercluster; import com.cowr.model.SyncTask; -import com.cowr.model.Sysuser; -import com.cowr.service.ssjygl.order.ordercluster.OrderclusterSyncService; import com.cowr.service.ssjygl.synctask.SyncTaskService; -import com.cowr.ssjygl.order.ordercluster.OrderclusterService; import com.jfinal.log.Log; import com.jfinal.plugin.activerecord.Db; import com.jfinal.plugin.activerecord.IAtom; import org.quartz.Job; import org.quartz.JobExecutionContext; -import java.math.BigDecimal; -import java.util.*; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class CheckUndonOrderclusterJob implements Job { private static Log log = Log.getLog(CheckUndonOrderclusterJob.class); @@ -50,7 +48,7 @@ public class CheckUndonOrderclusterJob implements Job { if (ordercluster.getState() == OrderStateEnum.INITIAL.getStateid()) { ordercluster.setState(OrderStateEnum.INVALID.getStateid()); } else { - ordercluster.setState(OrderStateEnum.RECEIVED.getStateid()); + ordercluster.setState(OrderStateEnum.RECEIVED.getStateid()); //到时间未完成的 } syncmap.get(ordercluster.getSupermarketId()).addUpdateData(ordercluster); diff --git a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/product/ProductController.java b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/product/ProductController.java index 6ab540b..3a3faf1 100644 --- a/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/product/ProductController.java +++ b/ssjygl-xsct-service/src/main/java/com/cowr/service/ssjygl/product/ProductController.java @@ -10,6 +10,10 @@ import com.cowr.ssjygl.product.ProductService; import com.cowr.ssjygl.product.ProductValidator; import com.jfinal.aop.Before; import com.jfinal.core.Controller; +import com.jfinal.plugin.activerecord.Db; +import com.jfinal.plugin.activerecord.Record; + +import java.util.List; /** * Generated by COWR Sat Apr 04 17:23:04 CST 2020 @@ -44,6 +48,11 @@ public class ProductController extends Controller { } Product model = getModel(Product.class, "", true); // 忽略不在model中的字段 + List recordList = Db.find("select * from product t where t.name = ?" , model.getName()); + if (!recordList.isEmpty()){ + renderJson(Result.failed("该商品已存在")); + return; + } renderJson(ProductSyncService.me.save(model, tokenuser)); } @@ -76,6 +85,11 @@ public class ProductController extends Controller { } Product model = getModel(Product.class, "", true); // 忽略不在model中的字段 + List recordList = Db.find("select * from product t where t.name = ? AND t.id != ?",model.getName(),model.getId()); + if (!recordList.isEmpty()){ + renderJson(Result.failed("该商品已存在")); + return; + } renderJson(ProductSyncService.me.restore(model, tokenuser)); } @@ -92,6 +106,11 @@ public class ProductController extends Controller { } Product model = getModel(Product.class, "", true); // 忽略不在model中的字段 + List recordList = Db.find("select * from product t where t.name = ? AND t.id != ?",model.getName(),model.getId()); + if (!recordList.isEmpty()){ + renderJson(Result.failed("该商品已存在")); + return; + } renderJson(ProductSyncService.me.update(model, tokenuser)); }