Commit b237057d authored by KeYong's avatar KeYong

Merge branch 'developer' of 172.16.10.76:moa/amos-boot-biz into developer

parents 3b3b7626 6606f134
package com.yeejoin.amos.boot.module.tzs.flc.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;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="EquipmentUseInfoDto", description="设备使用信息表")
public class EquipmentUseInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "使用单位名称")
private String useUnitName;
@ApiModelProperty(value = "使用单位id")
private Long useUnitId;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useOrganizationCode;
@ApiModelProperty(value = "产权单位名称")
private String propertyUnitName;
@ApiModelProperty(value = "产权单位id")
private Long propertyUnitId;
@ApiModelProperty(value = "产权统一信用代码")
private String propertyOrganizationCode;
@ApiModelProperty(value = "使用地址")
private String useAddress;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "使用场所")
private String useSite;
@ApiModelProperty(value = "使用场所编码")
private String useSiteCode;
@ApiModelProperty(value = "特设编码")
private String specialCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "96333识别码")
private String rescueCode;
@ApiModelProperty(value = "使用登记证编码")
private String registerLicenceCode;
@ApiModelProperty(value = "登记机关")
private String registerOrg;
@ApiModelProperty(value = "登记机关id")
private Long registerOrgId;
@ApiModelProperty(value = "登记日期")
private Date registerTime;
@ApiModelProperty(value = "发证日期")
private Date issueLicenceTime;
@ApiModelProperty(value = "投入使用日期")
private Date startUseTime;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_equipment_use_info")
public class EquipmentUseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 使用单位名称
*/
@TableField("use_unit_name")
private String useUnitName;
/**
* 使用单位id
*/
@TableField("use_unit_id")
private Long useUnitId;
/**
* 使用单位统一信用代码
*/
@TableField("use_organization_code")
private String useOrganizationCode;
/**
* 产权单位名称
*/
@TableField("property_unit_name")
private String propertyUnitName;
/**
* 产权单位id
*/
@TableField("property_unit_id")
private Long propertyUnitId;
/**
* 产权统一信用代码
*/
@TableField("property_organization_code")
private String propertyOrganizationCode;
/**
* 使用地址
*/
@TableField("use_address")
private String useAddress;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 使用场所
*/
@TableField("use_site")
private String useSite;
/**
* 使用场所编码
*/
@TableField("use_site_code")
private String useSiteCode;
/**
* 特设编码
*/
@TableField("special_code")
private String specialCode;
/**
* 设备注册代码
*/
@TableField("register_code")
private String registerCode;
/**
* 96333识别码
*/
@TableField("rescue_code")
private String rescueCode;
/**
* 使用登记证编码
*/
@TableField("register_licence_code")
private String registerLicenceCode;
/**
* 登记机关
*/
@TableField("register_org")
private String registerOrg;
/**
* 登记机关id
*/
@TableField("register_org_id")
private Long registerOrgId;
/**
* 登记日期
*/
@TableField("register_time")
private Date registerTime;
/**
* 发证日期
*/
@TableField("issue_licence_time")
private Date issueLicenceTime;
/**
* 投入使用日期
*/
@TableField("start_use_time")
private Date startUseTime;
/**
* 设备id
*/
@TableField("equipment_id")
private Long equipmentId;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设备使用信息表 Mapper 接口
*
* @author system_generator
* @date 2022-01-05
*/
public interface EquipmentUseInfoMapper extends BaseMapper<EquipmentUseInfo> {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
/**
* 设备使用信息表接口类
*
* @author system_generator
* @date 2022-01-05
*/
public interface IEquipmentUseInfoService {
}
<?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.tzs.flc.api.mapper.EquipmentUseInfoMapper">
</mapper>
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
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.List;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentUseInfoServiceImpl;
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.tzs.flc.api.dto.EquipmentUseInfoDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@RestController
@Api(tags = "设备使用信息表Api")
@RequestMapping(value = "/equipment-use-info")
public class EquipmentUseInfoController extends BaseController {
@Autowired
EquipmentUseInfoServiceImpl equipmentUseInfoServiceImpl;
/**
* 新增设备使用信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增设备使用信息表", notes = "新增设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> save(@RequestBody EquipmentUseInfoDto model) {
model = equipmentUseInfoServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新设备使用信息表", notes = "根据sequenceNbr更新设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> updateBySequenceNbrEquipmentUseInfo(@RequestBody EquipmentUseInfoDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.updateWithModel(model));
}
/**
* 根据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(equipmentUseInfoServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个设备使用信息表", notes = "根据sequenceNbr查询单个设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设备使用信息表分页查询", notes = "设备使用信息表分页查询")
public ResponseModel<Page<EquipmentUseInfoDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<EquipmentUseInfoDto> page = new Page<EquipmentUseInfoDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryForEquipmentUseInfoPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "设备使用信息表列表全部数据查询", notes = "设备使用信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<EquipmentUseInfoDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryForEquipmentUseInfoList());
}
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
......@@ -16,11 +17,14 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.enums.InformWorkFlowEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper;
......@@ -51,6 +55,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
/**
* 设备告知单服务实现类
......@@ -89,7 +94,11 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
@Autowired
EquipmentIndexInformServiceImpl iEquipmentIndexInformService;
@Autowired
EquipmentUseInfoServiceImpl equipmentUseInfoServiceImpl;
@Autowired
UnitInfoServiceImpl unitInfoServiceImpl;
/**
* 分页查询
......@@ -199,7 +208,9 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
public Boolean acceptInform(Long sequenceNbr) {
// 接收告知书 更新告知书状态
Boolean flag = false;
flag = this.update(new LambdaUpdateWrapper<EquipmentInform>().eq(EquipmentInform::getSequenceNbr,sequenceNbr).set(EquipmentInform::getInformStatus,"9"));
EquipmentInform inform = this.getById(sequenceNbr);
inform.setInformStatus("9");
flag = this.updateById(inform);
if(flag) {
// 更新设备相关参数
List<InformEquipmentDto> equipmentList = informEquipmentServiceImpl.getEquipListByInformId(sequenceNbr);
......@@ -209,6 +220,44 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
BeanUtils.copyProperties(t,sourceEquip);
sourceEquip.setSequenceNbr(t.getSourceEquipmentId());
equipmentServiceImpl.updateById(sourceEquip);
// 保存设备相关使用信息
EquipmentUseInfo useInfo = equipmentUseInfoServiceImpl.getOne(new LambdaQueryWrapper<EquipmentUseInfo>().eq(EquipmentUseInfo::getEquipmentId,t.getSourceEquipmentId()));
if(useInfo == null) {
useInfo = new EquipmentUseInfo();
}
useInfo.setLatitude(t.getLatitude());
useInfo.setLongitude(t.getLongitude());
useInfo.setUseAddress(t.getAddress());
useInfo.setUseSite(inform.getUseSite());
useInfo.setUseSiteCode(inform.getUseSiteCode());
//useInfo.setSpecialCode(UUID.randomUUID().toString().replaceAll("-",""));
//if(StringUtils.isEmpty(useInfo.getRegisterCode())) {
// useInfo.setRegisterCode(sourceEquip.getTypeId()+inform.getRegionCode()+ DateUtils.getYear(new Date())+"01");
//}
//useInfo.setRescueCode(UUID.randomUUID().toString().replaceAll("-",""));
//useInfo.setRegisterLicenceCode(UUID.randomUUID().toString().replaceAll("-",""));
if(useInfo.getRegisterTime() != null) {
useInfo.setRegisterTime(new Date());
}
useInfo.setStartUseTime(new Date());
useInfo.setIssueLicenceTime(new Date());
useInfo.setEquipmentId(t.getSourceEquipmentId());
useInfo.setUseUnitName(inform.getUseUnit());
useInfo.setUseUnitId(inform.getUseUnitId());
UnitInfo useUnit = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrgUserId,inform.getUseUnitId()));
useInfo.setUseOrganizationCode(useUnit.getOrganizationCode());
useInfo.setPropertyUnitName(inform.getPropertyUnit());
useInfo.setPropertyUnitId(inform.getPropertyUnitId());
UnitInfo propertyUnit = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrgUserId,inform.getPropertyUnitId()));
useInfo.setPropertyOrganizationCode(propertyUnit.getOrganizationCode());
equipmentUseInfoServiceImpl.saveOrUpdate(useInfo);
// 获取设备附件信息 保存附件信息
// 原附件信息
Map<String, List<AttachmentDto>> sourceAttach = sourceFileService.getAttachments(t.getSequenceNbr());
......@@ -283,6 +332,7 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
}
}
}
model.setProcessStatus("0");
return model;
}
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentUseInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IEquipmentUseInfoService;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 设备使用信息表服务实现类
*
* @author system_generator
* @date 2022-01-05
*/
@Service
public class EquipmentUseInfoServiceImpl extends BaseService<EquipmentUseInfoDto,EquipmentUseInfo,EquipmentUseInfoMapper> implements IEquipmentUseInfoService {
/**
* 分页查询
*/
public Page<EquipmentUseInfoDto> queryForEquipmentUseInfoPage(Page<EquipmentUseInfoDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<EquipmentUseInfoDto> queryForEquipmentUseInfoList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -805,5 +805,55 @@
</sql>
</changeSet>
<changeSet author="kongfm" id="2022-01-05-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="tcb_equipment_use_info"/>
</not>
</preConditions>
<comment>add tcb_equipment_use_info table </comment>
<sql>
CREATE TABLE `tcb_equipment_use_info` (
`sequence_nbr` bigint(30) NOT NULL,
`use_unit_name` varchar(200) DEFAULT NULL COMMENT '使用单位名称',
`use_unit_id` bigint(30) DEFAULT NULL COMMENT '使用单位id',
`use_organization_code` varchar(30) DEFAULT NULL COMMENT '使用单位统一信用代码',
`property_unit_name` varchar(50) DEFAULT NULL COMMENT '产权单位名称',
`property_unit_id` bigint(30) DEFAULT NULL COMMENT '产权单位id',
`property_organization_code` varchar(30) DEFAULT NULL COMMENT '产权统一信用代码',
`use_address` varchar(300) DEFAULT NULL COMMENT '使用地址',
`longitude` varchar(50) DEFAULT NULL COMMENT '经度',
`latitude` varchar(255) DEFAULT NULL COMMENT '纬度',
`use_site` varchar(30) DEFAULT NULL COMMENT '使用场所',
`use_site_code` varchar(30) DEFAULT NULL COMMENT '使用场所编码',
`special_code` varchar(50) DEFAULT NULL COMMENT '特设编码',
`register_code` varchar(50) DEFAULT NULL COMMENT '设备注册代码',
`rescue_code` varchar(50) DEFAULT NULL COMMENT '96333识别码',
`register_licence_code` varchar(50) DEFAULT NULL COMMENT '使用登记证编码',
`register_org` varchar(30) DEFAULT NULL COMMENT '登记机关',
`register_org_id` bigint(30) DEFAULT NULL COMMENT '登记机关id',
`register_time` datetime DEFAULT NULL COMMENT '登记日期',
`issue_licence_time` datetime DEFAULT NULL COMMENT '发证日期',
`start_use_time` datetime DEFAULT NULL COMMENT '投入使用日期',
`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备使用信息表';
</sql>
</changeSet>
<changeSet author="kongfm" id="2022-01-05-02">
<preConditions onFail="MARK_RAN">
<tableExists tableName="tcb_equipment_use_info"/>
</preConditions>
<comment>modify table tcb_equipment_use_info add equipment_id columns</comment>
<sql>
ALTER TABLE `tcb_equipment_use_info` add equipment_id bigint(50) COMMENT '设备ID';
</sql>
</changeSet>
</databaseChangeLog>
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