Compare commits
No commits in common. "7e7c063b9409f2d2c8ab42e89600c927703d0d5e" and "55317974622598b7d52742113227ac43c50b2103" have entirely different histories.
7e7c063b94
...
5531797462
|
|
@ -1,16 +1,12 @@
|
|||
package org.qinan.safetyeval.app.change.convertor;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
import org.qinan.safetyeval.client.co.QualFilingChangeAggregationCO;
|
||||
import org.qinan.safetyeval.client.dto.QualFilingChangeAddCmd;
|
||||
import org.qinan.safetyeval.domain.entity.QualFilingChangeEntity;
|
||||
import org.qinan.safetyeval.domain.entity.QualFilingEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备案变更基本信息命令转换
|
||||
*
|
||||
|
|
@ -25,7 +21,6 @@ public interface QualFilingChangeCmdConvertor {
|
|||
* @param qualFilingChangeAddCmd
|
||||
* @return
|
||||
*/
|
||||
@Mapping(target = "businessScope", source = "businessScope", qualifiedByName = "listToJsonString")
|
||||
QualFilingChangeEntity convertCmdToE(QualFilingChangeAddCmd qualFilingChangeAddCmd);
|
||||
|
||||
/**
|
||||
|
|
@ -46,16 +41,5 @@ public interface QualFilingChangeCmdConvertor {
|
|||
* @param changeEntity changeEntity
|
||||
* @return QualFilingChangeAggregationCO
|
||||
*/
|
||||
@Mapping(target = "businessScope", source = "businessScope", qualifiedByName = "jsonStringToList")
|
||||
QualFilingChangeAggregationCO convertChangeEToQualFilingChangeAggregationCO(QualFilingChangeEntity changeEntity);
|
||||
|
||||
@Named("listToJsonString")
|
||||
default String listToJsonString(List<String> list) {
|
||||
return list == null ? null : JSON.toJSONString(list);
|
||||
}
|
||||
|
||||
@Named("jsonStringToList")
|
||||
default List<String> jsonStringToList(String json) {
|
||||
return json == null || json.isEmpty() ? null : JSON.parseArray(json, String.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package org.qinan.safetyeval.app.executor;
|
|||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.qinan.safetyeval.app.change.convertor.*;
|
||||
import org.qinan.safetyeval.app.orchestrator.QualFilingOrchestrator;
|
||||
import org.qinan.safetyeval.client.api.QualFilingChangeApi;
|
||||
|
|
@ -100,7 +99,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
entity.setFilingUnitTypeCode(cmd.getFilingUnitTypeCode());
|
||||
entity.setFilingUnitTypeName(cmd.getFilingUnitTypeName());
|
||||
entity.setFilingNo(cmd.getFilingNo());
|
||||
entity.setBusinessScope(JSON.toJSONString(cmd.getBusinessScope()));
|
||||
entity.setBusinessScope(cmd.getBusinessScope());
|
||||
entity.setRegisterAddress(cmd.getRegisterAddress());
|
||||
entity.setOfficeAddress(cmd.getOfficeAddress());
|
||||
entity.setCreditCode(cmd.getCreditCode());
|
||||
|
|
@ -138,7 +137,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
entity.setFilingUnitTypeCode(cmd.getFilingUnitTypeCode());
|
||||
entity.setFilingUnitTypeName(cmd.getFilingUnitTypeName());
|
||||
entity.setFilingNo(cmd.getFilingNo());
|
||||
entity.setBusinessScope(JSON.toJSONString(cmd.getBusinessScope()));
|
||||
entity.setBusinessScope(cmd.getBusinessScope());
|
||||
entity.setRegisterAddress(cmd.getRegisterAddress());
|
||||
entity.setOfficeAddress(cmd.getOfficeAddress());
|
||||
entity.setCreditCode(cmd.getCreditCode());
|
||||
|
|
@ -651,7 +650,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
|||
co.setFilingUnitTypeCode(entity.getFilingUnitTypeCode());
|
||||
co.setFilingUnitTypeName(entity.getFilingUnitTypeName());
|
||||
co.setFilingNo(entity.getFilingNo());
|
||||
co.setBusinessScope(JSON.parseArray(entity.getBusinessScope(), String.class));
|
||||
co.setBusinessScope(entity.getBusinessScope());
|
||||
co.setRegisterAddress(entity.getRegisterAddress());
|
||||
co.setOfficeAddress(entity.getOfficeAddress());
|
||||
co.setCreditCode(entity.getCreditCode());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.qinan.safetyeval.app.executor;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.qinan.safetyeval.app.orchestrator.QualFilingOrchestrator;
|
||||
import org.qinan.safetyeval.client.api.QualFilingApi;
|
||||
import org.qinan.safetyeval.client.change.request.QualFilingCommitmentChangeAddCmd;
|
||||
|
|
@ -69,7 +68,7 @@ public class QualFilingExecutor implements QualFilingApi {
|
|||
entity.setFilingUnitTypeCode(cmd.getFilingUnitTypeCode());
|
||||
entity.setFilingUnitTypeName(cmd.getFilingUnitTypeName());
|
||||
entity.setFilingNo(cmd.getFilingNo());
|
||||
entity.setBusinessScope(JSON.toJSONString(cmd.getBusinessScope()));
|
||||
entity.setBusinessScope(cmd.getBusinessScope());
|
||||
entity.setRegisterAddress(cmd.getRegisterAddress());
|
||||
entity.setOfficeAddress(cmd.getOfficeAddress());
|
||||
entity.setCreditCode(cmd.getCreditCode());
|
||||
|
|
@ -168,7 +167,6 @@ public class QualFilingExecutor implements QualFilingApi {
|
|||
// 拷贝基本信息
|
||||
QualFilingEntity entity = new QualFilingEntity();
|
||||
BeanUtils.copyProperties(cmd.getQualFilingAddCmd(),entity);
|
||||
entity.setBusinessScope(JSON.toJSONString(cmd.getQualFilingAddCmd().getBusinessScope()));
|
||||
//备案承诺书
|
||||
QualFilingCommitmentEntity commitmentEntity = new QualFilingCommitmentEntity();
|
||||
BeanUtils.copyProperties(cmd.getQualFilingCommitmentAddCmd(),commitmentEntity);
|
||||
|
|
@ -215,7 +213,6 @@ public class QualFilingExecutor implements QualFilingApi {
|
|||
QualFilingDO qualFilingDO = qualFilingMapper.selectById(cmd.getFilingId());
|
||||
QualFilingChangeAddCmd qualFilingChangeAddCmd = new QualFilingChangeAddCmd();
|
||||
BeanUtils.copyProperties(qualFilingDO, qualFilingChangeAddCmd, "id");
|
||||
qualFilingChangeAddCmd.setBusinessScope(JSON.parseArray(qualFilingDO.getBusinessScope(), String.class));
|
||||
qualFilingChangeAddCmd.setFilingId(qualFilingDO.getId());
|
||||
cmdSync.setQualFilingChangeAddCmd(qualFilingChangeAddCmd);
|
||||
// 备案承诺书
|
||||
|
|
@ -270,7 +267,7 @@ public class QualFilingExecutor implements QualFilingApi {
|
|||
co.setFilingUnitTypeCode(entity.getFilingUnitTypeCode());
|
||||
co.setFilingUnitTypeName(entity.getFilingUnitTypeName());
|
||||
co.setFilingNo(entity.getFilingNo());
|
||||
co.setBusinessScope(JSON.parseArray(entity.getBusinessScope(), String.class));
|
||||
co.setBusinessScope(entity.getBusinessScope());
|
||||
co.setRegisterAddress(entity.getRegisterAddress());
|
||||
co.setOfficeAddress(entity.getOfficeAddress());
|
||||
co.setCreditCode(entity.getCreditCode());
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package org.qinan.safetyeval.app.orchestrator;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.qinan.safetyeval.app.support.*;
|
||||
import org.qinan.safetyeval.client.co.*;
|
||||
import org.qinan.safetyeval.client.dto.QualFilingModifyCmd;
|
||||
|
|
@ -618,7 +616,7 @@ public class QualFilingOrchestrator {
|
|||
entity.setFilingNo(cmd.getFilingNo());
|
||||
}
|
||||
if (cmd.getBusinessScope() != null) {
|
||||
entity.setBusinessScope(JSONUtil.toJsonStr(cmd.getBusinessScope()));
|
||||
entity.setBusinessScope(cmd.getBusinessScope());
|
||||
}
|
||||
if (cmd.getRegisterAddress() != null) {
|
||||
entity.setRegisterAddress(cmd.getRegisterAddress());
|
||||
|
|
@ -694,7 +692,7 @@ public class QualFilingOrchestrator {
|
|||
co.setFilingUnitTypeCode(entity.getFilingUnitTypeCode());
|
||||
co.setFilingUnitTypeName(entity.getFilingUnitTypeName());
|
||||
co.setFilingNo(entity.getFilingNo());
|
||||
co.setBusinessScope(JSON.parseArray(entity.getBusinessScope(), String.class));
|
||||
co.setBusinessScope(entity.getBusinessScope());
|
||||
co.setRegisterAddress(entity.getRegisterAddress());
|
||||
co.setOfficeAddress(entity.getOfficeAddress());
|
||||
co.setCreditCode(entity.getCreditCode());
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ package org.qinan.safetyeval.client.co;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.qinan.safetyeval.domain.constant.IndustryEnum;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资质备案申请CO(Client Object)
|
||||
|
|
@ -39,7 +37,7 @@ public class QualFilingCO {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "经营范围")
|
||||
private List<String> businessScope;
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
private String registerAddress;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package org.qinan.safetyeval.client.co;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -45,7 +43,7 @@ public class QualFilingChangeCO {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "经营范围")
|
||||
private List<String> businessScope;
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
private String registerAddress;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资质备案申请新增命令
|
||||
|
|
@ -36,7 +35,7 @@ public class QualFilingAddCmd {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "备案安全评价业务范围")
|
||||
private List<String> businessScope;
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
private String registerAddress;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import javax.validation.constraints.Max;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备案变更新增命令
|
||||
|
|
@ -55,7 +54,8 @@ public class QualFilingChangeAddCmd {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "备案安全评价业务范围")
|
||||
private List<String> businessScope;
|
||||
@Size(max = 512, message = "备案安全评价业务范围不能超过512个字符")
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
@Size(max = 128, message = "注册地址不能超过128个字符")
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ package org.qinan.safetyeval.client.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -39,7 +37,7 @@ public class QualFilingChangeModifyCmd {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "备案安全评价业务范围")
|
||||
private List<String> businessScope;
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
private String registerAddress;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package org.qinan.safetyeval.client.dto;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -35,7 +34,7 @@ public class QualFilingModifyCmd {
|
|||
private String filingNo;
|
||||
|
||||
@ApiModelProperty(value = "备案安全评价业务范围")
|
||||
private List<String> businessScope;
|
||||
private String businessScope;
|
||||
|
||||
@ApiModelProperty(value = "注册地址")
|
||||
private String registerAddress;
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
package org.qinan.safetyeval.infrastructure.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||
import org.apache.ibatis.type.MappedTypes;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MyBatis TypeHandler: 在数据库的 varchar/text 列中以 JSON 数组字符串形式存储 List<String>。
|
||||
* <p>
|
||||
* 入库: List<String> -> JSON.toJSONString -> String
|
||||
* 出库: String -> JSON.parseArray -> List<String>
|
||||
*
|
||||
* @author safety-eval
|
||||
*/
|
||||
@MappedJdbcTypes(JdbcType.VARCHAR)
|
||||
@MappedTypes(List.class)
|
||||
public class JsonStringListTypeHandler extends BaseTypeHandler<List<String>> {
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException {
|
||||
ps.setString(i, JSON.toJSONString(parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
return parse(rs.getString(columnName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
return parse(rs.getString(columnIndex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
return parse(cs.getString(columnIndex));
|
||||
}
|
||||
|
||||
private List<String> parse(String json) {
|
||||
if (json == null || json.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return JSON.parseArray(json, String.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -53,13 +53,7 @@
|
|||
`id`, `org_id`, `filing_territory_code`, `filing_territory_name`, `filing_unit_name`, `filing_unit_type_code`, `filing_unit_type_name`, `filing_no`, `business_scope`, `register_address`, `office_address`, `credit_code`, `qual_cert_no`, `legal_person_phone`, `contact_phone`, `info_disclosure_url`, `fixed_asset_amount`, `archive_room_area`, `fulltime_evaluator_count`, `registered_engineer_count`, `workplace_area`, `unit_intro`, `attachment_url`, `origin_filing_id`, `reject_reason`, `submit_time`, `approve_time`, `filing_status_code`, `filing_status_name`, `apply_type_code`, `apply_type_name`, `delete_enum`, `remarks`, `create_name`, `update_name`, `tenant_id`, `version`, `create_time`, `update_time`, `create_id`, `update_id`, `env`
|
||||
</sql>
|
||||
|
||||
<!-- CO查询映射结果(business_scope 以 JSON 数组字符串存储,出库时转换为 List<String>) -->
|
||||
<resultMap id="QualFilingCOResultMap" type="org.qinan.safetyeval.client.co.QualFilingCO" autoMapping="true">
|
||||
<result column="business_scope" property="businessScope"
|
||||
typeHandler="org.qinan.safetyeval.infrastructure.handler.JsonStringListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="qualificationMonitoringPage" resultMap="QualFilingCOResultMap">
|
||||
<select id="qualificationMonitoringPage" resultType="org.qinan.safetyeval.client.co.QualFilingCO">
|
||||
select info.credit_code as creditCode, info.unit_name as unitName, filing.* from org_info as info
|
||||
left join qual_filing as filing on info.id = filing.org_id
|
||||
where 1=1
|
||||
|
|
|
|||
Loading…
Reference in New Issue