Commit 1b8e3b3b authored by caotao's avatar caotao

改造登记后端代码初版提交

parent 372a120b
......@@ -100,12 +100,12 @@ public class JgChangeRegistrationReformDto extends BaseDto {
private String receiveCompanyCode;
@ApiModelProperty(value = "下一执行节点ids")
private String nextExecutorIds;
private String nextExecuteIds;
@ApiModelProperty(value = "改造告知申请id")
private String reformNoticeId;
@ApiModelProperty(value = "任务发起人id")
private String executorUserId;
private String promoter;
}
......@@ -178,11 +178,6 @@ public class JgChangeRegistrationReform extends BaseEntity {
@TableField("receive_company_code")
private String receiveCompanyCode;
/**
* 下一执行节点ids
*/
@TableField("next_executor_ids")
private String nextExecutorIds;
/**
* 改造告知申请id
......@@ -190,10 +185,20 @@ public class JgChangeRegistrationReform extends BaseEntity {
@TableField("reform_notice_id")
private String reformNoticeId;
@TableField("instance_status")
private String instanceStatus;
/**
* 下一执行节点ids
*/
@TableField("next_execute_ids")
private String nextExecuteIds;
/**
* 任务发起人id
*/
@TableField("executor_user_id")
private String executorUserId;
@TableField(value = "promoter")
private String promoter;
}
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.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 改造变更登记 Mapper 接口
......@@ -10,5 +16,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2023-12-20
*/
public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeRegistrationReform> {
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page, @Param("dto") JgUseRegistrationDto dto , @Param("roleIds") List<String> roleIds);
Map<String, Object> getDetail(@Param("id")String id);
Map<String, Object> getInspectDetail(@Param("id")String id);
Map<String, Object> getUseDetail(@Param("id")String id);
Page<Map<String, Object>> getEquipListPage(@Param("page")Page<Map<String, Object>> page,@Param("factoryNum") String factoryNum,@Param("equList")String equList,@Param("equCategory")String equCategory);
void updatePromoter(@Param("id")Long id);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformMapper">
<update id="updatePromoter">
UPDATE tzs_jg_change_registration_reform set promoter = null
where sequence_nbr = #{id}
</update>
<select id="getListPage" resultType="java.util.Map">
select ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
ur.reg_date as regDate,
ur.use_unit_name as useUnitName,
ur.status,
ur.receive_org_name as receiveOrgName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place,
ur.instance_id as instanceId,
re.equ_id as equipId,
ur.apply_no as applyNo,
ifnull(ur.next_execute_ids,'') as nextExecuteIds,
ur.promoter
from tzs_jg_change_registration_reform ur
LEFT JOIN tzs_jg_change_registration_reform_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
<where>
and ur.is_delete = 0
<if test="dto.equCategory != null and dto.equCategory != ''">
and jri.EQU_CATEGORY = #{dto.equCategory}
</if>
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and ur.audit_status = #{dto.auditStatus}
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
<if test="roleIds != null and dto.dataType == 'jg'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
</foreach>
</if>
<if test="dto.dataType == 'jg' ">
and ur.receive_company_code = #{dto.unitCode}
</if>
<if test="dto.dataType == 'company' ">
and ur.use_unit_credit_code = #{dto.unitCode}
</if>
</where>
order by ur.rec_date desc
</select>
<select id="getDetail" resultType="java.util.Map">
SELECT jri.EQU_CODE as equCode,
-- (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
-- (SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
-- (SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.EQU_CATEGORY as equCategory,
jri.EQU_LIST as equList,
jri.EQU_DEFINE as equDefine,
jri.PRODUCT_NAME as productName,
jri.EQU_TYPE as equType,
jri.PRODUCT_PHOTO as proDuctPhoto,
jfi.FACTORY_NUM as factoryNum,
jfi.PRODUCE_UNIT_NAME as produceUnitName,
jfi.PRODUCE_DATE as produceDate,
jfi.FACTORY_STANDARD as factoryStandard,
jfi.PRODUCT_QUALITY_YIELD_PROVE as productQualityYieldProve,
jfi.INS_USE_MAINTAIN_EXPLAIN as insUseMaintainExplanin,
jci.USC_UNIT_NAME as uscUnitName,
jci.USC_UNIT_CREDIT_CODE as uscUnitCreditCode
from idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_construction_info jci on jri.RECORD = jci.RECORD
where jri.RECORD = #{id}
</select>
<select id="getInspectDetail" resultType="java.util.Map">
SELECT INSPECT_TYPE as inspectType,
INSPECT_STAFF as inspctStaff,
INSPECT_CONCLUSION as inspectConclusion,
INSPECT_ORG_NAME as inspectOrgName,
INSPECT_DATE as inspectDate,
NEXT_INSPECT_DATE as nextInspectDate,
INSPECT_REPORT as inspectReport
from idx_biz_jg_inspection_detection_info
where RECORD = #{id}
ORDER BY INSPECT_DATE desc LIMIT 1
</select>
<select id="getUseDetail" resultType="java.util.Map">
SELECT USE_UNIT_NAME as useUnitName,
USE_UNIT_CREDIT_CODE as useUnitCreditCode,
USE_PLACE as usePlace,
SAFETY_MANAGER as safetyManager,
PHONE as phone,
ESTATE_UNIT_NAME as estateUnitName,
ESTATE_UNIT_CREDIT_CODE as estateUnitCreditCode,
ADDRESS as address,
PROVINCE as province,
CITY as city,
COUNTY as county,
USE_INNER_CODE as useInnerCode
FROM "idx_biz_jg_use_info" where RECORD = #{id}
</select>
<select id="getEquipListPage" resultType="java.util.Map">
SELECT jri.EQU_CODE as equCode,
jri.RECORD as id,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
jfi.FACTORY_NUM as factoryNum,
jui.ADDRESS as address,
jui.USE_INNER_CODE as useInnerCode,
jfi.PRODUCE_UNIT_NAME as produceUnitName
from idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_use_info jui on jri.RECORD = jui.RECORD
<where>
<if test="factoryNum != null and factoryNum != ''">
and jfi.FACTORY_NUM like concat('%',#{factoryNum},'%')
</if>
<if test="equList != null and equList != ''">
and jri.EQU_LIST like concat('%',#{equList},'%')
</if>
<if test="equCategory != null and equCategory != ''">
and jri.EQU_CATEGORY like concat('%',#{equCategory},'%')
</if>
</where>
</select>
</mapper>
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationReformServiceImpl;
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.JgChangeRegistrationReformDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -39,78 +45,85 @@ public class JgChangeRegistrationReformController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增改造变更登记", notes = "新增改造变更登记")
public ResponseModel<JgChangeRegistrationReformDto> save(@RequestBody JgChangeRegistrationReformDto model) {
model = jgChangeRegistrationReformServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
public ResponseModel<Object> save(@RequestBody JSONObject map) {
jgChangeRegistrationReformServiceImpl.save(map);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/flowExecute")
@ApiOperation(httpMethod = "POST", value = "执行流程", notes = "执行流程")
public ResponseModel<Object> flowExecute(@RequestBody JSONObject map) {
jgChangeRegistrationReformServiceImpl.flowExecute(Long.valueOf(String.valueOf(map.get("sequenceNbr"))),String.valueOf(map.get("instanceId")), String.valueOf(map.get("operate")), String.valueOf(map.get("comment")), true);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/withdraw")
@ApiOperation(httpMethod = "POST", value = "撤回", notes = "撤回")
public ResponseModel<Object> withdraw(@RequestBody JSONObject map) {
jgChangeRegistrationReformServiceImpl.withdraw(String.valueOf(map.get("instanceId")));
return ResponseHelper.buildResponse("ok");
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新改造变更登记", notes = "根据sequenceNbr更新改造变更登记")
public ResponseModel<JgChangeRegistrationReformDto> updateBySequenceNbrJgChangeRegistrationReform(@RequestBody JgChangeRegistrationReformDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.updateWithModel(model));
@PostMapping(value = "/deleteBatch")
@ApiOperation(httpMethod = "POST", value = "批量删除", notes = "批量删除")
public ResponseModel<Object> deleteBatch(@RequestBody JSONObject map) {
List<Long> ids = (List<Long>) map.get("ids");
jgChangeRegistrationReformServiceImpl.deleteBatch(ids);
return ResponseHelper.buildResponse("ok");
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除改造变更登记", notes = "根据sequenceNbr删除改造变更登记")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.removeById(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/deleteMessage")
@ApiOperation(httpMethod = "POST", value = "批量删除", notes = "批量删除")
public ResponseModel<Object> deleteMessage(@RequestParam("id") Long id) {
ArrayList<Long> ids = new ArrayList<>();
ids.add(id);
jgChangeRegistrationReformServiceImpl.deleteBatch(ids);
return ResponseHelper.buildResponse("ok");
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个改造变更登记", notes = "根据sequenceNbr查询单个改造变更登记")
public ResponseModel<JgChangeRegistrationReformDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.queryBySeq(sequenceNbr));
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getList(dto, page, dto.getRoleIds()));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "改造变更登记分页查询", notes = "改造变更登记分页查询")
public ResponseModel<Page<JgChangeRegistrationReformDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JgChangeRegistrationReformDto> page = new Page<JgChangeRegistrationReformDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.queryForJgChangeRegistrationReformPage(page));
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getEquipList")
public ResponseModel<Page<Map<String, Object>>> getEquipList(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "factoryNum", required = false) String factoryNum,
@RequestParam(value = "equList", required = false) String equList,
@RequestParam(value = "equCategory", required = false) String equCategory) {
Page<Map<String, Object>> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getEquipList(page, factoryNum, equList, equCategory));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getDetail")
public ResponseModel<Map<String, Object>> getDetail(@RequestParam("id") String id) {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDetail(id));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "改造变更登记列表全部数据查询", notes = "改造变更登记列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JgChangeRegistrationReformDto>> selectForList() {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.queryForJgChangeRegistrationReformList());
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getMessage")
public ResponseModel<Map<String, Object>> getMessage() {
ReginParams selectedOrgInfo = getSelectedOrgInfo();
HashMap<String, Object> map = new HashMap<>();
map.put("useUnitCreditCode", selectedOrgInfo.getCompany().getCompanyCode());
map.put("useUnitName", selectedOrgInfo.getCompany().getCompanyName());
return ResponseHelper.buildResponse(map);
}
}
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