Commit 9a5b46db authored by wanghao's avatar wanghao

1 液化石油气监管-车辆信息-外部对接接口开发。

2 液化石油气监管- 气瓶档案,充装记录,车辆信息 外部对接接口在已有基础上增加 字段级别校验 和 数据存在时更新处理,具体设计到 长度 和 类型校验,以及接收到的正确数据去重处理。
3 外部对接接口 避免 之后开发人员出现 两方数据可能对不上的问题,数据库建表开发接口 实时记录和维护 从外部接口接收的数据 。
parent 9bfb0294
......@@ -8,10 +8,11 @@ import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.TEnterpriseInfoMapper;
import com.zehong.system.service.DecryptService;
import com.zehong.system.service.ITLpgAirChargeFilesService;
import com.zehong.system.service.ITLpgGasBottleFilesService;
import com.zehong.system.service.*;
import com.zehong.web.controller.tool.DESEncoder;
import org.apache.commons.fileupload.MultipartStream;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -48,6 +49,15 @@ public class lpgGasController {
@Resource
private ITLpgAirChargeFilesService itLpgAirChargeFilesService;
@Resource
private ITLpgThirdPartyDockingInterfaceRecordService lpgThirdPartyDockingInterfaceRecordService;
/**
* 车辆信息
*/
@Resource
private ITLpgVehicleInfoService lpgVehicleInfoService;
@Autowired
DecryptService decryptService;
......@@ -63,6 +73,10 @@ public class lpgGasController {
keyInformation selectkey = decryptService.selectkey(encryption.getQybm());
if(selectkey == null) {
return AjaxResult.error("企业编码不存在!!!");
}
DESEncoder desEncoder=new DESEncoder();
String data = encryption.getData();
......@@ -77,6 +91,7 @@ public class lpgGasController {
int successNum = 0;
int errorNum = 0;
int repeatNum = 0;
if (StringUtils.isNotBlank(decrypt)) {
......@@ -86,7 +101,18 @@ public class lpgGasController {
List<JSONObject> list = JSONObject.parseArray(js,JSONObject.class);
if(list.size() > 500) {
return AjaxResult.error("每次最多处理500条数据");
}
List<TLpgGasBottleFiles> lpgGasBottleFiles = new ArrayList<>();
// 需要修改的
List<TLpgGasBottleFiles> updateLpgGasBottleFiles = new ArrayList<>();
// 接口保存记录
List<TLpgThirdPartyDockingInterfaceRecord> lpgThirdPartyDockingInterfaceRecords = new ArrayList<>();
TLpgThirdPartyDockingInterfaceRecord lpgThirdPartyDockingInterfaceRecord;
for (int i=0;i<list.size();i++){
TLpgGasBottleFiles lpgGasBottleFiles1 = new TLpgGasBottleFiles();
......@@ -98,192 +124,358 @@ public class lpgGasController {
// 气瓶条码
String qrcode = jsonObject.getString("qrcode");
if(StringUtils.isBlank(qrcode)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"气瓶条码不许为空!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
if(qrcode.length() > 64){
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"气瓶条码不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 生产日期
String makeDate = jsonObject.getString("makeDate") == null ? "" : jsonObject.getString("makeDate");
if(StringUtils.isNotBlank(makeDate) && !isValidDate(sdf,makeDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"生产日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 上检日期
String pchkDate = jsonObject.getString("pchkDate") == null ? "" : jsonObject.getString("pchkDate");
if(StringUtils.isNotBlank(pchkDate) && !isValidDate(sdf,pchkDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"上检日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 下检日期
String nchkDate = jsonObject.getString("nchkDate") == null ? "" : jsonObject.getString("nchkDate");
if(StringUtils.isNotBlank(nchkDate) && !isValidDate(sdf,nchkDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"下检日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 生产日期
String productDate = jsonObject.getString("productDate") == null ? "" : jsonObject.getString("productDate");
if(StringUtils.isNotBlank(productDate) && !isValidDate(sdf,productDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"生产日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 报废日期
String discardDate = jsonObject.getString("discardDate") == null ? "" : jsonObject.getString("discardDate");
if(StringUtils.isNotBlank(discardDate) && !isValidDate(sdf,discardDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"报废日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 安全评价日期
String safeJudgeDate = jsonObject.getString("safeJudgeDate") == null ? "" : jsonObject.getString("safeJudgeDate");
if(StringUtils.isNotBlank(safeJudgeDate) && !isValidDate(sdf,safeJudgeDate)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"安全评价日期不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
lpgGasBottleFiles1.setQrcode(qrcode);
try {
lpgGasBottleFiles1.setMakeDate(sdf.parse(makeDate));
lpgGasBottleFiles1.setPchkDate(sdf.parse(pchkDate));
lpgGasBottleFiles1.setNchkDate(sdf.parse(nchkDate));
lpgGasBottleFiles1.setProductDate(sdf.parse(productDate));
lpgGasBottleFiles1.setDiscardDate(sdf.parse(discardDate));
lpgGasBottleFiles1.setSafeJudgeDate(sdf.parse(safeJudgeDate));
} catch (ParseException e) {
throw new RuntimeException(e);
}
// 生产(制造单位)
String makeInfo = jsonObject.getString("makeInfo") == null ? "" : jsonObject.getString("makeInfo");
lpgGasBottleFiles1.setMakeInfo(makeInfo);
if(makeInfo.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"生产(制造单位)不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 登记证号
String regCode = jsonObject.getString("regCode") == null ? "" : jsonObject.getString("regCode");
lpgGasBottleFiles1.setRegCode(regCode);
if (regCode.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"登记证号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 产品编号
String equNo = jsonObject.getString("equNo") == null ? "" : jsonObject.getString("equNo");
lpgGasBottleFiles1.setEquNo(equNo);
if (equNo.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"产品编号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 设备类型
String equType = jsonObject.getString("equType") == null ? "" : jsonObject.getString("equType");
lpgGasBottleFiles1.setEquType(equType);
if (equType.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"设备类型不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 充装介质
String medium = jsonObject.getString("medium") == null ? "" : jsonObject.getString("medium");
lpgGasBottleFiles1.setMedium(medium);
if (medium.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"充装介质不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 单位内编号
String selfId = jsonObject.getString("selfId") == null ? "" : jsonObject.getString("selfId");
lpgGasBottleFiles1.setSelfId(selfId);
if (selfId.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"单位内编号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 压力
String pressure = jsonObject.getString("pressure") == null ? "" : jsonObject.getString("pressure");
BigDecimal pressureBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(pressure)) {
try {
BigDecimal bigDecimal = new BigDecimal(pressure);
lpgGasBottleFiles1.setPressure(bigDecimal);
pressureBigDecimal = new BigDecimal(pressure);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setPressure(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"压力不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 体积
String volume = jsonObject.getString("volume") == null ? "" : jsonObject.getString("volume");
BigDecimal volumeBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(volume)) {
try {
BigDecimal bigDecimal = new BigDecimal(volume);
lpgGasBottleFiles1.setVolume(bigDecimal);
volumeBigDecimal = new BigDecimal(volume);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setVolume(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"体积不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 电子标签
String appId = jsonObject.getString("appId") == null ? "" : jsonObject.getString("appId");
lpgGasBottleFiles1.setAppId(appId);
if (appId.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"电子标签不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 使用单位
String buildUser = jsonObject.getString("buildUser") == null ? "" : jsonObject.getString("buildUser");
lpgGasBottleFiles1.setBuildUser(buildUser);
if (buildUser.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"使用单位不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 公称压力Mpa
String gpressure = jsonObject.getString("gpressure") == null ? "" : jsonObject.getString("gpressure");
BigDecimal gpressureBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(gpressure)) {
try {
BigDecimal bigDecimal = new BigDecimal(gpressure);
lpgGasBottleFiles1.setGpressure(bigDecimal);
gpressureBigDecimal = new BigDecimal(gpressure);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setGpressure(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"公称压力不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 水试验压力Mpa
String wpressure = jsonObject.getString("wpressure") == null ? "" : jsonObject.getString("wpressure");
BigDecimal wpressureBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(wpressure)) {
try {
BigDecimal bigDecimal = new BigDecimal(wpressure);
lpgGasBottleFiles1.setWpressure(bigDecimal);
wpressureBigDecimal = new BigDecimal(wpressure);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setWpressure(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"水试验压力不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 标准重量KG
String selfWeight = jsonObject.getString("selfWeight") == null ? "" : jsonObject.getString("selfWeight");
BigDecimal selfWeightBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(selfWeight)) {
try {
BigDecimal bigDecimal = new BigDecimal(selfWeight);
lpgGasBottleFiles1.setSelfWeight(bigDecimal);
selfWeightBigDecimal = new BigDecimal(selfWeight);
}catch (NumberFormatException e) {
lpgGasBottleFiles1.setSelfWeight(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"标准重量不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 壁厚mm
String thickness = jsonObject.getString("thickness") == null ? "" : jsonObject.getString("thickness");
BigDecimal thicknessBigDecimal = BigDecimal.ZERO;
if (StringUtils.isNotBlank(thickness)) {
try {
BigDecimal bigDecimal = new BigDecimal(thickness);
lpgGasBottleFiles1.setThickness(bigDecimal);
thicknessBigDecimal = new BigDecimal(thickness);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setThickness(BigDecimal.ZERO);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"壁厚不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 气瓶许可证号
String permitNo = jsonObject.getString("permitNo") == null ? "" : jsonObject.getString("permitNo");
lpgGasBottleFiles1.setPermitNo(permitNo);
if (permitNo.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"气瓶许可证号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 阀类型名称
String valveName = jsonObject.getString("valveName") == null ? "" : jsonObject.getString("valveName");
lpgGasBottleFiles1.setValveName(valveName);
if (valveName.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"阀类型名称不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 钢瓶规格名称
String botSpecName = jsonObject.getString("botSpecName") == null ? "" : jsonObject.getString("botSpecName");
lpgGasBottleFiles1.setBotSpecName(botSpecName);
if (botSpecName.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"钢瓶规格名称不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 钢瓶型号
String bottleType = jsonObject.getString("bottleType") == null ? "" : jsonObject.getString("bottleType");
lpgGasBottleFiles1.setBottleType(bottleType);
if(bottleType.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"钢瓶型号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 已检验次数
String inspectedTimes = jsonObject.getString("inspectedTimes") == null ? "" : jsonObject.getString("inspectedTimes");
long inspectedTimesl = 0L;
if (StringUtils.isNotBlank(inspectedTimes)) {
try {
long l = Long.parseLong(inspectedTimes);
lpgGasBottleFiles1.setInspectedTimes(l);
inspectedTimesl = Long.parseLong(inspectedTimes);
} catch (NumberFormatException e) {
lpgGasBottleFiles1.setInspectedTimes(0L);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"已检验次数不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
// 阀厂家
String valveManuFacturer = jsonObject.getString("valveManuFacturer") == null ? "" : jsonObject.getString("valveManuFacturer");
lpgGasBottleFiles1.setValveManuFacturer(valveManuFacturer);
if (valveManuFacturer.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"阀厂家不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 检验标牌(有/无)
String inspectionLabel = jsonObject.getString("inspectionLabel") == null ? "" : jsonObject.getString("inspectionLabel");
lpgGasBottleFiles1.setInspectionLabel(inspectionLabel);
if (inspectionLabel.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"检验标牌不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 第三方标签
String thirdPartyLabel = jsonObject.getString("thirdPartyLabel") == null ? "" : jsonObject.getString("thirdPartyLabel");
lpgGasBottleFiles1.setThirdPartyLabel(thirdPartyLabel);
if (thirdPartyLabel.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"第三方标签不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 孔洞码
String holeCode = jsonObject.getString("holeCode") == null ? "" : jsonObject.getString("holeCode");
lpgGasBottleFiles1.setHoleCode(holeCode);
if (holeCode.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"孔洞码不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 存储类型(气相/液相)
String bottleStorageType = jsonObject.getString("bottleStorageType") == null ? "" : jsonObject.getString("bottleStorageType");
lpgGasBottleFiles1.setBottleStorageType(bottleStorageType);
if(bottleStorageType.length() > 100) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgGasBottleFiles", jsonObject.toJSONString(),
"存储类型不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 钢瓶交付文件照片
String payImage = jsonObject.getString("payImage") == null ? "" : jsonObject.getString("payImage");
......@@ -318,18 +510,113 @@ public class lpgGasController {
lpgGasBottleFiles1.setBotImage(botImage);
}
lpgGasBottleFiles1.setQrcode(qrcode);
try {
lpgGasBottleFiles1.setMakeDate(sdf.parse(makeDate));
lpgGasBottleFiles1.setPchkDate(sdf.parse(pchkDate));
lpgGasBottleFiles1.setNchkDate(sdf.parse(nchkDate));
lpgGasBottleFiles1.setProductDate(sdf.parse(productDate));
lpgGasBottleFiles1.setDiscardDate(sdf.parse(discardDate));
lpgGasBottleFiles1.setSafeJudgeDate(sdf.parse(safeJudgeDate));
} catch (ParseException e) {
throw new RuntimeException(e);
}
lpgGasBottleFiles1.setMakeInfo(makeInfo);
lpgGasBottleFiles1.setRegCode(regCode);
lpgGasBottleFiles1.setEquNo(equNo);
lpgGasBottleFiles1.setEquType(equType);
lpgGasBottleFiles1.setMedium(medium);
lpgGasBottleFiles1.setSelfId(selfId);
lpgGasBottleFiles1.setPressure(pressureBigDecimal);
lpgGasBottleFiles1.setVolume(volumeBigDecimal);
lpgGasBottleFiles1.setGpressure(gpressureBigDecimal);
lpgGasBottleFiles1.setWpressure(wpressureBigDecimal);
lpgGasBottleFiles1.setSelfWeight(selfWeightBigDecimal);
lpgGasBottleFiles1.setThickness(thicknessBigDecimal);
lpgGasBottleFiles1.setInspectedTimes(inspectedTimesl);
lpgGasBottleFiles1.setAppId(appId);
lpgGasBottleFiles1.setBuildUser(buildUser);
lpgGasBottleFiles1.setPermitNo(permitNo);
lpgGasBottleFiles1.setValveName(valveName);
lpgGasBottleFiles1.setBotSpecName(botSpecName);
lpgGasBottleFiles1.setBottleType(bottleType);
lpgGasBottleFiles1.setValveManuFacturer(valveManuFacturer);
lpgGasBottleFiles1.setInspectionLabel(inspectionLabel);
lpgGasBottleFiles1.setThirdPartyLabel(thirdPartyLabel);
lpgGasBottleFiles1.setHoleCode(holeCode);
lpgGasBottleFiles1.setBottleStorageType(bottleStorageType);
// 设置 企业id
lpgGasBottleFiles1.setEnterpriseId(tEnterpriseInfo.getEnterpriseId());
successNum++;
lpgGasBottleFiles.add(lpgGasBottleFiles1);
TLpgGasBottleFiles lpgGasBottleFilesDb = new TLpgGasBottleFiles();
BeanUtils.copyProperties(lpgGasBottleFiles1,lpgGasBottleFilesDb);
lpgGasBottleFilesDb.setPayImage("");
lpgGasBottleFilesDb.setBatchImage("");
lpgGasBottleFilesDb.setDeviceImage("");
lpgGasBottleFilesDb.setCheckImage("");
lpgGasBottleFilesDb.setBotImage("");
lpgThirdPartyDockingInterfaceRecord = successRecord("createLpgGasBottleFiles", lpgGasBottleFilesDb.toString(), encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
}
if (lpgGasBottleFiles.size() > 0) {
int i = tLpgGasBottleFilesService.externalDockingCreateLpgGasBottleFiles(lpgGasBottleFiles);
if (i < 1) {
return AjaxResult.error("入库异常!!!");
// 第一步 先把正确数据里面的 重复 气瓶条码的数据 去去重
Set<TLpgGasBottleFiles> set = new HashSet<>(lpgGasBottleFiles);
int i1 = lpgGasBottleFiles.size() - set.size();
if (i1 > 0) {
repeatNum = i1;
}
List<TLpgGasBottleFiles> notRepeatList = new ArrayList<>(set);
// 第二步 判断数据库里面的 气瓶条码 是否存在,存在的话就更新数据库数据
List<String> collect = notRepeatList.stream().map(TLpgGasBottleFiles::getQrcode).collect(Collectors.toList());
List<TLpgGasBottleFiles> lpgGasBottleFiles1 = tLpgGasBottleFilesService.queryAllByQrcodeAndEnterpriseList(collect, tEnterpriseInfo.getEnterpriseId());
Map<String, List<TLpgGasBottleFiles>> collect1 = lpgGasBottleFiles1.stream().collect(Collectors.groupingBy(TLpgGasBottleFiles::getQrcode));
Iterator<TLpgGasBottleFiles> iterator = notRepeatList.iterator();
while (iterator.hasNext()) {
TLpgGasBottleFiles next = iterator.next();
List<TLpgGasBottleFiles> lpgGasBottleFiles2 = collect1.get(next.getQrcode());
if (lpgGasBottleFiles2.size() > 0) {
updateLpgGasBottleFiles.add(next);
iterator.remove();
}
}
// 不重复的该新增的新增
if (notRepeatList.size() > 0){
int i = tLpgGasBottleFilesService.externalDockingCreateLpgGasBottleFiles(notRepeatList);
if (i < 1) {
return AjaxResult.error("入库异常!!!");
}
}
// 不重复的该修改的修改
if(updateLpgGasBottleFiles.size() > 0) {
int i = tLpgGasBottleFilesService.externalDockingUpdateLpgGasBottleFiles(updateLpgGasBottleFiles);
if (i < 1) {
return AjaxResult.error("入库异常!!!");
}
}
}
if (lpgThirdPartyDockingInterfaceRecords.size() > 0) {
lpgThirdPartyDockingInterfaceRecordService.insertBatch(lpgThirdPartyDockingInterfaceRecords);
}
} else {
......@@ -337,8 +624,8 @@ public class lpgGasController {
}
StringBuilder sb = new StringBuilder();
if (errorNum > 0) {
sb.append("成功:").append(successNum).append("条;失败:").append(errorNum).append("条");
if (errorNum > 0 || repeatNum > 0) {
sb.append("成功:").append(successNum).append("条;失败:").append(errorNum).append("条;重复").append(repeatNum).append("条");
return AjaxResult.success(sb.toString());
}
sb.append("成功:").append(successNum).append("条");
......@@ -353,7 +640,7 @@ public class lpgGasController {
public static boolean isValidDate(SimpleDateFormat sdf,String dateString) {
sdf.setLenient(false); // 设置为不宽松模式,严格按照指定的格式解析
try {
Date date = sdf.parse(dateString);
sdf.parse(dateString);
return true;
} catch (ParseException e) {
return false;
......@@ -376,7 +663,7 @@ public class lpgGasController {
// 如果成功读取到图片,则返回true
return image != null;
} catch (IOException e) {
} catch (IllegalArgumentException | IOException e) {
// 如果在解码或读取图片时发生异常,则认为不是有效的图片文件
return false;
}
......@@ -392,6 +679,10 @@ public class lpgGasController {
keyInformation selectkey = decryptService.selectkey(encryption.getQybm());
if(selectkey == null) {
return AjaxResult.error("企业编码不存在!!!");
}
DESEncoder desEncoder=new DESEncoder();
String data = encryption.getData();
......@@ -406,6 +697,7 @@ public class lpgGasController {
int successNum = 0;
int errorNum = 0;
int repeatNum = 0;
if (StringUtils.isNotBlank(decrypt)) {
......@@ -416,8 +708,19 @@ public class lpgGasController {
List<JSONObject> list = JSONObject.parseArray(js, JSONObject.class);
if(list.size() > 500) {
return AjaxResult.error("每次最多处理500条数据");
}
List<TLpgAirChargeFiles> lpgAirChargeFiles = new ArrayList<>();
TLpgAirChargeFiles tLpgAirChargeFiles;
// 需要更新的集合
List<TLpgAirChargeFiles> updateLpgAirChargeFiles = new ArrayList<>();
// 接口保存记录
List<TLpgThirdPartyDockingInterfaceRecord> lpgThirdPartyDockingInterfaceRecords = new ArrayList<>();
TLpgThirdPartyDockingInterfaceRecord lpgThirdPartyDockingInterfaceRecord;
for (int i = 0; i < list.size(); i++) {
tLpgAirChargeFiles = new TLpgAirChargeFiles();
......@@ -429,6 +732,40 @@ public class lpgGasController {
// 气瓶条码
String barCode = jsonObject.getString("barCode");
if(StringUtils.isBlank(barCode)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"气瓶条码不许为空!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
if(barCode.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"气瓶条码数据不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 充装记录编号
String gzId = jsonObject.getString("gzId") == null ? "" : jsonObject.getString("gzId");
if (StringUtils.isBlank(gzId)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装记录编号不许为空!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 充装记录编号
try {
long l = Long.parseLong(gzId);
tLpgAirChargeFiles.setGzId(l);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setGzId(0L);
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装记录编号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
......@@ -436,57 +773,74 @@ public class lpgGasController {
// 充装开始时间
String fillStatrTime = jsonObject.getString("fillStatrTime") == null ? "" : jsonObject.getString("fillStatrTime");
if(StringUtils.isNotBlank(fillStatrTime) && !isValidDate(sdf,fillStatrTime)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装开始时间不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 充装结束时间
String fillEndTime = jsonObject.getString("fillEndTime") == null ? "" : jsonObject.getString("fillEndTime");
if(StringUtils.isNotBlank(fillEndTime) && !isValidDate(sdf,fillEndTime)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装结束时间不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
tLpgAirChargeFiles.setBarCode(barCode);
tLpgAirChargeFiles.setFillStatrTime(fillStatrTime);
tLpgAirChargeFiles.setFillEndTime(fillEndTime);
// 充装记录编号
String gzId = jsonObject.getString("gzId") == null ? "" : jsonObject.getString("gzId");
if (StringUtils.isNotBlank(gzId)) {
try {
long l = Long.parseLong(gzId);
tLpgAirChargeFiles.setGzId(l);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setGzId(0L);
}
}
// 充装单位
String stationName = jsonObject.getString("stationName") == null ? "" : jsonObject.getString("stationName");
tLpgAirChargeFiles.setStationName(stationName);
if (stationName.length() > 300) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装单位不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 钢印号
String vaseCode = jsonObject.getString("vaseCode") == null ? "" : jsonObject.getString("vaseCode");
tLpgAirChargeFiles.setVaseCode(vaseCode);
if (vaseCode.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"钢印号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 秤号
String scaleNum = jsonObject.getString("scaleNum") == null ? "" : jsonObject.getString("scaleNum");
tLpgAirChargeFiles.setScaleNum(scaleNum);
if (scaleNum.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"秤号不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 充装工
String oprateName = jsonObject.getString("oprateName") == null ? "" : jsonObject.getString("oprateName");
tLpgAirChargeFiles.setOprateName(oprateName);
if (oprateName.length() > 64) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"充装工不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 设定净重
String setWeight = jsonObject.getString("setWeight") == null ? "" : jsonObject.getString("setWeight");
if (StringUtils.isNotBlank(setWeight)) {
try {
new BigDecimal(setWeight);
tLpgAirChargeFiles.setSetWeight(setWeight);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setSetWeight("0");
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"设定净重不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
......@@ -495,9 +849,12 @@ public class lpgGasController {
if (StringUtils.isNotBlank(wtNet)) {
try {
new BigDecimal(wtNet);
tLpgAirChargeFiles.setWtNet(wtNet);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setWtNet("0");
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"实际净重不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
......@@ -506,9 +863,12 @@ public class lpgGasController {
if (StringUtils.isNotBlank(setBottleWeight)) {
try {
new BigDecimal(setBottleWeight);
tLpgAirChargeFiles.setSetBottleWeight(setBottleWeight);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setSetBottleWeight("0");
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"设定瓶重不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
......@@ -517,9 +877,12 @@ public class lpgGasController {
if (StringUtils.isNotBlank(bottleWeight)) {
try {
new BigDecimal(bottleWeight);
tLpgAirChargeFiles.setBottleWeight(bottleWeight);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setBottleWeight("0");
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"实际瓶重不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
......@@ -528,11 +891,32 @@ public class lpgGasController {
if (StringUtils.isNotBlank(wtGross)) {
try {
new BigDecimal(wtGross);
tLpgAirChargeFiles.setWtGross(wtGross);
}catch (NumberFormatException e) {
tLpgAirChargeFiles.setWtGross("0");
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", jsonObject.toJSONString(),
"实际总重不符合要求!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
}
tLpgAirChargeFiles.setBarCode(barCode);
tLpgAirChargeFiles.setFillStatrTime(fillStatrTime);
tLpgAirChargeFiles.setFillEndTime(fillEndTime);
tLpgAirChargeFiles.setStationName(stationName);
tLpgAirChargeFiles.setVaseCode(vaseCode);
tLpgAirChargeFiles.setScaleNum(scaleNum);
tLpgAirChargeFiles.setOprateName(oprateName);
tLpgAirChargeFiles.setSetWeight(setWeight);
tLpgAirChargeFiles.setWtNet(wtNet);
tLpgAirChargeFiles.setSetBottleWeight(setBottleWeight);
tLpgAirChargeFiles.setBottleWeight(bottleWeight);
tLpgAirChargeFiles.setWtGross(wtGross);
tLpgAirChargeFiles.setEnterpriseId(tEnterpriseInfo.getEnterpriseId());
lpgAirChargeFiles.add(tLpgAirChargeFiles);
}
......@@ -548,24 +932,68 @@ public class lpgGasController {
if (lpgGasBottleFiles1 != null && lpgGasBottleFiles1.size() > 0) {
successNum++;
successLpgAirChargeFiles.add(lpgAirChargeFile);
lpgThirdPartyDockingInterfaceRecord = successRecord("createLpgAirChargeFiles", lpgAirChargeFile.toString(), encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
} else {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgAirChargeFiles", lpgAirChargeFile.toString(),
"监管平台气瓶档案下无此气瓶条码信息!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum ++;
}
}
}
if (successLpgAirChargeFiles.size() > 0) {
int i = itLpgAirChargeFilesService.externalDockingCreateLpgAirChargeFileInfo(successLpgAirChargeFiles);
// 把正确数据里面的 如果 气瓶条码 和 充装记录编号重复的去去重
Set<TLpgAirChargeFiles> uniqueList = new HashSet<>(successLpgAirChargeFiles);
int i1 = successLpgAirChargeFiles.size() - uniqueList.size();
if(i1> 0) {
repeatNum = i1;
}
List<TLpgAirChargeFiles> successNoRepeatLpgAirChargeFilesList = new ArrayList<>(uniqueList);
// 气瓶条码都符合规则后 并且去重 后 ,再根据 企业id 气瓶条码 充装记录编码判断唯一,如果已存在,则修改。不存在 则新增
List<TLpgAirChargeFiles> lpgAirChargeFiles1 = itLpgAirChargeFilesService.queryALlByBarcodeAndGizId(successNoRepeatLpgAirChargeFilesList);
Map<String, List<TLpgAirChargeFiles>> collect = lpgAirChargeFiles1.stream().collect(Collectors.groupingBy(item -> item.getBarCode() + ":" + item.getGzId()));
Iterator<TLpgAirChargeFiles> iterator = successNoRepeatLpgAirChargeFilesList.iterator();
while (iterator.hasNext()) {
TLpgAirChargeFiles next = iterator.next();
String key = next.getBarCode() + ":" + next.getGzId();
List<TLpgAirChargeFiles> lpgAirChargeFiles2 = collect.get(key);
// 说明是要修改的
if (lpgAirChargeFiles2.size() > 0) {
updateLpgAirChargeFiles.add(next);
iterator.remove();
}
}
// 插入新增的
if (successNoRepeatLpgAirChargeFilesList.size() > 0) {
int i = itLpgAirChargeFilesService.externalDockingCreateLpgAirChargeFileInfo(successNoRepeatLpgAirChargeFilesList);
if (i < 1) {
return AjaxResult.error("监管平台入库异常!!!");
}
}
// 修改要修改的
if (updateLpgAirChargeFiles.size() > 0) {
int i = itLpgAirChargeFilesService.externalDockingUpdateLpgAirChargeFileInfo(updateLpgAirChargeFiles);
if (i < 1) {
return AjaxResult.error("监管平台入库异常!!!");
}
}
if (lpgThirdPartyDockingInterfaceRecords.size() > 0) {
lpgThirdPartyDockingInterfaceRecordService.insertBatch(lpgThirdPartyDockingInterfaceRecords);
}
}
StringBuilder sb = new StringBuilder();
if (errorNum > 0) {
sb.append("成功:").append(successNum).append("条;失败:").append(errorNum).append("条");
if (errorNum > 0 || repeatNum > 0) {
sb.append("成功:").append(successNum).append("条;失败:").append(errorNum).append("条;重复:").append(repeatNum).append("条");
return AjaxResult.success(sb.toString());
}
sb.append("成功:").append(successNum).append("条");
......@@ -582,6 +1010,10 @@ public class lpgGasController {
keyInformation selectkey = decryptService.selectkey(encryption.getQybm());
if(selectkey == null) {
return AjaxResult.error("企业编码不存在!!!");
}
DESEncoder desEncoder = new DESEncoder();
String data = encryption.getData();
......@@ -605,86 +1037,240 @@ public class lpgGasController {
List<JSONObject> list = JSONObject.parseArray(js, JSONObject.class);
if(list.size() > 500) {
return AjaxResult.error("每次最多处理500条数据");
}
List<TLpgVehicleInfo> lpgAirChargeFiles = new ArrayList<>();
// 需要更新的数据
List<TLpgVehicleInfo> updateLpgAirChargeFiles = new ArrayList<>();
TLpgVehicleInfo lpgVehicleInfo;
// 接口保存记录
List<TLpgThirdPartyDockingInterfaceRecord> lpgThirdPartyDockingInterfaceRecords = new ArrayList<>();
TLpgThirdPartyDockingInterfaceRecord lpgThirdPartyDockingInterfaceRecord;
for (int i = 0; i < list.size(); i++) {
lpgVehicleInfo = new TLpgVehicleInfo();
String dateFormat = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
JSONObject jsonObject = list.get(i);
// 车牌号
String carNum = jsonObject.getString("carNum");
if(StringUtils.isBlank(carNum)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"车牌号不许为空!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
if (carNum.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"车牌号过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
lpgVehicleInfo.setCarNum(carNum);
// 储备站
String stationName = jsonObject.getString("stationName") == null ? "" : jsonObject.getString("stationName");
lpgVehicleInfo.setStationName(stationName);
if (stationName.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"储备站过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆编号
String carNumber = jsonObject.getString("carNumber") == null ? "" : jsonObject.getString("carNumber");
lpgVehicleInfo.setCarNumber(carNumber);
if (carNumber.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"车辆编号过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 代码
String vehicleCode = jsonObject.getString("vehicleCode") == null ? "" : jsonObject.getString("vehicleCode");
lpgVehicleInfo.setVehicleCode(vehicleCode);
if (vehicleCode.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"代码过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 品牌型号
String brandModel = jsonObject.getString("brandModel") == null ? "" : jsonObject.getString("brandModel");
lpgVehicleInfo.setBrandModel(brandModel);
if (brandModel.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"品牌型号过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆类型
String vehicleType = jsonObject.getString("vehicleType") == null ? "" : jsonObject.getString("vehicleType");
lpgVehicleInfo.setVehicleType(vehicleType);
if (vehicleType.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
"车辆类型过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆载重
String vehicleLoad = jsonObject.getString("vehicleLoad") == null ? "" : jsonObject.getString("vehicleLoad");
lpgVehicleInfo.setVehicleLoad(vehicleLoad);
if (vehicleLoad.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 车辆载重过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆大小
String vehicleSize = jsonObject.getString("vehicleSize") == null ? "" : jsonObject.getString("vehicleSize");
lpgVehicleInfo.setVehicleSize(vehicleSize);
if (vehicleSize.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 车辆大小过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆限乘
String vehicleLimt = jsonObject.getString("vehicleLimt") == null ? "" : jsonObject.getString("vehicleLimt");
lpgVehicleInfo.setVehicleLimt(vehicleLimt);
if (vehicleLimt.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 车辆限乘过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 车辆限乘
// 车辆检查信息
String vehicleInspect = jsonObject.getString("vehicleInspect") == null ? "" : jsonObject.getString("vehicleInspect");
lpgVehicleInfo.setVehicleInspect(vehicleInspect);
if (vehicleInspect.length() > 200) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 车辆检查信息过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 责任人
String personLiable = jsonObject.getString("personLiable") == null ? "" : jsonObject.getString("personLiable");
lpgVehicleInfo.setPersonLiable(personLiable);
if (personLiable.length() > 200) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 责任人过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 使用状态
String onState = jsonObject.getString("onState") == null ? "" : jsonObject.getString("onState");
lpgVehicleInfo.setOnState(onState);
if (onState.length() > 1) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 使用状态过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 使用状态
if (!"0".equals(onState) && !"1".equals(onState)) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 使用状态不符合要求值!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 使用人
String vehicleUser = jsonObject.getString("vehicleUser") == null ? "" : jsonObject.getString("vehicleUser");
lpgVehicleInfo.setVehicleUser(vehicleUser);
if (vehicleUser.length() > 200) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 使用人过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 联系电话
String phone = jsonObject.getString("phone") == null ? "" : jsonObject.getString("phone");
lpgVehicleInfo.setPhone(phone);
if (phone.length() > 50) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 联系电话过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
// 备注
String remarks = jsonObject.getString("remarks") == null ? "" : jsonObject.getString("remarks");
if (remarks.length() > 255) {
lpgThirdPartyDockingInterfaceRecord = errorRecord("createLpgVehicleInfo", jsonObject.toJSONString(),
" 备注过长!!!", encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
errorNum++;
continue;
}
lpgVehicleInfo.setCarNum(carNum);
lpgVehicleInfo.setStationName(stationName);
lpgVehicleInfo.setCarNumber(carNumber);
lpgVehicleInfo.setVehicleCode(vehicleCode);
lpgVehicleInfo.setBrandModel(brandModel);
lpgVehicleInfo.setVehicleType(vehicleType);
lpgVehicleInfo.setVehicleLoad(vehicleLoad);
lpgVehicleInfo.setVehicleSize(vehicleSize);
lpgVehicleInfo.setVehicleLimt(vehicleLimt);
lpgVehicleInfo.setVehicleInspect(vehicleInspect);
lpgVehicleInfo.setPersonLiable(personLiable);
lpgVehicleInfo.setOnState(onState);
lpgVehicleInfo.setVehicleUser(vehicleUser);
lpgVehicleInfo.setPhone(phone);
lpgVehicleInfo.setRemarks(remarks);
lpgVehicleInfo.setEnterpriseId(tEnterpriseInfo.getEnterpriseId());
lpgAirChargeFiles.add(lpgVehicleInfo);
lpgThirdPartyDockingInterfaceRecord = successRecord("createLpgVehicleInfo", jsonObject.toJSONString(), encryption.getQybm());
lpgThirdPartyDockingInterfaceRecords.add(lpgThirdPartyDockingInterfaceRecord);
successNum++;
}
if (lpgAirChargeFiles.size() > 0) {
}
//目前拿到的数据还都再判断下 车牌号 是否重复 重复直接更新
List<String> collect = lpgAirChargeFiles.stream().map(TLpgVehicleInfo::getCarNum).collect(Collectors.toList());
List<TLpgVehicleInfo> tLpgVehicleInfos = lpgVehicleInfoService.queryByCarNumsAndEnterpriseId(collect, tEnterpriseInfo.getEnterpriseId());
Map<String, List<TLpgVehicleInfo>> collect1 = tLpgVehicleInfos.stream().collect(Collectors.groupingBy(TLpgVehicleInfo::getCarNum));
Iterator<TLpgVehicleInfo> iterator = lpgAirChargeFiles.iterator();
while (iterator.hasNext()) {
TLpgVehicleInfo next = iterator.next();
List<TLpgVehicleInfo> tLpgVehicleInfos1 = collect1.get(next.getCarNum());
if (tLpgVehicleInfos1.size() > 0) {
updateLpgAirChargeFiles.add(next);
iterator.remove();
}
}
// 新增的新增
if (lpgAirChargeFiles.size() > 0) {
lpgVehicleInfoService.insertBatch(lpgAirChargeFiles);
}
// 修改的修改
if (updateLpgAirChargeFiles.size() > 0) {
lpgVehicleInfoService.updateBatch(updateLpgAirChargeFiles);
}
}
if (lpgThirdPartyDockingInterfaceRecords.size() > 0) {
lpgThirdPartyDockingInterfaceRecordService.insertBatch(lpgThirdPartyDockingInterfaceRecords);
}
}
StringBuilder sb = new StringBuilder();
if (errorNum > 0) {
......@@ -695,4 +1281,39 @@ public class lpgGasController {
return AjaxResult.success(sb.toString());
}
/**
* 封装一个 失败的接口对象
* @return r
*/
private TLpgThirdPartyDockingInterfaceRecord errorRecord(String interfaceName,String receiveData,
String failureReason,String qybm){
TLpgThirdPartyDockingInterfaceRecord lpgThirdPartyDockingInterfaceRecord = new TLpgThirdPartyDockingInterfaceRecord();
lpgThirdPartyDockingInterfaceRecord.setInterfaceName(interfaceName);
lpgThirdPartyDockingInterfaceRecord.setReceiveData(receiveData);
lpgThirdPartyDockingInterfaceRecord.setFailureReason(failureReason);
// 1 失败
lpgThirdPartyDockingInterfaceRecord.setState("1");
lpgThirdPartyDockingInterfaceRecord.setReceiveDate(new Date());
lpgThirdPartyDockingInterfaceRecord.setQybm(qybm);
return lpgThirdPartyDockingInterfaceRecord;
}
/**
* 返回一个 成功的接口对象
* @return r
*/
private TLpgThirdPartyDockingInterfaceRecord successRecord(String interfaceName,String receiveData,String qybm) {
TLpgThirdPartyDockingInterfaceRecord lpgThirdPartyDockingInterfaceRecord = new TLpgThirdPartyDockingInterfaceRecord();
lpgThirdPartyDockingInterfaceRecord.setInterfaceName(interfaceName);
lpgThirdPartyDockingInterfaceRecord.setReceiveData(receiveData);
// 0 成功
lpgThirdPartyDockingInterfaceRecord.setState("0");
lpgThirdPartyDockingInterfaceRecord.setReceiveDate(new Date());
lpgThirdPartyDockingInterfaceRecord.setQybm(qybm);
return lpgThirdPartyDockingInterfaceRecord;
}
}
......@@ -159,36 +159,80 @@ public class DESEncoder {
String lpggasdata = "[\n" +
" {\n" +
" \"barCode\": \"12121212\",\n" +
" \"gzId\": \"充装记录编号-接口来的-01\",\n" +
" \"stationName\": \"充装单位-接口来的-01\",\n" +
" \"vaseCode\": \"钢印号-接口来的-01\",\n" +
" \"scaleNum\": \"称号\",\n" +
" \"fillStatrTime\": \"2024-12-16\",\n" +
" \"fillEndTime\": \"2024-12-17\",\n" +
" \"setWeight\": \"15.63\",\n" +
" \"wtNet\": \"15.98\",\n" +
" \"setBottleWeight\": \"14.56\",\n" +
" \"bottleWeight\": \"45.69\",\n" +
" \"wtGross\": \"56.69\",\n" +
" \"oprateName\": \"充装工-01\"\n" +
" \"nchkDate\": \"2024-12-18\",\n" +
" \"discardDate\": \"2024-12-20\",\n" +
" \"wpressure\": \"15.96\",\n" +
" \"thickness\": \"15.46\",\n" +
" \"holeCode\": \"孔洞码-接口来的-01\",\n" +
" \"qrcode\": \"111111\",\n" +
" \"regCode\": \"登记证号-接口来的-01\",\n" +
" \"selfWeight\": \"15.98\",\n" +
" \"medium\": \"充装介质-接口来的-01\",\n" +
" \"bottleStorageType\": \"存储类型(气相/液相)-接口来的-01\",\n" +
" \"pchkDate\": \"2024-12-17\",\n" +
" \"batchImage\": \"一串base64数据\",\n" +
" \"safeJudgeDate\": \"2024-12-21\",\n" +
" \"checkImage\": \"一串base64数据\",\n" +
" \"appId\": \"电子标签-接口来的-01\",\n" +
" \"makeInfo\": \"生产(制造单位)\",\n" +
" \"gpressure\": \"12.56\",\n" +
" \"makeDate\": \"2024-12-16\",\n" +
" \"botSpecName\": \"钢瓶规格名称-接口来的-01\",\n" +
" \"payImage\": \"一串base64数据\",\n" +
" \"equType\": \"设备类型-接口来的-01\",\n" +
" \"inspectionLabel\": \"检验标牌(有/无)-接口来的-01\",\n" +
" \"botImage\": \"一串base64数据\",\n" +
" \"buildUser\": \"使用单位-接口来的-01\",\n" +
" \"pressure\": \"12.5\",\n" +
" \"productDate\": \"2024-12-19\",\n" +
" \"equNo\": \"产品编号-接口来的-01\",\n" +
" \"permitNo\": \"气瓶许可证号-接口来的-01\",\n" +
" \"volume\": \"30.6\",\n" +
" \"inspectedTimes\": \"14\",\n" +
" \"valveManuFacturer\": \"阀厂家-接口来的-01\",\n" +
" \"thirdPartyLabel\": \"第三方标签-接口来的-01\",\n" +
" \"valveName\": \"阀类型名称-接口来的-01\",\n" +
" \"deviceImage\": \"一串base64数据\",\n" +
" \"selfId\": \"单位内编号-接口来的-01\"\n" +
" },\n" +
" {\n" +
" \"barCode\": \"01199101071\",\n" +
" \"gzId\": \"充装记录编号-接口来的-02\",\n" +
" \"stationName\": \"充装单位-接口来的-02\",\n" +
" \"vaseCode\": \"钢印号-接口来的-02\",\n" +
" \"scaleNum\": \"称号\",\n" +
" \"fillStatrTime\": \"2024-12-16\",\n" +
" \"fillEndTime\": \"2024-12-17\",\n" +
" \"setWeight\": \"15.63\",\n" +
" \"wtNet\": \"15.98\",\n" +
" \"setBottleWeight\": \"14.56\",\n" +
" \"bottleWeight\": \"45.69\",\n" +
" \"wtGross\": \"56.69\",\n" +
" \"oprateName\": \"充装工-02\"\n" +
" \"nchkDate\": \"2024-12-23\",\n" +
" \"discardDate\": \"2024-12-25\",\n" +
" \"wpressure\": \"15.96\",\n" +
" \"thickness\": \"15.46\",\n" +
" \"holeCode\": \"孔洞码-接口来的-02\",\n" +
" \"qrcode\": \"222222\",\n" +
" \"regCode\": \"登记证号-接口来的-02\",\n" +
" \"selfWeight\": \"15.98\",\n" +
" \"medium\": \"充装介质-接口来的-02\",\n" +
" \"bottleStorageType\": \"存储类型(气相/液相)-接口来的-02\",\n" +
" \"pchkDate\": \"2024-12-22\",\n" +
" \"batchImage\": \"一串base64数据\",\n" +
" \"safeJudgeDate\": \"2024-12-26\",\n" +
" \"checkImage\": \"一串base64数据\",\n" +
" \"appId\": \"电子标签-接口来的-02\",\n" +
" \"makeInfo\": \"生产(制造单位)\",\n" +
" \"gpressure\": \"14.56\",\n" +
" \"makeDate\": \"2024-12-21\",\n" +
" \"botSpecName\": \"钢瓶规格名称-接口来的-02\",\n" +
" \"payImage\": \"一串base64数据\",\n" +
" \"equType\": \"设备类型-接口来的-02\",\n" +
" \"inspectionLabel\": \"检验标牌(有/无)-接口来的-02\",\n" +
" \"botImage\": \"一串base64数据\",\n" +
" \"buildUser\": \"使用单位-接口来的-02\",\n" +
" \"pressure\": \"12.5\",\n" +
" \"productDate\": \"2024-12-24\",\n" +
" \"equNo\": \"产品编号-接口来的-02\",\n" +
" \"permitNo\": \"气瓶许可证号-接口来的-02\",\n" +
" \"volume\": \"30.6\",\n" +
" \"inspectedTimes\": \"14\",\n" +
" \"valveManuFacturer\": \"阀厂家-接口来的-02\",\n" +
" \"thirdPartyLabel\": \"第三方标签-接口来的-02\",\n" +
" \"valveName\": \"阀类型名称-接口来的-02\",\n" +
" \"deviceImage\": \"一串base64数据\",\n" +
" \"selfId\": \"单位内编号-接口来的-02\"\n" +
" }\n" +
"]";
"]\n";
JSONArray objects = JSON.parseArray(lpggasdata);
System.out.println(objects);
......
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import java.util.Objects;
/**
* 液化石油气-充装记录对象 t_lpg_air_charge_files
*
......@@ -209,6 +209,19 @@ public class TLpgAirChargeFiles extends BaseEntity
this.enterpriseName = enterpriseName;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
TLpgAirChargeFiles lpgAirChargeFiles = (TLpgAirChargeFiles) obj;
return Objects.equals(barCode,lpgAirChargeFiles.getBarCode()) && Objects.equals(gzId,lpgAirChargeFiles.getGzId());
}
@Override
public int hashCode() {
return Objects.hash(barCode,gzId);
}
@Override
public String toString() {
return "TLpgAirChargeFiles{" +
......
......@@ -2,6 +2,8 @@ package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
......@@ -594,6 +596,19 @@ public class TLpgGasBottleFiles extends BaseEntity
this.enterpriseName = enterpriseName;
}
@Override
public boolean equals(Object obj) {
if(this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
TLpgGasBottleFiles tLpgGasBottleFiles = (TLpgGasBottleFiles) obj;
return Objects.equals(qrcode, tLpgGasBottleFiles.getQrcode());
}
@Override
public int hashCode() {
return Objects.hash(qrcode);
}
@Override
public String toString() {
return "TLpgGasBottleFiles{" +
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 液化气第三方对接接口记录对象 t_lpg_third_party_docking_interface_record
*
* @author zehong
* @date 2024-09-18
*/
public class TLpgThirdPartyDockingInterfaceRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long recordId;
/** 接口名称 */
private String interfaceName;
/** 状态0-成功,1-失败 */
private String state;
/** 接收的数据 */
private String receiveData;
/** 返回的数据 */
private String returnData;
/** 失败原因 */
private String failureReason;
/** 记录的时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date receiveDate;
private String qybm;
public void setRecordId(Long recordId)
{
this.recordId = recordId;
}
public Long getRecordId()
{
return recordId;
}
public void setInterfaceName(String interfaceName)
{
this.interfaceName = interfaceName;
}
public String getInterfaceName()
{
return interfaceName;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setReceiveData(String receiveData)
{
this.receiveData = receiveData;
}
public String getReceiveData()
{
return receiveData;
}
public void setReturnData(String returnData)
{
this.returnData = returnData;
}
public String getReturnData()
{
return returnData;
}
public void setFailureReason(String failureReason)
{
this.failureReason = failureReason;
}
public String getFailureReason()
{
return failureReason;
}
public void setReceiveDate(Date receiveDate)
{
this.receiveDate = receiveDate;
}
public String getQybm() {
return qybm;
}
public void setQybm(String qybm) {
this.qybm = qybm;
}
public Date getReceiveDate()
{
return receiveDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("interfaceName", getInterfaceName())
.append("state", getState())
.append("receiveData", getReceiveData())
.append("returnData", getReturnData())
.append("failureReason", getFailureReason())
.append("receiveDate", getReceiveDate())
.toString();
}
}
......@@ -37,6 +37,13 @@ public interface TLpgAirChargeFilesMapper
*/
public List<TLpgAirChargeFiles> queryAllForExport(TLpgAirChargeFiles tLpgAirChargeFiles);
/**
* 根据 集合 里面的 气瓶条码 和 充装记录编号 查询 数据
* @param tLpgAirChargeFiles s
* @return r
*/
public List<TLpgAirChargeFiles> queryALlByBarcodeAndGizId(@Param("list") List<TLpgAirChargeFiles> tLpgAirChargeFiles);
/**
* 新增液化石油气-充装记录
*
......@@ -52,6 +59,13 @@ public interface TLpgAirChargeFilesMapper
*/
public int insertBatch(@Param("list") List<TLpgAirChargeFiles> list);
/**
* 批量修改
* @param list l
* @return r
*/
public int updateBatch(@Param("list") List<TLpgAirChargeFiles> list);
/**
* 修改液化石油气-充装记录
*
......
......@@ -42,6 +42,14 @@ public interface TLpgGasBottleFilesMapper
*/
public List<TLpgGasBottleFiles> queryAllByFQRcodeList(@Param("codeList") List<String> codeList);
/**
* 根据 气瓶集合 和 企业id 查询数据
* @param list list
* @param enterpriseId e
* @return r
*/
public List<TLpgGasBottleFiles> queryAllByQrcodeAndEnterpriseList(@Param("list") List<String> list, @Param("enterpriseId") String enterpriseId);
/**
* 新增液化石油气-气瓶档案
*
......@@ -55,7 +63,14 @@ public interface TLpgGasBottleFilesMapper
* @param list list
* @return r
*/
public int insertBatch(List<TLpgGasBottleFiles> list);
public int insertBatch(@Param("list") List<TLpgGasBottleFiles> list);
/**
* 批量修改
* @param list l
* @return r
*/
public int updateBatch(@Param("list") List<TLpgGasBottleFiles> list);
/**
* 修改液化石油气-气瓶档案
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TLpgThirdPartyDockingInterfaceRecord;
import org.apache.ibatis.annotations.Param;
/**
* 液化气第三方对接接口记录Mapper接口
*
* @author zehong
* @date 2024-09-18
*/
public interface TLpgThirdPartyDockingInterfaceRecordMapper
{
/**
* 查询液化气第三方对接接口记录
*
* @param recordId 液化气第三方对接接口记录ID
* @return 液化气第三方对接接口记录
*/
public TLpgThirdPartyDockingInterfaceRecord selectTLpgThirdPartyDockingInterfaceRecordById(Long recordId);
/**
* 查询液化气第三方对接接口记录列表
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 液化气第三方对接接口记录集合
*/
public List<TLpgThirdPartyDockingInterfaceRecord> selectTLpgThirdPartyDockingInterfaceRecordList(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 新增液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
public int insertTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 批量插入
* @param list list
* @return r
*/
public int insertBatch(@Param("list") List<TLpgThirdPartyDockingInterfaceRecord> list);
/**
* 修改液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
public int updateTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 删除液化气第三方对接接口记录
*
* @param recordId 液化气第三方对接接口记录ID
* @return 结果
*/
public int deleteTLpgThirdPartyDockingInterfaceRecordById(Long recordId);
/**
* 批量删除液化气第三方对接接口记录
*
* @param recordIds 需要删除的数据ID
* @return 结果
*/
public int deleteTLpgThirdPartyDockingInterfaceRecordByIds(Long[] recordIds);
}
......@@ -29,6 +29,14 @@ public interface TLpgVehicleInfoMapper
*/
public List<TLpgVehicleInfo> selectTLpgVehicleInfoList(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 查询这个企业下 车牌号是否重复
* @param carNums c
* @param enterpriseId e
* @return r
*/
public List<TLpgVehicleInfo> queryByCarNumsAndEnterpriseId(@Param("carNums") List<String> carNums,@Param("enterpriseId") String enterpriseId);
/**
* 新增液化石油车辆信息
*
......@@ -59,6 +67,13 @@ public interface TLpgVehicleInfoMapper
* @return r
*/
public int insertBatch(@Param("list") List<TLpgVehicleInfo> list);
/**
* 批量更新
* @param list list
* @return r
*/
public int updateBatch(@Param("list") List<TLpgVehicleInfo> list);
/**
* 批量删除液化石油车辆信息
*
......
......@@ -5,6 +5,7 @@ import java.util.Map;
import com.zehong.system.domain.TLpgAirChargeFiles;
import com.zehong.system.domain.TLpgVehicleInfo;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
......@@ -34,6 +35,12 @@ public interface ITLpgAirChargeFilesService
*/
public List<TLpgAirChargeFiles> selectTLpgAirChargeFilesList(TLpgAirChargeFiles tLpgAirChargeFiles);
/**
* 根据 集合 里面的 气瓶条码 和 充装记录编号 查询 数据
* @param tLpgAirChargeFiles s
* @return r
*/
public List<TLpgAirChargeFiles> queryALlByBarcodeAndGizId(@Param("list") List<TLpgAirChargeFiles> tLpgAirChargeFiles);
/**
* 2024-09-12 wh 查询数据为了导出用 限制导出数量
......@@ -89,4 +96,11 @@ public interface ITLpgAirChargeFilesService
* @return r
*/
public int externalDockingCreateLpgAirChargeFileInfo(List<TLpgAirChargeFiles> list);
/**
* 修改
* @param list list
* @return r
*/
public int externalDockingUpdateLpgAirChargeFileInfo(List<TLpgAirChargeFiles> list);
}
......@@ -5,6 +5,8 @@ import java.util.Map;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.system.domain.TLpgGasBottleFiles;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import javax.servlet.http.HttpServletResponse;
......@@ -87,10 +89,25 @@ public interface ITLpgGasBottleFilesService
*/
public int externalDockingCreateLpgGasBottleFiles(List<TLpgGasBottleFiles> list);
/**
* 第三方对接 修改数据
* @param list list
* @return r
*/
public int externalDockingUpdateLpgGasBottleFiles(List<TLpgGasBottleFiles> list);
/**
* 根据 气瓶条码集合 查询 气瓶集合
* @param list l
* @return r
*/
public List<TLpgGasBottleFiles> queryALlByQrcodeList(List<String> list);
/**
* 根据 气瓶集合 和 企业id 查询数据
* @param list list
* @param enterpriseId e
* @return r
*/
public List<TLpgGasBottleFiles> queryAllByQrcodeAndEnterpriseList(@Param("list") List<String> list, @Param("enterpriseId") String enterpriseId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TLpgThirdPartyDockingInterfaceRecord;
/**
* 液化气第三方对接接口记录Service接口
*
* @author zehong
* @date 2024-09-18
*/
public interface ITLpgThirdPartyDockingInterfaceRecordService
{
/**
* 查询液化气第三方对接接口记录
*
* @param recordId 液化气第三方对接接口记录ID
* @return 液化气第三方对接接口记录
*/
public TLpgThirdPartyDockingInterfaceRecord selectTLpgThirdPartyDockingInterfaceRecordById(Long recordId);
/**
* 查询液化气第三方对接接口记录列表
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 液化气第三方对接接口记录集合
*/
public List<TLpgThirdPartyDockingInterfaceRecord> selectTLpgThirdPartyDockingInterfaceRecordList(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 新增液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
public int insertTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 批量插入
* @param list list
* @return r
*/
public int insertBatch(List<TLpgThirdPartyDockingInterfaceRecord> list);
/**
* 修改液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
public int updateTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord);
/**
* 批量删除液化气第三方对接接口记录
*
* @param recordIds 需要删除的液化气第三方对接接口记录ID
* @return 结果
*/
public int deleteTLpgThirdPartyDockingInterfaceRecordByIds(Long[] recordIds);
/**
* 删除液化气第三方对接接口记录信息
*
* @param recordId 液化气第三方对接接口记录ID
* @return 结果
*/
public int deleteTLpgThirdPartyDockingInterfaceRecordById(Long recordId);
}
......@@ -6,6 +6,7 @@ import java.util.List;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.system.domain.TLpgVehicleInfo;
import com.zehong.system.domain.vo.TLpgSafeCheckRecordImportVo;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
......@@ -33,6 +34,14 @@ public interface ITLpgVehicleInfoService
*/
public List<TLpgVehicleInfo> selectTLpgVehicleInfoList(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 查询这个企业下 车牌号是否重复
* @param carNums c
* @param enterpriseId e
* @return r
*/
public List<TLpgVehicleInfo> queryByCarNumsAndEnterpriseId(List<String> carNums,String enterpriseId);
/**
* 新增液化石油车辆信息
*
......@@ -49,6 +58,19 @@ public interface ITLpgVehicleInfoService
*/
public int updateTLpgVehicleInfo(TLpgVehicleInfo tLpgVehicleInfo);
/**
* 批量增加
* @param list list
* @return r
*/
public int insertBatch(List<TLpgVehicleInfo> list);
/**
* 批量修改
* @param list list
* @return r
*/
public int updateBatch(List<TLpgVehicleInfo> list);
/**
* 批量删除液化石油车辆信息
*
......
......@@ -68,6 +68,11 @@ public class TLpgAirChargeFilesServiceImpl implements ITLpgAirChargeFilesService
return tLpgAirChargeFilesMapper.selectTLpgAirChargeFilesList(tLpgAirChargeFiles);
}
@Override
public List<TLpgAirChargeFiles> queryALlByBarcodeAndGizId(List<TLpgAirChargeFiles> tLpgAirChargeFiles) {
return tLpgAirChargeFilesMapper.queryALlByBarcodeAndGizId(tLpgAirChargeFiles);
}
/**
* 2024-09-12 wh 查询数据为了导出用 限制导出数量
* @param tLpgAirChargeFiles t
......@@ -213,4 +218,14 @@ public class TLpgAirChargeFilesServiceImpl implements ITLpgAirChargeFilesService
public int externalDockingCreateLpgAirChargeFileInfo(List<TLpgAirChargeFiles> list) {
return tLpgAirChargeFilesMapper.insertBatch(list);
}
/**
* 修改
* @param list list
* @return r
*/
@Override
public int externalDockingUpdateLpgAirChargeFileInfo(List<TLpgAirChargeFiles> list) {
return tLpgAirChargeFilesMapper.updateBatch(list);
}
}
......@@ -182,6 +182,16 @@ public class TLpgGasBottleFilesServiceImpl implements ITLpgGasBottleFilesService
return tLpgGasBottleFilesMapper.insertBatch(list);
}
/**
* 第三方对接 修改数据
* @param list list
* @return r
*/
@Override
public int externalDockingUpdateLpgGasBottleFiles(List<TLpgGasBottleFiles> list) {
return tLpgGasBottleFilesMapper.updateBatch(list);
}
/**
* 根据气瓶条码集合 查询 气瓶集合
* @param list l
......@@ -191,4 +201,9 @@ public class TLpgGasBottleFilesServiceImpl implements ITLpgGasBottleFilesService
public List<TLpgGasBottleFiles> queryALlByQrcodeList(List<String> list) {
return tLpgGasBottleFilesMapper.queryAllByFQRcodeList(list);
}
@Override
public List<TLpgGasBottleFiles> queryAllByQrcodeAndEnterpriseList(List<String> list, String enterpriseId) {
return tLpgGasBottleFilesMapper.queryAllByQrcodeAndEnterpriseList(list,enterpriseId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TLpgThirdPartyDockingInterfaceRecordMapper;
import com.zehong.system.domain.TLpgThirdPartyDockingInterfaceRecord;
import com.zehong.system.service.ITLpgThirdPartyDockingInterfaceRecordService;
import javax.annotation.Resource;
/**
* 液化气第三方对接接口记录Service业务层处理
*
* @author zehong
* @date 2024-09-18
*/
@Service
public class TLpgThirdPartyDockingInterfaceRecordServiceImpl implements ITLpgThirdPartyDockingInterfaceRecordService
{
@Resource
private TLpgThirdPartyDockingInterfaceRecordMapper tLpgThirdPartyDockingInterfaceRecordMapper;
/**
* 查询液化气第三方对接接口记录
*
* @param recordId 液化气第三方对接接口记录ID
* @return 液化气第三方对接接口记录
*/
@Override
public TLpgThirdPartyDockingInterfaceRecord selectTLpgThirdPartyDockingInterfaceRecordById(Long recordId)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.selectTLpgThirdPartyDockingInterfaceRecordById(recordId);
}
/**
* 查询液化气第三方对接接口记录列表
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 液化气第三方对接接口记录
*/
@Override
public List<TLpgThirdPartyDockingInterfaceRecord> selectTLpgThirdPartyDockingInterfaceRecordList(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.selectTLpgThirdPartyDockingInterfaceRecordList(tLpgThirdPartyDockingInterfaceRecord);
}
/**
* 新增液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
@Override
public int insertTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.insertTLpgThirdPartyDockingInterfaceRecord(tLpgThirdPartyDockingInterfaceRecord);
}
/**
* 批量插入
* @param list list
* @return r
*/
@Override
public int insertBatch(List<TLpgThirdPartyDockingInterfaceRecord> list) {
return tLpgThirdPartyDockingInterfaceRecordMapper.insertBatch(list);
}
/**
* 修改液化气第三方对接接口记录
*
* @param tLpgThirdPartyDockingInterfaceRecord 液化气第三方对接接口记录
* @return 结果
*/
@Override
public int updateTLpgThirdPartyDockingInterfaceRecord(TLpgThirdPartyDockingInterfaceRecord tLpgThirdPartyDockingInterfaceRecord)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.updateTLpgThirdPartyDockingInterfaceRecord(tLpgThirdPartyDockingInterfaceRecord);
}
/**
* 批量删除液化气第三方对接接口记录
*
* @param recordIds 需要删除的液化气第三方对接接口记录ID
* @return 结果
*/
@Override
public int deleteTLpgThirdPartyDockingInterfaceRecordByIds(Long[] recordIds)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.deleteTLpgThirdPartyDockingInterfaceRecordByIds(recordIds);
}
/**
* 删除液化气第三方对接接口记录信息
*
* @param recordId 液化气第三方对接接口记录ID
* @return 结果
*/
@Override
public int deleteTLpgThirdPartyDockingInterfaceRecordById(Long recordId)
{
return tLpgThirdPartyDockingInterfaceRecordMapper.deleteTLpgThirdPartyDockingInterfaceRecordById(recordId);
}
}
......@@ -58,6 +58,17 @@ public class TLpgVehicleInfoServiceImpl implements ITLpgVehicleInfoService
return tLpgVehicleInfoMapper.selectTLpgVehicleInfoList(tLpgVehicleInfo);
}
/**
* 查询这个企业下车牌号是否重复
* @param carNums c
* @param enterpriseId e
* @return r
*/
@Override
public List<TLpgVehicleInfo> queryByCarNumsAndEnterpriseId(List<String> carNums, String enterpriseId) {
return tLpgVehicleInfoMapper.queryByCarNumsAndEnterpriseId(carNums,enterpriseId);
}
/**
* 新增液化石油车辆信息
*
......@@ -82,6 +93,26 @@ public class TLpgVehicleInfoServiceImpl implements ITLpgVehicleInfoService
return tLpgVehicleInfoMapper.updateTLpgVehicleInfo(tLpgVehicleInfo);
}
/**
* 批量插入
* @param list list
* @return r
*/
@Override
public int insertBatch(List<TLpgVehicleInfo> list) {
return tLpgVehicleInfoMapper.insertBatch(list);
}
/**
* 批量更新
* @param list list
* @return r
*/
@Override
public int updateBatch(List<TLpgVehicleInfo> list) {
return tLpgVehicleInfoMapper.updateBatch(list);
}
/**
* 批量删除液化石油车辆信息
*
......
......@@ -116,7 +116,7 @@
<!--查询管道数据列表-->
<select id="selectPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
select format(pipe_length,2)pipe_length,pipe_name,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
where is_del='0'
<if test="enterId != null and enterId != 0">
and beyond_enterprise_id=#{enterId}
......
......@@ -46,6 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
limit 1000
</select>
<select id="queryALlByBarcodeAndGizId" resultMap="TLpgAirChargeFilesResult">
<include refid="selectTLpgAirChargeFilesVo"/>
WHERE (f_bar_code, f_gz_id) IN
<foreach collection="list" item="item" separator="," open="(" close=")">
(#{item.barCode}, #{item.gzId})
</foreach>
</select>
<select id="selectTLpgAirChargeFilesById" parameterType="Long" resultMap="TLpgAirChargeFilesResult">
<include refid="selectTLpgAirChargeFilesVo"/>
where f_gas_air_charge_id = #{gasAirChargeId}
......@@ -72,6 +79,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<update id="updateBatch" parameterType="list">
<foreach collection="list" item="item" index="index" separator=";">
UPDATE t_lpg_air_charge_files
<set>
f_station_name = #{item.stationName},
f_vase_code = #{item.vehicleCode},
f_scale_num = #{item.brandModel},
f_fill_statr_time = #{item.vehicleType},
f_fill_end_time = #{item.vehicleLoad},
f_set_weight = #{item.vehicleSize},
f_wt_net = #{item.vehicleLimt},
f_set_bottle_weight = #{item.vehicleInspect},
f_bottle_weight = #{item.bottleWeight},
f_wt_gross = #{item.onState},
f_oprate_name = #{item.vehicleUser},
</set>
WHERE f_bar_code = #{item.barCode} and f_gz_id = #{item.gzId} and enterprise_id = #{item.enterpriseId}
</foreach>
</update>
<insert id="insertTLpgAirChargeFiles" parameterType="TLpgAirChargeFiles" useGeneratedKeys="true" keyProperty="fGasAirChargeId">
insert into t_lpg_air_charge_files
......
......@@ -51,7 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="holeCode" column="f_hole_code" />
<result property="bottleStorageType" column="f_bottle_storage_type" />
<result property="rowVersion" column="f_row_version" />
<result property="rowVersion" column="f_row_version" />
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterpriseName" />
</resultMap>
......@@ -65,7 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( CASE files.f_is_specialized WHEN '1' THEN '专用' WHEN '2' THEN '托管' ELSE '-' END ) AS f_is_specialized,
files.f_valve_manu_facturer, files.f_inspection_label, files.f_third_party_label, files.f_hole_code, files.f_bottle_storage_type,
( CASE files.f_state WHEN '1' THEN '新增' WHEN '2' THEN '修改' WHEN '-1' THEN '删除' ELSE '-' END ) AS f_state,
files.f_opt_name, files.f_add_time, files.f_up_time, files.f_up_opt_name, files.f_row_version,enterprise.enterprise_name as enterpriseName
files.f_opt_name, files.f_add_time, files.f_up_time, files.f_up_opt_name, files.f_row_version,files.enterprise_id,
enterprise.enterprise_name as enterpriseName
from t_lpg_gas_bottle_files files
left join t_enterprise_info enterprise on files.enterprise_id = enterprise.enterprise_id
</sql>
......@@ -126,18 +126,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</select>
<select id="queryAllByQrcodeAndEnterpriseList" resultMap="TLpgGasBottleFilesResult">
<include refid="selectTLpgGasBottleFilesVo"/>
where files.enterprise_id = #{enterpriseId} and files.f_q_rcode in
<foreach collection="list" close=")" index="i" item="item" open="(" separator=",">
#{item}
</foreach>
</select>
<select id="selectTLpgGasBottleFilesById" parameterType="Long" resultMap="TLpgGasBottleFilesResult">
<include refid="selectTLpgGasBottleFilesVo"/>
where f_gas_bottle_files_id = #{fGasBottleFilesId}
</select>
<update id="updateBatch" parameterType="list">
<foreach collection="list" item="item" index="index" separator=";">
UPDATE t_lpg_gas_bottle_files
<set>
f_reg_code = #{item.regCode},
f_equ_no = #{item.equNo},
f_equ_type = #{item.equType},
f_medium = #{item.medium},
f_make_date = #{item.makeDate},
f_make_info = #{item.makeInfo},
f_self_id = #{item.selfId},
f_pressure = #{item.pressure},
f_volume = #{item.volume},
f_app_id = #{item.appId},
f_build_user = #{item.buildUser},
f_p_chk_date = #{item.pchkDate},
f_n_chk_date = #{item.nchkDate},
f_product_date = #{item.productDate},
f_discard_date = #{item.discardDate},
f_safe_judge_date = #{item.safeJudgeDate},
f_g_pressure = #{item.gpressure},
f_w_pressure = #{item.wpressure},
f_self_weight = #{item.selfWeight},
f_thickness = #{item.thickness},
f_permit_no = #{item.permitNo},
f_valve_name = #{item.valveName},
f_bot_spec_name = #{item.botSpecName},
f_bottle_type = #{item.bottleType},
f_inspected_times = #{item.inspectedTimes},
f_is_specialized = #{item.isSpecialized},
f_valve_manu_facturer = #{item.valveManuFacturer},
f_inspection_label = #{item.inspectionLabel},
f_third_party_label = #{item.thirdPartyLabel},
f_hole_code = #{item.holeCode},
f_bottle_storage_type = #{item.bottleStorageType},
f_pay_image = #{item.payImage},
f_batch_image = #{item.batchImage},
f_device_image = #{item.deviceImage},
f_check_image = #{item.checkImage},
f_bot_image = #{item.botImage},
</set>
WHERE f_gas_bottle_files_id = #{item.gasBottleFilesId}
</foreach>
</update>
<insert id="insertBatch" parameterType="list">
insert into t_lpg_gas_bottle_files (f_reg_code, f_equ_no,f_equ_type,f_medium,f_make_date,f_make_info,
f_self_id,f_pressure,f_volume,f_app_id,f_q_rcode,f_build_user,f_p_chk_date,f_n_chk_date,f_product_date,
f_discard_date,f_safe_judge_date,f_g_pressure,f_w_pressure,f_self_weight,f_thickness,f_permit_no,
f_valve_name,f_bot_spec_name,f_bottle_type,f_inspected_times,f_is_specialized,f_valve_manu_facturer,
f_inspection_label, f_third_party_label,f_hole_code,f_bottle_storage_type,f_state,f_opt_name,f_add_time,
f_up_time,f_up_opt_name,f_row_version,enterprise_id)
f_up_time,f_up_opt_name,f_row_version,enterprise_id,f_pay_image,f_batch_image,f_device_image,f_check_image,f_bot_image)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.regCode,jdbcType=VARCHAR}, #{item.equNo}, #{item.equType,jdbcType=VARCHAR},
......@@ -150,7 +206,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.inspectedTimes},#{item.isSpecialized},#{item.valveManuFacturer},#{item.inspectionLabel},#{item.thirdPartyLabel},
#{item.holeCode,jdbcType=VARCHAR}, #{item.bottleStorageType}, #{item.state,jdbcType=VARCHAR},
#{item.optName,jdbcType=VARCHAR}, #{item.addTime}, #{item.upTime},
#{item.upOptName},#{item.rowVersion},#{item.enterpriseId})
#{item.upOptName},#{item.rowVersion},#{item.enterpriseId},#{item.payImage},#{item.batchImage},#{item.deviceImage},
#{item.checkImage},#{item.botImage})
</foreach>
</insert>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TLpgThirdPartyDockingInterfaceRecordMapper">
<resultMap type="TLpgThirdPartyDockingInterfaceRecord" id="TLpgThirdPartyDockingInterfaceRecordResult">
<result property="recordId" column="record_id" />
<result property="interfaceName" column="interface_name" />
<result property="state" column="state" />
<result property="receiveData" column="receive_data" />
<result property="returnData" column="return_data" />
<result property="failureReason" column="failure_reason" />
<result property="receiveDate" column="receive_date" />
<result property="qybm" column="qybm" />
</resultMap>
<sql id="selectTLpgThirdPartyDockingInterfaceRecordVo">
select record_id, interface_name, state, receive_data, return_data, failure_reason, receive_date ,qybm from t_lpg_third_party_docking_interface_record
</sql>
<select id="selectTLpgThirdPartyDockingInterfaceRecordList" parameterType="TLpgThirdPartyDockingInterfaceRecord" resultMap="TLpgThirdPartyDockingInterfaceRecordResult">
<include refid="selectTLpgThirdPartyDockingInterfaceRecordVo"/>
<where>
<if test="interfaceName != null and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
<if test="state != null and state != ''"> and state = #{state}</if>
<if test="receiveData != null and receiveData != ''"> and receive_data = #{receiveData}</if>
<if test="returnData != null and returnData != ''"> and return_data = #{returnData}</if>
<if test="failureReason != null and failureReason != ''"> and failure_reason = #{failureReason}</if>
<if test="receiveDate != null "> and receive_date = #{receiveDate}</if>
</where>
</select>
<select id="selectTLpgThirdPartyDockingInterfaceRecordById" parameterType="Long" resultMap="TLpgThirdPartyDockingInterfaceRecordResult">
<include refid="selectTLpgThirdPartyDockingInterfaceRecordVo"/>
where record_id = #{recordId}
</select>
<insert id="insertBatch" parameterType="list">
insert into t_lpg_third_party_docking_interface_record (interface_name, state,receive_data, return_data, failure_reason,
receive_date,qybm)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.interfaceName,jdbcType=VARCHAR}, #{item.state,jdbcType=VARCHAR}, #{item.receiveData,jdbcType=VARCHAR},
#{item.returnData,jdbcType=VARCHAR}, #{item.failureReason,jdbcType=VARCHAR},#{item.receiveDate},#{item.qybm}
)
</foreach>
</insert>
<insert id="insertTLpgThirdPartyDockingInterfaceRecord" parameterType="TLpgThirdPartyDockingInterfaceRecord" useGeneratedKeys="true" keyProperty="recordId">
insert into t_lpg_third_party_docking_interface_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="interfaceName != null">interface_name,</if>
<if test="state != null">state,</if>
<if test="receiveData != null">receive_data,</if>
<if test="returnData != null">return_data,</if>
<if test="failureReason != null">failure_reason,</if>
<if test="receiveDate != null">receive_date,</if>
<if test="qybm != null">qybm,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="interfaceName != null">#{interfaceName},</if>
<if test="state != null">#{state},</if>
<if test="receiveData != null">#{receiveData},</if>
<if test="returnData != null">#{returnData},</if>
<if test="failureReason != null">#{failureReason},</if>
<if test="receiveDate != null">#{receiveDate},</if>
<if test="qybm != null">#{qybm},</if>
</trim>
</insert>
<update id="updateTLpgThirdPartyDockingInterfaceRecord" parameterType="TLpgThirdPartyDockingInterfaceRecord">
update t_lpg_third_party_docking_interface_record
<trim prefix="SET" suffixOverrides=",">
<if test="interfaceName != null">interface_name = #{interfaceName},</if>
<if test="state != null">state = #{state},</if>
<if test="receiveData != null">receive_data = #{receiveData},</if>
<if test="returnData != null">return_data = #{returnData},</if>
<if test="failureReason != null">failure_reason = #{failureReason},</if>
<if test="receiveDate != null">receive_date = #{receiveDate},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteTLpgThirdPartyDockingInterfaceRecordById" parameterType="Long">
delete from t_lpg_third_party_docking_interface_record where record_id = #{recordId}
</delete>
<delete id="deleteTLpgThirdPartyDockingInterfaceRecordByIds" parameterType="String">
delete from t_lpg_third_party_docking_interface_record where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -57,7 +57,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="queryByCarNumsAndEnterpriseId" resultMap="TLpgVehicleInfoResult">
<include refid="selectTLpgVehicleInfoVo"/>
where enterprise_id = #{enterpriseId} and carNum in
<foreach collection="carNums" index="i" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectTLpgVehicleInfoById" parameterType="Long" resultMap="TLpgVehicleInfoResult">
<include refid="selectTLpgVehicleInfoVo"/>
where vehicle_id = #{vehicleId}
......@@ -77,6 +85,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<update id="updateBatch" parameterType="list">
<foreach collection="list" item="item" index="index" separator=";">
UPDATE t_lpg_vehicle_info
<set>
station_name = #{item.stationName},
car_number = #{item.carNumber},
vehicle_code = #{item.vehicleCode},
brand_model = #{item.brandModel},
vehicle_type = #{item.vehicleType},
vehicle_load = #{item.vehicleLoad},
vehicle_size = #{item.vehicleSize},
vehicle_limt = #{item.vehicleLimt},
vehicle_inspect = #{item.vehicleInspect},
person_liable = #{item.personLiable},
on_state = #{item.onState},
vehicle_user = #{item.vehicleUser},
phone = #{item.phone},
remarks = #{item.remarks}
</set>
WHERE car_num = #{item.carNum} and enterprise_id = #{item.enterpriseId}
</foreach>
</update>
<insert id="insertTLpgVehicleInfo" parameterType="TLpgVehicleInfo" useGeneratedKeys="true" keyProperty="vehicleId">
insert into t_lpg_vehicle_info
<trim prefix="(" suffix=")" suffixOverrides=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment