Commit 89a7bf44 authored by LiuLin's avatar LiuLin

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

parents d5c8ee55 685b2962
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit;
import java.util.List;
import java.util.Map;
/**
......@@ -58,6 +59,6 @@ public interface IJgChangeRegistrationUnitService {
* @param model 数据
* @param submitType 保存类型
*/
void saveNotice(String submitType, JSONObject model, ReginParams reginParams);
List<JgChangeRegistrationUnit> saveNotice(String submitType, JSONObject model, ReginParams reginParams);
}
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
......@@ -59,7 +60,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param model 数据
* @param submitType 保存类型
*/
void saveNotice(String submitType, JSONObject model, ReginParams reginParams);
List<JgInstallationNotice> saveNotice(String submitType, JSONObject model, ReginParams reginParams);
/**
* 打印告知单
......
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import jdk.nashorn.api.scripting.JSObject;
import java.util.List;
import java.util.Map;
/**
......@@ -26,7 +27,7 @@ public interface IJgTransferNoticeService extends IService<JgTransferNotice> {
Boolean deleteForBatch(Long[] sequenceNbrs);
void saveNotice(String submitType, Map<String, Object> model, ReginParams reginParams);
List<JgTransferNotice> saveNotice(String submitType, Map<String, Object> model, ReginParams reginParams);
String generateTransferNoticeReport(Long sequenceNbr);
......
......@@ -42,8 +42,7 @@ public class JgScrapCancelController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增/新增并提交", notes = "新增/新增并提交")
public ResponseModel<Object> save(@RequestParam String submitType, @RequestBody Map<String, Object> model) {
jgScrapCancelService.save(submitType, model);
return ResponseHelper.buildResponse("ok");
return ResponseHelper.buildResponse(jgScrapCancelService.save(submitType, model));
}
/**
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
......@@ -18,10 +19,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author system_generator
......@@ -40,8 +38,8 @@ public class JgUseRegistrationController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<Object> save(@RequestBody JSONObject map) {
jgUseRegistrationServiceImpl.save(map);
return ResponseHelper.buildResponse("ok");
JgUseRegistration data = jgUseRegistrationServiceImpl.save(map);
return ResponseHelper.buildResponse(Collections.singletonList(data));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -372,7 +372,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, JSONObject map, ReginParams reginParams) {
public List<JgChangeRegistrationUnit> saveNotice(String submitType, JSONObject map, ReginParams reginParams) {
JgChangeRegistrationUnitDto model = BeanUtil.toBeanIgnoreError(map.get("changeRegisInfo"), JgChangeRegistrationUnitDto.class);
String[] taskName = new String[]{"流程结束"};
......@@ -382,7 +382,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// 获取单位变更设备列表
List<Map<String, Object>> deviceList = model.getDeviceList();
if (CollectionUtils.isEmpty(deviceList)) {
return;
return new ArrayList<>();
}
// 获取单位变更单号
......@@ -390,7 +390,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List<String> applyNoList = listResponseModel.getResult();
if (CollectionUtils.isEmpty(applyNoList)) {
log.error("生成申请变更单位编失败");
return;
return new ArrayList<>();
}
ArrayList<String> roleListFirst = new ArrayList<>();
......@@ -588,7 +588,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}).collect(Collectors.toList());
JgChangeRegistrationUnitEqMapper.insertBatchSomeColumn(jgRelationEquipList);
return list;
}
void getNext(ArrayList<String> roleListFirst, String instanceId, String[] taskName) {
......
......@@ -198,7 +198,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put(s, ObjectUtils.isEmpty(installationInfo.get(s)) ? new JSONArray() : parseArray(installationInfo.get(s).toString()));
}
if(equipmentInfos.get(0).containsKey(s)) {
equipmentInfos.get(0).put(s, ObjectUtils.isEmpty(installationInfo.get(s)) ? new JSONArray() : parseArray(equipmentInfos.get(0).get(s).toString()));
equipmentInfos.get(0).put(s, ObjectUtils.isEmpty(equipmentInfos.get(0).get(s)) ? new JSONArray() : parseArray(equipmentInfos.get(0).get(s).toString()));
}
}
Map<String, Object> map = equipmentInfos.get(0);
......@@ -471,7 +471,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, JSONObject jgInstallationNoticeDtoMap, ReginParams reginParams) {
public List<JgInstallationNotice> saveNotice(String submitType, JSONObject jgInstallationNoticeDtoMap, ReginParams reginParams) {
JgInstallationNoticeDto model = JSON.parseObject(jgInstallationNoticeDtoMap.get(TABLE_PAGE_ID).toString(), JgInstallationNoticeDto.class);
// 字段转换
......@@ -517,6 +517,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return jgRelationEquip.setEquipTransferId(String.valueOf(sequenceNbr));
}).collect(Collectors.toList());
jgInstallationNoticeEqMapper.insertBatchSomeColumn(jgRelationEquipList);
return list;
}
/**
......
......@@ -142,9 +142,14 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
return JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
}
@Transactional(rollbackFor = Exception.class)
public List<JgScrapCancel> saveList(String submitType, Map<String, Object> mapParams) {
return Collections.singletonList(this.save(submitType, mapParams));
}
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void save(String submitType, Map<String, Object> mapParams) {
public JgScrapCancel save(String submitType, Map<String, Object> mapParams) {
ReginParams reginParams = this.getSelectedOrgInfo();
Map<?, ?> noticeParams = (Map) mapParams.get(PAGE_KEY);
String equipId = String.valueOf(noticeParams.get("record"));
......@@ -175,7 +180,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
List<String> roleListAll = new ArrayList<>();
List<String> applyNoList = listResponseModel.getResult();
if (CollectionUtils.isEmpty(applyNoList)) {
return;
return null;
}
// 判断当前是否为提交
List<WorkflowResultDto> workflowResultDtos = null;
......@@ -238,6 +243,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
this.createTaskModel(jgScrapCancel, taskName[0], submitType, nextUserIds);
jgRelationEquip.setEquipTransferId(String.valueOf(jgScrapCancel.getSequenceNbr()));
jgScrapCancelEqService.save(jgRelationEquip);
return jgScrapCancel;
}
private void createTaskModel(JgScrapCancel scrapCancel, String taskName, String submitType, String nextUserIds) {
......@@ -309,6 +315,8 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
LambdaQueryWrapper<JgScrapCancel> lambda = new QueryWrapper<JgScrapCancel>().lambda();
lambda.eq(JgScrapCancel::getSequenceNbr, id);
JgScrapCancel jgScrapCancel = this.baseMapper.selectOne(lambda);
//删除代办消息
commonService.deleteTaskModel(String.valueOf(jgScrapCancel.getSequenceNbr()));
//更新jgScrapCancel数据
jgScrapCancel.setIsDelete(true);
this.updateById(jgScrapCancel);
......
......@@ -266,7 +266,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey(noticeDto.getSequenceNbr().toString());
dto.setBusinessKey(String.valueOf(noticeDto.getSequenceNbr()));
dto.setCompleteFirstTask(Boolean.TRUE);
//下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(notice.getReceiveOrgCode());
......@@ -383,19 +383,19 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, Map<String, Object> jgTransferNoticeDtoMap, ReginParams reginParams) {
public List<JgTransferNotice> saveNotice(String submitType, Map<String, Object> jgTransferNoticeDtoMap, ReginParams reginParams) {
JgTransferNoticeDto model = JSON.parseObject(JSONObject.toJSONString(jgTransferNoticeDtoMap.get(TABLE_PAGE_ID)), JgTransferNoticeDto.class);
// 字段转换
convertField(model);
// 获取告知设备列表
List<Map<String, Object>> deviceList = model.getDeviceList();
if (CollectionUtils.isEmpty(deviceList)) {
return;
return new ArrayList<>();
}
// 获取告知单号
ResponseModel<List<String>> responseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.YZGZ.getCode(), deviceList.size());
if (CollectionUtils.isEmpty(responseModel.getResult())) {
return;
return new ArrayList<>();
}
// 启动工作流并返回信息
List<WorkflowResultDto> workflowResultList = workFlowInfo(submitType, deviceList, model.getReceiveOrgCode());
......@@ -418,10 +418,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}).collect(Collectors.toList());
jgTransferNoticeEqMapper.insertBatchSomeColumn(jgRelationEquipList);
return list;
}
/**
* 暂存任务生成待办
*
* @param list 业务信息
*/
private void buildTaskDraft(List<JgTransferNotice> list) {
......@@ -465,8 +467,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
dto.setPromoter(reginParams.getUserModel().getUserId());
dto.setNextTaskId(workflowResultList.get(i).getNextTaskId());
}
dto.setEquList(obj.get("EQU_LIST").toString());
dto.setSupervisoryCode(obj.get("SUPERVISORY_CODE").toString());
dto.setEquList(String.valueOf(obj.get("EQU_LIST")));
dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
......@@ -516,7 +518,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDtoList.add(taskModelDto);
if (isDeleteDraft) {
// 删除暂存时生成的待办
commonService.deleteTaskModel(item.getSequenceNbr()+"");
commonService.deleteTaskModel(item.getSequenceNbr() + "");
}
});
commonService.buildTaskModel(taskModelDtoList);
......@@ -536,7 +538,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
deviceList.forEach(item -> {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey(item.get("SEQUENCE_NBR").toString());
dto.setBusinessKey(String.valueOf(item.get("SEQUENCE_NBR")));
dto.setCompleteFirstTask(Boolean.TRUE);
//下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(receiveOrgCode);
......
......@@ -154,7 +154,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
@Transactional
public void save(JSONObject map) {
public JgUseRegistration save(JSONObject map) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 使用登记信息
JgUseRegistration jgUseRegistration = new JgUseRegistration();
......@@ -260,6 +260,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
list.add(dto);
commonServiceImpl.buildTaskModel(list);
}
return jgUseRegistration;
}
public JgUseRegistration updateData(Long sequenceNbr, String operate, WorkflowResultDto workflowResultDto, Boolean isFirst) {
......
......@@ -19,13 +19,14 @@ import java.util.List;
@AllArgsConstructor
public enum BizTypeEnum {
SUPERVISE("supervise", "监督检验"),
FIRST_INSPECTION("firstinspect", "定检"),
DETECTION("detection", "检测"),
BUSINESS_OPEN("businessOpen", "开通");
SUPERVISE("supervise", "监督检验","115"),
FIRST_INSPECTION("firstinspect", "定检","116"),
DETECTION("detection", "检测","117"),
BUSINESS_OPEN("businessOpen", "检验业务开通","114");
private String code;
private String name;
private String num;
public static List<String> getEnumNameList() {
List<String> codeList = new ArrayList<String>();
......@@ -44,4 +45,22 @@ public enum BizTypeEnum {
}
return null;
}
public static String getNumByCode(String code) {
for (BizTypeEnum c : BizTypeEnum.values()) {
if (c.getCode().equals(code)){
return c.getNum();
}
}
return null;
}
public static String getNameByNum(String num) {
for (BizTypeEnum c : BizTypeEnum.values()) {
if (c.getNum().equals(num)){
return c.getName();
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.jyjc.api.enums;
/**
* 业务类型枚举
*
* @author Administrator
*/
public enum BusinessTypeEnum {
/**
* 业务类型枚举
*/
JG_EQUIPMENT_HANDOVER("101", "设备移交"),
JG_INSTALLATION_NOTIFICATION("102", "安装告知"),
JG_MODIFICATION_NOTIFICATION("103", "改造告知"),
JG_MAINTENANCE_NOTIFICATION("104", "维修告知"),
JG_ADVICE_REMOVAL("105", "移装告知"),
JG_MAINTENANCE_RECORD("106", "维保备案"),
JG_USAGE_REGISTRATION("107", "使用登记"),
JG_NAME_CHANGE_REGISTRATION("108", "更名变更登记"),
JG_COMPANY_CHANGE_REGISTRATION("109", "单位变更登记"),
JG_CHANGE_REGISTRATION("110", "移装变更登记"),
JG_RENOVATION_REGISTRATION("111", "改造变更登记"),
JG_EQUIPMENT_START("112-1", "设备启用"),
JG_EQUIPMENT_STOP("112-2", "设备停用"),
JG_EQUIPMENT_MOVE("113-1", "移装报废"),
JG_EQUIPMENT_CANCEL("113-2", "注销报废"),
JY_OPENING_APPLICATION("114", "业务开通"),
JY_INSPECTION_APPLICATION_JD("115", "监督检验"),
JY_INSPECTION_APPLICATION_DS("116", "定(首)检验"),
JY_INSPECTION_APPLICATION_CHECK("117", "检验(含安全阀效验)");
private final String code;
private final String name;
BusinessTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getNameByType(String code) {
String name = null;
for (BusinessTypeEnum enumOne : BusinessTypeEnum.values()) {
if (enumOne.getCode().equals(code)) {
name = enumOne.getName();
break;
}
}
return name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
......@@ -7,8 +7,6 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEqui
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
......@@ -27,4 +25,6 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
JyjcInspectionApplicationModel selectDataBySeq(Long sequenceNbr);
void updatePromoter(@org.apache.ibatis.annotations.Param ("id") Long id);
Page<JyjcInspectionApplicationModel> selectForPage(@Param("page") Page<JyjcInspectionApplication> page, @Param("jyjcInspectionApplicationModel") JyjcInspectionApplicationModel jyjcInspectionApplicationModel, @Param("identity") String identity, @Param("currentApplicationUnitCode") String currentApplicationUnitCode, @Param("currentInspectionUnitCode") String currentInspectionUnitCode);
}
......@@ -68,6 +68,7 @@ public class JyjcInspectionApplicationModel extends BaseModel {
private String originalApplicationNo;
@ApiModelProperty(value = "受理日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date acceptDate;
@ApiModelProperty(value = "报检单位编号")
......@@ -165,7 +166,7 @@ public class JyjcInspectionApplicationModel extends BaseModel {
private String nextTaskId;
@ApiModelProperty(value = "下一步执行人Ids")
private String nextExcuteUserIds;
private String nextExecuteUserIds;
@ApiModelProperty(value = "下一步任务名称")
private String nextTaskName;
......
......@@ -121,4 +121,7 @@ public class JyjcOpeningApplicationModel extends BaseModel {
@ApiModelProperty ("下个任务执行人ids")
private String nextExecuteUserIds;
@ApiModelProperty ("是否监管")
private String identityType;
}
......@@ -58,4 +58,6 @@ public class TaskMessageDto {
* 设备id、使用登记使用
*/
String equipId;
String processKey;
}
package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import java.util.List;
......@@ -13,4 +15,5 @@ import java.util.List;
public interface IJyjcInspectionApplicationService {
Boolean deleteBatchData(List<Long> sequenceNbr);
Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model);
}
......@@ -5,27 +5,13 @@
<select id="queryForDataList"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel">
SELECT
tzjia.sequence_nbr,
tzjia.process_instance_id,
tzjia.workflow_node,
tzjia.biz_type,
tzjia.application_no,
tzjia.*
cdd1.NAME AS inspectionClassify,
cdd3.NAME AS inspectionType,
tzjia.inspection_unit_code,
cdd.NAME AS equipClassify,
tzjia.number_of_equip,
tzjia.inspection_unit_code,
tzjia.application_date,
tzjia.accept_date,
tzjia.inspection_charge_phone,
tbei.use_unit AS applicationUnitName,
tbei1.use_unit AS inspectionUnitName,
tzjia.status,
cdd2.NAME AS statusName,
tzjia.next_execute_ids as nextExecuteIds,
tzjia.promoter,
tzjia.create_user_id,
(select group_concat(name) from tzs_user_info where find_in_set(sequence_nbr,tzjia.inspection_charge_person)) as inspectionChargePerson FROM
tz_jyjc_inspection_application AS tzjia
LEFT JOIN tz_base_enterprise_info tbei ON tbei.use_code = tzjia.application_unit_code
......@@ -79,6 +65,83 @@
</where>
order by tzjia.application_no desc
</select>
<select id="selectForPage" resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel">
SELECT
tzjia.*
cdd1.NAME AS inspectionClassify,
cdd3.NAME AS inspectionType,
cdd.NAME AS equipClassify,
tbei.use_unit AS applicationUnitName,
tbei1.use_unit AS inspectionUnitName,
cdd2.NAME AS statusName
FROM
tz_jyjc_inspection_application AS tzjia
LEFT JOIN tz_base_enterprise_info tbei ON tbei.use_code = tzjia.application_unit_code
LEFT JOIN tz_base_enterprise_info tbei1 ON tbei1.use_code = tzjia.inspection_unit_code
LEFT JOIN cb_data_dictionary cdd ON cdd.code = tzjia.equip_classify and cdd.type = 'BJSBZL'
LEFT JOIN cb_data_dictionary cdd1 ON cdd1.code = tzjia.inspection_classify
LEFT JOIN cb_data_dictionary cdd2 ON cdd2.code = tzjia.status and cdd2.type = 'JYLCZT'
LEFT JOIN cb_data_dictionary cdd3 ON cdd3.code = tzjia.inspection_type
<where>
<if test="jyjcInspectionApplicationModel.applicationNo != null and jyjcInspectionApplicationModel.applicationNo != ''">
and tzjia.application_no like concat('%',#{jyjcInspectionApplicationModel.applicationNo},'%')
</if>
<if test="jyjcInspectionApplicationModel.inspectionClassify != null and jyjcInspectionApplicationModel.inspectionClassify != ''">
and tzjia.inspection_classify = #{jyjcInspectionApplicationModel.inspectionClassify}
</if>
<if test="jyjcInspectionApplicationModel.equipClassify != null and jyjcInspectionApplicationModel.equipClassify != ''">
and tzjia.equip_classify = #{jyjcInspectionApplicationModel.equipClassify}
</if>
<if test="jyjcInspectionApplicationModel.applicationDate != null and jyjcInspectionApplicationModel.applicationDate != ''">
and tzjia.application_date = #{jyjcInspectionApplicationModel.applicationDate}
</if>
<if test="jyjcInspectionApplicationModel.acceptDate != null and jyjcInspectionApplicationModel.acceptDate != ''">
and tzjia.accept_date = #{jyjcInspectionApplicationModel.acceptDate}
</if>
<if test="jyjcInspectionApplicationModel.inspectionChargePerson != null and jyjcInspectionApplicationModel.inspectionChargePerson != ''">
and tzjia.inspection_charge_person like concat('%',#{jyjcInspectionApplicationModel.inspectionChargePerson},'%')
</if>
<if test="jyjcInspectionApplicationModel.status != null and jyjcInspectionApplicationModel.status != ''">
and tzjia.status = #{jyjcInspectionApplicationModel.status}
</if>
<if test="jyjcInspectionApplicationModel.bizType != null and jyjcInspectionApplicationModel.bizType != ''">
and tzjia.biz_type = #{jyjcInspectionApplicationModel.bizType}
</if>
<if test="jyjcInspectionApplicationModel.inspectionUnitName != null and jyjcInspectionApplicationModel.inspectionUnitName != ''">
and tzjia.inspection_unit_code = (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{jyjcInspectionApplicationModel.inspectionUnitName},'%'))
</if>
<if test="jyjcInspectionApplicationModel.applicationUnitName != null and jyjcInspectionApplicationModel.applicationUnitName != ''">
and tzjia.application_unit_code = (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{jyjcInspectionApplicationModel.inspectionUnitName},'%'))
</if>
<if test="jyjcInspectionApplicationModel.inspectionUnitCode != null and jyjcInspectionApplicationModel.inspectionUnitCode != ''">
and tzjia.inspection_unit_code = #{jyjcInspectionApplicationModel.inspectionUnitCode} and tzjia.status != '6610'
</if>
<if test="jyjcInspectionApplicationModel.applicationUnitCode != null and jyjcInspectionApplicationModel.applicationUnitCode != ''">
and tzjia.application_unit_code = #{jyjcInspectionApplicationModel.applicationUnitCode}
</if>
<choose>
<when test="identity == 'apply'">
and tzjia.application_unit_code = #{currentApplicationUnitCode}
</when>
<when test="identity == 'receive'">
and tzjia.inspection_unit_code = #{currentInspectionUnitCode}
</when>
<when test="identity == 'all'">
and (tzjia.application_unit_code = #{currentApplicationUnitCode} or tzjia.inspection_unit_code = #{currentInspectionUnitCode})
</when>
<otherwise>
1=2
</otherwise>
</choose>
</where>
order by tzjia.application_no desc
</select>
<select id="listByCategory"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel">
select
......
......@@ -109,6 +109,12 @@
<if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null">
and use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%')
</if>
<if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null">
and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
</if>
<if test="jyjcInspectionResultModel.applicationUnitName != '' and jyjcInspectionResultModel.applicationUnitName != null">
and bei1.use_unit like concat('%',#{jyjcInspectionResultModel.applicationUnitName},'%')
</if>
<choose>
<when test="identity == 'apply'">
and res.application_unit_code = #{jyjcInspectionResultModel.companyCode}
......@@ -117,7 +123,7 @@
and res.inspection_unit_code = #{jyjcInspectionResultModel.companyCode}
</when>
<when test="identity == 'all'">
and (res.application_unit_code = #{jyjcInspectionResultModel.companyCode} or es.inspection_unit_code = #{jyjcInspectionResultModel.companyCode})
and (res.application_unit_code = #{jyjcInspectionResultModel.companyCode} or res.inspection_unit_code = #{jyjcInspectionResultModel.companyCode})
</when>
<otherwise>
1 = 2
......
......@@ -6,28 +6,7 @@
<select id="selectJyjcOpeningApplicationList"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel">
select
a.unit_code,
a.detection_region,
a.detection_region_name,
a.application_seq,
a.result_type,
a.expiry_date,
a.accept_date,
a.status,
a.remark,
a.sequence_nbr,
a.rec_date,
a.rec_user_id,
a.rec_user_name,
a.apply_time,
a.workflow_prostance_id,
a.workflow_role,
a.unit_code_name,
cdd2.NAME as status_name,
a.workflow_active_key,
a.next_execute_ids,
a.promoter,
a.create_user_id
a.*,cdd2.NAME as status_name
from tz_jyjc_opening_application a
LEFT JOIN cb_data_dictionary cdd2 ON cdd2.code = a.status and cdd2.type = 'JYLCSQ'
<where>
......
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
......@@ -56,9 +57,10 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<JyjcOpeningApplicationModel> save(@RequestBody JyjcOpeningApplicationModel model) {
model = jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(model, false);
return ResponseHelper.buildResponse(model);
public ResponseModel<JyjcOpeningApplicationModel> save(@RequestBody JSONObject model) {
JyjcOpeningApplicationModel jyjcOpeningApplicationModel = new JyjcOpeningApplicationModel();
BeanUtil.copyProperties(model.get("applyInfo"),jyjcOpeningApplicationModel);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(jyjcOpeningApplicationModel, false));
}
/**
......@@ -78,7 +80,13 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/submit")
@ApiOperation(httpMethod = "PUT", value = "保存并提交", notes = "保存并提交")
public ResponseModel<JyjcOpeningApplicationModel> updateBySequenceNbrAndStartFlow(@RequestBody JyjcOpeningApplicationModel model, @RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
public ResponseModel<List<JyjcOpeningApplicationModel>> updateBySequenceNbrAndStartFlow(@RequestBody JSONObject jsonObject, @RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
JyjcOpeningApplicationModel model = new JyjcOpeningApplicationModel();
if (jsonObject.containsKey("applyInfo")) {
BeanUtil.copyProperties(jsonObject.get("applyInfo"), model);
} else {
BeanUtil.copyProperties(jsonObject, model);
}
model.setSequenceNbr(sequenceNbr);
if (sequenceNbr != null) {
JyjcOpeningApplicationModel jyjcOpeningApplicationModel = jyjcOpeningApplicationServiceImpl.queryDetail(sequenceNbr);
......@@ -86,7 +94,8 @@ public class JyjcOpeningApplicationController extends BaseController {
throw new BadRequest("企业资质信息和检验人员信息为空,无法提交!");
}
}
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(model,true));
JyjcOpeningApplicationModel data = jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(model, true);
return ResponseHelper.buildResponse(Collections.singletonList(data));
}
@Deprecated
......@@ -217,7 +226,7 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "撤回业务开通申请", notes = "撤回业务开通申请")
@GetMapping(value = "/rollBackFlow")
public ResponseModel<JSONObject> overflow(@RequestParam("sequenceNbr") String sequenceNbr) {
public ResponseModel<Object> overflow(@RequestParam("sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.stopFlow(sequenceNbr));
}
......
......@@ -108,7 +108,7 @@ public class TaskModelServiceImpl {
model.setFlowCreateDate(new Date());
model.setTaskStatus(FlowStatusEnum.TO_BE_SUBMITTED.getCode());
model.setTaskTitle("有一条待提交的草稿");
model.setTaskName(BizTypeEnum.getNameByCode(obj.getTaskType()));
model.setTaskName(BizTypeEnum.getNameByNum(obj.getTaskType()));
model.setTaskTypeLabel(BizTypeEnum.getNameByCode(obj.getTaskType()));
// model.setTaskContent("【申请单号:"+obj.getTaskCode()+"】待提交");
}else {
......
......@@ -4,13 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil;
......@@ -24,7 +22,6 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttach
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
......@@ -127,7 +124,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
model = new JyjcInspectionResultModel();
}
// 判断当前登录人身份(报检机构、接收机构、即时报检又是接收机构、都不是(不存在此情况))
String identity= this.getCompanyIdentityByType(reginParams.getCompany().getCompanyType());
String identity = this.getCompanyIdentityByType(reginParams.getCompany().getCompanyType());
model.setCompanyCode(reginParams.getCompany().getCompanyCode());
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectForPage(page, model, identity);
resultPage.getRecords().forEach(v -> {
......@@ -142,27 +139,27 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return resultPage;
}
private String getCompanyIdentityByType(String companyType){
private String getCompanyIdentityByType(String companyType) {
// 可发起单位的单位类型(角色与单位类型已绑定,在业务系统增加的账号不会出现角色与的单位类型不匹配场景)
String[] applyIdentityDefine = {"使用单位", "安装改造维修单位"};
// 可进行检验检测申请接收的单位类型,在业务系统增加的账号不会出现角色与的单位类型不匹配场景
String[] receiveIdentityDefine = {"检验检测机构"};
boolean isApplyIdentityMatch = false;
boolean isReceiveIdentityMatch = false;
if(Arrays.stream(applyIdentityDefine).anyMatch(companyType::contains)){
if (Arrays.stream(applyIdentityDefine).anyMatch(companyType::contains)) {
isApplyIdentityMatch = true;
}
if(Arrays.stream(receiveIdentityDefine).anyMatch(companyType::contains)){
if (Arrays.stream(receiveIdentityDefine).anyMatch(companyType::contains)) {
isReceiveIdentityMatch = true;
}
if(isApplyIdentityMatch && !isReceiveIdentityMatch){
if (isApplyIdentityMatch && !isReceiveIdentityMatch) {
return "apply";
}
if(!isApplyIdentityMatch && isReceiveIdentityMatch){
if (!isApplyIdentityMatch && isReceiveIdentityMatch) {
return "receive";
}
if(isApplyIdentityMatch){
return "all";
if (isApplyIdentityMatch) {
return "all";
}
return "no";
}
......@@ -235,7 +232,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
paramList.add(resultParam);
}
});
if (!CollectionUtils.isEmpty(paramList)){
if (!CollectionUtils.isEmpty(paramList)) {
resultParamService.saveOrUpdateBatch(paramList);
}
......@@ -254,11 +251,11 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
inspectionDetectionInfoMapper.updateById(info);
}
//更新使用信息表
useInfoMapper.updateByRecord(model.getEquipUnicode(),model.getNextInspectionDate(),model.getInspectionType(),model.getApplicationNo());
useInfoMapper.updateByRecord(model.getEquipUnicode(), model.getNextInspectionDate(), model.getInspectionType(), model.getApplicationNo());
return model;
}
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info, JyjcInspectionResultAttachment jybgFile ) {
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info, JyjcInspectionResultAttachment jybgFile) {
// 回填检验机构名称
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseEnterpriseInfo::getUseCode, model.getInspectionUnitCode());
......
[
[ {
"type":"supervise",
"pageType": "draft",
"url": "/mixuap?appId=1742358052905971713&id=1734576595978448898&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"firstinspect",
"pageType": "draft",
"url": "/mixuap?appId=1742358052905971713&id=1736728282272919554&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"detection",
"pageType": "draft",
"url": "/mixuap?appId=1742358052905971713&id=1736733779709423618&roleIds={roleIds}&userId={userId}&pageType=edit"
},
{
"type":"supervise",
"pageType": "look",
......@@ -24,15 +36,15 @@
"pageType": "edit",
"url": "/mixuap?appId=1742358052905971713&id=1736733779709423618&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"businessOpen",
"type":"114",
"pageType": "draft",
"url": "/mixuap?appId=1742358052905971713&id=1734569644833927170&roleIds={roleIds}&userId={userId}&pageType=edit"
"url": "/mixuap?appId=1742358052905971713&id=1737319295022559234&roleIds={roleIds}&userId={userId}&pageType=edit"
}, {
"type":"businessOpen",
"type":"114",
"pageType": "look",
"url": "/mixuap?appId=1742358052905971713&id=1735201757841092609&roleIds={roleIds}&userId={userId}&pageType=edit"
"url": "/mixuap?appId=1742358052905971713&id=1735201757841092609&roleIds={roleIds}&userId={userId}&pageType=look"
}, {
"type":"businessOpen",
"type":"114",
"pageType": "edit",
"url": "/mixuap?appId=1742358052905971713&id=1735201757841092609&roleIds={roleIds}&userId={userId}&pageType=edit"
}
......
......@@ -5,9 +5,9 @@
UPDATE
idx_biz_jg_use_info
SET
NEXT_INSPECT_DATE = #{nextInspectDate},
LAST_INSPECT_TYPE = #{lastInspectType},
LAST_INSPECT_REPORT_NO = #{lastInspectReportNo}
"NEXT_INSPECT_DATE" = #{nextInspectDate},
"LAST_INSPECT_TYPE" = #{lastInspectType},
"LAST_INSPECT_REPORT_NO" = #{lastInspectReportNo}
WHERE
RECORD = #{record}
......
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