xuekang
2024-05-11 bac0878349a1db23e7b420ea164e22fb9db73a99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package com.nuvole.util;
 
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.file.FileWriter;
 
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
 
public class WriterUtil {
 
    private static String path = "F:\\data\\";
 
 
   /* @Test
    public void test() {
        login("nodata", 1122L, "男", "172.16.60.222", "https://www.baidu.com");
        member(11222L, "nodata", Convert.toShort(1), "12121");
    }*/
 
    /**
     * 写入商城登录数据
     *
     * @param code     机器码
     * @param memberId 会员id
     * @param sex      性别
     * @param ip       ip地址
     * @param address  登录地址
     * @Author: lc
     * @Date: 2019/10/23 15:13
     */
    public static void login(String code, Long memberId, String sex, String ip, String address) {
//        String day = DateUtil.today();
//        FileWriter writer = new FileWriter(path + "login\\" + day + ".txt");
//        String time = CodeUtil.getTimeCode();
//        writer.append(time + " " + code + " " + memberId + " " + sex + " " + ip + " " + address + "\n");
    }
 
 
    /**
     * 写入会员注册/修改数据
     *
     * @param memberId 会员id
     * @param area     地区
     * @param type     操作类型【1.新增 2.完善】
     * @param birthday 生日
     * @Author: lc
     * @Date: 2019/10/23 15:13
     */
    public static void member(Long memberId, String area, Short type, String birthday) {
//        String day = DateUtil.today();
//        FileWriter writer = new FileWriter(path + "member\\" + day + ".txt");
//        String time = CodeUtil.getTimeCode();
//        writer.append(time + " " + memberId + " " + area + " " + type + " " + birthday + "\n");
    }
 
 
    /**
     * 写入订单数据
     *
     * @param orderId     订单id
     * @param orderType   订单类型【1.商城 2.商户】
     * @param payMoney    支付金额
     * @param memberId    会员id
     * @param orderState  订单状态【1.待支付 2.已完成 3.已退款 4.支付失败】
     * @param payType     支付渠道【1.支付宝 2.微信 3.云闪付】
     * @param payWay      支付方式【1.扫码 2.线上 】
     * @param useScore    使用积分
     * @param couponId    使用优惠券id
     * @param couponMoney 优惠券金额
     * @param areaId      商户所属区域id
     * @Author: lc
     * @Date: 2019/10/23 15:13
     */
    public static void order(Long orderId, String orderType, Long payMoney, Long memberId, Short orderState, Short payType, Short payWay, Long useScore, Long couponId, Long couponMoney, String areaId) {
//        String day = DateUtil.today();
//        FileWriter writer = new FileWriter(path + "order\\" + day + ".txt");
//        String time = CodeUtil.getTimeCode();
//        writer.append(time + " " + orderId + " " + orderType + " " + payMoney + " " + memberId + " " + orderState + " " +
//                payType + " " + payWay + " " + useScore + " " + couponId + " " + couponMoney + " " + areaId + "\n");
    }
 
 
    /**
     * 写入商品数据
     *
     * @param goodsSpuId 商品SpuId
     * @param goodsSkuId 商品SkuId
     * @param money      金额
     * @param state      状态【1.新增 2.上架 3.下架 4.出售】
     * @Author: lc
     * @Date: 2019/10/23 15:13
     */
    public static void goods(Long goodsSpuId, Long goodsSkuId, Long money, Short state) {
//        String day = DateUtil.today();
//        FileWriter writer = new FileWriter(path + "goods\\" + day + ".txt");
//        String time = CodeUtil.getTimeCode();
//        writer.append(time + " " + goodsSpuId + " " + goodsSkuId + " " + money + " " + state + "\n");
    }
 
 
    /**
     * 写入商品销售
     *
     * @param goodsSpuId 商品SpuId(规格)
     * @param goodsSkuId 商品SkuId(属性)
     * @Author: lc
     * @Date: 2019/10/23 15:13
     */
    public static void goodsSell(Long goodsSpuId, Long goodsSkuId) {
//        String day = DateUtil.today();
//        FileWriter writer = new FileWriter(path + "goodsSell\\" + day + ".txt");
//        String time = CodeUtil.getTimeCode();
//        writer.append(time + " " + goodsSpuId + " " + goodsSkuId + "\n");
    }
 
    /**
     * 执行手动回调的订单id
     * @param builder
     * @throws IOException
     */
    public static void callBackGoodsInfo(StringBuilder builder) throws IOException {
        String fileName = new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".csv";
        String day = DateUtil.today();
        FileWriter writer = new FileWriter(path + "回调订单" +fileName );
        writer.append(String.valueOf(builder));
    }
 
}