Commit 02884ebe 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 c221bbbf bfcc62f7
......@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
......@@ -112,4 +111,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
/**
* 办理类型,unit(单位) set(台套)
*/
@ApiModelProperty(value = "办理类型")
private String manageType;
}
......@@ -193,10 +193,15 @@ public class JgUseRegistration extends BaseEntity {
@TableField(value = "transfer_to_user_ids")
private String transferToUserIds;
/**
* 其他附件
*/
@TableField(value = "other_accessories")
private String otherAccessories;
/**
* 办理类型,unit(单位) set(台套)
*/
@TableField(value = "manage_type")
private String manageType;
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -40,4 +41,17 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Map<String, Object> getiInstallDetail(@Param("id")String id);
Map<String, Object> getUseRegistrationDetail(@Param("id")String id);
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
@MapKey("records")
List<Map<String, Object>> queryForUnitVesselEquipment(@Param("records")List<String> records);
Page<JSONObject> queryForUnitPipelineEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
@MapKey("records")
List<Map<String, Object>> queryForUnitPipelineEquipment(@Param("records")List<String> records);
@MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id")Long id);
}
......@@ -105,7 +105,6 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.queryForEquipmentRegisterPage(jsonObject));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/category/list")
@ApiOperation(httpMethod = "GET", value = "查询不同单位类型可新增的设备种类列表", notes = "查询不同单位类型可新增的设备种类列表")
......@@ -121,5 +120,11 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), equList));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equip/page")
@ApiOperation(httpMethod = "GET", value = "单位办理设备列表查询", notes = "单位办理设备列表查询")
public ResponseModel<Page<JSONObject>> queryEquipPage(@RequestParam Map<String, Object> queryMap) {
JSONObject jsonObject = new JSONObject(queryMap);
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.queryForUnitEquipmentPage(jsonObject));
}
}
......@@ -75,8 +75,10 @@ public class JgInstallationNoticeController extends BaseController {
}
Object o = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("proxyStatementAttachment");
Object o1 = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("installContractAttachment");
Object o2 = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("otherAccessories");
installationInfo.setProxyStatementAttachmentList((List<Map<String, Object>>) o);
installationInfo.setInstallContractAttachmentList((List<Map<String, Object>>) o1);
installationInfo.setOtherAccessoriesList((List<Map<String, Object>>) o2);
return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateInstallationNotice(submitType,installationInfo, op));
}
......
......@@ -176,13 +176,14 @@ public class JgTransferNoticeController extends BaseController {
public void generateCertificateReport(HttpServletResponse response) {
Map<String, Object> map = new HashMap<>();
// 组装模板变量
map.put("useRegistrationCode", "202301256456"); // 编号
map.put("manageType", "unit"); // 编号
map.put("useRegistrationCode", "容3T陕A0001"); // 编号
map.put("useUnitName", "西安市高科物业服务有限公司"); // 使用单位名称
map.put("fullAddress", "西安市曲江新区春临东街南湖意境1单元2号楼"); // 设备使用地点
map.put("equList", "电梯"); // 设备种类
map.put("equDefine", "曳引驱动电梯啊啊啊啊啊啊啊啊啊啊啊啊啊"); // 设备品种
map.put("equipCode", ""); // 设备代码
map.put("equCategory", "曳引电梯噜啦噜啦嘞绿绿绿绿绿绿绿"); // 设备类别
map.put("equCategory", "压力管道"); // 设备类别
map.put("useInnerCode", "KY-9527555555555555"); // 单位内编号
map.put("factoryNum", "FUCK-G600010000056"); // 产品编号
map.put("receiveOrgName", "西安市曲江新区质检院"); // 登记机关
......
......@@ -54,6 +54,7 @@ public class JgUseRegistrationController extends BaseController {
String.valueOf(map.get("operate")),
String.valueOf(map.get("comment")),
String.valueOf(map.getOrDefault("carNumber","")),
String.valueOf(map.getOrDefault("manageType","")),
String.valueOf(map.get("nextTaskId")));
return ResponseHelper.buildResponse("ok");
}
......@@ -63,7 +64,8 @@ public class JgUseRegistrationController extends BaseController {
@PostMapping(value = "/withdraw")
@ApiOperation(httpMethod = "POST", value = "撤回", notes = "撤回")
public ResponseModel<Object> withdraw(@RequestBody JSONObject map) {
jgUseRegistrationServiceImpl.withdraw(String.valueOf(map.get("instanceId")), String.valueOf(map.get("nextTaskId")) );
jgUseRegistrationServiceImpl.withdraw(String.valueOf(map.get("instanceId")), String.valueOf(map.get("nextTaskId")),
String.valueOf(map.getOrDefault("manageType","unit")));
return ResponseHelper.buildResponse("ok");
}
......@@ -122,7 +124,8 @@ public class JgUseRegistrationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "详情", notes = "详情")
@GetMapping(value = "/getDetail")
public ResponseModel<Map<String, Object>> getDetail(@RequestParam("record") String record, @RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
public ResponseModel<Map<String, Object>> getDetail(@RequestParam(value = "record", required = false) String record,
@RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDetail(record, sequenceNbr));
}
......
package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import java.util.List;
/**
* 安全追溯-检验检测信息表接口类
*
......@@ -13,4 +13,6 @@ public interface IIdxBizJgInspectionDetectionInfoService {
boolean saveOrUpdateData(IdxBizJgInspectionDetectionInfo inspectionDetectionInfo);
IdxBizJgInspectionDetectionInfo queryNewestDetailByRecord(String record);
List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records);
}
......@@ -31,4 +31,6 @@ public interface IIdxBizJgRegisterInfoService {
Map<String, Object> getDetailFieldCamelCaseByRecord(String record);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList);
Page<JSONObject> queryForUnitEquipmentPage(JSONObject jsonObject);
}
......@@ -707,6 +707,8 @@ public class CommonServiceImpl implements ICommonService {
if (CollectionUtils.isEmpty(map)) {
throw new IllegalArgumentException("参数不能为空");
}
String wordPath = "equipment-registration-certificate-report.ftl";
wordPath = "unit".equals(map.get("manageType")) ? "unit-registration-certificate-report.ftl" : wordPath;
// 组装模板变量
map.put("useRegistrationCode", Optional.ofNullable(map.get("useRegistrationCode")).orElse("").toString()); // 编号
map.put("useUnitName", Optional.ofNullable(map.get("useUnitName")).orElse("").toString()); // 使用单位名称
......@@ -731,7 +733,7 @@ public class CommonServiceImpl implements ICommonService {
// word转pdf
File pdfFile;
try {
pdfFile = this.wordToPdf("特种设备使用登记证_", "equipment-registration-certificate-report.ftl", map);
pdfFile = this.wordToPdf("特种设备使用登记证_", wordPath, map);
} catch (Exception e) {
throw new RuntimeException(e);
}
......@@ -816,7 +818,7 @@ public class CommonServiceImpl implements ICommonService {
// 设置文本域的字体为中文字体
acroFields.setFieldProperty(param.getKey(), "textfont", font, null);
// 设置字体大小
acroFields.setFieldProperty(param.getKey(), "textsize", 9.0f, null);
acroFields.setFieldProperty(param.getKey(), "textsize", 12.0f, null);
// 将 map 中的值写到 pdf 模板对应的文本域中
acroFields.setField(param.getKey(), param.getValue() + "");
}
......
......@@ -37,4 +37,11 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
return result;
}
@Override
public List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records) {
IdxBizJgInspectionDetectionInfo result = new IdxBizJgInspectionDetectionInfo();
QueryWrapper<IdxBizJgInspectionDetectionInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(IdxBizJgInspectionDetectionInfo::getRecord, records).orderByDesc(IdxBizJgInspectionDetectionInfo::getInspectDate);
return list(queryWrapper);
}
}
\ No newline at end of file
......@@ -49,7 +49,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -281,6 +280,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return useTime <= 0;
}
private String getTipMsgString(String record) {
IdxBizJgRegisterInfo registerInfo = this.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", record));
return String.format("存在被引用的设备,设备代码:%s", registerInfo.getEquCode());
......@@ -769,6 +769,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
objMap.put("completedBusinessTypes",judgeTheBusinessAccordingByRecord(record,objMap));
// 账号类型(用于车用气瓶流程页面-》监管审核-》打开设备详情 时隐藏保存按钮)
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
objMap.put("accountType",reginParams.getCompany().getCompanyType());
return objMap;
}
......@@ -1710,4 +1713,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
return result;
}
@Override
public Page<JSONObject> queryForUnitEquipmentPage(JSONObject jsonObject) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String useUnitCreditCode = reginParams.getCompany().getCompanyCode();
jsonObject.put("useUnitCreditCode", useUnitCreditCode);
Page<JSONObject> page = new Page<>();
if ("8300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
return jgUseRegistrationMapper.queryForUnitPipelineEquipmentPage(page, jsonObject);
} else if ("2300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
return jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject);
}
return page;
}
}
\ No newline at end of file
......@@ -31,6 +31,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
......@@ -110,6 +112,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
private IdxBizJgOtherInfoMapper otherInfoMapper;
@Autowired
private JgUseRegistrationServiceImpl jgUseRegistrationService;
@Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
/**
* 新增(提交)车用气瓶
......@@ -126,6 +130,19 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
if (CollectionUtils.isEmpty(equipmentLists)) {
throw new BadRequest("请选择设备");
}
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream()
.map(v -> (String) v.get("record"))
.collect(Collectors.toList())
);
if (inspectionDetectionInfoList.stream().anyMatch(info ->
ObjectUtils.isEmpty(info) || ObjectUtils.isEmpty(info.getInspectType()) ||
ObjectUtils.isEmpty(info.getInspectConclusion()) || ObjectUtils.isEmpty(info.getInspectOrgCode()) ||
ObjectUtils.isEmpty(info.getInspectOrgName()))) {
throw new BadRequest("请补充设备检验检测信息后提交!");
}
CompanyBo company = reginParams.getCompany();
vehicleInfoDto.setCreateDate(new Date());
vehicleInfoDto.setPromoter(reginParams.getUserModel().getUserId());
......@@ -142,10 +159,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 使用单位信息
vehicleInfoDto.setUseUnitName(company.getCompanyName());
vehicleInfoDto.setUseUnitCreditCode(company.getCompanyCode());
List<LinkedHashMap> tree = commonService.getCreatTree();
// 接收单位信息
if (!StringUtils.isEmpty(vehicleInfoDto.getReceiveOrgCode())) {
List<LinkedHashMap> tree = commonService.getCreatTree();
String[] splitReceiveOrgCode = vehicleInfoDto.getReceiveOrgCode().split("_");
String orgCode = this.recursiveMatching(tree, splitReceiveOrgCode[0]);
vehicleInfoDto.setReceiveOrgCode(orgCode);
......@@ -612,7 +629,15 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
jgVehicleInformation.setNextExecuteUserIds("");
// 生成使用登记证编号
String code = this.getUseRegistrationCode(jgVehicleInformation.getVehicleApanage());
String receiveCompanyCode = jgVehicleInformation.getReceiveCompanyCode();
CompanyModel receiveCompanyResult = Privilege.companyClient.queryByCompanyCode(receiveCompanyCode).getResult();
//查询到局级
// 如果不是局级公司,则查询其上级公司信息
if (!"prefecture-level".equals(receiveCompanyResult.getLevel())) {
CompanyModel receiveParentResult = Privilege.companyClient.seleteOne(receiveCompanyResult.getParentId()).getResult();
receiveCompanyCode = receiveParentResult.getCompanyCode();
}
String code = generateVehicleUseRegistrationCode(receiveCompanyCode);
jgVehicleInformation.setUseRegistrationCode(code);
jgVehicleInformation.setAuditPassDate(new Date());
......@@ -680,6 +705,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
param.put("EQU_STATE", 1);
param.put("ORG_BRANCH_CODE", jgVehicleInformation.getOrgBranchCode());
param.put("ORG_BRANCH_NAME", jgVehicleInformation.getOrgBranchName());
param.put("EQU_CODE", dataMap.get("equCode"));
param.put("USE_ORG_CODE", jgVehicleInformation.getUseRegistrationCode());
objMap.put((String) dataMap.get("record"), param);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
......@@ -852,14 +878,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
}
/**
* @param vehicleApa 车辆属地
* 根据车辆属地生成使用登记证
* @param receiveCompanyCode 车辆属地
* @return String
* @deprecated 根据车辆属地生成使用登记证
*/
public String getUseRegistrationCode(String vehicleApa) {
private String generateVehicleUseRegistrationCode(String receiveCompanyCode) {
StringBuilder useRegistration = new StringBuilder("容3T");
if (!ObjectUtils.isEmpty(vehicleApa)) {
ResponseModel<String> stringResponseModel = tzsServiceFeignClient.useRegistrationCode(useRegistration.append(VehicleApanageEnum.of(vehicleApa)) + "");
if (!ObjectUtils.isEmpty(receiveCompanyCode)) {
ResponseModel<String> stringResponseModel = tzsServiceFeignClient.useRegistrationCode(useRegistration.append(VehicleApanageEnum.of(receiveCompanyCode)) + "");
return stringResponseModel.getResult();
}
return null;
......
......@@ -312,6 +312,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
// 事业单位信息
private TzsBaseInstitution regUnitMessage;
// 工商和许可信息是否可编辑
// 工商信息是否可编辑
private String canEdit;
// 许可信息是否可编辑
private String licenseCanEdit;
}
......@@ -250,6 +250,7 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitIcDto.setIsNotAccess("1");
// 判断是否可以让用户编辑工商及许可信息 事业单位、个人主体或省外企业都可编辑
tzBaseEnterpriseInfoDto.setCanEdit("0");
tzBaseEnterpriseInfoDto.setLicenseCanEdit("1");
} else {
regUnitIcDto = tzBaseEnterpriseInfoDto.getRegUnitIcDto();
regUnitIcDto.setIsNotAccess("0");
......@@ -260,6 +261,7 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitIcDto.setRegisterAddressList(addressList);
// 判断是否可以让用户编辑工商及许可信息 事业单位、个人主体或省外企业都可编辑
tzBaseEnterpriseInfoDto.setCanEdit("1");
tzBaseEnterpriseInfoDto.setLicenseCanEdit("1");
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
tzBaseEnterpriseInfoDto.setApprovalTime(regUnitIcDto.getApprovedDate());
......
......@@ -187,11 +187,17 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
// 2.异步调用ugp,同步公司数据
FutureTask<ResponseModel<Boolean>> future = getResponseModelFutureTask(model);
// 3.插入单位注册许可信息表:tz_base_unit_licence
// 3.1先删除已有许可信息 (2024-04-02放开企业许可信息编辑功能)
LambdaQueryWrapper<BaseUnitLicence> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseUnitLicence::getUnitCode, model.getUnitCode());
baseUnitLicenceService.remove(queryWrapper);
// 3.2再插入新许可信息
List<BaseUnitLicence> baseUnitLicences = model.getUnitLicences().stream().map(s -> {
s.setUnitCode(model.getUnitCode());
s.setUnitName(model.getName());
BaseUnitLicence target = new BaseUnitLicence();
Bean.copyExistPropertis(s, target);
target.setSequenceNbr(null);
return target;
}).collect(Collectors.toList());
if (!baseUnitLicences.isEmpty()) {
......
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......
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