接口调整
This commit is contained in:
parent
3f9a5fefd3
commit
f5c7dcefce
@ -2,7 +2,7 @@ package com.zhgd.xmgl.modules.basicdata.api.image_ai;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.FireSmokeDetectExample;
|
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.FireSmokeDetectExample;
|
||||||
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.LargeSafetyHelmetDetectExample;
|
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.MediumSafetyHelmetDetectExample;
|
||||||
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.ReflectiveVestDetectExample;
|
import com.zhgd.xmgl.modules.basicdata.api.image_ai.common.ReflectiveVestDetectExample;
|
||||||
import com.zhgd.xmgl.modules.basicdata.api.image_ai.utils.AiBroker;
|
import com.zhgd.xmgl.modules.basicdata.api.image_ai.utils.AiBroker;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
@ -16,7 +16,7 @@ public class ImageApi {
|
|||||||
*/
|
*/
|
||||||
public JSONArray safetyHelmet(String rtsp) {
|
public JSONArray safetyHelmet(String rtsp) {
|
||||||
String result = AiBroker.runAs(rtsp, imagePath -> {
|
String result = AiBroker.runAs(rtsp, imagePath -> {
|
||||||
return LargeSafetyHelmetDetectExample.imageAi(imagePath);
|
return MediumSafetyHelmetDetectExample.imageAi(imagePath);
|
||||||
});
|
});
|
||||||
return JSONArray.parseArray(result);
|
return JSONArray.parseArray(result);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class ImageApi {
|
|||||||
|
|
||||||
public static void main(String[] argstia) {
|
public static void main(String[] argstia) {
|
||||||
try {
|
try {
|
||||||
System.out.println(safetyHelmet("rtsp://admin:jxj12345@10.0.77.104:554/Streaming/Channels/101"));
|
System.out.println(fireSmoke("rtsp://admin:jxj12345@10.0.77.104:554/Streaming/Channels/101"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public class Opencv {
|
|||||||
mat.release();
|
mat.release();
|
||||||
cvmat.release();
|
cvmat.release();
|
||||||
log.info("==========opencv success=============");
|
log.info("==========opencv success=============");
|
||||||
return filePath + fileUrl + ".jpg";
|
return fileUrl;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("==========opencv fail=============");
|
log.info("==========opencv fail=============");
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package com.zhgd.xmgl.modules.basicdata.controller.admin;
|
package com.zhgd.xmgl.modules.basicdata.controller.admin;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.annotation.OperLog;
|
import com.zhgd.annotation.OperLog;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
import com.zhgd.jeecg.common.util.PageUtil;
|
import com.zhgd.jeecg.common.util.PageUtil;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.AppVersion;
|
import com.zhgd.xmgl.modules.basicdata.entity.AppVersion;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IAppVersionService;
|
import com.zhgd.xmgl.modules.basicdata.service.IAppVersionService;
|
||||||
@ -44,12 +46,14 @@ public class AppVersionController {
|
|||||||
@ApiOperation(value = " 分页列表查询APP版本表信息", notes = "分页列表查询APP版本表信息", httpMethod="POST")
|
@ApiOperation(value = " 分页列表查询APP版本表信息", notes = "分页列表查询APP版本表信息", httpMethod="POST")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "query", required = true, defaultValue = "1", dataType = "Integer"),
|
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "query", required = true, defaultValue = "1", dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query", required = true, defaultValue = "10", dataType = "Integer")
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query", required = true, defaultValue = "10", dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "versionName", value = "版本名称", paramType = "query", dataType = "String")
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/page")
|
@PostMapping(value = "/page")
|
||||||
public Result<IPage<AppVersion>> queryPageList(@RequestBody Map<String, Object> map) {
|
public Result<IPage<AppVersion>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||||
|
QueryWrapper<AppVersion> queryWrapper = QueryGenerator.initPageQueryWrapper(AppVersion.class, map);
|
||||||
Page<AppVersion> page = PageUtil.getPage(map);
|
Page<AppVersion> page = PageUtil.getPage(map);
|
||||||
return Result.success(appVersionService.page(page, null));
|
return Result.success(appVersionService.page(page, queryWrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -62,6 +62,7 @@ public class BaseModuleController {
|
|||||||
public Result<IPage<BaseModule>> queryPageList(@RequestBody Map<String, Object> map) {
|
public Result<IPage<BaseModule>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||||
QueryWrapper<BaseModule> queryWrapper = QueryGenerator.initPageQueryWrapper(BaseModule.class, map);
|
QueryWrapper<BaseModule> queryWrapper = QueryGenerator.initPageQueryWrapper(BaseModule.class, map);
|
||||||
Page page = PageUtil.getPage(map);
|
Page page = PageUtil.getPage(map);
|
||||||
|
queryWrapper.orderByAsc("label_sort_num", "priority");
|
||||||
IPage<BaseModule> pageList = baseModuleService.pageList(page, queryWrapper);
|
IPage<BaseModule> pageList = baseModuleService.pageList(page, queryWrapper);
|
||||||
return Result.success(pageList);
|
return Result.success(pageList);
|
||||||
}
|
}
|
||||||
@ -76,7 +77,6 @@ public class BaseModuleController {
|
|||||||
public Result<Map<String, Object>> queryListByType(@RequestBody BaseModule baseModule, HttpServletRequest req) {
|
public Result<Map<String, Object>> queryListByType(@RequestBody BaseModule baseModule, HttpServletRequest req) {
|
||||||
Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
||||||
QueryWrapper<BaseModule> queryWrapper = QueryGenerator.initQueryWrapper(baseModule, req.getParameterMap());
|
QueryWrapper<BaseModule> queryWrapper = QueryGenerator.initQueryWrapper(baseModule, req.getParameterMap());
|
||||||
queryWrapper.orderByDesc("is_important_module");
|
|
||||||
queryWrapper.orderByAsc("label_sort_num", "priority");
|
queryWrapper.orderByAsc("label_sort_num", "priority");
|
||||||
List<BaseModule> list = baseModuleService.list(queryWrapper);
|
List<BaseModule> list = baseModuleService.list(queryWrapper);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|||||||
@ -9,7 +9,9 @@ import com.zhgd.jeecg.common.api.vo.Result;
|
|||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||||
import com.zhgd.xmgl.modules.basicdata.dto.SystemUserDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.SystemUserDto;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.Government;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IGovernmentService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.vo.SystemUserVo;
|
import com.zhgd.xmgl.modules.basicdata.vo.SystemUserVo;
|
||||||
import com.zhgd.xmgl.security.JwtTokenProvider;
|
import com.zhgd.xmgl.security.JwtTokenProvider;
|
||||||
@ -57,6 +59,9 @@ public class SystemUserController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISystemUserService systemUserService;
|
private ISystemUserService systemUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IGovernmentService governmentService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JwtTokenProvider jwtTokenProvider;
|
private JwtTokenProvider jwtTokenProvider;
|
||||||
|
|
||||||
@ -324,12 +329,16 @@ public class SystemUserController {
|
|||||||
result.error500("登录名或密码错误");
|
result.error500("登录名或密码错误");
|
||||||
} else if(userInfo.getState() == 0) {
|
} else if(userInfo.getState() == 0) {
|
||||||
result.error500("账号已被禁用,请联系管理员");
|
result.error500("账号已被禁用,请联系管理员");
|
||||||
} else {
|
} else if(userInfo.getAccountType() != 1) {
|
||||||
|
Government government = governmentService.getGovByUser(userInfo);
|
||||||
|
if (government == null || government.getState() == 0) {
|
||||||
|
result.error500("住建局账号异常,请联系管理员");
|
||||||
|
}
|
||||||
|
}
|
||||||
String token = jwtTokenProvider.createToken(userInfo.getAccount(), 3600 * 24);
|
String token = jwtTokenProvider.createToken(userInfo.getAccount(), 3600 * 24);
|
||||||
userInfo.setToken(token);
|
userInfo.setToken(token);
|
||||||
result.setResult(userInfo);
|
result.setResult(userInfo);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,8 +66,14 @@ public class EngineeringController {
|
|||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<Engineering> add(@RequestBody EngineeringVo engineeringVo) {
|
public Result<Engineering> add(@RequestBody EngineeringVo engineeringVo) {
|
||||||
Result<Engineering> result = new Result<Engineering>();
|
Result<Engineering> result = new Result<Engineering>();
|
||||||
|
Engineering engineering = engineeringService.getOne(Wrappers.<Engineering>lambdaQuery()
|
||||||
|
.eq(Engineering::getEngineeringName, engineeringVo.getEngineeringName()));
|
||||||
|
if (engineering != null) {
|
||||||
|
result.error500("该工程名已被占用");
|
||||||
|
} else {
|
||||||
engineeringService.saveInfo(engineeringVo);
|
engineeringService.saveInfo(engineeringVo);
|
||||||
result.success("添加成功!");
|
result.success("添加成功!");
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,10 @@ package com.zhgd.xmgl.modules.basicdata.controller.project;
|
|||||||
import com.zhgd.annotation.OperLog;
|
import com.zhgd.annotation.OperLog;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.Enterprise;
|
import com.zhgd.xmgl.modules.basicdata.entity.Enterprise;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain;
|
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
|
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,13 +41,13 @@ public class EnterpriseController {
|
|||||||
*/
|
*/
|
||||||
@OperLog(operModul = "企业管理", operType = "列表查询", operDesc = "列表查询相对应资质的企业")
|
@OperLog(operModul = "企业管理", operType = "列表查询", operDesc = "列表查询相对应资质的企业")
|
||||||
@ApiOperation(value = "列表查询相对应资质的企业", notes = "列表查询相对应资质的企业", httpMethod = "POST")
|
@ApiOperation(value = "列表查询相对应资质的企业", notes = "列表查询相对应资质的企业", httpMethod = "POST")
|
||||||
@ApiImplicitParam(name = "mainType", value = "企业主体类型(1:建设;2:监理;3:施工;4:勘察;5:设计;)", paramType = "query", required = true, dataType = "Integer")
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "mainType", value = "企业主体类型(1:建设;2:监理;3:施工;4:勘察;5:设计;)", paramType = "query", required = true, dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "enterpriseName", value = "企业名称", paramType = "query", required = true, dataType = "String")
|
||||||
|
})
|
||||||
@PostMapping(value = "/listByMainType")
|
@PostMapping(value = "/listByMainType")
|
||||||
public Result<List<Enterprise>> listByMainType(@RequestBody EnterpriseMain enterpriseMain) {
|
public Result<List<Enterprise>> listByMainType(@RequestBody Map<String, Object> map) {
|
||||||
Result<List<Enterprise>> result = new Result<List<Enterprise>>();
|
List<Enterprise> enterpriseList = enterpriseService.listByMainType(map);
|
||||||
List<Enterprise> enterpriseList = enterpriseService.listByMainType(enterpriseMain.getMainType());
|
return Result.success(enterpriseList);
|
||||||
result.setResult(enterpriseList);
|
|
||||||
result.setSuccess(true);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -168,6 +170,12 @@ public class Engineering implements Serializable {
|
|||||||
@Excel(name = "安全监督编号", width = 15)
|
@Excel(name = "安全监督编号", width = 15)
|
||||||
@ApiModelProperty(value = "安全监督编号")
|
@ApiModelProperty(value = "安全监督编号")
|
||||||
private String safetySupervisionCode;
|
private String safetySupervisionCode;
|
||||||
|
/**
|
||||||
|
* 安全监督员
|
||||||
|
*/
|
||||||
|
@Excel(name = "安全监督员", width = 15)
|
||||||
|
@ApiModelProperty(value = "安全监督员")
|
||||||
|
private String safetySupervisionPerson;
|
||||||
/**
|
/**
|
||||||
* 安全监督工程状态
|
* 安全监督工程状态
|
||||||
*/
|
*/
|
||||||
@ -192,6 +200,12 @@ public class Engineering implements Serializable {
|
|||||||
@Excel(name = "质量监督编码", width = 15)
|
@Excel(name = "质量监督编码", width = 15)
|
||||||
@ApiModelProperty(value = "质量监督编码")
|
@ApiModelProperty(value = "质量监督编码")
|
||||||
private String qualitySupervisionCode;
|
private String qualitySupervisionCode;
|
||||||
|
/**
|
||||||
|
* 质量监督员
|
||||||
|
*/
|
||||||
|
@Excel(name = "质量监督员", width = 15)
|
||||||
|
@ApiModelProperty(value = "质量监督员")
|
||||||
|
private String qualitySupervisionPerson;
|
||||||
/**
|
/**
|
||||||
* 质量监督工程状态
|
* 质量监督工程状态
|
||||||
*/
|
*/
|
||||||
@ -207,13 +221,17 @@ public class Engineering implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 合同开工日期
|
* 合同开工日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "合同开工日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "合同开工日期", width = 20, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "合同开工日期")
|
@ApiModelProperty(value = "合同开工日期")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
/**
|
/**
|
||||||
* 合同竣工日期
|
* 合同竣工日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "合同竣工日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "合同竣工日期", width = 20, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "合同竣工日期")
|
@ApiModelProperty(value = "合同竣工日期")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -56,4 +56,16 @@ public class EngineeringMain implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "企业名称")
|
@ApiModelProperty(value = "企业名称")
|
||||||
private String enterpriseName;
|
private String enterpriseName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "企业信用代码")
|
||||||
|
private String creditCode;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "企业法定代表人")
|
||||||
|
private String legalPerson;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "企业法定代表人电话")
|
||||||
|
private String legalPersonTel;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,5 +15,5 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface EnterpriseMainMapper extends BaseMapper<EnterpriseMain> {
|
public interface EnterpriseMainMapper extends BaseMapper<EnterpriseMain> {
|
||||||
|
|
||||||
List<EnterpriseMain> getList(String dictType, String enterpriseSn);
|
List<EnterpriseMain> getList(String enterpriseSn);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,5 +24,5 @@ public interface EnterpriseMapper extends BaseMapper<Enterprise> {
|
|||||||
|
|
||||||
EnterpriseVo getDetailById(@Param("enterpriseId") Long enterpriseId);
|
EnterpriseVo getDetailById(@Param("enterpriseId") Long enterpriseId);
|
||||||
|
|
||||||
List<Enterprise> listByMainType(@Param("mainType") Integer mainType, @Param("governmentSn") String governmentSn);
|
List<Enterprise> listByMainType(@Param(Constants.WRAPPER) Wrapper<Object> wrapper);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.EnterpriseMainMapper">
|
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.EnterpriseMainMapper">
|
||||||
|
|
||||||
<select id="getList" resultType="com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain">
|
<select id="getList" resultType="com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain">
|
||||||
SELECT m.*, d.dict_value as mainTypeName FROM enterprise_main m
|
SELECT m.*, e.enterprise_ame, e.credit_code, e.legal_person, e.legal_person_tel FROM enterprise_main m
|
||||||
LEFT JOIN system_dict_data d
|
LEFT JOIN enterprise e
|
||||||
ON m.main_type = d.dict_label AND d.dict_type = #{dictType}
|
ON m.enterprise_sn = e.enterprise_sn
|
||||||
WHERE m.enterprise_sn = #{enterpriseSn}
|
WHERE m.enterprise_sn = #{enterpriseSn}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<select id="listByMainType" resultType="com.zhgd.xmgl.modules.basicdata.entity.Enterprise">
|
<select id="listByMainType" resultType="com.zhgd.xmgl.modules.basicdata.entity.Enterprise">
|
||||||
SELECT c.* FROM enterprise c INNER JOIN enterprise_main m ON c.enterprise_sn = m.enterprise_sn
|
SELECT c.* FROM enterprise c INNER JOIN enterprise_main m ON c.enterprise_sn = m.enterprise_sn
|
||||||
WHERE c.government_sn = #{governmentSn} AND m.main_type = #{mainType}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="pageList" resultType="com.zhgd.xmgl.modules.basicdata.entity.Enterprise">
|
<select id="pageList" resultType="com.zhgd.xmgl.modules.basicdata.entity.Enterprise">
|
||||||
|
|||||||
@ -24,5 +24,5 @@ public interface IEnterpriseService extends IService<Enterprise> {
|
|||||||
|
|
||||||
EnterpriseVo getDetailById(Long enterpriseId);
|
EnterpriseVo getDetailById(Long enterpriseId);
|
||||||
|
|
||||||
List<Enterprise> listByMainType(Integer mainType);
|
List<Enterprise> listByMainType(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.dto.GovernmentDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.GovernmentDto;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.Government;
|
import com.zhgd.xmgl.modules.basicdata.entity.Government;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
import com.zhgd.xmgl.modules.basicdata.vo.GovernmentVo;
|
import com.zhgd.xmgl.modules.basicdata.vo.GovernmentVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,4 +25,6 @@ public interface IGovernmentService extends IService<Government> {
|
|||||||
int updateInfo(GovernmentVo governmentVo);
|
int updateInfo(GovernmentVo governmentVo);
|
||||||
|
|
||||||
GovernmentDto getDetailById(Government government);
|
GovernmentDto getDetailById(Government government);
|
||||||
|
|
||||||
|
Government getGovByUser(SystemUser systemUser);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
|||||||
Enterprise enterprise = enterpriseService.getOne(Wrappers.<Enterprise>lambdaQuery().eq(Enterprise::getGovernmentSn, user.getSn()));
|
Enterprise enterprise = enterpriseService.getOne(Wrappers.<Enterprise>lambdaQuery().eq(Enterprise::getGovernmentSn, user.getSn()));
|
||||||
governmentSn = enterprise.getGovernmentSn();
|
governmentSn = enterprise.getGovernmentSn();
|
||||||
} else if (user.getAccountType() == 4){
|
} else if (user.getAccountType() == 4){
|
||||||
Project project = projectService.getOne(Wrappers.<Project>lambdaQuery().eq(Project::getGovernmentSn, user.getSn()));
|
Project project = projectService.getOne(Wrappers.<Project>lambdaQuery().eq(Project::getProjectSn, user.getSn()));
|
||||||
governmentSn = project.getGovernmentSn();
|
governmentSn = project.getGovernmentSn();
|
||||||
}
|
}
|
||||||
// TODO 一步到位
|
// TODO 一步到位
|
||||||
@ -87,7 +87,9 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
|||||||
@Override
|
@Override
|
||||||
public boolean removeInfo(String id) {
|
public boolean removeInfo(String id) {
|
||||||
List<String> actionIds = baseActionMapper.getByModuleId(id);
|
List<String> actionIds = baseActionMapper.getByModuleId(id);
|
||||||
|
if (actionIds.size() > 0) {
|
||||||
baseActionMapper.deleteBatchIds(actionIds);
|
baseActionMapper.deleteBatchIds(actionIds);
|
||||||
|
}
|
||||||
baseMenuMapper.delete(Wrappers.<BaseMenu>lambdaQuery().eq(BaseMenu::getModuleId, id));
|
baseMenuMapper.delete(Wrappers.<BaseMenu>lambdaQuery().eq(BaseMenu::getModuleId, id));
|
||||||
return this.removeById(id);
|
return this.removeById(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain;
|
import com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain;
|
||||||
import com.zhgd.xmgl.modules.basicdata.mapper.EnterpriseMainMapper;
|
import com.zhgd.xmgl.modules.basicdata.mapper.EnterpriseMainMapper;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseMainService;
|
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseMainService;
|
||||||
import com.zhgd.xmgl.util.ParamEnum;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,6 +19,6 @@ public class EnterpriseMainServiceImpl extends ServiceImpl<EnterpriseMainMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnterpriseMain> getList(String enterpriseSn) {
|
public List<EnterpriseMain> getList(String enterpriseSn) {
|
||||||
return baseMapper.getList(ParamEnum.SysDictType.ENTERPRISE_MAIN.getValue(), enterpriseSn);
|
return baseMapper.getList(enterpriseSn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,8 +139,16 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Enterprise> listByMainType(Integer mainType) {
|
public List<Enterprise> listByMainType(Map<String, Object> map) {
|
||||||
Project project = projectMapper.selectOne(Wrappers.<Project>lambdaQuery().eq(Project::getProjectSn, SecurityUtil.getUser().getSn()));
|
Project project = projectMapper.selectOne(Wrappers.<Project>lambdaQuery().eq(Project::getProjectSn, SecurityUtil.getUser().getSn()));
|
||||||
return baseMapper.listByMainType(mainType, project.getGovernmentSn());
|
Integer mainType = MapUtils.getInteger(map, "mainType");
|
||||||
|
String enterpriseName = MapUtils.getString(map, "enterpriseName");
|
||||||
|
QueryWrapper<Object> query = Wrappers.<Object>query();
|
||||||
|
query.eq("m.main_type", mainType);
|
||||||
|
query.eq("c.government_sn", project.getGovernmentSn());
|
||||||
|
if(StringUtils.isNotBlank(enterpriseName)) {
|
||||||
|
query.like("c.enterprise_name", enterpriseName);
|
||||||
|
}
|
||||||
|
return baseMapper.listByMainType(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,4 +115,21 @@ public class GovernmentServiceImpl extends ServiceImpl<GovernmentMapper, Governm
|
|||||||
governmentDto.setPassword(systemUser.getShowPassword());
|
governmentDto.setPassword(systemUser.getShowPassword());
|
||||||
return governmentDto;
|
return governmentDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Government getGovByUser(SystemUser systemUser) {
|
||||||
|
String govSn = "";
|
||||||
|
if (systemUser.getAccountType() == 4) {
|
||||||
|
Project project = projectMapper.selectOne(Wrappers.<Project>lambdaQuery().eq(Project::getProjectSn, systemUser.getSn()));
|
||||||
|
govSn = project.getGovernmentSn();
|
||||||
|
}
|
||||||
|
if (systemUser.getAccountType() == 3) {
|
||||||
|
Project project = projectMapper.selectOne(Wrappers.<Project>lambdaQuery().eq(Project::getProjectSn, systemUser.getSn()));
|
||||||
|
govSn = project.getGovernmentSn();
|
||||||
|
}
|
||||||
|
if (systemUser.getAccountType() == 2) {
|
||||||
|
govSn = systemUser.getSn();
|
||||||
|
}
|
||||||
|
return this.getOne(Wrappers.<Government>lambdaQuery().eq(Government::getGovernmentSn, govSn));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class ImageAiTask {
|
|||||||
*/
|
*/
|
||||||
// @Scheduled(cron = "0 0 * * * ?")
|
// @Scheduled(cron = "0 0 * * * ?")
|
||||||
private void safetyHelmet() {
|
private void safetyHelmet() {
|
||||||
log.error("=========AI识别预警任务执行开始========");
|
log.info("=========AI识别预警任务执行开始========");
|
||||||
JSONArray jsonArray = ImageApi.safetyHelmet("rtsp://admin:jxj12345@10.0.77.104:554/Streaming/Channels/101");
|
JSONArray jsonArray = ImageApi.safetyHelmet("rtsp://admin:jxj12345@10.0.77.104:554/Streaming/Channels/101");
|
||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
String className = jsonArray.getJSONObject(i).getString("className");
|
String className = jsonArray.getJSONObject(i).getString("className");
|
||||||
@ -27,6 +27,10 @@ public class ImageAiTask {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.error("=========AI识别预警任务执行结束========");
|
log.info("=========AI识别预警任务执行结束========");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(ImageApi.safetyHelmet("rtsp://admin:jxj12345@10.0.77.104:554/Streaming/Channels/101"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user