Administrator
2023-04-19 40ec16bbb7c9d23df625aa31ae42ac36e901749d
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
package com.mandi.fendan.test;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import net.sf.json.JSONArray;
 
import org.apache.log4j.Logger;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
 
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonArrayFormatVisitor;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mandi.basicconfig.persist.Ncfhdq;
import com.mandi.common.JSONobj;
import com.mandi.common.Jacksonmethod;
import com.mandi.common.ListSortUtil;
import com.mandi.common.Wxhtmethod;
import com.mandi.common.ParamFileter.RegexCheck;
import com.mandi.dao.common.ObjectResult;
import com.mandi.fendan.mapper.BusinessMapper;
import com.mandi.fendan.mapper.Fd_VehicleMapper;
import com.mandi.fendan.mapper.Fd_XSTDMXMapper;
import com.mandi.fendan.mapper.Fd_fhdqMapper;
import com.mandi.fendan.mapper.VehicleXSTDMapper;
import com.mandi.fendan.persist.Fd_Vehicle;
import com.mandi.fendan.persist.Fd_XSTDMX;
import com.mandi.fendan.persist.Vehicle_XSTD;
import com.mandi.fendan.service.impl.ErpService;
import com.mandi.fendan.service.impl.Fd_CompanyService;
import com.mandi.fendan.util.Contants;
import com.mandi.fendan.util.Runtest;
import com.mandi.fendan.util.SqlTxt;
import com.mandi.fendan.util.persist.Scxt_zcInfo;
import com.mandi.fendan.util.persist.Serviceenum;
import com.mandi.system.persist.Login;
 
