提交代码

main
姜玉琦 2024-10-28 22:06:39 +08:00
parent 09351213fb
commit 4cbde59770
7 changed files with 44 additions and 33 deletions

View File

@ -398,6 +398,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/system/alterationEndorseConfig/**", "anon");
filterChainDefinitionMap.put("/mkl/api/queryEnvironment", "anon");
filterChainDefinitionMap.put("/mkl/api/getWaringIngBaseInfo", "anon");
filterChainDefinitionMap.put("/mklApi/towerCrane/v1/push", "anon");
filterChainDefinitionMap.put("/business/saftEducationOpenIdMap/**", "anon");
filterChainDefinitionMap.put("/system/checkDutyUser/**", "anon");
filterChainDefinitionMap.put("/system/saftcheckissue/**", "anon");

View File

@ -9,6 +9,8 @@ import com.yanzhu.xd.system.domain.DevTowerProjectConfig;
import com.yanzhu.xd.system.domain.TowerReqVo;
import com.yanzhu.xd.system.emuns.TowerTypeEnums;
import com.yanzhu.xd.system.service.IDevTowerProjectConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@ -31,6 +33,8 @@ import java.util.Objects;
@RequestMapping("/mklApi/towerCrane")
public class TowerCraneApiController {
private static final Logger log = LoggerFactory.getLogger(TowerCraneApiController.class);
@Autowired
private IDevTowerProjectConfigService configService;
@ -52,7 +56,7 @@ public class TowerCraneApiController {
@PostMapping("/v1/push")
public AjaxResult pushData(@Validated @RequestBody TowerReqVo req) {
if(Objects.isNull(cacheMap.get("tower_cfg_"+req.getContent().getDeviceKey()))){
DevTowerProjectConfig config = configService.selectDevTowerProjectConfigById(Convert.toLong(req.getContent().getDeviceKey()));
DevTowerProjectConfig config = configService.selectDevTowerProjectConfigBySn(req.getContent().getDeviceKey());
if(config==null){
throw new ServiceException("设备序列号错误,请联系管理员配置序列号...");
}
@ -448,6 +452,7 @@ public class TowerCraneApiController {
* @param req
*/
private void pushLimitData(TowerReqVo req){
System.out.println("d3==>pushLimitData");
String sn = req.getContent().getDeviceKey();
Map<String, Object> dataContent = req.getContent().getDataContent();
@ -491,5 +496,7 @@ public class TowerCraneApiController {
*
* @param req
*/
private void pushLocalData(TowerReqVo req){}
private void pushLocalData(TowerReqVo req){
log.info("pushLocalData...");
}
}

View File

@ -25,13 +25,6 @@ public class DevTowerProjectConfig extends BaseEntity
@Excel(name = "项目名称")
private String projectName;
/** 总包单位主键 */
private Long deptId;
/** 总包单位名称 */
@Excel(name = "总包单位名称")
private String deptName;
/** 设备序列号 */
@Excel(name = "设备序列号")
private String deviceSn;
@ -122,15 +115,7 @@ public class DevTowerProjectConfig extends BaseEntity
{
return projectId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setDeviceSn(String deviceSn)
{
this.deviceSn = deviceSn;
@ -298,20 +283,11 @@ public class DevTowerProjectConfig extends BaseEntity
this.projectName = projectName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("projectId", getProjectId())
.append("deptId", getDeptId())
.append("deviceSn", getDeviceSn())
.append("deviceName", getDeviceName())
.append("deviceSource", getDeviceSource())

View File

@ -21,6 +21,14 @@ public interface DevTowerProjectConfigMapper
*/
public DevTowerProjectConfig selectDevTowerProjectConfigById(Long id);
/**
*
*
* @param sn
* @return
*/
public DevTowerProjectConfig selectDevTowerProjectConfigBySn(String sn);
/**
*
*

View File

@ -22,6 +22,14 @@ public interface IDevTowerProjectConfigService
*/
public DevTowerProjectConfig selectDevTowerProjectConfigById(Long id);
/**
*
*
* @param sn
* @return
*/
public DevTowerProjectConfig selectDevTowerProjectConfigBySn(String sn);
/**
*
*

View File

@ -36,6 +36,17 @@ public class DevTowerProjectConfigServiceImpl implements IDevTowerProjectConfigS
return devTowerProjectConfigMapper.selectDevTowerProjectConfigById(id);
}
/**
*
*
* @param sn
* @return
*/
@Override
public DevTowerProjectConfig selectDevTowerProjectConfigBySn(String sn){
return devTowerProjectConfigMapper.selectDevTowerProjectConfigBySn(sn);
}
/**
*
*

View File

@ -8,8 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="projectName" column="projectName" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="deviceSn" column="device_sn" />
<result property="deviceName" column="device_name" />
<result property="deviceSource" column="device_source" />
@ -36,9 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDevTowerProjectConfigVo">
select dtpc.id, dtpc.project_id, dtpc.dept_id, sp.projectName, sd.dept_name, dtpc.device_sn, dtpc.device_name, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.online, dtpc.dri_name, dtpc.dri_phone, dtpc.saf_name, dtpc.saf_phone, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc
select dtpc.id, dtpc.project_id, sp.projectName, dtpc.device_sn, dtpc.device_name, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.online, dtpc.dri_name, dtpc.dri_phone, dtpc.saf_name, dtpc.saf_phone, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc
left join sur_project sp on sp.id = dtpc.project_id
left join sys_dept sd on sd.dept_id = dtpc.dept_id
</sql>
<select id="selectDevTowerProjectConfigList" parameterType="DevTowerProjectConfig" resultMap="DevTowerProjectConfigResult">
@ -46,8 +43,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="projectId != null "> and dtpc.project_id = #{projectId}</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="deptId != null "> and dtpc.dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
<if test="deviceSn != null and deviceSn != ''"> and dtpc.device_sn = #{deviceSn}</if>
<if test="deviceName != null and deviceName != ''"> and dtpc.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceSource != null and deviceSource != ''"> and dtpc.device_source = #{deviceSource}</if>
@ -62,7 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDevTowerProjectConfigVo"/>
where dtpc.id = #{id}
</select>
<select id="selectDevTowerProjectConfigBySn" parameterType="String" resultMap="DevTowerProjectConfigResult">
<include refid="selectDevTowerProjectConfigVo"/>
where dtpc.device_sn = #{sn} and dtpc.is_del = '0'
</select>
<insert id="insertDevTowerProjectConfig" parameterType="DevTowerProjectConfig" useGeneratedKeys="true" keyProperty="id">
insert into dev_tower_project_config
<trim prefix="(" suffix=")" suffixOverrides=",">