Commit 710a0a83 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents c001bdb8 a69a56f1
......@@ -20,7 +20,7 @@ public interface JgChangeRegistrationTransferMapper extends BaseMapper<JgChangeR
void updatePromoter(@Param ("id")Long id);
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page, @Param("dto") JgChangeRegistrationTransferDto dto , @Param("roleIds") List<String> roleIds, @Param("type") String type, @Param("currentUserId")String currentUserId);
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page, @Param("dto") JgChangeRegistrationTransferDto dto , @Param("type") String type, @Param("currentUserId")String currentUserId);
@Select("select name from tz_equipment_category where code=#{code}")
String getEquiplistNameByEquiplist(String code);
......
......@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationTransferDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
import java.util.Map;
......@@ -29,7 +28,7 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr, String equipId);
Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String type);
Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType);
void flowExecute(Long sequenceNbr, String instanceId, String operate, String comment);
......
......@@ -59,6 +59,7 @@
</if>
<if test="dto.type == 'supervision'">
AND ur.receive_company_code = #{companyCode}
AND ur.instance_id is not null
</if>
<if test="dto.type == 'company'">
and ur.use_unit_credit_code = #{dto.useUnitCreditCode}
......
......@@ -28,7 +28,8 @@
ur.promoter,
ur.supervisory_code as supervisoryCode,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId
from tzs_jg_change_registration_reform ur
LEFT JOIN tzs_jg_change_registration_reform_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
......@@ -55,6 +56,7 @@
</if>
<if test="dto.dataType != null and dto.dataType == 'supervision' ">
and ur.receive_org_code = #{dto.receiveOrgCode}
AND ur.instance_id <![CDATA[<>]]> ''
</if>
<if test="dto.dataType != null and dto.dataType == 'company' ">
and ur.use_unit_credit_code = #{dto.useUnitCreditCode}
......
......@@ -8,7 +8,8 @@
</update>
<select id="getListPage" resultType="java.util.Map">
select crt.sequence_nbr as sequenceNbr,
select * from
(select crt.sequence_nbr as sequenceNbr,
crt.audit_status as auditStatus,
crt.reg_date as regDate,
crt.use_unit_name as useUnitName,
......@@ -34,14 +35,13 @@
LEFT JOIN tzs_jg_change_registration_transfer_eq crteq on crt.sequence_nbr = crteq.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on crteq.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on crteq.equ_id = use.RECORD
<where>
and crt.is_delete = 0
<if test="dto.equCategory != null and dto.equCategory != ''">
and jri.EQU_CATEGORY = #{dto.equCategory}
</if>
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and crt.audit_status = #{dto.auditStatus}
and crt.audit_status like concat('%', #{dto.auditStatus},'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
......@@ -52,22 +52,79 @@
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and crt.receive_company_code = #{dto.receiveOrgCode}
</if>
<if test="roleIds != null and type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
crt.execute_sequence like concat('%',#{role},'%')
</foreach>
</if>
<if test="type == 'supervision'">
AND crt.receive_company_code = #{dto.unitCode}
</if>
<if test="type == 'company'">
AND crt.use_unit_credit_code = #{dto.unitCode}
</if>
<if test="currentUserId != null and currentUserId != '' ">
or (crt.transfer_to_user_ids like concat('%',#{currentUserId},'%') and crt.is_delete = 0)
<if test="dto.applyNo != null and dto.applyNo != ''">
and crt.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.productName != null and dto.productName != ''">
and jri.PRODUCT_NAME like concat('%',#{dto.productName},'%')
</if>
</where>
order by crt.rec_date desc
union
select crt.sequence_nbr as sequenceNbr,
crt.audit_status as auditStatus,
crt.reg_date as regDate,
crt.use_unit_name as useUnitName,
crt.status,
crt.receive_org_name as receiveOrgName,
crt.apply_no as applyNo,
crt.next_executor_ids AS nextExecutorIds,
crt.promoter,
crt.rec_date as recDate,
crt.instance_id as instanceId,
crt.use_registration_code as useRegistrationCode,
crt.next_execute_user_ids as nextExecuteUserIds,
crt.create_user_id as createUserId,
crt.full_address as allAddress,
crt.next_task_id as nextTaskId,
use.USE_UNIT_NAME as useUnitName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
crteq.equ_id as equipId
from tzs_jg_change_registration_transfer crt
LEFT JOIN tzs_jg_change_registration_transfer_eq crteq on crt.sequence_nbr = crteq.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on crteq.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on crteq.equ_id = use.RECORD
<where>
and crt.is_delete = 0
AND crt.transfer_to_user_ids like concat('%',#{currentUserId},'%')
<if test="dto.equCategory != null and dto.equCategory != ''">
and jri.EQU_CATEGORY = #{dto.equCategory}
</if>
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and crt.audit_status = concat('%',#{dto.auditStatus},'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.useUnitCreditCode != null and dto.useUnitCreditCode != ''">
and crt.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and crt.receive_company_code = #{dto.receiveOrgCode}
</if>
<if test="type == 'supervision'">
AND crt.receive_company_code = #{dto.unitCode}
AND crt.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND crt.use_unit_credit_code = #{dto.unitCode}
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and crt.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.productName != null and dto.productName != ''">
and jri.PRODUCT_NAME like concat('%',#{dto.productName},'%')
</if>
</where>)
order by recDate desc
</select>
</mapper>
......@@ -24,7 +24,8 @@
isn.audit_pass_date AS auditPassDate,
isn.equ_type AS equType,
isn.next_execute_user_ids as nextExecuteUserIds,
isn.next_task_id as nextTaskId
isn.next_task_id as nextTaskId,
isn.create_user_id as createUserId
FROM
tzs_jg_change_registration_unit isn
<where>
......@@ -48,7 +49,7 @@
</if>
<if test="type == 'supervision'">
AND isn.receive_org_code = #{orgCode}
AND isn.instance_id is not null
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'enterprise'">
AND isn.new_use_unit_credit_code = #{orgCode}
......
......@@ -102,7 +102,7 @@
</if>
<if test="param.installUnitCodeFilter != '' and param.installUnitCodeFilter != null">
and jet.install_unit_credit_code = #{param.installUnitCodeFilter}
AND jet.instance_id is not null
AND jet.instance_id <![CDATA[<>]]> ''
</if>
</otherwise>
</choose>
......
......@@ -57,14 +57,14 @@
</if>
<if test="type == 'supervision'">
AND isn.receive_org_credit_code = #{orgCode}
AND isn.instance_id is not null
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND isn.install_unit_credit_code = #{orgCode}
</if>
<if test="type == 'testAdmin'">
((AND isn.receive_org_credit_code = #{orgCode}
AND isn.instance_id is not null)
AND isn.instance_id <![CDATA[<>]]> '')
or
AND isn.install_unit_credit_code = #{orgCode})
</if>
......
......@@ -42,7 +42,7 @@
</if>
</if>
<if test="type != 'company'">
AND isn.instance_id is not null
AND isn.instance_id <![CDATA[<>]]> ''
AND isn.receive_company_code = #{orgCode}
</if>
<if test="type == 'company'">
......
......@@ -64,6 +64,7 @@
<if test="type == 'supervision'">
AND (isn.notice_status in ('6612', '6613', '6614', '6616') )
AND isn.receive_org_code = #{orgCode}
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND isn.install_unit_credit_code = #{orgCode}
......
......@@ -66,6 +66,7 @@
</if>
<if test="dto.type == 'supervision'">
and ( ur.receive_org_code = #{orgCode} or ur.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
AND ur.instance_id <![CDATA[<>]]> ''
</if>
<if test="dto.type == 'company' ">
and (ur.use_unit_code = #{orgCode} or ur.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
......
......@@ -78,14 +78,14 @@
</if>
<if test="type == 'supervision'">
AND tjtn.receive_company_code = #{orgCode}
AND tjtn.instance_id is not null
AND tjtn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND tjtn.install_unit_credit_code = #{orgCode}
</if>
<if test="type == 'testAdmin'">
((AND tjtn.receive_company_code = #{orgCode}
AND tjtn.instance_id is not null)
AND tjtn.instance_id <![CDATA[<>]]> '')
or
AND tjtn.install_unit_credit_code = #{orgCode})
</if>
......
......@@ -31,7 +31,8 @@
date_format(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
......@@ -59,6 +60,7 @@
</if>
<if test="dto.dataType == 'supervision' ">
and ur.receive_company_code = #{dto.unitCode}
AND ur.instance_id <![CDATA[<>]]> ''
</if>
<if test="dto.dataType == 'company' ">
and ur.use_unit_credit_code = #{dto.unitCode}
......
......@@ -153,8 +153,15 @@ public class JgChangeRegistrationTransferController extends BaseController {
@RequestParam(value = "size") int size,
JgChangeRegistrationTransferDto params) {
Page<Map<String, Object>> page = new Page<>(current, size);
String type = (String) iJgInstallationNoticeService.getCompanyType().get("companyLevel");
return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.queryListForPage(page,params, type));
ReginParams reginParams = getSelectedOrgInfo();
String companyTypeCode = "";
if(reginParams.getCompany().getLevel().equals(COMPANY_TYPE_COMPANY)){
companyTypeCode = COMPANY_TYPE_COMPANY;
} else {
companyTypeCode = COMPANY_TYPE_SUPERVISION;
}
params.setUnitCode(reginParams.getCompany().getCompanyCode());
return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.queryListForPage(page,params, companyTypeCode, reginParams.getCompany().getCompanyType()));
}
/**
......
......@@ -623,13 +623,13 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*
* @param page
* @param params
* @param companyTypeCode
* @param companyType
* @return
*/
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String type) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String currentUserId = reginParams.getUserModel().getUserId();
String companyType = reginParams.getCompany().getCompanyType();
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, params, params.getRoleIds(), type, currentUserId);
@Override
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType) {
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, params, companyTypeCode, RequestContext.getExeUserId());
listPage.getRecords().forEach(x-> x.put("companyType",companyType));
return listPage;
}
......
......@@ -144,10 +144,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
equipMap.put("equRegisterCode", equipMap.getOrDefault("equCode", ""));
for (String s : fields) {
if (installationInfo.containsKey(s)) {
installationInfo.put(s, JSON.parseArray(installationInfo.get(s).toString()));
installationInfo.put(s, JSON.parse(String.valueOf(installationInfo.get(s))));
}
if (equipMap.containsKey(s)) {
equipMap.put(s, JSON.parseArray(equipMap.get(s).toString()));
equipMap.put(s, JSON.parse(String.valueOf(equipMap.get(s))));
}
}
}
......
......@@ -754,7 +754,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
*/
private void fillHistoryDataWithNewEquip(JSONObject jsonObject, JgUseRegistration jgUseRegistration, String record) {
if(jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getReject())
|| jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getRollBack())){
|| jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getRollBack())
|| jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getPass())
){
// 基本信息 + 制造信息
Map<String, Object> detail = this.baseMapper.getDetail(record);
// 设计信息
......
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