Commit 3460a338 authored by zhangsen's avatar zhangsen

更名变更API开发

parent 1ac231f2
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -84,4 +85,16 @@ public class JgChangeRegistrationNameDto extends BaseDto {
@ApiModelProperty(value = "任务发起人id")
private String promoter;
/**
* 流程状态
*/
@TableField("instance_status")
private String instanceStatus;
private List<String> roleIds;
// 区分监管和企业
private String type;
}
......@@ -136,4 +136,10 @@ public class JgChangeRegistrationName extends BaseEntity {
@TableField("promoter")
private String promoter;
/**
* 流程状态
*/
@TableField("instance_status")
private String instanceStatus;
}
......@@ -49,6 +49,15 @@ public enum WorkFlowStatusEnum {
CHANGE_REEXAMINE("三级受理", "changeReexamine", "三级待受理", "", ""),
/**
* 更名变更登记流程
*/
UNIT_RENAME_SUBMIT("使用单位提交", "unitRenameSubmit", "使用单位待提交", "一级受理已驳回", "使用单位已撤回"),
UNIT_RENAME_RECEIVE("一级受理", "unitRenameReceive", "一级待受理", "二级受理已驳回", "一级受理已撤回"),
UNIT_RENAME_PRELIMINARY("二级受理", "unitRenamePreliminary", "二级待受理", "三级受理已驳回", "二级受理已撤回"),
UNIT_RENAME_REEXAMINE("三级受理", "unitRenameReexamine", "三级待受理", "", ""),
/**
* 移装变更登记流程
*/
TRANSFER_SUBMIT("使用单位提交", "transferSubmit", "使用单位待提交", "一级受理已驳回", "使用单位已撤回"),
......
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationNameDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationName;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......@@ -16,4 +19,8 @@ import java.util.Map;
public interface JgChangeRegistrationNameMapper extends BaseMapper<JgChangeRegistrationName> {
List<Map<String, Object>> getEquipInfoByOrgCode(@Param("code") String code);
void deleteByChangeRegistrationId(@Param("changeRegistrationId") Long changeRegistrationId);
Page<Map<String, Object>> getListPage(Page<Map<String, Object>> page, JgChangeRegistrationNameDto dto, List<String> roleIds, String orgCode);
}
package com.yeejoin.amos.boot.module.jg.api.service;
/**
* 更名变更登记接口类
*
* @author system_generator
* @date 2023-12-25
*/
public interface IJgChangeRegistrationNameService {
}
......@@ -14,4 +14,47 @@
WHERE
USE_UNIT_CREDIT_CODE = #{code}
</select>
<delete id="deleteByChangeRegistrationId">
delete from tzs_jg_change_registration_name_eq where name_change_registration_id = #{changeRegistrationId}
</delete>
<select id="getListPage" resultType="java.util.Map">
select ur.sequence_nbr as sequenceNbr,
ur.instance_id as instanceId,
ur.audit_status as auditStatus,
ur.apply_no as applyNo,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d') as recDate,
DATE_FORMAT(ur.create_date,'%Y-%m-%d') as createDate,
DATE_FORMAT(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
ur.receive_org_code as receiveOrgCode,
ur.receive_org_name as receiveOrgName,
ur.receive_company_code as receiveCompanyCode,
ur.use_unit_name as useUnitName,
ur.new_use_unit_name AS newUseUnitName,
ur.promoter,
ur.next_executor_ids as nextExecutorIds
from tzs_jg_change_registration_name ur
<where>
and ur.is_delete = 0
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and ur.audit_status = #{dto.auditStatus}
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and ur.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="roleIds != null and dto.type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
ur.instance_status like concat('%',#{role},'%')
</foreach>
</if>
<if test="dto.type == 'supervision'">
AND ur.receive_org_code = #{orgCode}
</if>
<if test="dto.type == 'enterprise' ">
and ur.use_unit_code = #{orgCode}
</if>
</where>
order by ur.rec_date desc
</select>
</mapper>
package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.*;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationNameServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationNameDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 更名变更登记
*
* @author system_generator
* @date 2023-12-25
*/
@RestController
@Api(tags = "更名变更登记Api")
@RequestMapping(value = "/jg-change-registration-name")
public class JgChangeRegistrationNameController extends BaseController {
@Autowired
JgChangeRegistrationNameServiceImpl jgChangeRegistrationNameService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增/新增并提交", notes = "新增/新增并提交")
public ResponseModel<Object> save(@RequestParam String submitType, @RequestBody Map<String, JSONObject> model) {
jgChangeRegistrationNameService.save(submitType, model);
return ResponseHelper.buildResponse("ok");
}
/**
* 根据sequenceNbr更新
*
* @param model 安装告知
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/updateInfo")
@ApiOperation(httpMethod = "POST", value = "编辑API", notes = "编辑API")
public ResponseModel<JgChangeRegistrationNameDto> updateInfo(@RequestParam String submitType,
@RequestBody Map<String, Object> model,
@RequestParam(value = "op", required = false) String op) {
JgChangeRegistrationNameDto dto = BeanUtil.mapToBean(((LinkedHashMap) model.get("jgRegistrationInfo")), JgChangeRegistrationNameDto.class, true);
if (Objects.isNull(dto)) {
throw new IllegalArgumentException("参数jgRegistrationInfo不能为空");
}
Object o = ((LinkedHashMap<?, ?>) model.get("jgRegistrationInfo")).get("changeCertificateList");
dto.setChangeCertificateList((List<Map<String, Object>>) o);
return ResponseHelper.buildResponse(jgChangeRegistrationNameService.updateInfo(submitType, dto, op));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/deleteMessage")
@ApiOperation(httpMethod = "POST", value = "单个删除", notes = "单个删除")
public ResponseModel<Object> deleteMessage(@RequestParam("id") Long id) {
List<Long> ids = Collections.singletonList(id);
jgChangeRegistrationNameService.deleteBatch(ids);
return ResponseHelper.buildResponse("ok");
}
/**
* 撤回
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/withdraw")
@ApiOperation(httpMethod = "POST", value = "撤回", notes = "撤回")
public ResponseModel<Object> revocation(@RequestBody JSONObject map) {
jgChangeRegistrationNameService.revocation(String.valueOf(map.get("instanceId")));
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/flowExecute")
@ApiOperation(httpMethod = "POST", value = "执行流程", notes = "执行流程")
public ResponseModel<Object> flowExecute(@RequestBody JSONObject map) {
LinkedHashMap model1 = (LinkedHashMap) map.get("model");
LinkedHashMap jgRegistrationInfoMap = (LinkedHashMap) model1.get("jgRegistrationInfo");
JgChangeRegistrationNameDto jgScrapCancelDto = JSON.parseObject(JSON.toJSONString(jgRegistrationInfoMap), JgChangeRegistrationNameDto.class);
jgChangeRegistrationNameService.flowExecute(Long.valueOf(String.valueOf(jgScrapCancelDto.getSequenceNbr())), jgScrapCancelDto.getInstanceId(), String.valueOf(map.get("operate")), String.valueOf(map.get("opinion")));
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "列表全部数据查询", notes = "列表全部数据查询")
@PostMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(@RequestBody JgChangeRegistrationNameDto dto,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgChangeRegistrationNameService.getList(dto, page, dto.getRoleIds()));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个详情", notes = "根据sequenceNbr查询单个详情")
public ResponseModel<Map<String, Object>> selectOne(@RequestParam(required = false, value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jgChangeRegistrationNameService.queryBySequenceNbr(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表筛选办理状态下拉", notes = "列表筛选办理状态下拉")
@GetMapping(value = "/getAuditStatusList")
public ResponseModel<List<Map<String, String>>> getAuditStatusList(@RequestParam(value = "code") String code) {
return ResponseHelper.buildResponse(WorkFlowStatusEnum.getInfoList(code));
}
}
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