Commit 722ccc94 authored by suhuiguang's avatar suhuiguang

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 55341fd3 fa0f84fe
......@@ -138,6 +138,8 @@ public class JgMaintenanceContractDto extends BaseDto {
private String createUserId;
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonSerialize(using = BizCustomDateSerializer.class)
private Date createDate;
@TableField("instance_status")
......@@ -154,15 +156,10 @@ public class JgMaintenanceContractDto extends BaseDto {
private List<String> roleIds;
/**
* 设备种类
*/
@ApiModelProperty(value = "设备种类")
private String equList;
/**
* 设备类别
*/
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备品种")
......@@ -174,17 +171,12 @@ public class JgMaintenanceContractDto extends BaseDto {
@ApiModelProperty(value = "设备代码")
private String equCode;
/**
* 工作流下一节点任务id
*/
@ApiModelProperty(value = "工作流下一节点任务id")
private String nextTaskId;
/**
* 下一节点可执行人
*/
@ApiModelProperty(value = "下一节点可执行人")
private String nextExecuteUserIds;
@ApiModelProperty(value = "使用单位统一信用代码-数据隔离使用")
private String useUnitCodeFilter;
......@@ -199,4 +191,7 @@ public class JgMaintenanceContractDto extends BaseDto {
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
@ApiModelProperty(value = "当前登陆人单位类型")
private String unitType;
}
......@@ -108,8 +108,12 @@ public class JgUseRegistrationDto extends BaseDto {
private String dataType;
@ApiModelProperty(value = "使用单位code")
private String unitCode;
@ApiModelProperty(value = "使用单位code:用作接收搜索条件")
private String useUnitCode;
private String isXixian;
private String currentUserId;
......
......@@ -11,20 +11,6 @@ import java.util.Map;
@Data
public class JgMaintenanceContractVo {
@TableField("使用单位-提交-是否可操作")
private Boolean submitIsFlag;
@TableField("使用单位-撤回-是否可操作")
private Boolean revocationIsFlag;
@TableField("维保单位-受理-是否可操作")
private Boolean handleIsFlag;
@TableField("维保单位-驳回-是否可操作")
private Boolean rejectedIsFlag;
@TableField("使用:0,维保:1,监管:2")
private String phase;
@TableField("维保备案编号")
private String applyNo;
......@@ -153,7 +139,6 @@ public class JgMaintenanceContractVo {
@ApiModelProperty("status")
private String status;
@ApiModelProperty("设备种类")
private String equList;
......@@ -162,18 +147,15 @@ public class JgMaintenanceContractVo {
private List<? extends Map<?,?>> equipmentLists;
/**
* 工作流下一节点任务id
*/
@ApiModelProperty("next_task_id")
@ApiModelProperty("工作流下一节点任务id")
private String nextTaskId;
/**
* 安全管理员姓名联系方式
*/
@ApiModelProperty("maintenance_manager_phone")
@ApiModelProperty("安全管理员姓名联系方式")
private String maintenanceManagerPhone;
@ApiModelProperty (value = "其他附件")
private JSONArray otherAccessories;
@ApiModelProperty(value = "当前登陆人单位类型")
private String unitType;
}
......@@ -174,29 +174,34 @@
AND ri."EQU_CODE" like concat('%',#{contractDto.equCode},'%')
</if>
-- 数据过滤开始 ----------------------------------------------------
<choose>
<when test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null and
contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
-- 同时有使用单位和维保单位用
and (
tjmc.use_unit_code = #{contractDto.useUnitCodeFilter}
or tjmc.maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}
or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )
)
</when>
<otherwise >
<!-- <choose>-->
<!-- <when test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null and-->
<!-- contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">-->
<!-- &#45;&#45; 同时有使用单位和维保单位用-->
<!-- and (-->
<!-- tjmc.use_unit_code = #{contractDto.useUnitCodeFilter}-->
<!-- or tjmc.maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}-->
<!-- or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )-->
<!-- )-->
<!-- </when>-->
<!-- <otherwise >-->
-- 只有使用单位或者维保单位用,或者都没有
<if test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null">
and (tjmc.use_unit_code = #{contractDto.useUnitCodeFilter} or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tjmc.use_unit_code = #{contractDto.useUnitCodeFilter}
or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
and (tjmc.maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter} or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tjmc.maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}
or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tjmc.status <![CDATA[<>]]> '使用单位待提交' and tjmc.status <![CDATA[<>]]> '待提交')
</if>
</otherwise>
</choose>
<!-- </otherwise>-->
<!-- </choose>-->
-- 监管单位用
<if test="contractDto.receiveOrgCodeFilter != '' and contractDto.receiveOrgCodeFilter != null">
and (tjmc.receive_org_code = #{contractDto.receiveOrgCodeFilter} or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tjmc.receive_org_code = #{contractDto.receiveOrgCodeFilter}
or tjmc.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tjmc.status <![CDATA[<>]]> '使用单位待提交' and tjmc.status <![CDATA[<>]]> '待提交')
</if>
-- 数据过滤结束 ----------------------------------------------------
</where>
......
......@@ -100,13 +100,16 @@
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and ur.use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="roleIds != null and dto.dataType == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
</foreach>
</if>
<if test="dto.dataType == 'supervision' ">
and ur.receive_company_code = #{dto.unitCode}
AND ur.receive_company_code = #{dto.receiveCompanyCode}
AND ur.instance_id <![CDATA[<>]]> ''
</if>
<if test="dto.dataType == 'company' ">
......@@ -163,6 +166,9 @@
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and ur.use_unit_credit_code = #{dto.useUnitCode}
</if>
GROUP BY re.equip_transfer_id
</where>)
order by
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
......@@ -94,17 +95,19 @@ public class JgUseRegistrationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto,
@ApiParam(value = "排序字段", required = false) @RequestParam(value = "sort", required = false) String sort,
@ApiParam(value = "排序字段") @RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size);
ReginParams info = getSelectedOrgInfo();
dto.setUnitCode(info.getCompany().getCompanyCode());
dto.setCurrentUserId(info.getUserModel().getUserId());
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
dto.setDataType(BaseController.COMPANY_TYPE_COMPANY);
dto.setUnitCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(info.getCompany().getCompanyType()) ?
info.getCompany().getCompanyCode().split("_")[1] : info.getCompany().getCompanyCode());
} else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
}
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds());
list.getRecords().forEach(x -> x.put("companyType", info.getCompany().getCompanyType()));
......
......@@ -124,6 +124,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
}
contractList = maintenanceContractMapper.getContractList(page, sortMap, dto, reginParams.getUserModel().getUserId());
List<JgMaintenanceContractDto> records = contractList.getRecords().stream().peek(x->x.setUnitType(company.getCompanyType())).collect(Collectors.toList());
contractList.setRecords(records);
BeanUtils.copyProperties(contractList, result);
return result;
}
......
......@@ -21,10 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService;
......@@ -348,8 +345,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private List<Map<String, Object>> handleUseRegistration(JSONObject map) {
try {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip(map, reginParams);
checkForRepeatUsedEquip(map, company);
// 使用登记信息
JgUseRegistration jgUseRegistration = new JgUseRegistration();
jgUseRegistration.setRegDate(new Date());
......@@ -358,8 +356,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
String supervisoryCode = otherInfo.getSupervisoryCode();
jgUseRegistration.setSupervisoryCode(supervisoryCode);
jgUseRegistration.setUseUnitName(String.valueOf(map.get("useUnitName")));
jgUseRegistration.setUseUnitCreditCode(String.valueOf(map.get("useUnitCreditCode")));
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) {
jgUseRegistration.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories")));
}
......@@ -378,7 +375,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
map.put("safetyManagerName", data[1]);
}
// 使用单位提交
jgUseRegistration.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
jgUseRegistration.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyName().split("_")[1] : company.getCompanyName());
jgUseRegistration.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] : company.getCompanyCode());
jgUseRegistration.setCreateUserId(reginParams.getUserModel().getUserId());
if (!ObjectUtils.isEmpty(map.get("inspectUnitCreditCode"))) {
jgUseRegistration.setInspectUnitCreditCode(map.get("inspectUnitCreditCode").toString());
......@@ -525,10 +525,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
});
}
private void checkForRepeatUsedEquip(JSONObject map, ReginParams reginParams) {
private void checkForRepeatUsedEquip(JSONObject map, CompanyBo company) {
if (!ObjectUtils.isEmpty(map.get("submit"))) {
// 流程中或已完成
EquipUsedCheckStrategyContext.getUsedStrategy("useRegister").equipRepeatUsedCheck(map.get("equipId").toString(), reginParams.getCompany().getCompanyCode());
EquipUsedCheckStrategyContext.getUsedStrategy("useRegister").equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode());
}
}
......@@ -579,9 +579,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setPromoter(reginParams.getUserModel().getUserId());
useRegistration.setCreateUserId(reginParams.getUserModel().getUserId());
// 使用单位信息
useRegistration.setUseUnitName(company.getCompanyName());
useRegistration.setUseUnitCreditCode(company.getCompanyCode());
List<LinkedHashMap> tree = commonService.getCreatTree();
useRegistration.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyName().split("_")[1] : company.getCompanyName());
useRegistration.setUseUnitCreditCode(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] : company.getCompanyCode());
// 接收单位信息
Optional.ofNullable(useRegistration.getReceiveOrgCode())
.filter(code -> code.contains("_"))
......
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