public class Test12 {
    private Logger log=Logger.getLogger(Test12.class);
    ApplicationContext c=new ClassPathXmlApplicationContext("applicationcontext.xml");
    BusinessMapper bnper=c.getBean(BusinessMapper.class);
    Fd_VehicleMapper Fd_Vcper=c.getBean(Fd_VehicleMapper.class);
    ErpService erpser=c.getBean(ErpService.class);
    VehicleXSTDMapper vx=c.getBean(VehicleXSTDMapper.class);
    Fd_XSTDMXMapper mxpers=c.getBean(Fd_XSTDMXMapper.class);
    Fd_fhdqMapper dqper=c.getBean(Fd_fhdqMapper.class);
    
    
    @Test
    public void test_ccr(){
        List<Ncfhdq> l=this.dqper.getLikebydqNo("11");
        log.info(":::::::::::;;"+Jacksonmethod.tojson(l, false));
    }
    @Test
    public void test_qx(){
//        log.info(RegexCheck.checkphone("13007607720"));
        Login lg=new Login();
        lg.setWorkerno("worker");
        lg.setDepartno("016");
        try {
            erpser.delFdsheet(lg, "XS201904050005");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }
    
    
    
    @Test
    public void test_arg(){
        List<Fd_XSTDMX> l=this.mxpers.getlistA();
        for (Fd_XSTDMX mx : l) {
            String gg=mx.getTdmx_ggxh();
            mx.setTdmx_ggxh(gg.split("\\*")[2]+"*"+gg.split("\\*")[1]+"*"+gg.split("\\*")[0]);
            
            this.mxpers.updateMXGG(mx);
        }
//        List<String> ll=vx.getlistbyVehicleIdGp("豫J30829");
//        System.err.println("ll::::"+Jacksonmethod.tojson(ll, false));
//        List<Vehicle_XSTD> vxl=vx.getlistbyVehandcompanyNo("豫J30829", "011");
//        System.err.println("ll::::"+Jacksonmethod.tojson(vxl, false));
//        try {
//            erpser.testsave(null);
//        } catch (Exception e) {
//            try {
//                throw new Exception(e.getMessage());
//            } catch (Exception e1) {
//                e1.printStackTrace();
//            }
//        }
    }
    
    
    @Test
    public void test_dg(){
//        log.info(RegexCheck.checkphone("13007607720"));
        String bianhao="0102";
        log.info(bianhao.substring(0, bianhao.length()-2));
        
    }
    
    
    @Test
    public void test_eo(){
//        Runtest tty=new Runtest("你好");
//        tty.run();
//        String zclist="";
//        try {
//            erpser.batchSaveZcInfo(zclist);
//        } catch (Exception e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
    }
    
    
    
    @Test
    public void test_del(){
        Map<String, Object> map=new HashMap<String, Object>();
        map.put("companyNo", "001");
        Fd_Vcper.getCompanyVehicle(map);
    }
    
    
    @Test
    public void test_cg(){
        Scxt_zcInfo zc=new Scxt_zcInfo();
        zc.setCph("豫ATEST1");
        zc.setCzy("管理员");
        zc.setYktkh("6666555555");
        
        zc.setGgxh("0.02*450*10000");
        zc.setJz(494.0);
        zc.setMz(561.0);
        zc.setPch("KJC1710X80303-2");
        zc.setPz(561.0-494.0);
        zc.setTdbh("KJTD-18010108");
        zc.setTmh("123456");
        
        Scxt_zcInfo zc1=new Scxt_zcInfo();
        zc1.setCph("豫ATEST1");
        zc1.setCzy("管理员");
        zc1.setYktkh("6666555555");
        zc1.setTdbh("KJTD-18010108");
        
        zc1.setGgxh("0.02*450*8000");
        zc1.setJz(797.0);
        zc1.setMz(886.0);
        zc1.setPch("KJC1710X80303-30");
        zc1.setPz(886.0-797.0);
        zc1.setTmh("345678");
        
        Scxt_zcInfo zc2=new Scxt_zcInfo();
        zc2.setCph("豫ATEST1");
        zc2.setCzy("管理员");
        zc2.setYktkh("6666555555");
        zc2.setTdbh("KJTD-18010108");
        
        zc2.setGgxh("0.02*450*8000");
        zc2.setJz(803.0);
        zc2.setMz(891.0);
        zc2.setPch("KJC1712X80186-60");
        zc2.setPz(891.0-803.0);
        zc2.setTmh("234567");
        List<Scxt_zcInfo> l=new ArrayList<Scxt_zcInfo>();
        l.add(zc);
        l.add(zc1);
        l.add(zc2);
        String str=Jacksonmethod.tojson(l, false);
        log.info(str);
        
    }
    
    @Test
    public void  test_sendmsg(){
        JsonObject jo=new JsonObject();
        jo.addProperty("name", "郭来权");
        jo.addProperty("chehao", "豫ATest1");
        jo.addProperty("number", "123456");
//        ObjectResult<String> orc=dyser.sendCode("13007607720" , jo);
//        log.info(Jacksonmethod.tojson(orc, false));
    }
    
    
    @Test
    public void test_cc(){
        Map<String, String> mm=new HashMap<String, String>();
        String url="http://192.168.4.248/testc.htm";
        List<Map<String, Object>> ll=new ArrayList<Map<String,Object>>();
        Map<String, Object> m1=new HashMap<String, Object>();
        m1.put("name", "1");
        Map<String, Object> m2=new HashMap<String, Object>();
        m2.put("name", "2");
        Map<String, Object> m3=new HashMap<String, Object>();
        m3.put("name", "3");
        ll.add(m1);
        ll.add(m2);
        ll.add(m3);
//        JSONArray ja=JSONArray.fromObject(ll);
        String str=Jacksonmethod.tojson(ll, false);
        log.info(str);
        mm.put("cc",str);
        log.info(mm);
        Wxhtmethod.postJson(url, mm);
    }
    
    
    @Test
    public void test_bsmaper(){
        Map<String, Object> mm=bnper.getbsbyBt("豫C555555", Contants.cpxsBtNo, Serviceenum.在办, "04");
        log.info(Jacksonmethod.tojson(mm, false));
    }
    @Test
    public void test(){
        ApplicationContext c=new ClassPathXmlApplicationContext("applicationcontext.xml");
        Fd_CompanyService msdao=c.getBean(Fd_CompanyService.class);
//        msdao.open("jdbc:jtds:sqlserver://125.46.81.106:1433;databaseName=goblin_test", "goblin", "goblin_2017");
        try {
            log.info(Jacksonmethod.tojson(msdao.get("54665"), true));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
 
    }
    
    
    @Test
    public void testlist(){
//        ApplicationContext c=new ClassPathXmlApplicationContext("applicationcontext.xml");
//        MSSQLDao mdao=c.getBean(MSSQLDao.class);
//        String sql=SqlTxt.countGYErpXSTDsql;
//        String url="jdbc:jtds:sqlserver://125.46.81.106:1433;databaseName=cwbase5";
//        String username="lc0059999";
//        String pwd="aaaaaa";
//        mdao.open(url, username, pwd);
//        List<List<Object>> m_l=new ArrayList<List<Object>>();
//        List<Object> m_l_l1=new ArrayList<Object>();
//        m_l_l1.add("豫ABcdef");
//        m_l_l1.add("GFC1706N80075-1");
//        List<Object> m_l_l2=new ArrayList<Object>();
//        m_l_l2.add("豫ABcdef");
//        m_l_l2.add("GFC1706N80075-2");
//        m_l.add(m_l_l1);
//        m_l.add(m_l_l2);
//        try {
////            mdao.saveMapsnoclose(sql, m_l);
//        } catch (Exception e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
//        mdao.close();
        
        JsonParser jp=new JsonParser();
        String vehicleInfo= "{\"phone\":\"13007607720\",\"fdCnum\":18,\"vehicleId\":\"豫NTEST4\",\"status\":\"未配车\",\"IDNum\":\"41140319901225655\",\"state\":true,\"companyNo\":\"008\",\"type\":\"公司车\",\"loadweight\":0,\"id\":\"66195228-92ac-4d8d-a3b2-db58fc6139d5\",\"vehicleweight\":0,\"fdCweight\":0,\"driver\":\"测试\",\"feature\":null,\"fdweight\":0,\"note\":null,\"fdnum\":0,\"indx\":\"0\",\"lastweight\":\"0.000\"}";
        JsonObject vjo=jp.parse(vehicleInfo).getAsJsonObject();
        Fd_Vehicle fdv=new Fd_Vehicle();
        fdv=JSONobj.getobj(vjo, fdv);
    }
}