Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety-progress
Commits
88ed3bf9
Commit
88ed3bf9
authored
Aug 16, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
气瓶管理
parent
61f97d65
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1066 additions
and
0 deletions
+1066
-0
TGasBottleInfoController.java
...b/controller/gasBottleTrack/TGasBottleInfoController.java
+122
-0
TGasStorageStationInfoController.java
...ller/gasBottleTrack/TGasStorageStationInfoController.java
+6
-0
TGasBottleInfo.java
...rc/main/java/com/zehong/system/domain/TGasBottleInfo.java
+415
-0
TGasBottleInfoMapper.java
...n/java/com/zehong/system/mapper/TGasBottleInfoMapper.java
+61
-0
ITGasBottleInfoService.java
...ava/com/zehong/system/service/ITGasBottleInfoService.java
+69
-0
TGasBottleInfoServiceImpl.java
...zehong/system/service/impl/TGasBottleInfoServiceImpl.java
+177
-0
TGasBottleInfoMapper.xml
...src/main/resources/mapper/system/TGasBottleInfoMapper.xml
+216
-0
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/gasBottleTrack/TGasBottleInfoController.java
0 → 100644
View file @
88ed3bf9
package
com
.
zehong
.
web
.
controller
.
gasBottleTrack
;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
com.zehong.system.service.ITGasBottleInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
/**
* 气瓶信息Controller
*
* @author zehong
* @date 2023-08-15
*/
@RestController
@RequestMapping
(
"/gasBottle/info"
)
public
class
TGasBottleInfoController
extends
BaseController
{
@Autowired
private
ITGasBottleInfoService
tGasBottleInfoService
;
/**
* 查询气瓶信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TGasBottleInfo
tGasBottleInfo
)
{
startPage
();
List
<
TGasBottleInfo
>
list
=
tGasBottleInfoService
.
selectTGasBottleInfoList
(
tGasBottleInfo
);
return
getDataTable
(
list
);
}
/**
* 导出气瓶信息列表
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:export')"
)
@Log
(
title
=
"气瓶信息"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TGasBottleInfo
tGasBottleInfo
)
{
List
<
TGasBottleInfo
>
list
=
tGasBottleInfoService
.
selectTGasBottleInfoList
(
tGasBottleInfo
);
ExcelUtil
<
TGasBottleInfo
>
util
=
new
ExcelUtil
<
TGasBottleInfo
>(
TGasBottleInfo
.
class
);
return
util
.
exportExcel
(
list
,
"气瓶信息数据"
);
}
/**
* 获取气瓶信息详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:query')"
)
@GetMapping
(
value
=
"/{bottleId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"bottleId"
)
Long
bottleId
)
{
return
AjaxResult
.
success
(
tGasBottleInfoService
.
selectTGasBottleInfoById
(
bottleId
));
}
/**
* 新增气瓶信息
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:add')"
)
@Log
(
title
=
"气瓶信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TGasBottleInfo
tGasBottleInfo
)
{
return
toAjax
(
tGasBottleInfoService
.
insertTGasBottleInfo
(
tGasBottleInfo
));
}
/**
* 修改气瓶信息
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:edit')"
)
@Log
(
title
=
"气瓶信息"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TGasBottleInfo
tGasBottleInfo
)
{
return
toAjax
(
tGasBottleInfoService
.
updateTGasBottleInfo
(
tGasBottleInfo
));
}
/**
* 删除气瓶信息
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottle:info:remove')"
)
@Log
(
title
=
"气瓶信息"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{bottleIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
bottleIds
)
{
return
toAjax
(
tGasBottleInfoService
.
deleteTGasBottleInfoByIds
(
bottleIds
));
}
/**
* 储配站导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize
(
"@ss.hasPermi('gasBottleTrack:storageStationManage:import')"
)
@Log
(
title
=
"储配站维护"
,
businessType
=
BusinessType
.
IMPORT
)
@PostMapping
(
"/importData"
)
public
AjaxResult
importData
(
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
ExcelUtil
<
TGasBottleInfo
>
util
=
new
ExcelUtil
<>(
TGasBottleInfo
.
class
);
List
<
TGasBottleInfo
>
tGasBottleInfoList
=
util
.
importExcel
(
file
.
getInputStream
());
String
message
=
tGasBottleInfoService
.
importTGasBottleInfo
(
tGasBottleInfoList
,
updateSupport
);
return
AjaxResult
.
success
(
message
);
}
@GetMapping
(
"/importTemplate"
)
public
AjaxResult
importTemplate
(){
ExcelUtil
<
TGasBottleInfo
>
util
=
new
ExcelUtil
<>(
TGasBottleInfo
.
class
);
return
util
.
importTemplateExcel
(
"气瓶数据"
);
}
}
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/gasBottleTrack/TGasStorageStationInfoController.java
View file @
88ed3bf9
...
...
@@ -40,6 +40,12 @@ public class TGasStorageStationInfoController extends BaseController
return
getDataTable
(
list
);
}
@GetMapping
(
"/gasStorageStationList"
)
public
AjaxResult
gasStorageStationList
(
TGasStorageStationInfo
tGasStorageStationInfo
){
List
<
TGasStorageStationInfo
>
list
=
tGasStorageStationInfoService
.
selectTGasStorageStationInfoList
(
tGasStorageStationInfo
);
return
AjaxResult
.
success
(
list
);
}
/**
* 导出储配站信息列表
*/
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/domain/TGasBottleInfo.java
0 → 100644
View file @
88ed3bf9
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
;
/**
* 气瓶信息对象 t_gas_bottle_info
*
* @author zehong
* @date 2023-08-15
*/
public
class
TGasBottleInfo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 气瓶主键 */
private
Long
bottleId
;
/** 储配站 */
private
Long
stationId
;
@Excel
(
name
=
"储配站"
)
private
String
stationName
;
/** 气瓶条码 */
@Excel
(
name
=
"气瓶条码"
)
private
String
bottleCode
;
/** 自有编号 */
@Excel
(
name
=
"自有编号"
)
private
String
myselfNum
;
/** 制造单位 */
@Excel
(
name
=
"制造单位"
)
private
String
produceUnit
;
/** 制造年月 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"制造年月"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
produceDate
;
/** 出厂编号 */
@Excel
(
name
=
"出厂编号"
)
private
String
produceCode
;
/** 1.正常 2.逾期未检 3.报废 */
@Excel
(
name
=
"气瓶状态:1.正常 2.逾期未检 3.报废"
)
private
String
bottleStatus
;
/** 末次充装时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"末次充装时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
lastChargeDate
;
/** 经度 */
@Excel
(
name
=
"经度"
)
private
BigDecimal
longitude
;
/** 纬度 */
@Excel
(
name
=
"纬度"
)
private
BigDecimal
latitude
;
/** 充装介质 */
@Excel
(
name
=
"充装介质"
)
private
String
chargeMedium
;
/** 气瓶规格Kg/MPa */
@Excel
(
name
=
"气瓶规格Kg/MPa"
)
private
String
bottleSpecs
;
/** 公称压力Mpa */
@Excel
(
name
=
"公称压力Mpa"
)
private
String
ratedPresure
;
/** 气瓶容积L */
@Excel
(
name
=
"气瓶容积L"
)
private
String
bottleCapacity
;
/** 壁厚 */
@Excel
(
name
=
"壁厚"
)
private
String
wallThickness
;
/** 皮重 */
@Excel
(
name
=
"皮重"
)
private
String
tare
;
/** 使用登记代码 */
@Excel
(
name
=
"使用登记代码"
)
private
String
useRegisterCode
;
/** 登记日期 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"登记日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
registerDate
;
/** 末检日期 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"末检日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
lastCheckDate
;
/** 下检日期 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"下检日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
nextCheckDate
;
/** 报废日期 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"报废日期"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
scrapDate
;
/** 0.在站 1.离站 */
@Excel
(
name
=
"在站/离站: 0.在站 1.离站"
)
private
String
currentStatus
;
/** 0.空瓶 1.满瓶 */
@Excel
(
name
=
"空满状态:0.空瓶 1.满瓶"
)
private
String
emptyType
;
/** 删除状态:0.否 1.是 */
private
String
isDel
;
private
Date
produceBeginTime
;
private
Date
produceEndTime
;
public
void
setBottleId
(
Long
bottleId
)
{
this
.
bottleId
=
bottleId
;
}
public
Long
getBottleId
()
{
return
bottleId
;
}
public
void
setStationId
(
Long
stationId
)
{
this
.
stationId
=
stationId
;
}
public
Long
getStationId
()
{
return
stationId
;
}
public
void
setBottleCode
(
String
bottleCode
)
{
this
.
bottleCode
=
bottleCode
;
}
public
String
getStationName
()
{
return
stationName
;
}
public
void
setStationName
(
String
stationName
)
{
this
.
stationName
=
stationName
;
}
public
String
getBottleCode
()
{
return
bottleCode
;
}
public
void
setMyselfNum
(
String
myselfNum
)
{
this
.
myselfNum
=
myselfNum
;
}
public
String
getMyselfNum
()
{
return
myselfNum
;
}
public
void
setProduceUnit
(
String
produceUnit
)
{
this
.
produceUnit
=
produceUnit
;
}
public
String
getProduceUnit
()
{
return
produceUnit
;
}
public
void
setProduceDate
(
Date
produceDate
)
{
this
.
produceDate
=
produceDate
;
}
public
Date
getProduceDate
()
{
return
produceDate
;
}
public
void
setProduceCode
(
String
produceCode
)
{
this
.
produceCode
=
produceCode
;
}
public
String
getProduceCode
()
{
return
produceCode
;
}
public
void
setBottleStatus
(
String
bottleStatus
)
{
this
.
bottleStatus
=
bottleStatus
;
}
public
String
getBottleStatus
()
{
return
bottleStatus
;
}
public
void
setLastChargeDate
(
Date
lastChargeDate
)
{
this
.
lastChargeDate
=
lastChargeDate
;
}
public
Date
getLastChargeDate
()
{
return
lastChargeDate
;
}
public
void
setLongitude
(
BigDecimal
longitude
)
{
this
.
longitude
=
longitude
;
}
public
BigDecimal
getLongitude
()
{
return
longitude
;
}
public
void
setLatitude
(
BigDecimal
latitude
)
{
this
.
latitude
=
latitude
;
}
public
BigDecimal
getLatitude
()
{
return
latitude
;
}
public
void
setChargeMedium
(
String
chargeMedium
)
{
this
.
chargeMedium
=
chargeMedium
;
}
public
String
getChargeMedium
()
{
return
chargeMedium
;
}
public
void
setBottleSpecs
(
String
bottleSpecs
)
{
this
.
bottleSpecs
=
bottleSpecs
;
}
public
String
getBottleSpecs
()
{
return
bottleSpecs
;
}
public
void
setRatedPresure
(
String
ratedPresure
)
{
this
.
ratedPresure
=
ratedPresure
;
}
public
String
getRatedPresure
()
{
return
ratedPresure
;
}
public
void
setBottleCapacity
(
String
bottleCapacity
)
{
this
.
bottleCapacity
=
bottleCapacity
;
}
public
String
getBottleCapacity
()
{
return
bottleCapacity
;
}
public
void
setWallThickness
(
String
wallThickness
)
{
this
.
wallThickness
=
wallThickness
;
}
public
String
getWallThickness
()
{
return
wallThickness
;
}
public
void
setTare
(
String
tare
)
{
this
.
tare
=
tare
;
}
public
String
getTare
()
{
return
tare
;
}
public
void
setUseRegisterCode
(
String
useRegisterCode
)
{
this
.
useRegisterCode
=
useRegisterCode
;
}
public
String
getUseRegisterCode
()
{
return
useRegisterCode
;
}
public
void
setRegisterDate
(
Date
registerDate
)
{
this
.
registerDate
=
registerDate
;
}
public
Date
getRegisterDate
()
{
return
registerDate
;
}
public
void
setLastCheckDate
(
Date
lastCheckDate
)
{
this
.
lastCheckDate
=
lastCheckDate
;
}
public
Date
getLastCheckDate
()
{
return
lastCheckDate
;
}
public
void
setNextCheckDate
(
Date
nextCheckDate
)
{
this
.
nextCheckDate
=
nextCheckDate
;
}
public
Date
getNextCheckDate
()
{
return
nextCheckDate
;
}
public
void
setScrapDate
(
Date
scrapDate
)
{
this
.
scrapDate
=
scrapDate
;
}
public
Date
getScrapDate
()
{
return
scrapDate
;
}
public
void
setCurrentStatus
(
String
currentStatus
)
{
this
.
currentStatus
=
currentStatus
;
}
public
String
getCurrentStatus
()
{
return
currentStatus
;
}
public
void
setEmptyType
(
String
emptyType
)
{
this
.
emptyType
=
emptyType
;
}
public
String
getEmptyType
()
{
return
emptyType
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
public
String
getIsDel
()
{
return
isDel
;
}
public
Date
getProduceBeginTime
()
{
return
produceBeginTime
;
}
public
void
setProduceBeginTime
(
Date
produceBeginTime
)
{
this
.
produceBeginTime
=
produceBeginTime
;
}
public
Date
getProduceEndTime
()
{
return
produceEndTime
;
}
public
void
setProduceEndTime
(
Date
produceEndTime
)
{
this
.
produceEndTime
=
produceEndTime
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"bottleId"
,
getBottleId
())
.
append
(
"stationId"
,
getStationId
())
.
append
(
"bottleCode"
,
getBottleCode
())
.
append
(
"myselfNum"
,
getMyselfNum
())
.
append
(
"produceUnit"
,
getProduceUnit
())
.
append
(
"produceDate"
,
getProduceDate
())
.
append
(
"produceCode"
,
getProduceCode
())
.
append
(
"bottleStatus"
,
getBottleStatus
())
.
append
(
"lastChargeDate"
,
getLastChargeDate
())
.
append
(
"longitude"
,
getLongitude
())
.
append
(
"latitude"
,
getLatitude
())
.
append
(
"chargeMedium"
,
getChargeMedium
())
.
append
(
"bottleSpecs"
,
getBottleSpecs
())
.
append
(
"ratedPresure"
,
getRatedPresure
())
.
append
(
"bottleCapacity"
,
getBottleCapacity
())
.
append
(
"wallThickness"
,
getWallThickness
())
.
append
(
"tare"
,
getTare
())
.
append
(
"useRegisterCode"
,
getUseRegisterCode
())
.
append
(
"registerDate"
,
getRegisterDate
())
.
append
(
"lastCheckDate"
,
getLastCheckDate
())
.
append
(
"nextCheckDate"
,
getNextCheckDate
())
.
append
(
"scrapDate"
,
getScrapDate
())
.
append
(
"currentStatus"
,
getCurrentStatus
())
.
append
(
"emptyType"
,
getEmptyType
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"isDel"
,
getIsDel
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TGasBottleInfoMapper.java
0 → 100644
View file @
88ed3bf9
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TGasBottleInfo
;
/**
* 气瓶信息Mapper接口
*
* @author zehong
* @date 2023-08-15
*/
public
interface
TGasBottleInfoMapper
{
/**
* 查询气瓶信息
*
* @param bottleId 气瓶信息ID
* @return 气瓶信息
*/
public
TGasBottleInfo
selectTGasBottleInfoById
(
Long
bottleId
);
/**
* 查询气瓶信息列表
*
* @param tGasBottleInfo 气瓶信息
* @return 气瓶信息集合
*/
public
List
<
TGasBottleInfo
>
selectTGasBottleInfoList
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 新增气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
public
int
insertTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 修改气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
public
int
updateTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 删除气瓶信息
*
* @param bottleId 气瓶信息ID
* @return 结果
*/
public
int
deleteTGasBottleInfoById
(
Long
bottleId
);
/**
* 批量删除气瓶信息
*
* @param bottleIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteTGasBottleInfoByIds
(
Long
[]
bottleIds
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/ITGasBottleInfoService.java
0 → 100644
View file @
88ed3bf9
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TGasBottleInfo
;
/**
* 气瓶信息Service接口
*
* @author zehong
* @date 2023-08-15
*/
public
interface
ITGasBottleInfoService
{
/**
* 查询气瓶信息
*
* @param bottleId 气瓶信息ID
* @return 气瓶信息
*/
public
TGasBottleInfo
selectTGasBottleInfoById
(
Long
bottleId
);
/**
* 查询气瓶信息列表
*
* @param tGasBottleInfo 气瓶信息
* @return 气瓶信息集合
*/
public
List
<
TGasBottleInfo
>
selectTGasBottleInfoList
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 新增气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
public
int
insertTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 修改气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
public
int
updateTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
);
/**
* 批量删除气瓶信息
*
* @param bottleIds 需要删除的气瓶信息ID
* @return 结果
*/
public
int
deleteTGasBottleInfoByIds
(
Long
[]
bottleIds
);
/**
* 删除气瓶信息信息
*
* @param bottleId 气瓶信息ID
* @return 结果
*/
public
int
deleteTGasBottleInfoById
(
Long
bottleId
);
/**
* 气瓶数据导出
* @param tGasBottleInfoList 气瓶实体
* @param isUpdateSupport 是否更新
* @return
*/
String
importTGasBottleInfo
(
List
<
TGasBottleInfo
>
tGasBottleInfoList
,
Boolean
isUpdateSupport
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/impl/TGasBottleInfoServiceImpl.java
0 → 100644
View file @
88ed3bf9
package
com
.
zehong
.
system
.
service
.
impl
;
import
com.zehong.common.exception.CustomException
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
com.zehong.system.domain.TGasStorageStationInfo
;
import
com.zehong.system.mapper.TGasBottleInfoMapper
;
import
com.zehong.system.mapper.TGasStorageStationInfoMapper
;
import
com.zehong.system.service.ITGasBottleInfoService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 气瓶信息Service业务层处理
*
* @author zehong
* @date 2023-08-15
*/
@Service
public
class
TGasBottleInfoServiceImpl
implements
ITGasBottleInfoService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
TGasBottleInfoServiceImpl
.
class
);
@Autowired
private
TGasBottleInfoMapper
tGasBottleInfoMapper
;
@Resource
private
TGasStorageStationInfoMapper
tGasStorageStationInfoMapper
;
/**
* 查询气瓶信息
*
* @param bottleId 气瓶信息ID
* @return 气瓶信息
*/
@Override
public
TGasBottleInfo
selectTGasBottleInfoById
(
Long
bottleId
)
{
return
tGasBottleInfoMapper
.
selectTGasBottleInfoById
(
bottleId
);
}
/**
* 查询气瓶信息列表
*
* @param tGasBottleInfo 气瓶信息
* @return 气瓶信息
*/
@Override
public
List
<
TGasBottleInfo
>
selectTGasBottleInfoList
(
TGasBottleInfo
tGasBottleInfo
)
{
return
tGasBottleInfoMapper
.
selectTGasBottleInfoList
(
tGasBottleInfo
);
}
/**
* 新增气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
@Override
public
int
insertTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
)
{
tGasBottleInfo
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tGasBottleInfoMapper
.
insertTGasBottleInfo
(
tGasBottleInfo
);
}
/**
* 修改气瓶信息
*
* @param tGasBottleInfo 气瓶信息
* @return 结果
*/
@Override
public
int
updateTGasBottleInfo
(
TGasBottleInfo
tGasBottleInfo
)
{
tGasBottleInfo
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
tGasBottleInfoMapper
.
updateTGasBottleInfo
(
tGasBottleInfo
);
}
/**
* 批量删除气瓶信息
*
* @param bottleIds 需要删除的气瓶信息ID
* @return 结果
*/
@Override
public
int
deleteTGasBottleInfoByIds
(
Long
[]
bottleIds
)
{
return
tGasBottleInfoMapper
.
deleteTGasBottleInfoByIds
(
bottleIds
);
}
/**
* 删除气瓶信息信息
*
* @param bottleId 气瓶信息ID
* @return 结果
*/
@Override
public
int
deleteTGasBottleInfoById
(
Long
bottleId
)
{
return
tGasBottleInfoMapper
.
deleteTGasBottleInfoById
(
bottleId
);
}
/**
* 气瓶数据导出
* @param tGasBottleInfoList 气瓶实体
* @param isUpdateSupport 是否更新
* @return
*/
@Override
public
String
importTGasBottleInfo
(
List
<
TGasBottleInfo
>
tGasBottleInfoList
,
Boolean
isUpdateSupport
){
if
(
StringUtils
.
isNull
(
tGasBottleInfoList
)
||
tGasBottleInfoList
.
size
()
==
0
){
throw
new
CustomException
(
"导入数据不能为空!"
);
}
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
successMsg
=
new
StringBuilder
();
StringBuilder
failureMsg
=
new
StringBuilder
();
for
(
TGasBottleInfo
tGasBottleInfo
:
tGasBottleInfoList
){
try
{
//查询储配站信息
TGasStorageStationInfo
queryGasStorageStationInfo
=
new
TGasStorageStationInfo
();
queryGasStorageStationInfo
.
setStationName
(
tGasBottleInfo
.
getStationName
());
List
<
TGasStorageStationInfo
>
gasStorageStationInfo
=
tGasStorageStationInfoMapper
.
selectTGasStorageStationInfoList
(
queryGasStorageStationInfo
);
if
(
CollectionUtils
.
isEmpty
(
gasStorageStationInfo
)){
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、气瓶条码为 "
+
tGasBottleInfo
.
getBottleCode
()
+
"、储配站"
+
tGasBottleInfo
.
getStationName
()
+
" 不存在请创建或导入"
);
continue
;
}
TGasBottleInfo
gasBottleInfo
=
new
TGasBottleInfo
();
gasBottleInfo
.
setBottleCode
(
tGasBottleInfo
.
getBottleCode
());
List
<
TGasBottleInfo
>
queryGasBottleInfo
=
tGasBottleInfoMapper
.
selectTGasBottleInfoList
(
gasBottleInfo
);
if
(
StringUtils
.
isNull
(
queryGasBottleInfo
)
||
queryGasBottleInfo
.
size
()
==
0
){
tGasBottleInfo
.
setStationId
(
gasStorageStationInfo
.
get
(
0
).
getStationId
());
this
.
insertTGasBottleInfo
(
tGasBottleInfo
);
successNum
++;
successMsg
.
append
(
"<br/>"
+
successNum
+
"、气瓶条码 "
+
tGasBottleInfo
.
getBottleCode
()
+
" 导入成功"
);
}
else
if
(
isUpdateSupport
){
queryGasBottleInfo
.
stream
().
forEach
(
bottleInfo
->{
tGasBottleInfo
.
setBottleId
(
bottleInfo
.
getBottleId
());
tGasBottleInfo
.
setStationId
(
gasStorageStationInfo
.
get
(
0
).
getStationId
());
this
.
updateTGasBottleInfo
(
tGasBottleInfo
);
});
successNum
++;
successMsg
.
append
(
"<br/>"
+
successNum
+
"、气瓶条码 "
+
tGasBottleInfo
.
getBottleCode
()
+
" 更新成功"
);
}
else
{
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、气瓶条码 "
+
tGasBottleInfo
.
getBottleCode
()
+
" 已存在"
);
}
}
catch
(
Exception
e
)
{
failureNum
++;
String
msg
=
"<br/>"
+
failureNum
+
"、气瓶条码 "
+
tGasBottleInfo
.
getBottleCode
()
+
" 导入失败:"
;
failureMsg
.
append
(
msg
+
e
.
getMessage
());
log
.
error
(
msg
,
e
);
}
}
if
(
failureNum
>
0
)
{
failureMsg
.
insert
(
0
,
"很抱歉,导入失败!共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
throw
new
CustomException
(
failureMsg
.
toString
());
}
else
{
successMsg
.
insert
(
0
,
"恭喜您,数据已全部导入成功!共 "
+
successNum
+
" 条,数据如下:"
);
}
return
successMsg
.
toString
();
}
}
gassafetyprogress-system/src/main/resources/mapper/system/TGasBottleInfoMapper.xml
0 → 100644
View file @
88ed3bf9
<?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.TGasBottleInfoMapper"
>
<resultMap
type=
"TGasBottleInfo"
id=
"TGasBottleInfoResult"
>
<result
property=
"bottleId"
column=
"bottle_id"
/>
<result
property=
"stationId"
column=
"station_id"
/>
<result
property=
"bottleCode"
column=
"bottle_code"
/>
<result
property=
"myselfNum"
column=
"myself_num"
/>
<result
property=
"produceUnit"
column=
"produce_unit"
/>
<result
property=
"produceDate"
column=
"produce_date"
/>
<result
property=
"produceCode"
column=
"produce_code"
/>
<result
property=
"bottleStatus"
column=
"bottle_status"
/>
<result
property=
"lastChargeDate"
column=
"last_charge_date"
/>
<result
property=
"longitude"
column=
"longitude"
/>
<result
property=
"latitude"
column=
"latitude"
/>
<result
property=
"chargeMedium"
column=
"charge_medium"
/>
<result
property=
"bottleSpecs"
column=
"bottle_specs"
/>
<result
property=
"ratedPresure"
column=
"rated_presure"
/>
<result
property=
"bottleCapacity"
column=
"bottle_capacity"
/>
<result
property=
"wallThickness"
column=
"wall_thickness"
/>
<result
property=
"tare"
column=
"tare"
/>
<result
property=
"useRegisterCode"
column=
"use_register_code"
/>
<result
property=
"registerDate"
column=
"register_date"
/>
<result
property=
"lastCheckDate"
column=
"last_check_date"
/>
<result
property=
"nextCheckDate"
column=
"next_check_date"
/>
<result
property=
"scrapDate"
column=
"scrap_date"
/>
<result
property=
"currentStatus"
column=
"current_status"
/>
<result
property=
"emptyType"
column=
"empty_type"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"stationName"
column=
"station_name"
/>
</resultMap>
<sql
id=
"selectTGasBottleInfoVo"
>
SELECT
bottle_id,
station_id,
bottle_code,
myself_num,
produce_unit,
produce_date,
produce_code,
bottle_status,
last_charge_date,
longitude,
latitude,
charge_medium,
bottle_specs,
rated_presure,
bottle_capacity,
wall_thickness,
tare,
use_register_code,
register_date,
last_check_date,
next_check_date,
scrap_date,
current_status,
empty_type,
create_time,
update_time,
is_del,
remark,
(SELECT station_name FROM t_gas_storage_station_info info WHERE info.station_id = station_id) as station_name
FROM
t_gas_bottle_info
</sql>
<select
id=
"selectTGasBottleInfoList"
parameterType=
"TGasBottleInfo"
resultMap=
"TGasBottleInfoResult"
>
<include
refid=
"selectTGasBottleInfoVo"
/>
<where>
<if
test=
"stationId != null "
>
and station_id = #{stationId}
</if>
<if
test=
"bottleCode != null and bottleCode != ''"
>
and bottle_code = #{bottleCode}
</if>
<if
test=
"myselfNum != null and myselfNum != ''"
>
and myself_num = #{myselfNum}
</if>
<if
test=
"produceUnit != null and produceUnit != ''"
>
and produce_unit = #{produceUnit}
</if>
<if
test=
"produceDate != null "
>
and produce_date = #{produceDate}
</if>
<if
test=
"produceBeginTime != null and produceEndTime"
>
and produce_date between #{produceBeginTime} and #{produceEndTime}
</if>
<if
test=
"produceCode != null and produceCode != ''"
>
and produce_code = #{produceCode}
</if>
<if
test=
"bottleStatus != null and bottleStatus != ''"
>
and bottle_status = #{bottleStatus}
</if>
<if
test=
"lastChargeDate != null "
>
and last_charge_date = #{lastChargeDate}
</if>
<if
test=
"longitude != null "
>
and longitude = #{longitude}
</if>
<if
test=
"latitude != null "
>
and latitude = #{latitude}
</if>
<if
test=
"chargeMedium != null and chargeMedium != ''"
>
and charge_medium = #{chargeMedium}
</if>
<if
test=
"bottleSpecs != null and bottleSpecs != ''"
>
and bottle_specs = #{bottleSpecs}
</if>
<if
test=
"ratedPresure != null and ratedPresure != ''"
>
and rated_presure = #{ratedPresure}
</if>
<if
test=
"bottleCapacity != null and bottleCapacity != ''"
>
and bottle_capacity = #{bottleCapacity}
</if>
<if
test=
"wallThickness != null and wallThickness != ''"
>
and wall_thickness = #{wallThickness}
</if>
<if
test=
"tare != null and tare != ''"
>
and tare = #{tare}
</if>
<if
test=
"useRegisterCode != null and useRegisterCode != ''"
>
and use_register_code = #{useRegisterCode}
</if>
<if
test=
"registerDate != null "
>
and register_date = #{registerDate}
</if>
<if
test=
"lastCheckDate != null "
>
and last_check_date = #{lastCheckDate}
</if>
<if
test=
"nextCheckDate != null "
>
and next_check_date = #{nextCheckDate}
</if>
<if
test=
"scrapDate != null "
>
and scrap_date = #{scrapDate}
</if>
<if
test=
"currentStatus != null and currentStatus != ''"
>
and current_status = #{currentStatus}
</if>
<if
test=
"emptyType != null and emptyType != ''"
>
and empty_type = #{emptyType}
</if>
<if
test=
"isDel != null and isDel != ''"
>
and is_del = #{isDel}
</if>
</where>
</select>
<select
id=
"selectTGasBottleInfoById"
parameterType=
"Long"
resultMap=
"TGasBottleInfoResult"
>
<include
refid=
"selectTGasBottleInfoVo"
/>
where bottle_id = #{bottleId}
</select>
<insert
id=
"insertTGasBottleInfo"
parameterType=
"TGasBottleInfo"
useGeneratedKeys=
"true"
keyProperty=
"bottleId"
>
insert into t_gas_bottle_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"stationId != null"
>
station_id,
</if>
<if
test=
"bottleCode != null"
>
bottle_code,
</if>
<if
test=
"myselfNum != null"
>
myself_num,
</if>
<if
test=
"produceUnit != null"
>
produce_unit,
</if>
<if
test=
"produceDate != null"
>
produce_date,
</if>
<if
test=
"produceCode != null"
>
produce_code,
</if>
<if
test=
"bottleStatus != null"
>
bottle_status,
</if>
<if
test=
"lastChargeDate != null"
>
last_charge_date,
</if>
<if
test=
"longitude != null"
>
longitude,
</if>
<if
test=
"latitude != null"
>
latitude,
</if>
<if
test=
"chargeMedium != null"
>
charge_medium,
</if>
<if
test=
"bottleSpecs != null"
>
bottle_specs,
</if>
<if
test=
"ratedPresure != null"
>
rated_presure,
</if>
<if
test=
"bottleCapacity != null"
>
bottle_capacity,
</if>
<if
test=
"wallThickness != null"
>
wall_thickness,
</if>
<if
test=
"tare != null"
>
tare,
</if>
<if
test=
"useRegisterCode != null"
>
use_register_code,
</if>
<if
test=
"registerDate != null"
>
register_date,
</if>
<if
test=
"lastCheckDate != null"
>
last_check_date,
</if>
<if
test=
"nextCheckDate != null"
>
next_check_date,
</if>
<if
test=
"scrapDate != null"
>
scrap_date,
</if>
<if
test=
"currentStatus != null"
>
current_status,
</if>
<if
test=
"emptyType != null"
>
empty_type,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"isDel != null"
>
is_del,
</if>
<if
test=
"remark != null"
>
remark,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"stationId != null"
>
#{stationId},
</if>
<if
test=
"bottleCode != null"
>
#{bottleCode},
</if>
<if
test=
"myselfNum != null"
>
#{myselfNum},
</if>
<if
test=
"produceUnit != null"
>
#{produceUnit},
</if>
<if
test=
"produceDate != null"
>
#{produceDate},
</if>
<if
test=
"produceCode != null"
>
#{produceCode},
</if>
<if
test=
"bottleStatus != null"
>
#{bottleStatus},
</if>
<if
test=
"lastChargeDate != null"
>
#{lastChargeDate},
</if>
<if
test=
"longitude != null"
>
#{longitude},
</if>
<if
test=
"latitude != null"
>
#{latitude},
</if>
<if
test=
"chargeMedium != null"
>
#{chargeMedium},
</if>
<if
test=
"bottleSpecs != null"
>
#{bottleSpecs},
</if>
<if
test=
"ratedPresure != null"
>
#{ratedPresure},
</if>
<if
test=
"bottleCapacity != null"
>
#{bottleCapacity},
</if>
<if
test=
"wallThickness != null"
>
#{wallThickness},
</if>
<if
test=
"tare != null"
>
#{tare},
</if>
<if
test=
"useRegisterCode != null"
>
#{useRegisterCode},
</if>
<if
test=
"registerDate != null"
>
#{registerDate},
</if>
<if
test=
"lastCheckDate != null"
>
#{lastCheckDate},
</if>
<if
test=
"nextCheckDate != null"
>
#{nextCheckDate},
</if>
<if
test=
"scrapDate != null"
>
#{scrapDate},
</if>
<if
test=
"currentStatus != null"
>
#{currentStatus},
</if>
<if
test=
"emptyType != null"
>
#{emptyType},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"isDel != null"
>
#{isDel},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
</trim>
</insert>
<update
id=
"updateTGasBottleInfo"
parameterType=
"TGasBottleInfo"
>
update t_gas_bottle_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"stationId != null"
>
station_id = #{stationId},
</if>
<if
test=
"bottleCode != null"
>
bottle_code = #{bottleCode},
</if>
<if
test=
"myselfNum != null"
>
myself_num = #{myselfNum},
</if>
<if
test=
"produceUnit != null"
>
produce_unit = #{produceUnit},
</if>
<if
test=
"produceDate != null"
>
produce_date = #{produceDate},
</if>
<if
test=
"produceCode != null"
>
produce_code = #{produceCode},
</if>
<if
test=
"bottleStatus != null"
>
bottle_status = #{bottleStatus},
</if>
<if
test=
"lastChargeDate != null"
>
last_charge_date = #{lastChargeDate},
</if>
<if
test=
"longitude != null"
>
longitude = #{longitude},
</if>
<if
test=
"latitude != null"
>
latitude = #{latitude},
</if>
<if
test=
"chargeMedium != null"
>
charge_medium = #{chargeMedium},
</if>
<if
test=
"bottleSpecs != null"
>
bottle_specs = #{bottleSpecs},
</if>
<if
test=
"ratedPresure != null"
>
rated_presure = #{ratedPresure},
</if>
<if
test=
"bottleCapacity != null"
>
bottle_capacity = #{bottleCapacity},
</if>
<if
test=
"wallThickness != null"
>
wall_thickness = #{wallThickness},
</if>
<if
test=
"tare != null"
>
tare = #{tare},
</if>
<if
test=
"useRegisterCode != null"
>
use_register_code = #{useRegisterCode},
</if>
<if
test=
"registerDate != null"
>
register_date = #{registerDate},
</if>
<if
test=
"lastCheckDate != null"
>
last_check_date = #{lastCheckDate},
</if>
<if
test=
"nextCheckDate != null"
>
next_check_date = #{nextCheckDate},
</if>
<if
test=
"scrapDate != null"
>
scrap_date = #{scrapDate},
</if>
<if
test=
"currentStatus != null"
>
current_status = #{currentStatus},
</if>
<if
test=
"emptyType != null"
>
empty_type = #{emptyType},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"isDel != null"
>
is_del = #{isDel},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
</trim>
where bottle_id = #{bottleId}
</update>
<delete
id=
"deleteTGasBottleInfoById"
parameterType=
"Long"
>
delete from t_gas_bottle_info where bottle_id = #{bottleId}
</delete>
<delete
id=
"deleteTGasBottleInfoByIds"
parameterType=
"String"
>
delete from t_gas_bottle_info where bottle_id in
<foreach
item=
"bottleId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{bottleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment