正在显示
18 个修改的文件
包含
630 行增加
和
62 行删除
| @@ -90,6 +90,13 @@ | @@ -90,6 +90,13 @@ | ||
| 90 | <version>2.1.0</version> | 90 | <version>2.1.0</version> |
| 91 | </dependency> | 91 | </dependency> |
| 92 | 92 | ||
| 93 | + <dependency> | ||
| 94 | + <groupId>com.alibaba</groupId> | ||
| 95 | + <artifactId>fastjson</artifactId> | ||
| 96 | + <version>1.2.47</version> | ||
| 97 | + </dependency> | ||
| 98 | + | ||
| 99 | + | ||
| 93 | <!--IMF need jar--> | 100 | <!--IMF need jar--> |
| 94 | <dependency> | 101 | <dependency> |
| 95 | <groupId>org.apache.xmlbeans</groupId> | 102 | <groupId>org.apache.xmlbeans</groupId> |
| 1 | -package com.sy.controller; | 1 | +package com.sy.bwAnalysis; |
| 2 | 2 | ||
| 3 | -import com.sy.bwAnalysis.*; | ||
| 4 | import com.sy.bwAssist.Message; | 3 | import com.sy.bwAssist.Message; |
| 5 | import com.sy.model.*; | 4 | import com.sy.model.*; |
| 6 | import com.sy.service.*; | 5 | import com.sy.service.*; |
| @@ -52,49 +51,7 @@ public class AnalysisRoute { | @@ -52,49 +51,7 @@ public class AnalysisRoute { | ||
| 52 | route.infoService = this.infoService; | 51 | route.infoService = this.infoService; |
| 53 | route.commandService = this.commandService; | 52 | route.commandService = this.commandService; |
| 54 | } | 53 | } |
| 55 | - /* public static void main(String[] args) { | ||
| 56 | - AnalysisRoute route = new AnalysisRoute(); | ||
| 57 | - route.analysis("<MSG><META><SNDR>KAKO</SNDR><RCVR></RCVR><SEQN>20181226160547</SEQN><DDTM>20181226160547</DDTM><TYPE>KAKO</TYPE><STYP>CARM</STYP></META><GATHER_INFO AREA_ID=\"4604000000\" CHNL_NO=\"4604333322\" I_E_TYPE=\"E\" SEQ_NO=\"20181128144318000004\">\n" + | ||
| 58 | - "\t<IC>\n" + | ||
| 59 | - "\t\t<DR_IC_NO/>\n" + | ||
| 60 | - "\t\t<IC_DR_CUSTOMS_NO/>\n" + | ||
| 61 | - "\t\t<IC_CO_CUSTOMS_NO/>\n" + | ||
| 62 | - "\t\t<IC_BILL_NO/>\n" + | ||
| 63 | - "\t\t<IC_FORM_TYPE/>\n" + | ||
| 64 | - "\t\t<IC_GROSS_WT/>\n" + | ||
| 65 | - "\t\t<IC_VE_CUSTOMS_NO/>\n" + | ||
| 66 | - "\t\t<IC_VE_NAME/>\n" + | ||
| 67 | - "\t\t<IC_CONTA_ID/>\n" + | ||
| 68 | - "\t\t<IC_ESEAL_ID/>\n" + | ||
| 69 | - "\t\t<IC_REG_DATETIME/>\n" + | ||
| 70 | - "\t\t<IC_PER_DAY_DUE/>\n" + | ||
| 71 | - "\t</IC>\n" + | ||
| 72 | - "\t<WEIGHT>\n" + | ||
| 73 | - "\t\t<GROSS_WT>9100</GROSS_WT>\n" + | ||
| 74 | - "\t</WEIGHT>\n" + | ||
| 75 | - "\t<CAR>\n" + | ||
| 76 | - "\t\t<VE_NAME>豫AJ1205</VE_NAME>\n" + | ||
| 77 | - "\t\t<CAR_EC_NO>E0040000BFB0C007</CAR_EC_NO>\n" + | ||
| 78 | - "\t\t<CAR_EC_NO2/>\n" + | ||
| 79 | - "\t\t<VE_CUSTOMS_NO/>\n" + | ||
| 80 | - "\t\t<VE_WT/>\n" + | ||
| 81 | - "\t</CAR>\n" + | ||
| 82 | - "\t<CONTA>\n" + | ||
| 83 | - "\t\t<CONTA_NUM/>\n" + | ||
| 84 | - "\t\t<CONTA_RECO>1</CONTA_RECO>\n" + | ||
| 85 | - "\t\t<CONTA_ID_F/>\n" + | ||
| 86 | - "\t\t<CONTA_ID_B/>\n" + | ||
| 87 | - "\t\t<CONTA_MODEL_F/>\n" + | ||
| 88 | - "\t\t<CONTA_MODEL_B/>\n" + | ||
| 89 | - "\t</CONTA>\n" + | ||
| 90 | - "\t<ORDER_NUM/>\n" + | ||
| 91 | - "\t<BAR_CODE/>\n" + | ||
| 92 | - "\t<SEAL>\n" + | ||
| 93 | - "\t\t<ESEAL_ID/>\n" + | ||
| 94 | - "\t\t<SEAL_KEY/>\n" + | ||
| 95 | - "\t</SEAL>\n" + | ||
| 96 | - "</GATHER_INFO></MSG>"); | ||
| 97 | - }*/ | 54 | + |
| 98 | public void analysis(String string) { | 55 | public void analysis(String string) { |
| 99 | Message message = analysis.readTicketsXml(string); | 56 | Message message = analysis.readTicketsXml(string); |
| 100 | String stype = message.getMeta().getSmType(); | 57 | String stype = message.getMeta().getSmType(); |
src/main/java/com/sy/logic/GainGrossWt.java
0 → 100644
| 1 | +package com.sy.logic; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.alibaba.fastjson.JSON; | ||
| 5 | +import com.alibaba.fastjson.JSONArray; | ||
| 6 | +import org.springframework.stereotype.Component; | ||
| 7 | + | ||
| 8 | +import java.io.BufferedReader; | ||
| 9 | +import java.io.IOException; | ||
| 10 | +import java.io.InputStreamReader; | ||
| 11 | +import java.net.MalformedURLException; | ||
| 12 | +import java.net.URL; | ||
| 13 | +import java.net.URLConnection; | ||
| 14 | +import java.util.Map; | ||
| 15 | + | ||
| 16 | +@Component | ||
| 17 | +public class GainGrossWt { | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * @Param waybill 主单号 | ||
| 21 | + * @Param imp 进出港标识 | ||
| 22 | + * @Result 获取运单重量 | ||
| 23 | + * */ | ||
| 24 | + | ||
| 25 | + //根据主单号和进出标志获取运单重量 | ||
| 26 | + public static double getGrossWt(String waybill, String imp) { | ||
| 27 | + | ||
| 28 | + String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp; | ||
| 29 | + StringBuilder json = new StringBuilder(); | ||
| 30 | + Map map = null; | ||
| 31 | + double bg = 0; | ||
| 32 | + try { | ||
| 33 | + URL oracle = new URL(url); | ||
| 34 | + URLConnection yc = oracle.openConnection(); | ||
| 35 | + BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream())); | ||
| 36 | + String inputLine = null; | ||
| 37 | + while ((inputLine = in.readLine()) != null) { | ||
| 38 | + json.append(inputLine); | ||
| 39 | + } | ||
| 40 | + JSONArray array = JSONArray.parseArray(json.toString()); | ||
| 41 | + for (int i = 0; i < array.size(); i++) { | ||
| 42 | + map = JSON.parseObject(array.getString(i)); | ||
| 43 | + if (map.get("receiptinformation").toString().startsWith("41301")) { | ||
| 44 | + bg = Double.parseDouble((String) map.get("totalweight")); | ||
| 45 | + return bg; | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + in.close(); | ||
| 49 | + } catch (MalformedURLException e) { | ||
| 50 | + e.getMessage(); | ||
| 51 | + } catch (IOException e) { | ||
| 52 | + e.getMessage(); | ||
| 53 | + } | ||
| 54 | + return bg; | ||
| 55 | + } | ||
| 56 | +} |
| 1 | +package com.sy.logic; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sy.model.GatherInfo; | ||
| 5 | +import com.sy.model.LandBusinessTypeList; | ||
| 6 | +import com.sy.service.LandBusListService; | ||
| 7 | +import com.sy.socket.CommandClient; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Component; | ||
| 10 | + | ||
| 11 | +import javax.annotation.PostConstruct; | ||
| 12 | +import java.math.BigDecimal; | ||
| 13 | +import java.util.List; | ||
| 14 | + | ||
| 15 | +@Component | ||
| 16 | +public class LogicOperation { | ||
| 17 | + | ||
| 18 | + @Autowired | ||
| 19 | + private LandBusListService listService; | ||
| 20 | + | ||
| 21 | + private static LogicOperation logic; | ||
| 22 | + | ||
| 23 | + @PostConstruct | ||
| 24 | + public void init(){ | ||
| 25 | + logic = this; | ||
| 26 | + logic.listService = this.listService; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public boolean operation(GatherInfo info){ | ||
| 30 | + boolean sign = false; | ||
| 31 | + BigDecimal grosssWt = info.getGrosswt(); | ||
| 32 | + String ietype = info.getIetype(); | ||
| 33 | + List<LandBusinessTypeList>lists = null; | ||
| 34 | + if("E".equals(ietype)){ | ||
| 35 | + ietype = "出场站"; | ||
| 36 | + lists = listService.selectByFrameNoAndType(info.getIcvename(),ietype); | ||
| 37 | + for (LandBusinessTypeList list:lists) { | ||
| 38 | + //查询是否做了出场申请 | ||
| 39 | + if(list.getContrastflag()==""|list.getContrastflag()==null){ | ||
| 40 | + //判断车重 | ||
| 41 | + //判断载货重量是否符合所设定的范围 | ||
| 42 | + //发送放行指令 | ||
| 43 | + String flag = ""; | ||
| 44 | + CommandClient.Client(info,flag); | ||
| 45 | + sign = true; | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + }else { | ||
| 49 | + ietype = "进场站"; | ||
| 50 | + lists = listService.selectByFrameNoAndType(info.getIcvename(),ietype); | ||
| 51 | + } | ||
| 52 | + return sign; | ||
| 53 | + } | ||
| 54 | +} |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.GatherInfo; | 3 | import com.sy.model.GatherInfo; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface GatherInfoMapper { | 7 | public interface GatherInfoMapper { |
| 6 | int deleteByPrimaryKey(String seqno); | 8 | int deleteByPrimaryKey(String seqno); |
| 7 | 9 |
| 1 | -package com.sy.mapper; | ||
| 2 | - | ||
| 3 | -import com.sy.model.User; | ||
| 4 | - | ||
| 5 | -public interface UserMapper { | ||
| 6 | - int deleteByPrimaryKey(Integer userId); | ||
| 7 | - | ||
| 8 | - int insert(User record); | ||
| 9 | - | ||
| 10 | - int insertSelective(User record); | ||
| 11 | - | ||
| 12 | - User selectByPrimaryKey(Integer userId); | ||
| 13 | - | ||
| 14 | - int updateByPrimaryKeySelective(User record); | ||
| 15 | - | ||
| 16 | - int updateByPrimaryKey(User record); | ||
| 17 | -} |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.airone_ex_stock; | 3 | import com.sy.model.airone_ex_stock; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface airone_ex_stockMapper { | 7 | public interface airone_ex_stockMapper { |
| 6 | 8 | ||
| 7 | int deleteByPrimaryKey(String workNo); | 9 | int deleteByPrimaryKey(String workNo); |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.airone_im_stock; | 3 | import com.sy.model.airone_im_stock; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface airone_im_stockMapper { | 7 | public interface airone_im_stockMapper { |
| 6 | int deleteByPrimaryKey(String workNo); | 8 | int deleteByPrimaryKey(String workNo); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.commandInfo; | 3 | import com.sy.model.commandInfo; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface commandInfoMapper { | 7 | public interface commandInfoMapper { |
| 6 | int deleteByPrimaryKey(String seqNo); | 8 | int deleteByPrimaryKey(String seqNo); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.messagehead; | 3 | import com.sy.model.messagehead; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface messageheadMapper { | 7 | public interface messageheadMapper { |
| 6 | int deleteByPrimaryKey(String messageid); | 8 | int deleteByPrimaryKey(String messageid); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.port_manifest_body; | 3 | import com.sy.model.port_manifest_body; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface port_manifest_bodyMapper { | 7 | public interface port_manifest_bodyMapper { |
| 6 | int deleteByPrimaryKey(String autoid); | 8 | int deleteByPrimaryKey(String autoid); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.port_manifest_head; | 3 | import com.sy.model.port_manifest_head; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface port_manifest_headMapper { | 7 | public interface port_manifest_headMapper { |
| 6 | int deleteByPrimaryKey(String baseid); | 8 | int deleteByPrimaryKey(String baseid); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.port_manifest_head_stat; | 3 | import com.sy.model.port_manifest_head_stat; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface port_manifest_head_statMapper { | 7 | public interface port_manifest_head_statMapper { |
| 6 | int deleteByPrimaryKey(String baseid); | 8 | int deleteByPrimaryKey(String baseid); |
| 7 | 9 |
| 1 | package com.sy.mapper; | 1 | package com.sy.mapper; |
| 2 | 2 | ||
| 3 | import com.sy.model.v_express_billno; | 3 | import com.sy.model.v_express_billno; |
| 4 | +import org.springframework.stereotype.Component; | ||
| 4 | 5 | ||
| 6 | +@Component | ||
| 5 | public interface v_express_billnoMapper { | 7 | public interface v_express_billnoMapper { |
| 6 | int deleteByPrimaryKey(String hawbGuid); | 8 | int deleteByPrimaryKey(String hawbGuid); |
| 7 | 9 |
| 1 | +package com.sy.service; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sy.model.LandBusinessTypeList; | ||
| 5 | + | ||
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +public interface LandBusListService { | ||
| 9 | + | ||
| 10 | + List<LandBusinessTypeList> selectByFrameNoAndType(String frameNo, String flag); | ||
| 11 | + | ||
| 12 | + int updateById(LandBusinessTypeList list); | ||
| 13 | +} |
| 1 | +package com.sy.service.impl; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sy.mapper.LandBusinessTypeListMapper; | ||
| 5 | +import com.sy.model.LandBusinessTypeList; | ||
| 6 | +import com.sy.service.LandBusListService; | ||
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | +import org.springframework.stereotype.Service; | ||
| 9 | + | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 12 | +@Service | ||
| 13 | +public class LandBusListServiceImpl implements LandBusListService { | ||
| 14 | + | ||
| 15 | + @Autowired | ||
| 16 | + private LandBusinessTypeListMapper listMapper; | ||
| 17 | + | ||
| 18 | + @Override | ||
| 19 | + public List<LandBusinessTypeList> selectByFrameNoAndType(String frameNo, String flag) { | ||
| 20 | + List<LandBusinessTypeList> lists = listMapper.selectFrameNoAndType(frameNo,flag); | ||
| 21 | + return lists; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + @Override | ||
| 25 | + public int updateById(LandBusinessTypeList list) { | ||
| 26 | + int result = 0; | ||
| 27 | + try{ | ||
| 28 | + result = listMapper.updateByPrimaryKeySelective(list); | ||
| 29 | + }catch (Exception e){ | ||
| 30 | + e.printStackTrace(); | ||
| 31 | + } | ||
| 32 | + return 0; | ||
| 33 | + } | ||
| 34 | +} |
| 1 | +package com.sy.socket; | ||
| 2 | + | ||
| 3 | +import com.sy.model.GatherInfo; | ||
| 4 | +import org.apache.log4j.Logger; | ||
| 5 | +import org.springframework.stereotype.Component; | ||
| 6 | + | ||
| 7 | +import java.io.IOException; | ||
| 8 | +import java.io.OutputStream; | ||
| 9 | +import java.net.Socket; | ||
| 10 | +import java.net.UnknownHostException; | ||
| 11 | + | ||
| 12 | +@Component | ||
| 13 | +public class CommandClient { | ||
| 14 | + | ||
| 15 | + private static final Logger logger = Logger.getLogger(CommandClient.class); | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * @Param GatherInfo 所传卡口信息 | ||
| 19 | + * @Param flag 是否放行标识符 | ||
| 20 | + * */ | ||
| 21 | + public static void Client(GatherInfo info,String flag) { | ||
| 22 | + String xmlBody = getXmlInfo(info,flag); | ||
| 23 | + Socket socket =null; | ||
| 24 | + OutputStream op = null; | ||
| 25 | + try { | ||
| 26 | + socket = new Socket("192.168.1.107", 9002); | ||
| 27 | + logger.info("socket通讯创建连接成功"); | ||
| 28 | + op = socket.getOutputStream(); | ||
| 29 | + byte[]xBody =xmlBody.getBytes("GB2312"); | ||
| 30 | + byte[] head = new byte[4]; | ||
| 31 | + head[0]=(byte)0xE2; | ||
| 32 | + head[1]=(byte)0x5C; | ||
| 33 | + head[2]=(byte)0x4B; | ||
| 34 | + head[3]=(byte)0x89; | ||
| 35 | + byte[]packge = intToByte4((40+xBody.length)); | ||
| 36 | + byte[] mType = new byte[1]; | ||
| 37 | + mType[0] = (byte)0x22; | ||
| 38 | + byte[]station ="4257010001".getBytes("ASCII"); | ||
| 39 | + byte[]aisle ="4257011005".getBytes("ASCII"); | ||
| 40 | + byte[]eType ="E".getBytes("ASCII"); | ||
| 41 | + byte[] bwFlag = new byte[4]; | ||
| 42 | + bwFlag[0]=(byte)0xFF; | ||
| 43 | + bwFlag[1]=(byte)0xFF; | ||
| 44 | + bwFlag[2]=(byte)0xFF; | ||
| 45 | + bwFlag[3]=(byte)0xFF; | ||
| 46 | + byte[]xmlLength = intToByte4(xBody.length); | ||
| 47 | + byte[]end = new byte[2]; | ||
| 48 | + end[0]=(byte)0xFF; | ||
| 49 | + end[1]=(byte)0xFF; | ||
| 50 | + byte[]b1 = byteMerger(head,packge); | ||
| 51 | + byte[]b2 = byteMerger(mType,station); | ||
| 52 | + byte[]b3 = byteMerger(aisle,eType); | ||
| 53 | + byte[]b4 = byteMerger(bwFlag, xmlLength); | ||
| 54 | + byte[]b5 = byteMerger(xBody, end); | ||
| 55 | + byte[]b6 = byteMerger(b1,b2); | ||
| 56 | + byte[]b7 = byteMerger(b3,b4); | ||
| 57 | + byte[]b8 = byteMerger(b5,b6); | ||
| 58 | + byte[]b9 = byteMerger(b7,b8); | ||
| 59 | + op.write(b9); | ||
| 60 | + op.close(); | ||
| 61 | + logger.info("发送完毕"); | ||
| 62 | + socket.close(); | ||
| 63 | + } catch (UnknownHostException e) { | ||
| 64 | + e.printStackTrace(); | ||
| 65 | + logger.info("创建连接失败"+e.getMessage()); | ||
| 66 | + } catch (IOException e) { | ||
| 67 | + e.printStackTrace(); | ||
| 68 | + logger.info("文件发送失败"+e.getMessage()); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + | ||
| 72 | + } | ||
| 73 | + private static String getXmlInfo(GatherInfo info,String flag) { | ||
| 74 | + StringBuffer buffer = new StringBuffer(); | ||
| 75 | + buffer.append("<?xml version='1.0' encoding='GB2312' ?>"); | ||
| 76 | + buffer.append("<COMMAND_INFO AREA_ID="+info.getAreaid()+" CHNL_NO="+info.getChnlno()+" I_E_TYPE="+info | ||
| 77 | + .getIetype()+" SEQ_NO="+info.getSeqno()+">"); | ||
| 78 | + buffer.append("<CHECK_RESULT>11000000000000000000</CHECK_RESULT><OP_HINT>数据不完整</OP_HINT>"); | ||
| 79 | + buffer.append("<SEAL>"); | ||
| 80 | + buffer.append("<ESEAL_ID></ESEAL_ID>"); | ||
| 81 | + buffer.append("<SEAL_KEY></SEAL_KEY>"); | ||
| 82 | + buffer.append("<OPEN_TIMES></OPEN_TIMES>"); | ||
| 83 | + buffer.append("<ESEAL_IC_NO></ESEAL_IC_NO>"); | ||
| 84 | + buffer.append("</SEAL>"); | ||
| 85 | + buffer.append("<SZ_MSG></SZ_MSG>"); | ||
| 86 | + buffer.append("</COMMAND_INFO>"); | ||
| 87 | + return buffer.toString(); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + //int转byte | ||
| 91 | + public static byte[] intToByte4(int i) { | ||
| 92 | + byte[] targets = new byte[4]; | ||
| 93 | + //低位到高位 | ||
| 94 | + targets[0] = (byte) (i & 0xFF); | ||
| 95 | + targets[1] = (byte) (i >> 8 & 0xFF); | ||
| 96 | + targets[2] = (byte) (i >> 16 & 0xFF); | ||
| 97 | + targets[3] = (byte) (i >> 24 & 0xFF); | ||
| 98 | + return targets; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + //合并两个byte数组 | ||
| 102 | + public static byte[] byteMerger(byte[] bt1, byte[] bt2) { | ||
| 103 | + byte[] bt3 = new byte[bt1.length + bt2.length]; | ||
| 104 | + System.arraycopy(bt1, 0, bt3, 0, bt1.length); | ||
| 105 | + System.arraycopy(bt2, 0, bt3, bt1.length, bt2.length); | ||
| 106 | + return bt3; | ||
| 107 | + } | ||
| 108 | + //byte转int | ||
| 109 | + public static int byteArrayToInt(byte[] bytes) { | ||
| 110 | + int value = 0; | ||
| 111 | + // 由高位到低位 | ||
| 112 | + for (int i = 0; i < 4; i++) { | ||
| 113 | + int shift = (4 - 1 - i) * 8; | ||
| 114 | + value += (bytes[i] & 0x000000FF) << shift;// 往高位游 | ||
| 115 | + } | ||
| 116 | + return value; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | +} |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.sy.mapper.LandBusinessTypeListMapper"> | ||
| 4 | + <resultMap id="BaseResultMap" type="com.sy.model.LandBusinessTypeList"> | ||
| 5 | + <id column="id" jdbcType="VARCHAR" property="id" /> | ||
| 6 | + <result column="MASSAGE_ID" jdbcType="VARCHAR" property="massageId" /> | ||
| 7 | + <result column="TRAILER_FRAME_NO" jdbcType="VARCHAR" property="trailerFrameNo" /> | ||
| 8 | + <result column="TRAILER_LICENSE_NO" jdbcType="VARCHAR" property="trailerLicenseNo" /> | ||
| 9 | + <result column="MASTER_LIST" jdbcType="VARCHAR" property="masterList" /> | ||
| 10 | + <result column="PRODECT_TIME" jdbcType="TIMESTAMP" property="prodectTime" /> | ||
| 11 | + <result column="RETURNMESSAGE" jdbcType="VARCHAR" property="returnmessage" /> | ||
| 12 | + <result column="AGENTNO" jdbcType="VARCHAR" property="agentno" /> | ||
| 13 | + <result column="AGENTNAME" jdbcType="VARCHAR" property="agentname" /> | ||
| 14 | + <result column="COCODE" jdbcType="VARCHAR" property="cocode" /> | ||
| 15 | + <result column="DRIVERNAME" jdbcType="VARCHAR" property="drivername" /> | ||
| 16 | + <result column="DRIVERID" jdbcType="VARCHAR" property="driverid" /> | ||
| 17 | + <result column="STARTPORT" jdbcType="VARCHAR" property="startport" /> | ||
| 18 | + <result column="ENDPORT" jdbcType="VARCHAR" property="endport" /> | ||
| 19 | + <result column="STARTSATATION" jdbcType="VARCHAR" property="startsatation" /> | ||
| 20 | + <result column="ENDSTATION" jdbcType="VARCHAR" property="endstation" /> | ||
| 21 | + <result column="AISLE" jdbcType="VARCHAR" property="aisle" /> | ||
| 22 | + <result column="BUSINESSTYPE" jdbcType="VARCHAR" property="businesstype" /> | ||
| 23 | + <result column="TURNOVERFLAG" jdbcType="VARCHAR" property="turnoverflag" /> | ||
| 24 | + <result column="CONTRASTFLAG" jdbcType="VARCHAR" property="contrastflag" /> | ||
| 25 | + <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" /> | ||
| 26 | + <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" /> | ||
| 27 | + <result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy" /> | ||
| 28 | + <result column="UPDATE_DATE" jdbcType="TIMESTAMP" property="updateDate" /> | ||
| 29 | + </resultMap> | ||
| 30 | + <sql id="Base_Column_List"> | ||
| 31 | + id, MASSAGE_ID, TRAILER_FRAME_NO, TRAILER_LICENSE_NO, MASTER_LIST, PRODECT_TIME, | ||
| 32 | + RETURNMESSAGE, AGENTNO, AGENTNAME, COCODE, DRIVERNAME, DRIVERID, STARTPORT, ENDPORT, | ||
| 33 | + STARTSATATION, ENDSTATION, AISLE, BUSINESSTYPE, TURNOVERFLAG, CONTRASTFLAG, CREATE_BY, | ||
| 34 | + CREATE_DATE, UPDATE_BY, UPDATE_DATE | ||
| 35 | + </sql> | ||
| 36 | + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 37 | + select | ||
| 38 | + <include refid="Base_Column_List" /> | ||
| 39 | + from land_businesstype_list | ||
| 40 | + where id = #{id,jdbcType=VARCHAR} | ||
| 41 | + </select> | ||
| 42 | + | ||
| 43 | + <select id="selectFrameNoAndType" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 44 | + select | ||
| 45 | + <include refid="Base_Column_List" /> | ||
| 46 | + from land_businesstype_list | ||
| 47 | + where TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR} | ||
| 48 | + and TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR} | ||
| 49 | + </select> | ||
| 50 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | ||
| 51 | + delete from land_businesstype_list | ||
| 52 | + where id = #{id,jdbcType=VARCHAR} | ||
| 53 | + </delete> | ||
| 54 | + <insert id="insert" parameterType="com.sy.model.LandBusinessTypeList"> | ||
| 55 | + insert into land_businesstype_list (id, MASSAGE_ID, TRAILER_FRAME_NO, | ||
| 56 | + TRAILER_LICENSE_NO, MASTER_LIST, PRODECT_TIME, | ||
| 57 | + RETURNMESSAGE, AGENTNO, AGENTNAME, | ||
| 58 | + COCODE, DRIVERNAME, DRIVERID, | ||
| 59 | + STARTPORT, ENDPORT, STARTSATATION, | ||
| 60 | + ENDSTATION, AISLE, BUSINESSTYPE, | ||
| 61 | + TURNOVERFLAG, CONTRASTFLAG, CREATE_BY, | ||
| 62 | + CREATE_DATE, UPDATE_BY, UPDATE_DATE | ||
| 63 | + ) | ||
| 64 | + values (#{id,jdbcType=VARCHAR}, #{massageId,jdbcType=VARCHAR}, #{trailerFrameNo,jdbcType=VARCHAR}, | ||
| 65 | + #{trailerLicenseNo,jdbcType=VARCHAR}, #{masterList,jdbcType=VARCHAR}, #{prodectTime,jdbcType=TIMESTAMP}, | ||
| 66 | + #{returnmessage,jdbcType=VARCHAR}, #{agentno,jdbcType=VARCHAR}, #{agentname,jdbcType=VARCHAR}, | ||
| 67 | + #{cocode,jdbcType=VARCHAR}, #{drivername,jdbcType=VARCHAR}, #{driverid,jdbcType=VARCHAR}, | ||
| 68 | + #{startport,jdbcType=VARCHAR}, #{endport,jdbcType=VARCHAR}, #{startsatation,jdbcType=VARCHAR}, | ||
| 69 | + #{endstation,jdbcType=VARCHAR}, #{aisle,jdbcType=VARCHAR}, #{businesstype,jdbcType=VARCHAR}, | ||
| 70 | + #{turnoverflag,jdbcType=VARCHAR}, #{contrastflag,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, | ||
| 71 | + #{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP} | ||
| 72 | + ) | ||
| 73 | + </insert> | ||
| 74 | + <insert id="insertSelective" parameterType="com.sy.model.LandBusinessTypeList"> | ||
| 75 | + insert into land_businesstype_list | ||
| 76 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 77 | + <if test="id != null"> | ||
| 78 | + id, | ||
| 79 | + </if> | ||
| 80 | + <if test="massageId != null"> | ||
| 81 | + MASSAGE_ID, | ||
| 82 | + </if> | ||
| 83 | + <if test="trailerFrameNo != null"> | ||
| 84 | + TRAILER_FRAME_NO, | ||
| 85 | + </if> | ||
| 86 | + <if test="trailerLicenseNo != null"> | ||
| 87 | + TRAILER_LICENSE_NO, | ||
| 88 | + </if> | ||
| 89 | + <if test="masterList != null"> | ||
| 90 | + MASTER_LIST, | ||
| 91 | + </if> | ||
| 92 | + <if test="prodectTime != null"> | ||
| 93 | + PRODECT_TIME, | ||
| 94 | + </if> | ||
| 95 | + <if test="returnmessage != null"> | ||
| 96 | + RETURNMESSAGE, | ||
| 97 | + </if> | ||
| 98 | + <if test="agentno != null"> | ||
| 99 | + AGENTNO, | ||
| 100 | + </if> | ||
| 101 | + <if test="agentname != null"> | ||
| 102 | + AGENTNAME, | ||
| 103 | + </if> | ||
| 104 | + <if test="cocode != null"> | ||
| 105 | + COCODE, | ||
| 106 | + </if> | ||
| 107 | + <if test="drivername != null"> | ||
| 108 | + DRIVERNAME, | ||
| 109 | + </if> | ||
| 110 | + <if test="driverid != null"> | ||
| 111 | + DRIVERID, | ||
| 112 | + </if> | ||
| 113 | + <if test="startport != null"> | ||
| 114 | + STARTPORT, | ||
| 115 | + </if> | ||
| 116 | + <if test="endport != null"> | ||
| 117 | + ENDPORT, | ||
| 118 | + </if> | ||
| 119 | + <if test="startsatation != null"> | ||
| 120 | + STARTSATATION, | ||
| 121 | + </if> | ||
| 122 | + <if test="endstation != null"> | ||
| 123 | + ENDSTATION, | ||
| 124 | + </if> | ||
| 125 | + <if test="aisle != null"> | ||
| 126 | + AISLE, | ||
| 127 | + </if> | ||
| 128 | + <if test="businesstype != null"> | ||
| 129 | + BUSINESSTYPE, | ||
| 130 | + </if> | ||
| 131 | + <if test="turnoverflag != null"> | ||
| 132 | + TURNOVERFLAG, | ||
| 133 | + </if> | ||
| 134 | + <if test="contrastflag != null"> | ||
| 135 | + CONTRASTFLAG, | ||
| 136 | + </if> | ||
| 137 | + <if test="createBy != null"> | ||
| 138 | + CREATE_BY, | ||
| 139 | + </if> | ||
| 140 | + <if test="createDate != null"> | ||
| 141 | + CREATE_DATE, | ||
| 142 | + </if> | ||
| 143 | + <if test="updateBy != null"> | ||
| 144 | + UPDATE_BY, | ||
| 145 | + </if> | ||
| 146 | + <if test="updateDate != null"> | ||
| 147 | + UPDATE_DATE, | ||
| 148 | + </if> | ||
| 149 | + </trim> | ||
| 150 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 151 | + <if test="id != null"> | ||
| 152 | + #{id,jdbcType=VARCHAR}, | ||
| 153 | + </if> | ||
| 154 | + <if test="massageId != null"> | ||
| 155 | + #{massageId,jdbcType=VARCHAR}, | ||
| 156 | + </if> | ||
| 157 | + <if test="trailerFrameNo != null"> | ||
| 158 | + #{trailerFrameNo,jdbcType=VARCHAR}, | ||
| 159 | + </if> | ||
| 160 | + <if test="trailerLicenseNo != null"> | ||
| 161 | + #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 162 | + </if> | ||
| 163 | + <if test="masterList != null"> | ||
| 164 | + #{masterList,jdbcType=VARCHAR}, | ||
| 165 | + </if> | ||
| 166 | + <if test="prodectTime != null"> | ||
| 167 | + #{prodectTime,jdbcType=TIMESTAMP}, | ||
| 168 | + </if> | ||
| 169 | + <if test="returnmessage != null"> | ||
| 170 | + #{returnmessage,jdbcType=VARCHAR}, | ||
| 171 | + </if> | ||
| 172 | + <if test="agentno != null"> | ||
| 173 | + #{agentno,jdbcType=VARCHAR}, | ||
| 174 | + </if> | ||
| 175 | + <if test="agentname != null"> | ||
| 176 | + #{agentname,jdbcType=VARCHAR}, | ||
| 177 | + </if> | ||
| 178 | + <if test="cocode != null"> | ||
| 179 | + #{cocode,jdbcType=VARCHAR}, | ||
| 180 | + </if> | ||
| 181 | + <if test="drivername != null"> | ||
| 182 | + #{drivername,jdbcType=VARCHAR}, | ||
| 183 | + </if> | ||
| 184 | + <if test="driverid != null"> | ||
| 185 | + #{driverid,jdbcType=VARCHAR}, | ||
| 186 | + </if> | ||
| 187 | + <if test="startport != null"> | ||
| 188 | + #{startport,jdbcType=VARCHAR}, | ||
| 189 | + </if> | ||
| 190 | + <if test="endport != null"> | ||
| 191 | + #{endport,jdbcType=VARCHAR}, | ||
| 192 | + </if> | ||
| 193 | + <if test="startsatation != null"> | ||
| 194 | + #{startsatation,jdbcType=VARCHAR}, | ||
| 195 | + </if> | ||
| 196 | + <if test="endstation != null"> | ||
| 197 | + #{endstation,jdbcType=VARCHAR}, | ||
| 198 | + </if> | ||
| 199 | + <if test="aisle != null"> | ||
| 200 | + #{aisle,jdbcType=VARCHAR}, | ||
| 201 | + </if> | ||
| 202 | + <if test="businesstype != null"> | ||
| 203 | + #{businesstype,jdbcType=VARCHAR}, | ||
| 204 | + </if> | ||
| 205 | + <if test="turnoverflag != null"> | ||
| 206 | + #{turnoverflag,jdbcType=VARCHAR}, | ||
| 207 | + </if> | ||
| 208 | + <if test="contrastflag != null"> | ||
| 209 | + #{contrastflag,jdbcType=VARCHAR}, | ||
| 210 | + </if> | ||
| 211 | + <if test="createBy != null"> | ||
| 212 | + #{createBy,jdbcType=VARCHAR}, | ||
| 213 | + </if> | ||
| 214 | + <if test="createDate != null"> | ||
| 215 | + #{createDate,jdbcType=TIMESTAMP}, | ||
| 216 | + </if> | ||
| 217 | + <if test="updateBy != null"> | ||
| 218 | + #{updateBy,jdbcType=VARCHAR}, | ||
| 219 | + </if> | ||
| 220 | + <if test="updateDate != null"> | ||
| 221 | + #{updateDate,jdbcType=TIMESTAMP}, | ||
| 222 | + </if> | ||
| 223 | + </trim> | ||
| 224 | + </insert> | ||
| 225 | + <update id="updateByPrimaryKeySelective" parameterType="com.sy.model.LandBusinessTypeList"> | ||
| 226 | + update land_businesstype_list | ||
| 227 | + <set> | ||
| 228 | + <if test="massageId != null"> | ||
| 229 | + MASSAGE_ID = #{massageId,jdbcType=VARCHAR}, | ||
| 230 | + </if> | ||
| 231 | + <if test="trailerFrameNo != null"> | ||
| 232 | + TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR}, | ||
| 233 | + </if> | ||
| 234 | + <if test="trailerLicenseNo != null"> | ||
| 235 | + TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 236 | + </if> | ||
| 237 | + <if test="masterList != null"> | ||
| 238 | + MASTER_LIST = #{masterList,jdbcType=VARCHAR}, | ||
| 239 | + </if> | ||
| 240 | + <if test="prodectTime != null"> | ||
| 241 | + PRODECT_TIME = #{prodectTime,jdbcType=TIMESTAMP}, | ||
| 242 | + </if> | ||
| 243 | + <if test="returnmessage != null"> | ||
| 244 | + RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR}, | ||
| 245 | + </if> | ||
| 246 | + <if test="agentno != null"> | ||
| 247 | + AGENTNO = #{agentno,jdbcType=VARCHAR}, | ||
| 248 | + </if> | ||
| 249 | + <if test="agentname != null"> | ||
| 250 | + AGENTNAME = #{agentname,jdbcType=VARCHAR}, | ||
| 251 | + </if> | ||
| 252 | + <if test="cocode != null"> | ||
| 253 | + COCODE = #{cocode,jdbcType=VARCHAR}, | ||
| 254 | + </if> | ||
| 255 | + <if test="drivername != null"> | ||
| 256 | + DRIVERNAME = #{drivername,jdbcType=VARCHAR}, | ||
| 257 | + </if> | ||
| 258 | + <if test="driverid != null"> | ||
| 259 | + DRIVERID = #{driverid,jdbcType=VARCHAR}, | ||
| 260 | + </if> | ||
| 261 | + <if test="startport != null"> | ||
| 262 | + STARTPORT = #{startport,jdbcType=VARCHAR}, | ||
| 263 | + </if> | ||
| 264 | + <if test="endport != null"> | ||
| 265 | + ENDPORT = #{endport,jdbcType=VARCHAR}, | ||
| 266 | + </if> | ||
| 267 | + <if test="startsatation != null"> | ||
| 268 | + STARTSATATION = #{startsatation,jdbcType=VARCHAR}, | ||
| 269 | + </if> | ||
| 270 | + <if test="endstation != null"> | ||
| 271 | + ENDSTATION = #{endstation,jdbcType=VARCHAR}, | ||
| 272 | + </if> | ||
| 273 | + <if test="aisle != null"> | ||
| 274 | + AISLE = #{aisle,jdbcType=VARCHAR}, | ||
| 275 | + </if> | ||
| 276 | + <if test="businesstype != null"> | ||
| 277 | + BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR}, | ||
| 278 | + </if> | ||
| 279 | + <if test="turnoverflag != null"> | ||
| 280 | + TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR}, | ||
| 281 | + </if> | ||
| 282 | + <if test="contrastflag != null"> | ||
| 283 | + CONTRASTFLAG = #{contrastflag,jdbcType=VARCHAR}, | ||
| 284 | + </if> | ||
| 285 | + <if test="createBy != null"> | ||
| 286 | + CREATE_BY = #{createBy,jdbcType=VARCHAR}, | ||
| 287 | + </if> | ||
| 288 | + <if test="createDate != null"> | ||
| 289 | + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, | ||
| 290 | + </if> | ||
| 291 | + <if test="updateBy != null"> | ||
| 292 | + UPDATE_BY = #{updateBy,jdbcType=VARCHAR}, | ||
| 293 | + </if> | ||
| 294 | + <if test="updateDate != null"> | ||
| 295 | + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, | ||
| 296 | + </if> | ||
| 297 | + </set> | ||
| 298 | + where id = #{id,jdbcType=VARCHAR} | ||
| 299 | + </update> | ||
| 300 | + <update id="updateByPrimaryKey" parameterType="com.sy.model.LandBusinessTypeList"> | ||
| 301 | + update land_businesstype_list | ||
| 302 | + set MASSAGE_ID = #{massageId,jdbcType=VARCHAR}, | ||
| 303 | + TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR}, | ||
| 304 | + TRAILER_LICENSE_NO = #{trailerLicenseNo,jdbcType=VARCHAR}, | ||
| 305 | + MASTER_LIST = #{masterList,jdbcType=VARCHAR}, | ||
| 306 | + PRODECT_TIME = #{prodectTime,jdbcType=TIMESTAMP}, | ||
| 307 | + RETURNMESSAGE = #{returnmessage,jdbcType=VARCHAR}, | ||
| 308 | + AGENTNO = #{agentno,jdbcType=VARCHAR}, | ||
| 309 | + AGENTNAME = #{agentname,jdbcType=VARCHAR}, | ||
| 310 | + COCODE = #{cocode,jdbcType=VARCHAR}, | ||
| 311 | + DRIVERNAME = #{drivername,jdbcType=VARCHAR}, | ||
| 312 | + DRIVERID = #{driverid,jdbcType=VARCHAR}, | ||
| 313 | + STARTPORT = #{startport,jdbcType=VARCHAR}, | ||
| 314 | + ENDPORT = #{endport,jdbcType=VARCHAR}, | ||
| 315 | + STARTSATATION = #{startsatation,jdbcType=VARCHAR}, | ||
| 316 | + ENDSTATION = #{endstation,jdbcType=VARCHAR}, | ||
| 317 | + AISLE = #{aisle,jdbcType=VARCHAR}, | ||
| 318 | + BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR}, | ||
| 319 | + TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR}, | ||
| 320 | + CONTRASTFLAG = #{contrastflag,jdbcType=VARCHAR}, | ||
| 321 | + CREATE_BY = #{createBy,jdbcType=VARCHAR}, | ||
| 322 | + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, | ||
| 323 | + UPDATE_BY = #{updateBy,jdbcType=VARCHAR}, | ||
| 324 | + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP} | ||
| 325 | + where id = #{id,jdbcType=VARCHAR} | ||
| 326 | + </update> | ||
| 327 | +</mapper> |
-
请 注册 或 登录 后发表评论