Commit 8d2145db authored by wanghao's avatar wanghao

1 液化石油气监管-气瓶档案导入-功能开发, 涉及到实体类解析报错问题处理.

parent 53052611
package com.zehong.web.controller.lpgRegulation;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TLpgAirChargeFiles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -56,8 +53,8 @@ public class TLpgGasBottleFilesController extends BaseController
@GetMapping("/export")
public AjaxResult export(TLpgGasBottleFiles tLpgGasBottleFiles)
{
List<TLpgGasBottleFiles> list = tLpgGasBottleFilesService.selectTLpgGasBottleFilesList(tLpgGasBottleFiles);
ExcelUtil<TLpgGasBottleFiles> util = new ExcelUtil<TLpgGasBottleFiles>(TLpgGasBottleFiles.class);
List<TLpgGasBottleFiles> list = tLpgGasBottleFilesService.exportTLpgGasBottleFilesList(tLpgGasBottleFiles);
ExcelUtil<TLpgGasBottleFiles> util = new ExcelUtil<>(TLpgGasBottleFiles.class);
return util.exportExcel(list, "液化石油气-气瓶档案数据");
}
......@@ -124,8 +121,8 @@ public class TLpgGasBottleFilesController extends BaseController
ExcelUtil<TLpgGasBottleFiles> util = new ExcelUtil<>(TLpgGasBottleFiles.class);
List<TLpgGasBottleFiles> XmbhList = util.importExcel(file.getInputStream());
Map<String, Object> map = tLpgGasBottleFilesService.importLpgGasBottleFilesInfo(XmbhList, updateSupport, response);
return AjaxResult.success(map);
tLpgGasBottleFilesService.importLpgGasBottleFilesInfo(XmbhList, updateSupport, response);
return AjaxResult.success();
}
}
......@@ -138,29 +138,29 @@ public class TimeTasksController {
tLpgGasBottleFiles.setVolume(new BigDecimal(0));
}
tLpgGasBottleFiles.setAppId(jsonObject.getString("appId"));
tLpgGasBottleFiles.setqRcode(jsonObject.getString("qRcode"));
tLpgGasBottleFiles.setQrcode(jsonObject.getString("qRcode"));
tLpgGasBottleFiles.setBuildUser(jsonObject.getString("buildUser"));
tLpgGasBottleFiles.setAddTime(jsonObject.getDate("addtime"));
tLpgGasBottleFiles.setOptName(jsonObject.getString("optName"));
tLpgGasBottleFiles.setUpTime(jsonObject.getDate("uptime"));
tLpgGasBottleFiles.setState(jsonObject.getString("state"));
tLpgGasBottleFiles.setUpOptName(jsonObject.getString("upOptName"));
tLpgGasBottleFiles.setpChkDate(jsonObject.getDate("pChkDate"));
tLpgGasBottleFiles.setnChkDate(jsonObject.getDate("nChkDate"));
tLpgGasBottleFiles.setPchkDate(jsonObject.getDate("pChkDate"));
tLpgGasBottleFiles.setNchkDate(jsonObject.getDate("nChkDate"));
tLpgGasBottleFiles.setProductDate(jsonObject.getDate("productDate"));
tLpgGasBottleFiles.setDiscardDate(jsonObject.getDate("discardDate"));
tLpgGasBottleFiles.setSafeJudgeDate(jsonObject.getDate("safeJudgeDate"));
String gpressure = jsonObject.getString("gpressure");
if (gpressure != null && !gpressure.isEmpty()) {
tLpgGasBottleFiles.setgPressure(new BigDecimal(gpressure));
tLpgGasBottleFiles.setGpressure(new BigDecimal(gpressure));
} else {
tLpgGasBottleFiles.setgPressure(new BigDecimal(0));
tLpgGasBottleFiles.setGpressure(new BigDecimal(0));
}
String wpressure = jsonObject.getString("wpressure");
if (wpressure != null && !wpressure.isEmpty()) {
tLpgGasBottleFiles.setwPressure(new BigDecimal(wpressure));
tLpgGasBottleFiles.setWpressure(new BigDecimal(wpressure));
} else {
tLpgGasBottleFiles.setwPressure(new BigDecimal(0));
tLpgGasBottleFiles.setWpressure(new BigDecimal(0));
}
String selfWeight = jsonObject.getString("selfWeight");
if (selfWeight != null && !selfWeight.isEmpty()) {
......
......@@ -3,8 +3,6 @@ package com.zehong.system.domain;
import java.math.BigDecimal;
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;
......@@ -27,7 +25,7 @@ public class TLpgGasBottleFiles extends BaseEntity
/** 气瓶条码 */
@Excel(name = "气瓶条码", width = 30 )
private String qRcode;
private String qrcode;
/** 登记证号 */
@Excel(name = "登记证号", width = 30 )
......@@ -80,7 +78,7 @@ public class TLpgGasBottleFiles extends BaseEntity
private Date upTime;
/** 状态1 新增、2 修改、-1、删除 (默认1) 3.注销 */
@Excel(name = "气瓶状态 ", readConverterExp = "1=新增,2=修改,-1=删除")
//@Excel(name = "气瓶状态 ", readConverterExp = "1=新增,2=修改,-1=删除") 2024-09-13 wh 去掉,感觉监管不需要
private String state;
/** 修改人姓名 */
......@@ -89,12 +87,12 @@ public class TLpgGasBottleFiles extends BaseEntity
/** 上检日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上检日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pChkDate;
private Date pchkDate;
/** 下检日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下检日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date nChkDate;
private Date nchkDate;
/** 生产日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
......@@ -113,11 +111,11 @@ public class TLpgGasBottleFiles extends BaseEntity
/** 公称压力Mpa */
@Excel(name = "公称压力/Mpa")
private BigDecimal gPressure;
private BigDecimal gpressure;
/** 水试验压力Mpa */
@Excel(name = "水试验压力/Mpa")
private BigDecimal wPressure;
private BigDecimal wpressure;
/** 标准重量KG */
@Excel(name = "标准重量/KG")
......@@ -176,7 +174,7 @@ public class TLpgGasBottleFiles extends BaseEntity
private Long inspectedTimes;
/** 是否专用(1:专用 2:托管) */
@Excel(name = "是否专用")
//@Excel(name = "是否专用") 2024-09-13 wh 去掉,感觉监管不需要
private String isSpecialized;
/** 阀厂家 */
......@@ -216,15 +214,6 @@ public class TLpgGasBottleFiles extends BaseEntity
public void setMakeInfo(String makeInfo) {
this.makeInfo = makeInfo;
}
public String getqRcode() {
return qRcode;
}
public void setqRcode(String qRcode) {
this.qRcode = qRcode;
}
public String getRegCode() {
return regCode;
}
......@@ -345,22 +334,6 @@ public class TLpgGasBottleFiles extends BaseEntity
this.upOptName = upOptName;
}
public Date getpChkDate() {
return pChkDate;
}
public void setpChkDate(Date pChkDate) {
this.pChkDate = pChkDate;
}
public Date getnChkDate() {
return nChkDate;
}
public void setnChkDate(Date nChkDate) {
this.nChkDate = nChkDate;
}
public Date getProductDate() {
return productDate;
}
......@@ -385,22 +358,6 @@ public class TLpgGasBottleFiles extends BaseEntity
this.safeJudgeDate = safeJudgeDate;
}
public BigDecimal getgPressure() {
return gPressure;
}
public void setgPressure(BigDecimal gPressure) {
this.gPressure = gPressure;
}
public BigDecimal getwPressure() {
return wPressure;
}
public void setwPressure(BigDecimal wPressure) {
this.wPressure = wPressure;
}
public BigDecimal getSelfWeight() {
return selfWeight;
}
......@@ -569,12 +526,52 @@ public class TLpgGasBottleFiles extends BaseEntity
this.rowVersion = rowVersion;
}
public String getQrcode() {
return qrcode;
}
public void setQrcode(String qrcode) {
this.qrcode = qrcode;
}
public Date getPchkDate() {
return pchkDate;
}
public void setPchkDate(Date pchkDate) {
this.pchkDate = pchkDate;
}
public Date getNchkDate() {
return nchkDate;
}
public void setNchkDate(Date nchkDate) {
this.nchkDate = nchkDate;
}
public BigDecimal getGpressure() {
return gpressure;
}
public void setGpressure(BigDecimal gpressure) {
this.gpressure = gpressure;
}
public BigDecimal getWpressure() {
return wpressure;
}
public void setWpressure(BigDecimal wpressure) {
this.wpressure = wpressure;
}
@Override
public String toString() {
return "TLpgGasBottleFiles{" +
"gasBottleFilesId=" + gasBottleFilesId +
", makeInfo='" + makeInfo + '\'' +
", qRcode='" + qRcode + '\'' +
", qRcode='" + qrcode + '\'' +
", regCode='" + regCode + '\'' +
", equNo='" + equNo + '\'' +
", equType='" + equType + '\'' +
......@@ -590,13 +587,13 @@ public class TLpgGasBottleFiles extends BaseEntity
", upTime=" + upTime +
", state='" + state + '\'' +
", upOptName='" + upOptName + '\'' +
", pChkDate=" + pChkDate +
", nChkDate=" + nChkDate +
", pChkDate=" + pchkDate +
", nChkDate=" + nchkDate +
", productDate=" + productDate +
", discardDate=" + discardDate +
", safeJudgeDate=" + safeJudgeDate +
", gPressure=" + gPressure +
", wPressure=" + wPressure +
", gPressure=" + gpressure +
", wPressure=" + wpressure +
", selfWeight=" + selfWeight +
", thickness=" + thickness +
", permitNo='" + permitNo + '\'' +
......
......@@ -28,6 +28,13 @@ public interface TLpgGasBottleFilesMapper
*/
public List<TLpgGasBottleFiles> selectTLpgGasBottleFilesList(TLpgGasBottleFiles tLpgGasBottleFiles);
/**
* 导出查询
* @param tLpgGasBottleFiles t
* @return r
*/
public List<TLpgGasBottleFiles> exportTLpgGasBottleFilesList(TLpgGasBottleFiles tLpgGasBottleFiles);
/**
* 根据 气瓶条码 集合查询数据
* @param codeList codelist
......@@ -43,6 +50,13 @@ public interface TLpgGasBottleFilesMapper
*/
public int insertTLpgGasBottleFiles(TLpgGasBottleFiles tLpgGasBottleFiles);
/**
* 批量插入
* @param list list
* @return r
*/
public int insertBatch(List<TLpgGasBottleFiles> list);
/**
* 修改液化石油气-气瓶档案
*
......
......@@ -31,6 +31,12 @@ public interface ITLpgGasBottleFilesService
*/
public List<TLpgGasBottleFiles> selectTLpgGasBottleFilesList(TLpgGasBottleFiles tLpgGasBottleFiles);
/**
* 导出查询
* @param tLpgGasBottleFiles t
* @return r
*/
public List<TLpgGasBottleFiles> exportTLpgGasBottleFilesList(TLpgGasBottleFiles tLpgGasBottleFiles);
/**
* 新增液化石油气-气瓶档案
*
......@@ -70,6 +76,6 @@ public interface ITLpgGasBottleFilesService
* @param response res
* @return r
*/
public Map<String,Object> importLpgGasBottleFilesInfo(List<TLpgGasBottleFiles> xmbhList, boolean updateSupport, HttpServletResponse response);
public void importLpgGasBottleFilesInfo(List<TLpgGasBottleFiles> xmbhList, boolean updateSupport, HttpServletResponse response);
}
......@@ -152,7 +152,7 @@ public class TLpgAirChargeFilesServiceImpl implements ITLpgAirChargeFilesService
// 这是 上面气瓶条码 有的气瓶数据
List<TLpgGasBottleFiles> tLpgGasBottleFiles2 = tLpgGasBottleFilesMapper.queryAllByFQRcodeList(collect);
// 按照 气瓶条码 分组
Map<String, List<TLpgGasBottleFiles>> collect1 = tLpgGasBottleFiles2.stream().collect(Collectors.groupingBy(TLpgGasBottleFiles::getqRcode));
Map<String, List<TLpgGasBottleFiles>> collect1 = tLpgGasBottleFiles2.stream().collect(Collectors.groupingBy(TLpgGasBottleFiles::getQrcode));
errorNum += noBarCodeList.size();
......
......@@ -98,13 +98,13 @@ public class TLpgDeliveryRecordServiceImpl implements ITLpgDeliveryRecordService
// 气瓶条码处理
TLpgGasBottleFiles tLpgGasBottleFiles = new TLpgGasBottleFiles();
tLpgGasBottleFiles.setqRcode(tLpgDeliveryRecordImportVo.getBottleCode());
tLpgGasBottleFiles.setQrcode(tLpgDeliveryRecordImportVo.getBottleCode());
List<TLpgGasBottleFiles> tLpgGasBottleFiles1 = tLpgGasBottleFilesMapper.selectTLpgGasBottleFilesList(tLpgGasBottleFiles);
if (tLpgGasBottleFiles1 == null || tLpgGasBottleFiles1.size() == 0) {
errorNum ++;
continue;
}
lpgDeliveryRecord.setBottleCode(tLpgGasBottleFiles1.get(0).getqRcode());
lpgDeliveryRecord.setBottleCode(tLpgGasBottleFiles1.get(0).getQrcode());
// 燃气用户处理
......
......@@ -48,6 +48,16 @@ public class TLpgGasBottleFilesServiceImpl implements ITLpgGasBottleFilesService
return tLpgGasBottleFilesMapper.selectTLpgGasBottleFilesList(tLpgGasBottleFiles);
}
/**
* 导出
* @param tLpgGasBottleFiles t
* @return r
*/
@Override
public List<TLpgGasBottleFiles> exportTLpgGasBottleFilesList(TLpgGasBottleFiles tLpgGasBottleFiles) {
return tLpgGasBottleFilesMapper.exportTLpgGasBottleFilesList(tLpgGasBottleFiles);
}
/**
* 新增液化石油气-气瓶档案
*
......@@ -104,12 +114,9 @@ public class TLpgGasBottleFilesServiceImpl implements ITLpgGasBottleFilesService
* @return r
*/
@Override
public Map<String, Object> importLpgGasBottleFilesInfo(List<TLpgGasBottleFiles> xmbhList, boolean updateSupport, HttpServletResponse response) {
for (TLpgGasBottleFiles tLpgGasBottleFiles : xmbhList) {
System.out.println(tLpgGasBottleFiles.getqRcode());
public void importLpgGasBottleFilesInfo(List<TLpgGasBottleFiles> xmbhList, boolean updateSupport, HttpServletResponse response) {
if (xmbhList.size() > 0) {
tLpgGasBottleFilesMapper.insertBatch(xmbhList);
}
return null;
}
}
......@@ -10,16 +10,16 @@
/>
</el-form-item>
<el-form-item label="气瓶条码" prop="qRcode">
<el-form-item label="气瓶条码" prop="qrcode">
<el-input
v-model="queryParams.qRcode"
v-model="queryParams.qrcode"
placeholder="请输入气瓶条码"
clearable
size="small"
/>
</el-form-item>
<el-form-item label="钢瓶状态" prop="fState">
<!-- <el-form-item label="钢瓶状态" prop="fState"> 2024-09-13 wh 去掉,感觉监管不需要
<el-select v-model="queryParams.state" placeholder="请选择钢瓶状态" clearable>
<el-option
v-for="item in stateOptions"
......@@ -28,7 +28,7 @@
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
......@@ -64,17 +64,17 @@
<el-table v-loading="loading" :data="filesList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="生产(制造)单位" align="center" prop="makeInfo" :show-overflow-tooltip="true"/>
<el-table-column label="气瓶条码" align="center" prop="qRcode" :show-overflow-tooltip="true"/>
<el-table-column label="气瓶条码" align="center" prop="qrcode" :show-overflow-tooltip="true"/>
<el-table-column label="钢瓶规格名称" align="center" prop="botSpecName" :show-overflow-tooltip="true"/>
<el-table-column label="钢瓶型号" align="center" prop="bottleType" :show-overflow-tooltip="true"/>
<el-table-column label="上检日期" align="center" prop="pChkDate">
<el-table-column label="上检日期" align="center" prop="pchkDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.pChkDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.pchkDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="下检日期" align="center" prop="nChkDate">
<el-table-column label="下检日期" align="center" prop="nchkDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.nChkDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.nchkDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="生产日期" align="center" prop="productDate">
......@@ -93,7 +93,7 @@
</template>
</el-table-column>
<el-table-column label="已检验次数" align="center" prop="inspectedTimes"/>
<el-table-column label="钢瓶状态" align="center" prop="state"/>
<!-- <el-table-column label="钢瓶状态" align="center" prop="state"/> 2024-09-13 wh 去掉,感觉监管不需要 -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -217,12 +217,12 @@ export default {
pageNum: 1,
pageSize: 10,
cChkDate: null,
nChkDate: null,
nchkDate: null,
productDate: null,
discardDate: null,
safeJudgeDate: null,
gPressure: null,
wPressure: null,
gpressure: null,
wpressure: null,
selfWeight: null,
permitNo: null,
valveName: null,
......@@ -263,15 +263,7 @@ export default {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
if (response.data != null) {
if (response.data.errorMsg != null && response.data.errorMsg !== "") {
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.data.errorMsg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}else{
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + "成功:" + response.data.successNum + "条,失败:" + response.data.errorNum + "条" + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}
} else {
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}
this.getList();
this.$showLoading.hide();
},
......@@ -352,7 +344,7 @@ export default {
sbCode: null,
cardRecId: null,
appId: null,
qRcode: null,
qrcode: null,
cardSendMan: null,
cardSendDeptCode: null,
cardSendDeptName: null,
......@@ -362,13 +354,13 @@ export default {
bak0: null,
bak1: null,
bak2: null,
pChkDate: null,
nChkDate: null,
pchkDate: null,
nchkDate: null,
productDate: null,
discardDate: null,
safeJudgeDate: null,
gPressure: null,
wPressure: null,
gpressure: null,
wpressure: null,
selfWeight: null,
thickness: null,
permitNo: null,
......
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