白名单批量上传

pull/1/head
bmpandlcm 11 months ago
parent a388f44dfb
commit fe5ad126da

@ -1,14 +1,20 @@
package com.nmgs.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.fastjson.JSONObject;
import com.nmgs.config.ResultData;
import com.nmgs.entity.WhiteCarnoList;
import com.nmgs.entity.WhiteCarnoLogTable;
import com.nmgs.service.IWhiteBatchImportSerive;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -19,11 +25,19 @@ import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/whiteBatchImport")
@Api(tags = "白名单批量导入")
public class WhiteBatchImportController {
public IWhiteBatchImportSerive iWhiteBatchImportSerive;
@Autowired
public void setiWhiteBatchImportSerive(IWhiteBatchImportSerive iWhiteBatchImportSerive) {
this.iWhiteBatchImportSerive = iWhiteBatchImportSerive;
}
//实现Spring Boot 的文件下载功能,映射网址为/download
@ApiOperation(value = "模板下载",httpMethod = "GET",ignoreJsonView = false )
@ApiImplicitParams(
@ -93,48 +107,29 @@ public class WhiteBatchImportController {
}
/**
* excel
* @param file
* @param params
* @throws Exception
*/
@PostMapping("/import")
public ResultData<String> importExcel(MultipartFile file) throws Exception {
InputStream inputStream = file.getInputStream();
ExcelReader reader = ExcelUtil.getReader(inputStream);
// 方式1(推荐) 通过 javabean的方式读取Excel内的对象但是要求表头必须是英文跟javabean的属性要对应起来
// List<User> list = reader.readAll(User.class);
// 方式2忽略表头的中文直接读取表的内容
List<List<Object>> read = reader.read(1);
/* List<User> users = CollUtil.newArrayList();
for (List<Object> row : list) {
User user = new User();
user.setUsername(row.get(0).toString());
user.setPassword(row.get(1).toString());
user.setNickname(row.get(2).toString());
user.setEmail(row.get(3).toString());
user.setPhone(row.get(4).toString());
user.setAddress(row.get(5).toString());
user.setAvatarUrl(row.get(6).toString());
users.add(user);
}*/
return ResultData.success("","",1);
@PostMapping("/importExcel")
public ResultData<JSONObject> importExcel(@RequestBody Object params ) throws Exception {
JSONObject ret=iWhiteBatchImportSerive.insertData(params);
return ResultData.success("",ret,1);
}
@PostMapping("/uploadFile")
public ResultData<String> uploadFile(HttpServletRequest request, HttpServletResponse response,@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
System.out.println("文件上传开始");
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
// 下载文件能正常显示中文
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.getName(), "UTF-8"));
//当前项目的目录
String path = com.nmgs.util.PathUtil.webappsPath + "\\CarNoFile\\";
//每天创建一个文件目录
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
String fileDirName = sdf.format(new Date());
String folderPath = path + fileDirName;
System.out.println("文件路径=====>"+folderPath);
String folderPath = com.nmgs.util.PathUtil.webappsPath + "\\CarNoFile\\"+fileDirName;
//每天创建一个文件目录
SimpleDateFormat sdfs=new SimpleDateFormat("hhmmss");
String afterSuffix = sdfs.format(new Date());
String originalFilename = file.getOriginalFilename();
String[] split = originalFilename.split("\\.");
File fileTemp=new File(folderPath);
if (!fileTemp.exists())
{
@ -144,8 +139,7 @@ public class WhiteBatchImportController {
if (file != null){
try
{
fileName = file.getOriginalFilename();
System.out.println("上传的文件名称======>"+fileName);
fileName = split[0]+afterSuffix+"."+split[1];
File fileDocument=new File(folderPath,fileName);
File fileExists=new File(folderPath+"//"+fileName);
if(fileExists.exists()){
@ -157,8 +151,7 @@ public class WhiteBatchImportController {
}
catch (Exception ex)
{
System.out.println("文件异常====="+ ex.getMessage());
return ResultData.fail("文件异常====="+ ex.getMessage());
return ResultData.fail("文件异常:"+ ex.getMessage());
}
}
return ResultData.success(1,fileName);

@ -222,8 +222,11 @@
<if test="params.discrp !='' and params.discrp != null">
DISCRP= #{params.discrp},
</if>
MEMO= #{params.memo},
VEHICLE_CLASS=#{params.vehicleClass}
<if test="params.vehicleClass !='' and params.vehicleClass != null">
VEHICLE_CLASS=#{params.vehicleClass},
</if>
MEMO= #{params.memo}
</set>
where ID=#{params.id}
</update>
@ -274,11 +277,24 @@
</update>
<insert id="insertData" parameterType="com.nmgs.entity.WhiteCarnoList">
insert into WHITE_CARNO_TABLE(ID,acarno,COLOR,DT,BEGDT,ENDDT,VEHICLE_TYPE,
DATAFLAG,DESCRIB,BEGDT,ACCOUNT,VERNO,BAK1,BAK2,BAK3,MEMO,
VEHICLE_CLASS,DISCRP) values(#{params.id},#{params.acarno},#{params.color},#{params.dt},#{params.begdt},
#{params.enddt},#{params.vehicleType},#{params.dataflag},#{params.describ},#{params.begdate},
#{params.account},#{params.version},#{params.bak1},#{params.bak12},#{params.bak3},#{params.memo},
insert into WHITE_CARNO_TABLE(ID,
acarno,
COLOR,
DT,BEGDT,ENDDT,
VEHICLE_TYPE,
DATAFLAG,DESCRIB,BEGDATE,ACCOUNT,VERNO,
BAK1,BAK2,BAK3,MEMO,
VEHICLE_CLASS,DISCRP)
values(#{params.id},
#{params.acarno},
#{params.color},
#{params.dt},
#{params.begdt},
#{params.enddt},
#{params.vehicleType},
#{params.dataflag},#{params.describ},#{params.begdate},
#{params.account},#{params.verno},#{params.bak1},
#{params.bak2},#{params.bak3},#{params.memo},
#{params.vehicleClass},#{params.discrp}
)
</insert>

@ -0,0 +1,20 @@
package com.nmgs.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.WhiteAccountText;
import java.util.List;
import java.util.Map;
public interface IWhiteBatchImportSerive {
/**
*
* @param params
* @return
* @throws Exception
*/
JSONObject insertData(Object params) throws Exception;
}

@ -0,0 +1,275 @@
package com.nmgs.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.UUID;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.config.ResultData;
import com.nmgs.entity.Consistent;
import com.nmgs.entity.WhiteCarnoList;
import com.nmgs.entity.WhiteCarnoLogTable;
import com.nmgs.mapper.Mapper;
import com.nmgs.mapper.WhiteCarnoListMapper;
import com.nmgs.mapper.WhiteCarnoLogMapper;
import com.nmgs.service.ISelectData;
import com.nmgs.service.IWhiteBatchImportSerive;
import com.nmgs.service.IWhiteCarnoListSerive;
import com.nmgs.service.IWhiteCarnoLogService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
import com.nmgs.util.PubTools;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.FileInputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@Transactional(rollbackFor = Exception.class)
@Service
public class WhiteBatchImportSeriveImpl implements IWhiteBatchImportSerive {
public Mapper iMapper;
@Autowired
public void setiMapper(Mapper iMapper) {
this.iMapper = iMapper;
}
public WhiteCarnoListMapper whiteCarnoListMapper;
public WhiteCarnoLogMapper whiteCarnoLogMapper;
@Autowired
public void setWhiteCarnoListMapper(WhiteCarnoListMapper whiteCarnoListMapper) {
this.whiteCarnoListMapper = whiteCarnoListMapper;
}
@Autowired
public void setWhiteCarnoLogMapper(WhiteCarnoLogMapper whiteCarnoLogMapper) {
this.whiteCarnoLogMapper = whiteCarnoLogMapper;
}
@Override
public JSONObject insertData(Object params) throws Exception {
Map<String,Object> map=(Map<String,Object>)params;
JSONObject json=new JSONObject();
String txtLog="";
String logShowExist="";
String filename=map.get("filename").toString();
String opermano=map.get("opermano").toString();
String opermaname=map.get("opermaname").toString();
String zdyzh=map.get("zdyzh").toString();
String zdyzhAccount=map.get("zdyzhAccount").toString();
String mfld=map.get("mfld").toString();
String mfldAccount=map.get("mfldAccount").toString();
String zdyzhDis=map.get("zdyzhDis").toString();
String mfldDis=map.get("mfldDis").toString();
List<WhiteCarnoList> users = new ArrayList<WhiteCarnoList>();//新增的数据
List<WhiteCarnoList> usersUpdate = new ArrayList<WhiteCarnoList>();//修改的数据:根据车牌号和颜色查询是否存在数据,存在则更新
List<WhiteCarnoLogTable> carnoLogAdd = new ArrayList<WhiteCarnoLogTable>();//操作日志
int count = 0;
//当前项目的目录
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
String fileDirName = sdf.format(new Date());
String folderPath = com.nmgs.util.PathUtil.webappsPath + "\\CarNoFile\\"+fileDirName+"\\"+filename;
File fileTemp=new File(folderPath);
if (!fileTemp.exists())
{
txtLog="附件不存在";
json.put("txtLog",txtLog);
return json;
}else{
FileInputStream fileInputStream = new FileInputStream(folderPath);
ExcelReader reader = ExcelUtil.getReader(fileInputStream);
List<List<Object>> read = reader.read(3);
// 方式2忽略表头的中文直接读取表的内容
SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
txtLog += "\n";
if(read.size()>0){
txtLog += PubTools.getCurrentDate() + "白名单批量导入文件名称-->" + filename + "\n";
}
for ( int k=0;k<read.size()-1;k++) {//由于最后一行内容是填报人信息, 所以不管
List<Object> row=read.get(k);
try{
if(!PubTools.isEmpty(row.get(1)) && !PubTools.isEmpty(row.get(2)) && !PubTools.isEmpty(row.get(3))
&& !PubTools.isNull(row.get(1).toString()) && !PubTools.isNull(row.get(2).toString()) &&
!PubTools.isNull(row.get(3).toString())){
}
//
WhiteCarnoList user = new WhiteCarnoList();
WhiteCarnoLogTable carNoLog = new WhiteCarnoLogTable();
//校验车牌
boolean isregex = PubTools.isregex(row.get(1).toString());
if(!isregex){
txtLog += PubTools.getCurrentDate() + row.get(1).toString() + ":车牌号码不正确!" + "\n";
}else{
if (row.get(1).toString().trim().toUpperCase().contains("I") || row.get(1).toString().trim().toUpperCase().contains("O"))
{
txtLog += PubTools.getCurrentDate() + row.get(1).toString() + "车牌号码不能包含I/O(i/o)字母!";
json.put("txtLog",txtLog);
return json;
}
}
int color = getColor(row.get(2).toString());
if(color <0){
txtLog += PubTools.getCurrentDate() + row.get(1).toString() + ":车牌颜色选择错误!";
json.put("txtLog",txtLog);
return json;
}
count++;
user.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
user.setAcarno(row.get(1).toString());//车牌号
user.setColor(color);//车牌颜色
user.setDescrib(row.get(3).toString());//车辆描述
user.setEnddt(sd.parse(row.get(4).toString()));//有效结束日期
user.setDt(sd.parse(PubTools.getCurrentDate()));
user.setBegdt(sd.parse(PubTools.getCurrentDate()));
user.setBegdate(sd.parse(PubTools.getCurrentDate()));
user.setDataflag("1");//默认启用
user.setVerno("0");
//处理所属单位以及memo信息处理
if(!PubTools.isNull(zdyzh)){//自定义组合
user.setMemo(zdyzh);
user.setDiscrp(zdyzhDis);
user.setAccount(Integer.parseInt(zdyzhAccount));
}else{
if (!PubTools.isNull(mfld)){
String[] ckgFree=mfld.split(",");
String memoDb="";
for (int i = 0; i < ckgFree.length; i++){
String r = ckgFree[i]+"";
if (!PubTools.isNull(ckgFree[i]+"")){
//不足两位补0,
if (Integer.parseInt(ckgFree[i]+"") < 10){
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
}else{
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
}
}
}
user.setMemo(memoDb);
user.setDiscrp(mfldDis);
user.setAccount(Integer.parseInt(mfldAccount));
}
}
//根据车牌和颜色判断车牌是否已经存在
Map<String,Object> mapParas=new HashMap<String,Object>();
mapParas.put("acarNo",row.get(1).toString()) ;
mapParas.put("color",color) ;
List<WhiteCarnoList> whiteCarnoList = whiteCarnoListMapper.getWhiteCarnoList(mapParas);
if(whiteCarnoList.size()>0){
WhiteCarnoList whiteCarnoList1 = whiteCarnoList.get(0);
logShowExist += whiteCarnoList1.getAcarno() + ",";
user.setId(whiteCarnoList1.getId());
user.setVehicleType(whiteCarnoList1.getVehicleType());
user.setVehicleClass(whiteCarnoList1.getVehicleClass());
user.setBak1(whiteCarnoList1.getBak1());
user.setBak2(whiteCarnoList1.getBak2());
user.setBak3(whiteCarnoList1.getBak3());
usersUpdate.add(user);
}else{
user.setVehicleType(0);
user.setVehicleClass(0);
user.setBak1("");
user.setBak2("");
user.setBak3("");
users.add(user);
}
//memo设置
BeanUtils.copyProperties(user,carNoLog,"id");
carNoLog.setId(UUID.randomUUID().toString().replace("-","").substring(0,32));
carNoLog.setOperdate(sd.parse(PubTools.getCurrentDate()));
carNoLog.setOpertype(Consistent.IMPORT_BATCH);
carNoLog.setOpertypename(Consistent.IMPORT_BATCH_NAME);
carNoLog.setOpermano(opermano);
carNoLog.setOpermaname(opermaname);
carNoLog.setIdbusiness(user.getId());
carnoLogAdd.add(carNoLog);
}catch (Exception e){
txtLog += PubTools.getCurrentDate() + row.get(1).toString() + "【白名单文件没有按规定填写,请检查!!】 ";
json.put("txtLog",txtLog);
return json;
}
}
}
try
{
int ret=-1;
if (users.size()>0){
for(WhiteCarnoList whiteCarnoList:users){
int i = this.whiteCarnoListMapper.insertData(whiteCarnoList);
if(i<1){
txtLog += PubTools.getCurrentDate() + "导入失败!! ";
json.put("txtLog",txtLog);
return json;
}
}
}
if (usersUpdate.size()>0){
for(WhiteCarnoList whiteCarnoList:usersUpdate){
int i = this.whiteCarnoListMapper.updateById(whiteCarnoList);
if(i<1){
txtLog += PubTools.getCurrentDate() + "导入失败!! ";
json.put("txtLog",txtLog);
return json;
}
}
}
if (carnoLogAdd.size()>0){
for(WhiteCarnoLogTable whiteCarnoList:carnoLogAdd){
int i = this.whiteCarnoLogMapper.insert(whiteCarnoList);
if(i<1){
txtLog += PubTools.getCurrentDate() + "导入失败!! ";
json.put("txtLog",txtLog);
return json;
}
}
}
if(!PubTools.isNull(logShowExist)){
txtLog += "已存在车牌:"+logShowExist + "\n";
}
txtLog += PubTools.getCurrentDate() + "成功,共计:【" + count + "】条 ";
}
catch (Exception ex)
{
txtLog += PubTools.getCurrentDate() + "白名单批量导入异常:" + ex.getMessage() + "\n";
}
json.put("txtLog",txtLog);
return json;
}
private int getColor(String colorName){
String sql="select t.VALUE AS LABEL from white_PLATE_COLOR t where t.TEXT='"+colorName+"'";
List selectforlist = this.iMapper.selectforlist(sql);
int ret=-1;
if(selectforlist.size()>0){
Map<String,Object> o =(Map<String,Object>) selectforlist.get(0);
if(o.get("LABEL") instanceof BigDecimal){
ret=((BigDecimal) o.get("LABEL")).intValue();
}else if(o.get("LABEL") instanceof Integer){
ret=(Integer) o.get("LABEL");
}else{
ret=Integer.parseInt(o.get("LABEL").toString()) ;
}
}
return ret;
}
}

@ -56,11 +56,11 @@ public class WhiteCarnoDicSeviceImpl implements IWhiteCarnoDicService {
if (!PubTools.isNull(ckgFree[i]+"")){
//不足两位补0,
if (Integer.parseInt(ckgFree[i]+"") < 10){
memoDb += GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
memoDb += GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
}else{
memoDb += GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
}
}
}
@ -69,7 +69,7 @@ public class WhiteCarnoDicSeviceImpl implements IWhiteCarnoDicService {
String[] ckgFree=memoSS.split(",");
for (int i = 0; i < ckgFree.length; i++){
String r = ckgFree[i]+"";
memoDb += GetHex(r);
memoDb += PubTools.GetHex(r);
}
}
whiteAccountText.setDicname(params.get("dicname").toString());
@ -129,20 +129,4 @@ public class WhiteCarnoDicSeviceImpl implements IWhiteCarnoDicService {
return records;
}
private String GetHex(Object o)
{
String r = "", s1 = "", s2 = "";
String s = o.toString();
if (s.length() >= 10)
{
r = "00" + Integer.toHexString(Integer.parseInt(s.substring(0, 2)));
s1 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(2, 6)));
s2 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(6, 10)));
r = r.substring(r.length() - 2, r.length());
s1 = s1.substring(s1.length() - 4, s1.length());
s2 = s2.substring(s2.length() - 4, s2.length());
}
return r + s1 + s2;
}
}

@ -100,11 +100,11 @@ public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
if (!PubTools.isNull(ckgFree[i]+"")){
//不足两位补0,
if (Integer.parseInt(ckgFree[i]+"") < 10){
memoDb += GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
memoDb += GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
}else{
memoDb += GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
}
}
}
@ -114,7 +114,7 @@ public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
String[] ckgFree=whiteCarnoList.getMfzzh().split(",");
for (int i = 0; i < ckgFree.length; i++){
String r = ckgFree[i]+"";
memoDb += GetHex(r);
memoDb += PubTools.GetHex(r);
}
}
//自定义组合
@ -227,11 +227,11 @@ public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
if (!PubTools.isNull(ckgFree[i]+"")){
//不足两位补0,
if (Integer.parseInt(ckgFree[i]+"") < 10){
memoDb += GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex("0" + ckgFree[i]+"" + "0" + ckgFree[i]+"" + "00" + "0" + ckgFree[i]+"" + "00");
}else if(Integer.parseInt(ckgFree[i]+"") < 100 && Integer.parseInt(ckgFree[i]+"")>=10){//两位的
memoDb += GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
memoDb += PubTools.GetHex(ckgFree[i]+"" + ckgFree[i]+"" + "00" + ckgFree[i]+"" + "00");
}else{
memoDb += GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
memoDb += PubTools.GetHex(ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2)+ ckgFree[i].substring(0,2));
}
}
}
@ -241,7 +241,7 @@ public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
String[] ckgFree=params.getMfzzh().split(",");
for (int i = 0; i < ckgFree.length; i++){
String r = ckgFree[i]+"";
memoDb += GetHex(r);
memoDb += PubTools.GetHex(r);
}
}
//自定义组合
@ -413,20 +413,4 @@ public class WhiteCarnoListSeriveImpl implements IWhiteCarnoListSerive {
return this.whiteCarnoListMapper.getWhiteCarno(params);
}
private String GetHex(Object o)
{
String r = "", s1 = "", s2 = "";
String s = o.toString();
if (s.length() >= 10)
{
r = "00" + Integer.toHexString(Integer.parseInt(s.substring(0, 2)));
s1 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(2, 6)));
s2 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(6, 10)));
r = r.substring(r.length() - 2, r.length());
s1 = s1.substring(s1.length() - 4, s1.length());
s2 = s2.substring(s2.length() - 4, s2.length());
}
return r + s1 + s2;
}
}

@ -187,6 +187,23 @@ public class PubTools {
return PropertiesUtil.getValue("WhiteDBType");
}
public static String GetHex(Object o)
{
String r = "", s1 = "", s2 = "";
String s = o.toString();
if (s.length() >= 10)
{
r = "00" + Integer.toHexString(Integer.parseInt(s.substring(0, 2)));
s1 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(2, 6)));
s2 = "0000" + Integer.toHexString(Integer.parseInt(s.substring(6, 10)));
r = r.substring(r.length() - 2, r.length());
s1 = s1.substring(s1.length() - 4, s1.length());
s2 = s2.substring(s2.length() - 4, s2.length());
}
return r + s1 + s2;
}
}

@ -28,6 +28,7 @@ spring.session.store-type=none
spring.session.timeout=PT30M
spring.sql.init.mode=always
#\u89E3\u9664\u6587\u4EF6\u4E0A\u4F20\u5927\u5C0F\u9650\u5236
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1
server.tomcat.max-swallow-size=-1

Loading…
Cancel
Save