Commit dc22c4f5 authored by suhuiguang's avatar suhuiguang

reafact(jyjc): 对接接口

1.增加联调对接接口,供圣元对接使用
parent b11dcf48
package com.yeejoin.amos.boot.module.jyjc.api.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class InspectMockAppData {
@NotBlank(message = "设备种类代码不能为空")
private String equList;
@NotBlank(message = "设备类别代码不能为空")
private String equCategory;
private String equDefine;
@NotBlank(message = "检验检测类型不能为空")
private String inspectType;
@NotBlank(message = "报检单位代码不能为空")
private String applicationUnitCode;
@NotBlank(message = "报检单位名称不能为空")
private String applicationUnitName;
@NotBlank(message = "检验机构信用代码不能为空")
private String inspectionUnitCode;
@NotBlank(message = "检验机构名称不能为空")
private String inspectionUnitName;
@NotBlank(message = "申请联系人")
private String applicationContactName;
@NotBlank(message = "申请联系人电话")
private String applicationContactPhone;
@NotBlank(message = "对接唯一标识")
private String appId;
private Integer size = 1;
}
...@@ -8,12 +8,14 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -8,12 +8,14 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams; import com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectMockAppData;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionApplicationPushEvent; import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionApplicationPushEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher; import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.InspectAppMockServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
...@@ -21,11 +23,16 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieModel; ...@@ -21,11 +23,16 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -40,11 +47,15 @@ import java.util.*; ...@@ -40,11 +47,15 @@ import java.util.*;
@RestController @RestController
@Api(tags = "报检申请Api") @Api(tags = "报检申请Api")
@RequestMapping(value = "/jyjc-inspection-application") @RequestMapping(value = "/jyjc-inspection-application")
@Slf4j
public class JyjcInspectionApplicationController extends BaseController { public class JyjcInspectionApplicationController extends BaseController {
@Autowired @Autowired
private JyjcInspectionApplicationServiceImpl jyjcInspectionApplicationServiceImpl; private JyjcInspectionApplicationServiceImpl jyjcInspectionApplicationServiceImpl;
@Autowired
private InspectAppMockServiceImpl inspectAppMockServiceImpl;
/** /**
* 业务通用发起——基本信息 * 业务通用发起——基本信息
*/ */
...@@ -378,4 +389,22 @@ public class JyjcInspectionApplicationController extends BaseController { ...@@ -378,4 +389,22 @@ public class JyjcInspectionApplicationController extends BaseController {
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForPageList2(page, model, sort)); return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForPageList2(page, model, sort));
} }
/**
* 模拟报检接口
*
* @param appData 测试数据
* @return 是否成功
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "模拟报检接口", notes = "模拟报检接口,联调使用,模拟用户的报检接收")
@PutMapping(value = "/mock/app")
public ResponseModel<Boolean> testAppAndPassApp(@Validated @RequestBody InspectMockAppData appData, BindingResult bindingResult) {
List<FieldError> fieldErrors = bindingResult.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
log.info("模拟报检接口请求的数据内容:{}", JSONObject.toJSONString(appData));
return ResponseHelper.buildResponse(inspectAppMockServiceImpl.testAppAndPassApp(appData));
}
} }
...@@ -983,7 +983,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -983,7 +983,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} }
} }
private String getDictNameByCode(String code) { String getDictNameByCode(String code) {
DataDictionary dataDictionary = dataDictionaryService.getByCode(code, "JYJC"); DataDictionary dataDictionary = dataDictionaryService.getByCode(code, "JYJC");
return dataDictionary != null ? dataDictionary.getName() : ""; return dataDictionary != null ? dataDictionary.getName() : "";
} }
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper; import com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore;
import com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto; import com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -47,4 +48,6 @@ public interface IdxBizJgUseInfoMapper extends CustomBaseMapper<IdxBizJgUseInfo> ...@@ -47,4 +48,6 @@ public interface IdxBizJgUseInfoMapper extends CustomBaseMapper<IdxBizJgUseInfo>
JSONObject getUsePlaceAndCodeByRecord(@Param("record") String record); JSONObject getUsePlaceAndCodeByRecord(@Param("record") String record);
List<Map<String, Object>> queryBaseInfoByIds(@Param("records") List<String> records); List<Map<String, Object>> queryBaseInfoByIds(@Param("records") List<String> records);
List<IdxBizJgOtherInfo> selectOneMockRecord(@Param("equList") String equList, @Param("equCategory") String equCategory, @Param("equDefine") String equDefine, @Param("useUnitCode") String useUnitCode, @Param("size") Integer size);
} }
...@@ -215,5 +215,24 @@ ...@@ -215,5 +215,24 @@
</foreach> </foreach>
]) ])
</select> </select>
<select id="selectOneMockRecord" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo">
SELECT
r."RECORD",
o."SUPERVISORY_CODE"
FROM
idx_biz_jg_register_info r,
idx_biz_jg_use_info u,
idx_biz_jg_other_info o
where
u."RECORD" = r."RECORD"
and o."RECORD" = r."RECORD"
and r."EQU_LIST" = #{equList}
and r."EQU_CATEGORY" = #{equCategory}
<if test="equDefine != null and equDefine != ''">
and r."EQU_DEFINE" = #{equDefine}
</if>
and u."USE_UNIT_CREDIT_CODE" = #{useUnitCode}
ORDER BY r."REC_DATE" limit ${size}
</select>
</mapper> </mapper>
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