Ver Fonte

修改营销管理,修改打印小票

MS-QJVSRANLTYEO\Administrator há 4 anos atrás
pai
commit
3de21a1586

+ 17 - 3
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/domain/MarkertPlan.java

@@ -9,7 +9,7 @@ import com.yijia.common.core.domain.BaseEntity;
  * 营销方案对象 markert_plan
  * 
  * @author yijia
- * @date 2021-01-23
+ * @date 2021-01-26
  */
 public class MarkertPlan extends BaseEntity
 {
@@ -18,8 +18,8 @@ public class MarkertPlan extends BaseEntity
     /** id */
     private Long id;
 
-    /** 等级名称 */
-    @Excel(name = "等级名称")
+    /** 方案名称 */
+    @Excel(name = "方案名称")
     private String grade;
 
     /** 优惠条件(满100元) */
@@ -62,6 +62,10 @@ public class MarkertPlan extends BaseEntity
     @Excel(name = "油站名称")
     private String stationName;
 
+    /** 状态(1.在用状态,2,删除) */
+    @Excel(name = "状态", readConverterExp = "1=.在用状态,2,删除")
+    private String status;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -170,6 +174,15 @@ public class MarkertPlan extends BaseEntity
     {
         return stationName;
     }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
 
     @Override
     public String toString() {
@@ -186,6 +199,7 @@ public class MarkertPlan extends BaseEntity
             .append("oilName", getOilName())
             .append("stationId", getStationId())
             .append("stationName", getStationName())
+            .append("status", getStatus())
             .toString();
     }
 }

+ 6 - 1
Yijia-SaaS/yijia-market/src/main/resources/mapper/market/MarkertPlanMapper.xml

@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="oilName"    column="oil_name"    />
         <result property="stationId"    column="station_id"    />
         <result property="stationName"    column="station_name"    />
+        <result property="status"    column="status"    />
     </resultMap>
 
     <sql id="selectMarkertPlanVo">
-        select id, grade, discount_term, discount_amt, gasoil_discount_amt, dieseloil_discount_amt, vip_discounty_plus, coupon_plus, discount_plan_type, oil_name, station_id, station_name from markert_plan
+        select id, grade, discount_term, discount_amt, gasoil_discount_amt, dieseloil_discount_amt, vip_discounty_plus, coupon_plus, discount_plan_type, oil_name, station_id, station_name, status from markert_plan
     </sql>
 
     <select id="selectMarkertPlanList" parameterType="MarkertPlan" resultMap="MarkertPlanResult">
@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
         </where>
     </select>
     
@@ -59,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null">oil_name,</if>
             <if test="stationId != null">station_id,</if>
             <if test="stationName != null">station_name,</if>
+            <if test="status != null">status,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="grade != null">#{grade},</if>
@@ -72,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null">#{oilName},</if>
             <if test="stationId != null">#{stationId},</if>
             <if test="stationName != null">#{stationName},</if>
+            <if test="status != null">#{status},</if>
          </trim>
     </insert>
 
@@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null">oil_name = #{oilName},</if>
             <if test="stationId != null">station_id = #{stationId},</if>
             <if test="stationName != null">station_name = #{stationName},</if>
+            <if test="status != null">status = #{status},</if>
         </trim>
         where id = #{id}
     </update>

+ 66 - 25
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationClassStructureController.java

@@ -452,7 +452,7 @@ public class StationClassStructureController extends BaseController
                     content += "开始时间: <BR>";
                 }
                 content += "班结时间:"+dateFormat.format(list.get(0).getClassStructureDate())+" <BR>";
-                content += "油品     笔    升数   金额<BR>";
+                content += "油品  笔    升数      金额<BR>";
                 content += "--------------------------------<BR>";
 
                 BigDecimal sumAmt = new BigDecimal(0);
