Commit 8ed81e85 authored by sxwnfpwx@163.com's avatar sxwnfpwx@163.com

parent 07232074
......@@ -95,9 +95,9 @@ public class ControllerAop {
// 不需要校验token的接口直接返回
if (joinPoint.getSignature() instanceof MethodSignature) {
if (!((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(TycloudOperation.class).needAuth() && !request.getParameterMap().containsKey("token") && ValidationUtil.isEmpty(token)) {
// if (!((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(TycloudOperation.class).needAuth() && !request.getParameterMap().containsKey("token") && ValidationUtil.isEmpty(token)) {
return;
}
// }
}
// 平台studio配置的下载接口token从url里取
......
package com.yeejoin.amos.boot.module.ugp.api.dto;
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-10-7
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="InstallNoticeMsgPageDto", description="项目安装告知短信通知记录表")
public class InstallNoticeMsgPageDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "项目名称")
private String name;
@ApiModelProperty(value = "项目安装区域")
private String installRegion;
@ApiModelProperty(value = "项目开工日期")
private Date startDate;
@ApiModelProperty(value = "建设单位")
private String constructionUnit;
@ApiModelProperty(value = "安装单位")
private String installationUnit;
@ApiModelProperty(value = "项目告知处理进度")
private String progressStatus;
@ApiModelProperty(value = "短信通知单位")
private Long targetUnitId;
@ApiModelProperty(value = "短信接收人")
private Long targetPersonId;
@ApiModelProperty(value = "短信通知内容")
private String content;
@ApiModelProperty(value = "短信发送日期")
private Date sendTime;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -39,4 +40,5 @@ public class SuperviseRuleDto extends BaseDto {
@ApiModelProperty(value = "创建时间")
private Date createDate;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
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 org.aspectj.weaver.ast.Test;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
/**
* 焊机设备表
*
* @author system_generator
* @date 2022-10-8
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="WelderEquipmentDto", description="焊机设备表")
public class WelderEquipmentDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备名称")
private String name;
@ApiModelProperty(value = "设备编号")
private String code;
@ApiModelProperty(value = "设备类型")
private String type;
@ApiModelProperty(value = "项目ID")
private Long projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "生产厂家")
private String manufacturer;
@ApiModelProperty(value = "出厂日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date manufactureDate;
@ApiModelProperty(value = "使用年限")
private String serviceLife;
@ApiModelProperty(value = "校验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inspectionDate;
@ApiModelProperty(value = "使用状态")
private String useStatus;
@ApiModelProperty(value = "检定状态")
private String verifyStatus;
@ApiModelProperty(value = "附件信息")
private String info;
@ApiModelProperty(value = "资源id")
private String projectResourceId;
@ApiModelProperty(value = "附件")
private MultipartFile[] files;
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
......@@ -25,115 +26,115 @@ public class Project extends BaseEntity {
/**
* 项目名称
*/
@TableField("name")
@TableField("name")
private String name;
/**
* 项目编号
*/
@TableField("code")
@TableField("code")
private String code;
/**
* 项目进度
*/
@TableField("progress_status")
@TableField("progress_status")
private String progressStatus;
/**
* 项目地点
*/
@TableField("address")
@TableField("address")
private String address;
/**
* 项目开工日期
*/
@TableField("start_date")
@TableField("start_date")
private Date startDate;
/**
* 项目安装区域代码
*/
@TableField("install_region_code")
@TableField("install_region_code")
private String installRegionCode;
/**
* 项目安装区域
*/
@TableField("install_region")
@TableField("install_region")
private String installRegion;
/**
* 建设单位id
*/
@TableField("construction_unit_id")
@TableField("construction_unit_id")
private Long constructionUnitId;
/**
* 建设单位名称
*/
@TableField("construction_unit")
@TableField("construction_unit")
private String constructionUnit;
/**
* 项目设计单位
*/
@TableField("design_unit")
@TableField("design_unit")
private String designUnit;
/**
* 项目设计单位id
*/
@TableField("design_unit_id")
@TableField("design_unit_id")
private Long designUnitId;
/**
* 安装单位id
*/
@TableField("installation_unit_id")
@TableField("installation_unit_id")
private Long installationUnitId;
/**
* 安装单位名称
*/
@TableField("installation_unit")
@TableField("installation_unit")
private String installationUnit;
/**
* 企业id
*/
@TableField("company_id")
@TableField("company_id")
private Long companyId;
/**
* 建设单位负责人id
*/
@TableField("charge_person_id")
@TableField("charge_person_id")
private Long chargePersonId;
/**
* 建设单位负责人名称
*/
@TableField("charge_person")
@TableField("charge_person")
private String chargePerson;
/**
* 组织机构代码
*/
@TableField("org_code")
@TableField("org_code")
private String orgCode;
/**
* 项目提交日期
*/
@TableField("submit_date")
@TableField("submit_date")
private Date submitDate;
/**
* 备注
*/
@TableField("remark")
@TableField("remark")
private String remark;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 设备信息表 Mapper 接口
......@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public interface EquipmentMapper extends BaseMapper<Equipment> {
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 项目安装告知短信记录表 Mapper 接口
*
* @author system_generator
* @date 2022-09-22
* @date 2022-10-8
*/
@Mapper
public interface InstallNoticeMsgMapper extends BaseMapper<InstallNoticeMsg> {
//安装告知申请页面分页列表
Page<InstallNoticeMsgPageDto> InstallNoticeMsgPage(IPage<InstallNoticeMsgPageDto> page, @Param("name") String name, @Param("installationUnit") String installationUnit );
Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, @Param("name") String name, @Param("unit") String unit);
InstallNoticeMsgPageDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.aspectj.weaver.ast.Test;
/**
* 项目资源表(包括焊工、管材、设备) Mapper 接口
......@@ -9,6 +16,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public interface ProjectResourceMapper extends BaseMapper<ProjectResource> {
//焊机设备表
Page<WelderEquipmentDto> WelderEquipment(IPage<WelderEquipmentDto> page, @Param("name") String name, @Param("type") String type);
Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, @Param("name") String name, @Param("unit") String unit);
Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, @Param("info") Test info, @Param("unit") String unit);
WelderEquipmentDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
/**
* 项目安装告知短信记录表接口类
*
* @author system_generator
* @date 2022-09-22
* @date 2022-10-8
*/
public interface IInstallNoticeMsgService {
//安装告知页面列表
Page<InstallNoticeMsgPageDto> installNoticeMsgList(Page<InstallNoticeMsgPageDto> page, String name, String installationUnit);
//安装告知页面分页查询
Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, String name ,String unit);
//根据sequenceNbr查询列表数据
InstallNoticeMsgPageDto customSelectById(Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import org.aspectj.weaver.ast.Test;
/**
* 项目资源表(包括焊工、管材、设备)接口类
*
......@@ -9,4 +13,13 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/
public interface IProjectResourceService {
//焊机设备表
Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type);
//焊机设备页面分页查询
Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name ,String unit);
Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info , String unit);
//根据sequenceNbr查询列表数据
WelderEquipmentDto customSelectById(Long sequenceNbr);
}
......@@ -2,4 +2,69 @@
<!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.ugp.api.mapper.InstallNoticeMsgMapper">
<select id="InstallNoticeMsgPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="installationUnit != null and installationUnit != ''">
and tz_ugp_project.installationUnit = #{installationUnit}
</if>
</select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_project.construction_unit_id = #{unit}
</if>
</select>
<select id="customSelectById"
resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
and tz_ugp_project.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
......@@ -2,4 +2,101 @@
<!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.ugp.api.mapper.ProjectResourceMapper">
<select id="WelderEquipment" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="name != null and name != ''">
and tz_ugp_equipment.name = #{name}
</if>
<if test="type != null and type != ''">
and tz_ugp_equipment.type = #{type}
</if>
</where>
</select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name as project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_project.construction_unit_id = #{unit}
</if>
</where>
</select>
<select id="selectByInfo" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="info != null and info != ''">
and tz_ugp_attachment.info = #{info}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_attachment.company_id = #{unit}
</if>
</where>
</select>
<select id="customSelectById"
resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
where tz_ugp_equipment.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
......@@ -107,7 +107,7 @@ public class CompanyController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth=false)
@ApiOperation(httpMethod = "GET",value = "企业信息表列表全部数据查询", notes = "企业信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<CompanyDto>> selectForList() {
......
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -36,7 +37,7 @@ public class InstallNoticeMsgController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增项目安装告知短信记录表", notes = "新增项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> save(@RequestBody InstallNoticeMsgDto model) {
......@@ -50,7 +51,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新项目安装告知短信记录表", notes = "根据sequenceNbr更新项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> updateBySequenceNbrInstallNoticeMsg(@RequestBody InstallNoticeMsgDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
......@@ -64,7 +65,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除项目安装告知短信记录表", notes = "根据sequenceNbr删除项目安装告知短信记录表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
......@@ -77,7 +78,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个项目安装告知短信记录表", notes = "根据sequenceNbr查询单个项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> selectOne(@PathVariable Long sequenceNbr) {
......@@ -91,7 +92,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目安装告知短信记录表分页查询", notes = "项目安装告知短信记录表分页查询")
public ResponseModel<Page<InstallNoticeMsgDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
......@@ -107,10 +108,32 @@ public class InstallNoticeMsgController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "项目安装告知短信记录表列表全部数据查询", notes = "项目安装告知短信记录表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<InstallNoticeMsgDto>> selectForList() {
return ResponseHelper.buildResponse(installNoticeMsgServiceImpl.queryForInstallNoticeMsgList());
}
/**
* 安装告知短信通知记录列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/msgpage")
@ApiOperation(httpMethod = "GET",value = "安装告知短信记录表分页查询", notes = "项目安装告知短信记录表分页查询")
public ResponseModel<Page<InstallNoticeMsgPageDto>> queryForMsgPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "installationUnit", required = false) String installationUnit
){
Page<InstallNoticeMsgPageDto> page = new Page<InstallNoticeMsgPageDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(installNoticeMsgServiceImpl.installNoticeMsgList(page, name, installationUnit));
}
}
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import org.springframework.http.HttpStatus;
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.sql.SQLIntegrityConstraintViolationException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.SuperviseRuleServiceImpl;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -36,10 +47,11 @@ public class SuperviseRuleController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增监管区域规则表", notes = "新增监管区域规则表")
public ResponseModel<SuperviseRuleDto> save(@RequestBody SuperviseRuleDto model) {
model.setCreateDate(new Date());
model = superviseRuleServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
......@@ -50,10 +62,11 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PutMapping(value = "")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新监管区域规则表", notes = "根据sequenceNbr更新监管区域规则表")
public ResponseModel<SuperviseRuleDto> updateBySequenceNbrSuperviseRule(@RequestBody SuperviseRuleDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<SuperviseRuleDto> updateBySequenceNbrSuperviseRule(@RequestBody SuperviseRuleDto model,@RequestParam(value = "sequenceNbr") Long sequenceNbr) {
model.setRecDate(new Date());
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(superviseRuleServiceImpl.updateWithModel(model));
}
......@@ -64,11 +77,16 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@DeleteMapping(value = "")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除监管区域规则表", notes = "根据sequenceNbr删除监管区域规则表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(superviseRuleServiceImpl.removeById(sequenceNbr));
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "sequenceNbr") String sequenceNbr){
List<Long> ids = Arrays.stream(sequenceNbr.split(",")).map(Long::valueOf).collect(Collectors.toList());
try{
return ResponseHelper.buildResponse(superviseRuleServiceImpl.removeByIds(ids));
} catch (Exception e){
return ResponseHelper.buildResponse(false);
}
}
/**
......@@ -77,10 +95,10 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个监管区域规则表", notes = "根据sequenceNbr查询单个监管区域规则表")
public ResponseModel<SuperviseRuleDto> selectOne(@PathVariable Long sequenceNbr) {
public ResponseModel<SuperviseRuleDto> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryBySeq(sequenceNbr));
}
......@@ -91,15 +109,20 @@ public class SuperviseRuleController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "监管区域规则表分页查询", notes = "监管区域规则表分页查询")
public ResponseModel<Page<SuperviseRuleDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
public ResponseModel<Page<SuperviseRuleDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
int adminRegionCode,
@RequestParam(value = "superviseDeptId", required = false) Long superviseDeptId,
@RequestParam(value = "inspectionUnitId", required = false) Long inspectionUnitId
) {
Page<SuperviseRuleDto> page = new Page<SuperviseRuleDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page));
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page, superviseDeptId, inspectionUnitId));
}
/**
......
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMsgMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeMsgService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -17,6 +19,9 @@ import java.util.List;
*/
@Service
public class InstallNoticeMsgServiceImpl extends BaseService<InstallNoticeMsgDto,InstallNoticeMsg,InstallNoticeMsgMapper> implements IInstallNoticeMsgService {
@Autowired
InstallNoticeMsgMapper installNoticeMsgMapper;
/**
* 分页查询
*/
......@@ -30,4 +35,22 @@ public class InstallNoticeMsgServiceImpl extends BaseService<InstallNoticeMsgDto
public List<InstallNoticeMsgDto> queryForInstallNoticeMsgList() {
return this.queryForList("" , false);
}
/**
* 项目安装告知短信通知记录分页查询
*/
@Override
public Page<InstallNoticeMsgPageDto> installNoticeMsgList(Page<InstallNoticeMsgPageDto> page, String name, String installationUnit){
return this.getBaseMapper().InstallNoticeMsgPage(page, name, installationUnit);
}
@Override
public Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, String name, String unit) {
return this.getBaseMapper().selectByName(page, name, unit);
}
@Override
public InstallNoticeMsgPageDto customSelectById(Long sequenceNbr) {
return this.getBaseMapper().customSelectById(sequenceNbr);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectResourceService;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto;
import org.aspectj.weaver.ast.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 项目资源表(包括焊工、管材、设备)服务实现类
......@@ -17,6 +30,13 @@ import java.util.List;
*/
@Service
public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,ProjectResource,ProjectResourceMapper> implements IProjectResourceService {
@Autowired
ProjectResourceMapper projectResourceMapper;
@Autowired
EquipmentMapper equipmentMapper;
/**
* 分页查询
*/
......@@ -30,4 +50,61 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
public List<ProjectResourceDto> queryForProjectResourceList() {
return this.queryForList("" , false);
}
@Override
public Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type) {
return this.projectResourceMapper.WelderEquipment(page, name, type);
}
@Override
public Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name, String unit) {
return null;
}
@Override
public Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info, String unit) {
return null;
}
@Override
public WelderEquipmentDto customSelectById(Long sequenceNbr) {
return null;
}
/**
* 项目设备新增
*/
@Transactional()
public void welderSave(WelderEquipmentDto welderEquipmentDto) {
// 保存设备
Equipment equipment = new Equipment();
BeanUtils.copyProperties(welderEquipmentDto, equipment);
equipmentMapper.insert(equipment);
// 处理附件
MultipartFile[] files = welderEquipmentDto.getFiles();
// 保存项目与设备对应关系
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(welderEquipmentDto.getProjectId());
projectResource.setName(equipment.getName());
projectResource.setType("equipment");
projectResource.setResourceId(equipment.getSequenceNbr());
projectResourceMapper.insert(projectResource);
}
/**
* 项目设备删除
* @param ids
*/
@Transactional
public void welderDelete(String ids) {
this.list(new QueryWrapper<ProjectResource>().lambda().in(
ProjectResource::getSequenceNbr,
Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()))
).forEach(item -> {
this.equipmentMapper.deleteById(item.getResourceId());
this.projectResourceMapper.deleteById(item.getSequenceNbr());
});
}
}
\ No newline at end of file
......@@ -20,8 +20,8 @@ public class SuperviseRuleServiceImpl extends BaseService<SuperviseRuleDto,Super
/**
* 分页查询
*/
public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page) {
return this.queryForPage(page, null, false);
public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page, Long superviseDeptId, Long inspectionUnitId) {
return this.queryForPage(page, null, false, superviseDeptId, inspectionUnitId );
}
/**
......
......@@ -6,18 +6,18 @@ spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
##eureka properties:
eureka.client.service-url.defaultZone =http://172.16.10.210:10001/eureka/
eureka.client.service-url.defaultZone =http://39.98.45.134:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.99:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://39.98.45.134:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.99:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.99:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.status-page-url=http://39.98.45.134:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://39.98.45.134:${server.port}${server.servlet.context-path}/swagger-ui.html
#redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.210
spring.redis.host=39.98.45.134
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
......
......@@ -45,8 +45,10 @@ spring.redis.expire.time=300
## emqx properties:
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.90:1883
emqx.broker=tcp://39.98.45.134:1883
emqx.user-name=super
emqx.password=123456
fire-rescue=123
\ No newline at end of file
fire-rescue=123
#logging.level.com.yeejoin.amos=error
\ 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