Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
c9b389a2
Commit
c9b389a2
authored
Dec 26, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
2c62b9ae
ae63084e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
180 additions
and
222 deletions
+180
-222
JgEnableDisableDto.java
...ejoin/amos/boot/module/jg/api/dto/JgEnableDisableDto.java
+5
-0
WorkFlowStatusEnum.java
...oin/amos/boot/module/jg/api/enums/WorkFlowStatusEnum.java
+9
-1
JgEnableDisableMapper.java
...amos/boot/module/jg/api/mapper/JgEnableDisableMapper.java
+8
-0
IJgEquipTransferService.java
...s/boot/module/jg/api/service/IJgEquipTransferService.java
+0
-8
JgChangeRegistrationUnitMapper.xml
.../main/resources/mapper/JgChangeRegistrationUnitMapper.xml
+3
-2
JgEnableDisableMapper.xml
...g-api/src/main/resources/mapper/JgEnableDisableMapper.xml
+68
-0
JgEnableDisableController.java
...t/module/jg/biz/controller/JgEnableDisableController.java
+41
-60
JgEquipTransferController.java
...t/module/jg/biz/controller/JgEquipTransferController.java
+1
-2
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+10
-107
JgEnableDisableServiceImpl.java
...odule/jg/biz/service/impl/JgEnableDisableServiceImpl.java
+0
-0
JgEquipTransferServiceImpl.java
...odule/jg/biz/service/impl/JgEquipTransferServiceImpl.java
+35
-42
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgEnableDisableDto.java
View file @
c9b389a2
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.List
;
/**
*
...
...
@@ -75,4 +76,8 @@ public class JgEnableDisableDto extends BaseDto {
@ApiModelProperty
(
value
=
"申请类型(1启用,0停用)"
)
private
String
applyType
;
private
List
<
String
>
roleIds
;
private
String
type
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/WorkFlowStatusEnum.java
View file @
c9b389a2
...
...
@@ -71,7 +71,15 @@ public enum WorkFlowStatusEnum {
UNITCHANGE_SUBMIT
(
"使用单位提交"
,
"unitChangeSubmit"
,
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
),
UNITCHANGE_RECEIVE
(
"一级受理"
,
"unitChangeReceive"
,
"一级待受理"
,
"二级受理已驳回"
,
"一级受理已撤回"
),
UNITCHANGE_PRELIMINARY
(
"二级受理"
,
"unitChangePreliminary"
,
"二级待受理"
,
"三级受理已驳回"
,
"二级受理已撤回"
),
UNITCHANGE_REEXAMINE
(
"三级受理"
,
"unitChangeReexamine"
,
"三级待受理"
,
""
,
""
);
UNITCHANGE_REEXAMINE
(
"三级受理"
,
"unitChangeReexamine"
,
"三级待受理"
,
""
,
""
),
/**
* 停用启用流程
*/
ENABLE_SUBMIT
(
"使用单位提交"
,
"enableSubmit"
,
"待提交"
,
"已驳回"
,
"已撤回"
),
ENABLE_RECEIVE
(
"监管受理"
,
"enableReceive"
,
"待受理"
,
""
,
""
);
private
final
String
name
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgEnableDisableMapper.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* Mapper 接口
...
...
@@ -11,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
JgEnableDisableMapper
extends
BaseMapper
<
JgEnableDisable
>
{
Page
<
Map
<
String
,
Object
>>
pageList
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"dto"
)
JgEnableDisableDto
dto
);
Map
<
String
,
Object
>
getDetail
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgEquipTransferService.java
View file @
c9b389a2
...
...
@@ -34,12 +34,4 @@ public interface IJgEquipTransferService extends IService<JgEquipTransfer> {
* @return 设备移交详情
*/
Map
<
String
,
Object
>
queryBySequenceNbr
(
Long
sequenceNbr
);
/**
* 保存设备移交接口
* @param submitType 按钮类型
* @param dto dto
* @param selectedOrgInfo reginParams
*/
void
saveEquipTransfer
(
String
submitType
,
Map
<
String
,
JgEquipTransferDto
>
dto
,
ReginParams
selectedOrgInfo
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationUnitMapper.xml
View file @
c9b389a2
...
...
@@ -58,7 +58,8 @@
</if>
</where>
ORDER BY
isn.create_date,isn.apply_no DESC
isn.create_date DESC, isn.apply_no DESC
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
...
...
@@ -67,7 +68,7 @@
isn.apply_no AS applyNo,
isn.change_certificate AS changeCertificate,
isn.remark AS remark,
isn.
use_regist_code
AS equRegisterCode,
isn.
equ_code_b
AS equRegisterCode,
ri.equ_list AS equList,
ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgEnableDisableMapper.xml
View file @
c9b389a2
...
...
@@ -2,4 +2,72 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper"
>
<select
id=
"pageList"
resultType=
"java.util.Map"
>
SELECT jed.sequence_nbr as sequenceNbr,
jed.apply_no as applyNo,
date_format(jed.apply_date, '%Y-%m-%d') as applyDate,
CASE
when
jed.apply_type = 1 then '停用'
else '启用' end as applyType,
jri.USE_ORG_CODE as useOrgCode,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.PRODUCT_NAME as productName,
use.USE_UNIT_NAME as useUnitName,
jed.receive_org_name as receiveOrgName,
concat(use."PROVINCE_NAME", '-', use."CITY_NAME", '-', use."COUNTY_NAME", '-', use."ADDRESS") as address,
use."USE_INNER_CODE" as useInnerCode,
jed.audit_status as auditStatus,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
jed.instance_id as instanceId,
jed.execute_sequence as executeSequence,
jed.next_executor_ids as nextExecutorIds,
jed.promoter
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
<where>
<if
test=
"dto.applyNo != null and dto.applyNo != '' "
>
and jed.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if
test=
"dto.applyNo != null and dto.applyNo != '' "
>
and jed.apply_no = #{dto.receiveOrgCode}
</if>
<if
test=
"dto.auditStatus != null and dto.auditStatus != '' "
>
and jed.audit_status = #{dto.auditStatus}
</if>
<if
test=
"dto.type == 'enterprise'"
>
and jed.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if
test=
"dto.type == 'supervision'"
>
and jed.receive_org_code = #{dto.useUnitCreditCode}
</if>
<if
test=
"dto.roleIds != null and dto.type == 'supervision'"
>
<foreach
collection=
'dto.roleIds'
item=
'role'
open=
'and ('
close=
')'
separator=
'or'
>
execute_sequence like concat('%',#{role},'%')
</foreach>
</if>
</where>
order by jed.rec_date desc
</select>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
SELECT jed.sequence_nbr as sequenceNbr,
concat(jed.receive_org_code,'_',jed.receive_org_name) as receiveOrgCode,
concat(use."PROVINCE_NAME", use."CITY_NAME", use."COUNTY_NAME", use."ADDRESS",
use.STREET_NAME) as address,
jri.EQU_CODE as equCode,
jed.apply_type as applyType,
jed.remark,
use.RECORD as record,
jfi.FACTORY_NUM as factoryNum
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
where jed.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgEnableDisableController.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
...
...
@@ -18,8 +26,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
*
*
* @author system_generator
* @date 2023-12-25
*/
...
...
@@ -39,78 +45,53 @@ public class JgEnableDisableController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
JgEnableDisableDto
>
save
(
@RequestBody
JgEnableDisableDto
model
)
{
model
=
jgEnableDisableServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
Object
>
save
(
@RequestBody
JSONObject
map
)
{
jgEnableDisableServiceImpl
.
saveOrUpdate
(
map
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
JgEnableDisableDto
>
updateBySequenceNbrJgEnableDisable
(
@RequestBody
JgEnableDisableDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
updateWithModel
(
model
));
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"使用登记设备关系表分页查询"
,
notes
=
"使用登记设备关系表分页查询"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
page
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
JgEnableDisableDto
dto
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
pageList
(
page
,
dto
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
removeById
(
sequenceNbr
));
@PostMapping
(
value
=
"/flowExecute"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行流程"
,
notes
=
"执行流程"
)
public
ResponseModel
<
Object
>
flowExecute
(
@RequestBody
JSONObject
map
)
{
jgEnableDisableServiceImpl
.
flowExecute
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))),
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
JgEnableDisableDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryBySeq
(
sequenceNbr
));
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
jgEnableDisableServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
JgEnableDisableDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
JgEnableDisableDto
>
page
=
new
Page
<
JgEnableDisableDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryForJgEnableDisablePage
(
page
));
@DeleteMapping
(
value
=
"/deleteMessage"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除"
,
notes
=
"删除"
)
public
ResponseModel
<
Object
>
deleteMessage
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
jgEnableDisableServiceImpl
.
deleteMessage
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询
"
)
@GetMapping
(
value
=
"/list
"
)
public
ResponseModel
<
List
<
JgEnableDisableDto
>>
selectForList
(
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryForJgEnableDisableList
(
));
@GetMapping
(
value
=
"/detail
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"详情"
,
notes
=
"详情
"
)
public
ResponseModel
<
Object
>
detail
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
getDetail
(
sequenceNbr
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgEquipTransferController.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.jg.api.common.BaseException
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
...
@@ -132,7 +131,7 @@ public class JgEquipTransferController extends BaseController {
String
companyCode
=
companyModels
.
get
(
0
).
getCompanyCode
();
String
companyName
=
companyModels
.
get
(
0
).
getCompanyName
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"个人主体"
.
equals
(
companyType
))
{
if
(
"个人主体"
.
equals
(
companyType
))
{
map
.
put
(
"useUnitName"
,
companyName
.
split
(
"_"
)[
1
]);
map
.
put
(
"useUnitCreditCode"
,
companyCode
.
split
(
"_"
)[
1
]);
map
.
put
(
"companyType"
,
"person"
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
View file @
c9b389a2
...
...
@@ -297,112 +297,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
this
.
updateBatchById
(
JgChangeRegistrationUnits
);
}
/**
* 打印单位变更单
*
* @param sequenceNbr 主键
* @return pdf文件路径
*/
@Override
public
String
generateInstallationNoticeReport
(
Long
sequenceNbr
)
{
if
(
Objects
.
isNull
(
sequenceNbr
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
JgChangeRegistrationUnit
JgChangeRegistrationUnit
=
this
.
getById
(
sequenceNbr
);
List
<
Map
<
String
,
Object
>>
informationList
=
JgChangeRegistrationUnitMapper
.
queryEquipInformation
(
sequenceNbr
);
if
(
Objects
.
isNull
(
JgChangeRegistrationUnit
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"单位变更单不存在"
);
}
Map
<
String
,
Object
>
installation
=
informationList
.
get
(
0
);
Function
<
String
,
String
>
getValue
=
key
->
installation
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
placeholders
.
put
(
"sequenceNbr"
,
getValue
.
apply
(
"sequenceNbr"
));
placeholders
.
put
(
"installUnitName"
,
getValue
.
apply
(
"installUnitName"
));
placeholders
.
put
(
"applyNo"
,
getValue
.
apply
(
"applyNo"
));
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
// TODO: 出厂编号
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"单位变更"
);
// TODO: 施工类别
placeholders
.
put
(
"installLicenseNo"
,
getValue
.
apply
(
"installLicenseNo"
));
placeholders
.
put
(
"installLicenseExpirationDate"
,
getValue
.
apply
(
"installLicenseExpirationDate"
));
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"useUnitName"
,
getValue
.
apply
(
"useUnitName"
));
placeholders
.
put
(
"useUnitLeaderName"
,
getValue
.
apply
(
"safetyManager"
));
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"address"
));
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"applyNo"
),
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
// word转pdf
File
pdfFile
;
try
{
pdfFile
=
this
.
wordToPdf
(
"installation-notification-report.ftl"
,
placeholders
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
// 上传pdf至文件服务器
String
url
=
this
.
uploadFile
(
pdfFile
);
// 删除临时文件
try
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
catch
(
IOException
e
)
{
log
.
error
(
"删除临时文件失败:{}"
,
e
);
}
// 更新到数据库
// JgChangeRegistrationUnit.setNoticeReportUrl(url);
this
.
updateById
(
JgChangeRegistrationUnit
);
return
url
;
}
/**
* word 转 pdf
*
* @param wordPath word文件路径
*/
private
File
wordToPdf
(
String
wordPath
,
Map
<
String
,
Object
>
placeholders
)
throws
Exception
{
Assert
.
hasText
(
wordPath
,
"word文件路径不能为空"
);
String
tempFileName
=
"单位变更单_"
+
System
.
currentTimeMillis
()
+
"_temp.pdf"
;
WordTemplateUtils
instance
=
WordTemplateUtils
.
getInstance
();
return
instance
.
fillAndConvertDocFile
(
wordPath
,
tempFileName
,
placeholders
,
SaveFormat
.
PDF
);
}
/**
* 上传文件至文件服务器
*
* @param file 文件
*/
private
String
uploadFile
(
File
file
)
{
Assert
.
notNull
(
file
,
"文件不能为空"
);
MultipartFile
multipartFile
=
new
ByteArrayMultipartFile
(
"file"
,
"file.pdf"
,
"application/pdf"
,
file2byte
(
file
));
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
multipartFile
);
String
urlString
=
""
;
if
(
result
!=
null
)
{
for
(
String
s
:
result
.
getResult
().
keySet
())
{
urlString
=
s
;
}
}
return
urlString
;
}
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
...
...
@@ -509,7 +403,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
dto
.
setEquType
((
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY"
))));
dto
.
setProductNameB
((
String
.
valueOf
(
obj
.
get
(
"PRODUCT_NAME"
))));
dto
.
setEquCodeB
((
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
))));
dto
.
setUseInnerCode
(
(
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)
)));
dto
.
setUseInnerCode
(
ValidationUtil
.
isEmpty
(
obj
.
get
(
"USE_INNER_CODE"
))
?
""
:
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)));
dto
.
setEquAddress
((
String
.
valueOf
(
obj
.
get
(
"ADDRESS"
))));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
...
...
@@ -573,6 +467,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
String
newUseUnitId
=
model
.
getNewUseUnitCreditCode
();
if
(!
ObjectUtils
.
isEmpty
(
newUseUnitId
))
{
String
[]
newUseUnitList
=
newUseUnitId
.
split
(
"_"
);
if
(
newUseUnitList
.
length
>
1
)
{
model
.
setNewUseUnitCreditCode
(
newUseUnitList
[
0
]);
model
.
setNewUseUnitName
(
newUseUnitList
[
1
]);
}
}
String
receiveOrgCode
=
model
.
getReceiveOrgCode
();
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgCode
))
{
String
[]
receiveOrgCodeList
=
receiveOrgCode
.
split
(
"_"
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgEnableDisableServiceImpl.java
View file @
c9b389a2
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgEquipTransferServiceImpl.java
View file @
c9b389a2
This diff is collapsed.
Click to expand it.
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