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
44315ceb
Commit
44315ceb
authored
Aug 21, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
充装查询
parent
604eccdc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
777 additions
and
0 deletions
+777
-0
TAirChargeRecordController.java
...controller/gasBottleTrack/TAirChargeRecordController.java
+130
-0
TPractitionerInfoController.java
...ontroller/gasBottleTrack/TPractitionerInfoController.java
+7
-0
TAirChargeRecord.java
.../main/java/com/zehong/system/domain/TAirChargeRecord.java
+196
-0
TAirChargeRecordMapper.java
...java/com/zehong/system/mapper/TAirChargeRecordMapper.java
+61
-0
ITAirChargeRecordService.java
...a/com/zehong/system/service/ITAirChargeRecordService.java
+69
-0
TAirChargeRecordServiceImpl.java
...hong/system/service/impl/TAirChargeRecordServiceImpl.java
+194
-0
TAirChargeRecordMapper.xml
...c/main/resources/mapper/system/TAirChargeRecordMapper.xml
+120
-0
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/gasBottleTrack/TAirChargeRecordController.java
0 → 100644
View file @
44315ceb
package
com
.
zehong
.
web
.
controller
.
gasBottleTrack
;
import
java.util.List
;
import
com.zehong.system.domain.TGasUserInfo
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TAirChargeRecord
;
import
com.zehong.system.service.ITAirChargeRecordService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* 充装记录Controller
*
* @author zehong
* @date 2023-08-21
*/
@RestController
@RequestMapping
(
"/charge/record"
)
public
class
TAirChargeRecordController
extends
BaseController
{
@Autowired
private
ITAirChargeRecordService
tAirChargeRecordService
;
/**
* 查询充装记录列表
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TAirChargeRecord
tAirChargeRecord
)
{
startPage
();
List
<
TAirChargeRecord
>
list
=
tAirChargeRecordService
.
selectTAirChargeRecordList
(
tAirChargeRecord
);
return
getDataTable
(
list
);
}
/**
* 导出充装记录列表
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:export')"
)
@Log
(
title
=
"充装记录"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TAirChargeRecord
tAirChargeRecord
)
{
List
<
TAirChargeRecord
>
list
=
tAirChargeRecordService
.
selectTAirChargeRecordList
(
tAirChargeRecord
);
ExcelUtil
<
TAirChargeRecord
>
util
=
new
ExcelUtil
<
TAirChargeRecord
>(
TAirChargeRecord
.
class
);
return
util
.
exportExcel
(
list
,
"充装记录数据"
);
}
/**
* 获取充装记录详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:query')"
)
@GetMapping
(
value
=
"/{chargeRecordId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"chargeRecordId"
)
Long
chargeRecordId
)
{
return
AjaxResult
.
success
(
tAirChargeRecordService
.
selectTAirChargeRecordById
(
chargeRecordId
));
}
/**
* 新增充装记录
*/
@PreAuthorize
(
"@ss.hasPermi('system:record:add')"
)
@Log
(
title
=
"充装记录"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TAirChargeRecord
tAirChargeRecord
)
{
return
toAjax
(
tAirChargeRecordService
.
insertTAirChargeRecord
(
tAirChargeRecord
));
}
/**
* 修改充装记录
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:edit')"
)
@Log
(
title
=
"充装记录"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TAirChargeRecord
tAirChargeRecord
)
{
return
toAjax
(
tAirChargeRecordService
.
updateTAirChargeRecord
(
tAirChargeRecord
));
}
/**
* 删除充装记录
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:remove')"
)
@Log
(
title
=
"充装记录"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{chargeRecordIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
chargeRecordIds
)
{
return
toAjax
(
tAirChargeRecordService
.
deleteTAirChargeRecordByIds
(
chargeRecordIds
));
}
/**
* 充装记录导入
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize
(
"@ss.hasPermi('charge:record:import')"
)
@Log
(
title
=
"充装记录导入"
,
businessType
=
BusinessType
.
IMPORT
)
@PostMapping
(
"/importData"
)
public
AjaxResult
importData
(
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
ExcelUtil
<
TAirChargeRecord
>
util
=
new
ExcelUtil
<>(
TAirChargeRecord
.
class
);
List
<
TAirChargeRecord
>
airChargeRecordList
=
util
.
importExcel
(
file
.
getInputStream
());
String
message
=
tAirChargeRecordService
.
importAirChargeRecordInfo
(
airChargeRecordList
,
updateSupport
);
return
AjaxResult
.
success
(
message
);
}
@GetMapping
(
"/importTemplate"
)
public
AjaxResult
importTemplate
(){
ExcelUtil
<
TAirChargeRecord
>
util
=
new
ExcelUtil
<>(
TAirChargeRecord
.
class
);
return
util
.
importTemplateExcel
(
"充装记录数据"
);
}
}
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/gasBottleTrack/TPractitionerInfoController.java
View file @
44315ceb
...
@@ -48,6 +48,13 @@ public class TPractitionerInfoController extends BaseController
...
@@ -48,6 +48,13 @@ public class TPractitionerInfoController extends BaseController
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
@GetMapping
(
"/practitionerInfoList"
)
public
AjaxResult
practitionerInfoList
(
TPractitionerInfo
tPractitionerInfo
)
{
List
<
TPractitionerInfo
>
list
=
tPractitionerInfoService
.
selectTPractitionerInfoList
(
tPractitionerInfo
);
return
AjaxResult
.
success
(
list
);
}
/**
/**
* 导出从业人员信息列表
* 导出从业人员信息列表
*/
*/
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/domain/TAirChargeRecord.java
0 → 100644
View file @
44315ceb
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_air_charge_record
*
* @author zehong
* @date 2023-08-21
*/
public
class
TAirChargeRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 充装主键 */
private
Long
chargeRecordId
;
/** 储配站主键 */
private
Long
stationId
;
@Excel
(
name
=
"储配站"
)
private
String
stationName
;
@Excel
(
name
=
"气瓶条码"
)
private
String
bottleCode
;
private
String
bottleCapacity
;
private
String
bottleStatus
;
@Excel
(
name
=
"充装人员"
)
private
String
chargeOperatorName
;
/** 气瓶主键 */
private
Long
bottleId
;
/** 充装人员 */
private
Long
chargeOperator
;
/** 充装量 */
@Excel
(
name
=
"充装量"
)
private
String
chargeMeasure
;
/** 充装时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"充装时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
chargeDate
;
/** 删除状态:0.否 1.是 */
private
String
isDel
;
private
Date
chargeBeginTime
;
private
Date
chargeEndTime
;
public
void
setChargeRecordId
(
Long
chargeRecordId
)
{
this
.
chargeRecordId
=
chargeRecordId
;
}
public
Long
getChargeRecordId
()
{
return
chargeRecordId
;
}
public
void
setStationId
(
Long
stationId
)
{
this
.
stationId
=
stationId
;
}
public
Long
getStationId
()
{
return
stationId
;
}
public
void
setBottleId
(
Long
bottleId
)
{
this
.
bottleId
=
bottleId
;
}
public
String
getStationName
()
{
return
stationName
;
}
public
void
setStationName
(
String
stationName
)
{
this
.
stationName
=
stationName
;
}
public
String
getBottleCode
()
{
return
bottleCode
;
}
public
void
setBottleCode
(
String
bottleCode
)
{
this
.
bottleCode
=
bottleCode
;
}
public
String
getBottleCapacity
()
{
return
bottleCapacity
;
}
public
void
setBottleCapacity
(
String
bottleCapacity
)
{
this
.
bottleCapacity
=
bottleCapacity
;
}
public
String
getBottleStatus
()
{
return
bottleStatus
;
}
public
void
setBottleStatus
(
String
bottleStatus
)
{
this
.
bottleStatus
=
bottleStatus
;
}
public
String
getChargeOperatorName
()
{
return
chargeOperatorName
;
}
public
void
setChargeOperatorName
(
String
chargeOperatorName
)
{
this
.
chargeOperatorName
=
chargeOperatorName
;
}
public
Long
getBottleId
()
{
return
bottleId
;
}
public
void
setChargeOperator
(
Long
chargeOperator
)
{
this
.
chargeOperator
=
chargeOperator
;
}
public
Long
getChargeOperator
()
{
return
chargeOperator
;
}
public
void
setChargeMeasure
(
String
chargeMeasure
)
{
this
.
chargeMeasure
=
chargeMeasure
;
}
public
String
getChargeMeasure
()
{
return
chargeMeasure
;
}
public
void
setChargeDate
(
Date
chargeDate
)
{
this
.
chargeDate
=
chargeDate
;
}
public
Date
getChargeDate
()
{
return
chargeDate
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
public
String
getIsDel
()
{
return
isDel
;
}
public
Date
getChargeBeginTime
()
{
return
chargeBeginTime
;
}
public
void
setChargeBeginTime
(
Date
chargeBeginTime
)
{
this
.
chargeBeginTime
=
chargeBeginTime
;
}
public
Date
getChargeEndTime
()
{
return
chargeEndTime
;
}
public
void
setChargeEndTime
(
Date
chargeEndTime
)
{
this
.
chargeEndTime
=
chargeEndTime
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"chargeRecordId"
,
getChargeRecordId
())
.
append
(
"stationId"
,
getStationId
())
.
append
(
"bottleId"
,
getBottleId
())
.
append
(
"chargeOperator"
,
getChargeOperator
())
.
append
(
"chargeMeasure"
,
getChargeMeasure
())
.
append
(
"chargeDate"
,
getChargeDate
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"isDel"
,
getIsDel
())
.
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TAirChargeRecordMapper.java
0 → 100644
View file @
44315ceb
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TAirChargeRecord
;
/**
* 充装记录Mapper接口
*
* @author zehong
* @date 2023-08-21
*/
public
interface
TAirChargeRecordMapper
{
/**
* 查询充装记录
*
* @param chargeRecordId 充装记录ID
* @return 充装记录
*/
public
TAirChargeRecord
selectTAirChargeRecordById
(
Long
chargeRecordId
);
/**
* 查询充装记录列表
*
* @param tAirChargeRecord 充装记录
* @return 充装记录集合
*/
public
List
<
TAirChargeRecord
>
selectTAirChargeRecordList
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 新增充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
public
int
insertTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 修改充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
public
int
updateTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 删除充装记录
*
* @param chargeRecordId 充装记录ID
* @return 结果
*/
public
int
deleteTAirChargeRecordById
(
Long
chargeRecordId
);
/**
* 批量删除充装记录
*
* @param chargeRecordIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteTAirChargeRecordByIds
(
Long
[]
chargeRecordIds
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/ITAirChargeRecordService.java
0 → 100644
View file @
44315ceb
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TAirChargeRecord
;
/**
* 充装记录Service接口
*
* @author zehong
* @date 2023-08-21
*/
public
interface
ITAirChargeRecordService
{
/**
* 查询充装记录
*
* @param chargeRecordId 充装记录ID
* @return 充装记录
*/
public
TAirChargeRecord
selectTAirChargeRecordById
(
Long
chargeRecordId
);
/**
* 查询充装记录列表
*
* @param tAirChargeRecord 充装记录
* @return 充装记录集合
*/
public
List
<
TAirChargeRecord
>
selectTAirChargeRecordList
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 新增充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
public
int
insertTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 修改充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
public
int
updateTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
);
/**
* 批量删除充装记录
*
* @param chargeRecordIds 需要删除的充装记录ID
* @return 结果
*/
public
int
deleteTAirChargeRecordByIds
(
Long
[]
chargeRecordIds
);
/**
* 删除充装记录信息
*
* @param chargeRecordId 充装记录ID
* @return 结果
*/
public
int
deleteTAirChargeRecordById
(
Long
chargeRecordId
);
/**
* 充装记录导入
* @param airChargeRecordList 充装记录实体
* @param isUpdateSupport 是否更新
* @return
*/
String
importAirChargeRecordInfo
(
List
<
TAirChargeRecord
>
airChargeRecordList
,
boolean
isUpdateSupport
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/impl/TAirChargeRecordServiceImpl.java
0 → 100644
View file @
44315ceb
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.TAirChargeRecord
;
import
com.zehong.system.domain.TGasBottleInfo
;
import
com.zehong.system.domain.TGasStorageStationInfo
;
import
com.zehong.system.domain.TPractitionerInfo
;
import
com.zehong.system.mapper.TAirChargeRecordMapper
;
import
com.zehong.system.mapper.TGasBottleInfoMapper
;
import
com.zehong.system.mapper.TGasStorageStationInfoMapper
;
import
com.zehong.system.mapper.TPractitionerInfoMapper
;
import
com.zehong.system.service.ITAirChargeRecordService
;
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-21
*/
@Service
public
class
TAirChargeRecordServiceImpl
implements
ITAirChargeRecordService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
TAirChargeRecordServiceImpl
.
class
);
@Autowired
private
TAirChargeRecordMapper
tAirChargeRecordMapper
;
@Resource
private
TGasStorageStationInfoMapper
tGasStorageStationInfoMapper
;
@Resource
private
TGasBottleInfoMapper
tGasBottleInfoMapper
;
@Resource
private
TPractitionerInfoMapper
tPractitionerInfoMapper
;
/**
* 查询充装记录
*
* @param chargeRecordId 充装记录ID
* @return 充装记录
*/
@Override
public
TAirChargeRecord
selectTAirChargeRecordById
(
Long
chargeRecordId
)
{
return
tAirChargeRecordMapper
.
selectTAirChargeRecordById
(
chargeRecordId
);
}
/**
* 查询充装记录列表
*
* @param tAirChargeRecord 充装记录
* @return 充装记录
*/
@Override
public
List
<
TAirChargeRecord
>
selectTAirChargeRecordList
(
TAirChargeRecord
tAirChargeRecord
)
{
return
tAirChargeRecordMapper
.
selectTAirChargeRecordList
(
tAirChargeRecord
);
}
/**
* 新增充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
@Override
public
int
insertTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
)
{
tAirChargeRecord
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tAirChargeRecordMapper
.
insertTAirChargeRecord
(
tAirChargeRecord
);
}
/**
* 修改充装记录
*
* @param tAirChargeRecord 充装记录
* @return 结果
*/
@Override
public
int
updateTAirChargeRecord
(
TAirChargeRecord
tAirChargeRecord
)
{
tAirChargeRecord
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
tAirChargeRecordMapper
.
updateTAirChargeRecord
(
tAirChargeRecord
);
}
/**
* 批量删除充装记录
*
* @param chargeRecordIds 需要删除的充装记录ID
* @return 结果
*/
@Override
public
int
deleteTAirChargeRecordByIds
(
Long
[]
chargeRecordIds
)
{
return
tAirChargeRecordMapper
.
deleteTAirChargeRecordByIds
(
chargeRecordIds
);
}
/**
* 删除充装记录信息
*
* @param chargeRecordId 充装记录ID
* @return 结果
*/
@Override
public
int
deleteTAirChargeRecordById
(
Long
chargeRecordId
)
{
return
tAirChargeRecordMapper
.
deleteTAirChargeRecordById
(
chargeRecordId
);
}
/**
* 充装记录导入
* @param airChargeRecordList 充装记录实体
* @param isUpdateSupport 是否更新
* @return
*/
@Override
public
String
importAirChargeRecordInfo
(
List
<
TAirChargeRecord
>
airChargeRecordList
,
boolean
isUpdateSupport
){
if
(
StringUtils
.
isNull
(
airChargeRecordList
)
||
airChargeRecordList
.
size
()
==
0
){
throw
new
CustomException
(
"导入数据不能为空!"
);
}
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
successMsg
=
new
StringBuilder
();
StringBuilder
failureMsg
=
new
StringBuilder
();
for
(
TAirChargeRecord
tAirChargeRecord
:
airChargeRecordList
){
try
{
//查询储配站信息
TGasStorageStationInfo
queryGasStorageStationInfo
=
new
TGasStorageStationInfo
();
queryGasStorageStationInfo
.
setStationName
(
tAirChargeRecord
.
getStationName
());
//储配站
List
<
TGasStorageStationInfo
>
gasStorageStationInfo
=
tGasStorageStationInfoMapper
.
selectTGasStorageStationInfoList
(
queryGasStorageStationInfo
);
if
(
CollectionUtils
.
isEmpty
(
gasStorageStationInfo
)){
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、气瓶条码 "
+
tAirChargeRecord
.
getBottleCode
()
+
"、储配站"
+
tAirChargeRecord
.
getStationName
()
+
" 不存在请创建或导入"
);
continue
;
}
//气瓶
TGasBottleInfo
tGasBottleInfo
=
new
TGasBottleInfo
();
tGasBottleInfo
.
setBottleCode
(
tAirChargeRecord
.
getBottleCode
());
List
<
TGasBottleInfo
>
gasBottleInfoList
=
tGasBottleInfoMapper
.
selectTGasBottleInfoList
(
tGasBottleInfo
);
if
(
CollectionUtils
.
isEmpty
(
gasBottleInfoList
)){
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、气瓶条码 "
+
tAirChargeRecord
.
getBottleCode
()
+
" 不存在请创建"
);
continue
;
}
//从业人员
TPractitionerInfo
query
=
new
TPractitionerInfo
();
query
.
setName
(
tAirChargeRecord
.
getChargeOperatorName
());
List
<
TPractitionerInfo
>
queryPractitionerInfo
=
tPractitionerInfoMapper
.
selectTPractitionerInfoList
(
query
);
if
(
CollectionUtils
.
isEmpty
(
queryPractitionerInfo
)){
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、从业人员 "
+
tAirChargeRecord
.
getChargeOperatorName
()
+
" 不存在请创建"
);
continue
;
}
tAirChargeRecord
.
setStationId
(
gasStorageStationInfo
.
get
(
0
).
getStationId
());
tAirChargeRecord
.
setBottleId
(
gasBottleInfoList
.
get
(
0
).
getBottleId
());
tAirChargeRecord
.
setChargeOperator
(
queryPractitionerInfo
.
get
(
0
).
getPractitionerId
());
this
.
insertTAirChargeRecord
(
tAirChargeRecord
);
successNum
++;
successMsg
.
append
(
"<br/>"
+
successNum
+
"、气瓶条码为 "
+
tAirChargeRecord
.
getBottleCode
()
+
" 充装记录导入成功"
);
}
catch
(
Exception
e
)
{
failureNum
++;
String
msg
=
"<br/>"
+
failureNum
+
"、气瓶条码为 "
+
tAirChargeRecord
.
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/TAirChargeRecordMapper.xml
0 → 100644
View file @
44315ceb
<?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.TAirChargeRecordMapper"
>
<resultMap
type=
"TAirChargeRecord"
id=
"TAirChargeRecordResult"
>
<result
property=
"chargeRecordId"
column=
"charge_record_id"
/>
<result
property=
"stationId"
column=
"station_id"
/>
<result
property=
"bottleId"
column=
"bottle_id"
/>
<result
property=
"chargeOperator"
column=
"charge_operator"
/>
<result
property=
"chargeMeasure"
column=
"charge_measure"
/>
<result
property=
"chargeDate"
column=
"charge_date"
/>
<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"
/>
<result
property=
"bottleCode"
column=
"bottle_code"
/>
<result
property=
"bottleCapacity"
column=
"bottle_capacity"
/>
<result
property=
"bottleStatus"
column=
"bottle_status"
/>
<result
property=
"chargeOperatorName"
column=
"charge_operator_name"
/>
</resultMap>
<sql
id=
"selectTAirChargeRecordVo"
>
SELECT
charge.charge_record_id,
charge.station_id,
charge.bottle_id,
charge.charge_operator,
charge.charge_measure,
charge.charge_date,
charge.create_time,
charge.update_time,
charge.is_del,
charge.remark,
station.station_name,
bottle.bottle_code,
bottle.bottle_capacity,
bottle.bottle_status,
pr.name AS charge_operator_name
FROM
t_air_charge_record charge
LEFT JOIN t_gas_storage_station_info station ON station.station_id = charge.station_id
LEFT JOIN t_gas_bottle_info bottle ON bottle.bottle_id = charge.bottle_id
LEFT JOIN t_practitioner_info pr ON pr.practitioner_id = charge.charge_operator
</sql>
<select
id=
"selectTAirChargeRecordList"
parameterType=
"TAirChargeRecord"
resultMap=
"TAirChargeRecordResult"
>
<include
refid=
"selectTAirChargeRecordVo"
/>
<where>
<if
test=
"stationId != null "
>
and charge.station_id = #{stationId}
</if>
<if
test=
"bottleId != null "
>
and charge.bottle_id = #{bottleId}
</if>
<if
test=
"chargeOperator != null "
>
and charge.charge_operator = #{chargeOperator}
</if>
<if
test=
"chargeMeasure != null and chargeMeasure != ''"
>
and charge.charge_measure = #{chargeMeasure}
</if>
<if
test=
"chargeDate != null "
>
and charge.charge_date = #{chargeDate}
</if>
<if
test=
"isDel != null and isDel != ''"
>
and charge.is_del = #{isDel}
</if>
<if
test=
"chargeBeginTime != null and chargeEndTime != null"
>
and charge.charge_date BETWEEN #{chargeBeginTime} and #{chargeEndTime}
</if>
<if
test=
"bottleCode != null"
>
and bottle.bottle_code like concat('%', #{bottleCode}, '%')
</if>
</where>
</select>
<select
id=
"selectTAirChargeRecordById"
parameterType=
"Long"
resultMap=
"TAirChargeRecordResult"
>
<include
refid=
"selectTAirChargeRecordVo"
/>
where charge.charge_record_id = #{chargeRecordId}
</select>
<insert
id=
"insertTAirChargeRecord"
parameterType=
"TAirChargeRecord"
useGeneratedKeys=
"true"
keyProperty=
"chargeRecordId"
>
insert into t_air_charge_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"stationId != null"
>
station_id,
</if>
<if
test=
"bottleId != null"
>
bottle_id,
</if>
<if
test=
"chargeOperator != null"
>
charge_operator,
</if>
<if
test=
"chargeMeasure != null"
>
charge_measure,
</if>
<if
test=
"chargeDate != null"
>
charge_date,
</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=
"bottleId != null"
>
#{bottleId},
</if>
<if
test=
"chargeOperator != null"
>
#{chargeOperator},
</if>
<if
test=
"chargeMeasure != null"
>
#{chargeMeasure},
</if>
<if
test=
"chargeDate != null"
>
#{chargeDate},
</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=
"updateTAirChargeRecord"
parameterType=
"TAirChargeRecord"
>
update t_air_charge_record
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"stationId != null"
>
station_id = #{stationId},
</if>
<if
test=
"bottleId != null"
>
bottle_id = #{bottleId},
</if>
<if
test=
"chargeOperator != null"
>
charge_operator = #{chargeOperator},
</if>
<if
test=
"chargeMeasure != null"
>
charge_measure = #{chargeMeasure},
</if>
<if
test=
"chargeDate != null"
>
charge_date = #{chargeDate},
</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 charge_record_id = #{chargeRecordId}
</update>
<delete
id=
"deleteTAirChargeRecordById"
parameterType=
"Long"
>
delete from t_air_charge_record where charge_record_id = #{chargeRecordId}
</delete>
<delete
id=
"deleteTAirChargeRecordByIds"
parameterType=
"String"
>
delete from t_air_charge_record where charge_record_id in
<foreach
item=
"chargeRecordId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{chargeRecordId}
</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