Commit 1c781f05 authored by LiuLin's avatar LiuLin

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents a926d9e2 d5f2e56e
......@@ -737,7 +737,7 @@
<w:sz-cs w:val="32"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
<w:t>北京市天安门质检院</w:t>
<w:t>${(receiveOrgName)!''}</w:t>
</w:r>
</w:p>
<w:p>
......
......@@ -182,4 +182,10 @@ public class JyjcInspectionApplication extends BaseEntity {
@TableField(value = "create_user_id")
private String createUserId;
@TableField(value = "next_task_id")
private String nextTaskId;
@TableField(value = "next_execute_user_ids")
private String nextExcuteUserIds;
}
......@@ -126,4 +126,10 @@ public class JyjcOpeningApplication extends BaseEntity {
@TableField(value = "create_user_id")
private String createUserId;
@TableField(value = "next_task_id")
private String nextTaskId;
@TableField(value = "next_execute_user_ids")
private String nextExecuteUserIds;
}
......@@ -21,7 +21,8 @@ public enum BizTypeEnum {
SUPERVISE("supervise", "监督检验"),
FIRST_INSPECTION("firstinspect", "定检"),
DETECTION("detection", "检测");
DETECTION("detection", "检测"),
BUSINESS_OPEN("businessOpen", "开通");
private String code;
private String name;
......
......@@ -16,4 +16,6 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
Page<JyjcInspectionResultModel> selectJyjcInspectionResultpPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel);
Page<JyjcInspectionResultModel> selectForPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel,@Param("identity") String identity);
}
......@@ -161,6 +161,19 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "创建人ID")
private String createUserId;
@ApiModelProperty(value = "下一步任务id")
private String nextTaskId;
@ApiModelProperty(value = "下一步执行人Ids")
private String nextExcuteUserIds;
@ApiModelProperty(value = "下一步任务名称")
private String nextTaskName;
@ApiModelProperty(value = "设备分类")
private String equList;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
private String instanceId;
......
......@@ -35,8 +35,7 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "报检单位编号")
private String applicationUnitCode;
//监管码
@ApiModelProperty(value = "设备唯一标识")
@ApiModelProperty(value = "设备唯一标识, 监管码")
private String equipUnicode;
@ApiModelProperty(value = "检验结果状态(已出2、未出1)")
......
......@@ -114,4 +114,11 @@ public class JyjcOpeningApplicationModel extends BaseModel {
@ApiModelProperty ("企业营业执照")
private List<AttachmentDto> unitBusinessLicense;
@ApiModelProperty ("下个任务id")
private String nextTaskId;
@ApiModelProperty ("下个任务执行人ids")
private String nextExecuteUserIds;
}
......@@ -58,4 +58,69 @@
</where>
ORDER BY application_date DESC
</select>
<select id="selectForPage"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
select res.sequence_nbr, res.inspection_unit_code, res.application_no, res.application_unit_code,
res.equip_unicode, res.result_status, res.license_number, res.result_no, res.inspector, res.inner_person_code,
res.inspection_conclusion, res.inspection_date, res.next_inspection_date, res.inspection_start_date,
res.inspection_end_date, res.inspection_result_summary, res.non_conformance, res.remark,
res.rec_user_id, res.rec_date, res.biz_type,res.equ_category, res.inspection_type, res.inspection_type_name,
res.application_date,use_unit_name, use_unit_credit_code, province_name, city_name, county_name, street_name, equ_code, use_inner_code, ibjri.equ_list,
tec1.name equ_list_name, ibjri.equ_category , ibjoi.SUPERVISORY_CODE supervisoryCode
, use_org_code, res.equ_define, ibjui.ADDRESS equUseAddress, bei.use_unit inspectionUnitName, bei1.use_unit applicationUnitName, cdb.name inspectionTypeName
from tz_jyjc_inspection_result res
left join idx_biz_jg_other_info ibjoi on res.equip_unicode = ibjoi.record
left join idx_biz_jg_use_info ibjui on ibjui.record = res.equip_unicode
left join idx_biz_jg_register_info ibjri on ibjui.record = ibjri.record
left join tz_equipment_category tec on ibjri.equ_category = tec.code
left join tz_equipment_category tec1 on ibjri.equ_list = tec1.code
left join tz_base_enterprise_info bei on res.inspection_unit_code = bei.use_code
left join tz_base_enterprise_info bei1 on res.application_unit_code = bei1.use_code
left join cb_data_dictionary cdb on res.inspection_type = cdb.code
<where>
<if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null">
and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%')
</if>
<if test="jyjcInspectionResultModel.applicationUnitCode != '' and jyjcInspectionResultModel.applicationUnitCode != null">
and res.application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode}
</if>
<if test="jyjcInspectionResultModel.useInnerCode != '' and jyjcInspectionResultModel.useInnerCode != null">
and use_inner_code like concat('%',#{jyjcInspectionResultModel.useInnerCode},'%')
</if>
<if test="jyjcInspectionResultModel.equCode != '' and jyjcInspectionResultModel.equCode != null">
and equ_code like concat('%',#{jyjcInspectionResultModel.equCode},'%')
</if>
<if test="jyjcInspectionResultModel.equipUnicode != '' and jyjcInspectionResultModel.equipUnicode != null">
and res.equip_unicode like concat('%',#{jyjcInspectionResultModel.equipUnicode},'%')
</if>
<if test="jyjcInspectionResultModel.equCategory != '' and jyjcInspectionResultModel.equCategory != null">
and ibjri.equ_category = #{jyjcInspectionResultModel.equCategory}
</if>
<if test="jyjcInspectionResultModel.inspectionType != '' and jyjcInspectionResultModel.inspectionType != null">
and res.inspection_type = #{jyjcInspectionResultModel.inspectionType}
</if>
<if test="jyjcInspectionResultModel.applicationDate!=null">
AND TO_DAYS(res.application_date) = TO_DAYS(#{jyjcInspectionResultModel.applicationDate})
</if>
<if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null">
and use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%')
</if>
<choose>
<when test="identity == 'apply'">
and use_org_code like concat('%',#{jyjcInspectionResultModel.useOrgCode},'%')
</when>
<when test="identity == 'receive'">
and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
</when>
<when test="identity == 'all'">
and (use_org_code like concat('%',#{jyjcInspectionResultModel.useOrgCode},'%') or es.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode})
</when>
<otherwise>
1 = 2
</otherwise>
</choose>
</where>
ORDER BY application_date DESC
</select>
</mapper>
......@@ -52,6 +52,9 @@
<if test="jyjcOpeningApplicationRequstDto.type == 'supervision'">
and a.status not in ('6610')
</if>
<if test="jyjcOpeningApplicationRequstDto.unitCode != '' and jyjcOpeningApplicationRequstDto.unitCode != null">
and a.unit_code = #{jyjcOpeningApplicationRequstDto.unitCode}
</if>
</where>
order by sequence_nbr desc
......
......@@ -136,7 +136,21 @@ public class JyjcInspectionResultController extends BaseController {
}
/**
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/page")
@ApiOperation(httpMethod = "POST", value = "列表页面(检验检测单位、使用单位共用)", notes = "列表页面(检验检测单位、使用单位共用)")
public ResponseModel<Page<JyjcInspectionResultModel>> pageList(
@RequestParam int current, @RequestParam int size,
@RequestBody JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForPageList(page, model));
}
/**
* 检验结果-上传结果和编辑结果
*
* @return
......
......@@ -161,23 +161,23 @@ public class JyjcOpeningApplicationController extends BaseController {
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageForCompany")
@ApiOperation(httpMethod = "GET",value = "分页查询-公司", notes = "分页查询-公司")
public ResponseModel<Page<JyjcOpeningApplicationModel>> querypageForCompany(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto) {
Page<JyjcOpeningApplication> page = new Page<JyjcOpeningApplication>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.querypageForCompany(page,jyjcOpeningApplicationRequstDto));
}
// /**
// * 列表分页查询
// *
// * @param current 当前页
// * @param current 每页大小
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @GetMapping(value = "/pageForCompany")
// @ApiOperation(httpMethod = "GET",value = "分页查询-公司", notes = "分页查询-公司")
// public ResponseModel<Page<JyjcOpeningApplicationModel>> querypageForCompany(@RequestParam(value = "current") int current, @RequestParam
// (value = "size") int size, JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto) {
// Page<JyjcOpeningApplication> page = new Page<JyjcOpeningApplication>();
// page.setCurrent(current);
// page.setSize(size);
// return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.querypageForCompany(page,jyjcOpeningApplicationRequstDto));
// }
/**
* 列表全部数据查询
......
......@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......@@ -34,6 +35,8 @@ import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class TaskModelServiceImpl {
@Autowired
private RedisUtils redisUtils;
......
......@@ -110,14 +110,61 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectJyjcInspectionResultpPage(page, model);
resultPage.getRecords().stream().forEach(v -> {
if (ResultStatusEnum.NO_RESULT.getCode().equals(v.getResultStatus()))
if (ResultStatusEnum.NO_RESULT.getCode().equals(v.getResultStatus())) {
v.setResultStatusName(ResultStatusEnum.NO_RESULT.getName());
if (ResultStatusEnum.YES_RESULT.getCode().equals(v.getResultStatus()))
}
if (ResultStatusEnum.YES_RESULT.getCode().equals(v.getResultStatus())) {
v.setResultStatusName(ResultStatusEnum.YES_RESULT.getName());
}
});
return resultPage;
}
public Page<JyjcInspectionResultModel> queryForPageList(Page<JyjcInspectionResultModel> page, JyjcInspectionResultModel model) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class);
if (ObjectUtils.isEmpty(model)) {
model = new JyjcInspectionResultModel();
}
// 判断当前登录人身份(报检机构、接收机构、即时报检又是接收机构、都不是(不存在此情况))
String identity= this.getCompanyIdentityByType(reginParams.getCompany().getCompanyType());
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectForPage(page, model, identity);
resultPage.getRecords().forEach(v -> {
if (ResultStatusEnum.NO_RESULT.getCode().equals(v.getResultStatus())) {
v.setResultStatusName(ResultStatusEnum.NO_RESULT.getName());
}
if (ResultStatusEnum.YES_RESULT.getCode().equals(v.getResultStatus())) {
v.setResultStatusName(ResultStatusEnum.YES_RESULT.getName());
}
});
return resultPage;
}
private String getCompanyIdentityByType(String companyType){
// 可发起单位的单位类型(角色与单位类型已绑定,在业务系统增加的账号不会出现角色与的单位类型不匹配场景)
String[] applyIdentityDefine = {"使用单位", "安装改造维修单位"};
// 可进行检验检测申请接收的单位类型,在业务系统增加的账号不会出现角色与的单位类型不匹配场景
String[] receiveIdentityDefine = {"检验检测机构"};
boolean isApplyIdentityMatch = false;
boolean isReceiveIdentityMatch = false;
if(Arrays.stream(applyIdentityDefine).anyMatch(companyType::contains)){
isApplyIdentityMatch = true;
}
if(Arrays.stream(receiveIdentityDefine).anyMatch(companyType::contains)){
isReceiveIdentityMatch = true;
}
if(isApplyIdentityMatch && !isReceiveIdentityMatch){
return "apply";
}
if(!isApplyIdentityMatch && isReceiveIdentityMatch){
return "receive";
}
if(isApplyIdentityMatch){
return "all";
}
return "no";
}
@Transactional(rollbackFor = Exception.class)
public JyjcInspectionResultModel updateJyjcInspectionResult(Map<String, Map<String, Object>> tableModel) {
......
......@@ -23,5 +23,17 @@
"type":"detection",
"pageType": "edit",
"url": "/mixuap?appId=1742358052905971713&id=1736733779709423618&roleIds={roleIds}&userId={userId}&pageType=edit"
}
}, {
"type":"businessOpen",
"pageType": "draft",
"url": "/mixuap?appId=1742358052905971713&id=1734569644833927170&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"businessOpen",
"pageType": "look",
"url": "/mixuap?appId=1742358052905971713&id=1735201757841092609&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"businessOpen",
"pageType": "edit",
"url": "/mixuap?appId=1742358052905971713&id=1735201757841092609&roleIds={roleIds}&userId={userId}&pageType=edit"
}
]
\ No newline at end of file
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