@@ -463,57 +463,89 @@ public class StationClassStructureController extends BaseController
                 int num = 0;
                 int pageNum=0;
                 for(StationClassStructure str : list){
+                    String orderLiter="";
+                    String amt="";
+                    String receivableAmt="";
+                    String orderno="";
+                    //打印小票数量
+                    if(str.getPrintNum()!=null){
+                        pageNum += str.getPrintNum();
+                    }
                     if( str.getOrderLiters()==null){
                         str.setOrderLiters(BigDecimal.valueOf(0));
+                        orderLiter="0";
+                    }else{
+                        liters=liters.add(str.getOrderLiters());
+                        orderLiter= str.getOrderLiters().toString();
                     }
                     //实收金额
                     if( str.getAmt()==null){
                         str.setAmt(BigDecimal.valueOf(0));
+                        amt="0";
+                    }else{
+                        sumAmt=sumAmt.add(str.getAmt());
+                        amt=str.getAmt().toString();
                     }
                     //应付金额
                     if( str.getReceivableAmt()==null){
                         str.setReceivableAmt(BigDecimal.valueOf(0));
+                        receivableAmt="0";
+                    }else{
+                        ysAmt=ysAmt.add(str.getReceivableAmt());
+                        receivableAmt=str.getReceivableAmt().toString();
                     }
                     //到款金额
                     if( str.getReceivedAmt()==null){
                         str.setReceivedAmt(BigDecimal.valueOf(0));
+                    }else{
+                        dzAmt = dzAmt.add(str.getReceivedAmt());
                     }
+                    //优惠金额
                     if( str.getDiscountAmt()==null){
                         str.setDiscountAmt(BigDecimal.valueOf(0));
+                    }else{
+                        coupon=coupon.add(str.getDiscountAmt());
                     }
+                    //订单数量
                     if( str.getOrderNo()==null){
                         str.setOrderNo(String.valueOf(0));
-                    }
-                    content += str.getOilName()+"    "+str.getOrderNo()+"    "+str.getOrderLiters()+"    "+str.getReceivableAmt()+"<BR>";
-                    if(str.getAmt()!=null){
-                        sumAmt=sumAmt.add(str.getAmt());
-                    }
-                    if(str.getReceivableAmt()!=null){
-                        ysAmt=ysAmt.add(str.getReceivableAmt());
-                    }
-                    if(str.getOrderLiters()!=null){
-                        liters=liters.add(str.getOrderLiters());
-                    }
-                    if(str.getOrderNo()!=null){
+                    }else{
                         num= num+Integer.parseInt(str.getOrderNo());
+                        orderno=str.getOrderNo().toString();
                     }
-                    if(str.getDiscountAmt()!=null){
-                        coupon=coupon.add(str.getDiscountAmt());
-                    }
-                    if(str.getPrintNum()!=null){
-                        pageNum += str.getPrintNum();
-                    }
-                    if(str.getReceivedAmt()!=null){
-                        dzAmt = dzAmt.add(str.getReceivedAmt());
-                    }
+                    String oilname=addSpace(str.getOilName(),4);
+                    orderno=addSpace(orderno,3);
+                    orderLiter=addSpace(orderLiter,8);
+                    receivableAmt=addSpace(receivableAmt,8);
+                    content += oilname+"  "+orderno+"  "+orderLiter+"  "+receivableAmt+"<BR>";
                 }
                 content += "--------------------------------<BR>";
-                content += "合计  "+num +"  "+liters +"  "+sumAmt+"<BR>";
+                String sumorder=addSpace(String.valueOf(num),3);
+                String oilliters=addSpace(String.valueOf(liters),9);
+                String oilYsAmt=addSpace(String.valueOf(ysAmt),9);
+                content += "合计  "+sumorder +"  "+liters +"  "+oilYsAmt+"<BR>";
                 content += " <BR>";
                 //按支付方式
-                content += "支付方式  笔  升数  金额 <BR>";
+                content += "支付方式  笔    升数      金额<BR>";
                 for(StationClassStructure sc : paylist){
-                    content += sc.getPayType()+"  "+sc.getOrderNo()+"  "+sc.getOrderLiters()+"  "+sc.getReceivableAmt()+"<BR>";
+                   String orderno= sc.getOrderNo();
+                    orderno =addSpace(orderno,3);
+                    String orderLiter="";
+                    if(sc.getOrderLiters()!=null){
+                         orderLiter = sc.getOrderLiters().toString();
+                    }else{
+                        sc.setOrderLiters(BigDecimal.valueOf(0));
+                        orderLiter= sc.getOrderLiters().toString();
+                    }
+                    orderLiter =addSpace(orderLiter,8);
+                    String receivableAmt="";
+                    if(sc.getReceivableAmt()!=null){
+                        receivableAmt = sc.getReceivableAmt().toString();
+                    }else{
+                        sc.setReceivableAmt(BigDecimal.valueOf(0));
+                        receivableAmt= sc.getReceivableAmt().toString();
+                    }
+                    content += sc.getPayType()+"  "+orderno+"  "+orderLiter+"  "+receivableAmt+"<BR>";
                 }
                 content += "小票张数: "+pageNum+" 张<BR>";
                 content += "班结金额: "+ysAmt+" 元<BR>";
@@ -555,6 +587,15 @@ public class StationClassStructureController extends BaseController
         return toAjax(i);
 
     }
+    private  String addSpace(String str, int size) {
+        int len = str.length();
+        if (len < size) {
+            for (int i = 0; i < size - len; i++) {
+                str += " ";
+            }
+        }
+        return str;
+    }
 
     /**
      * 修改班结管理