1
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
package com.mosty.hczx;
|
||||
|
||||
import com.mosty.common.base.timeconsume.EnableTimeConsume;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 核查中心 微服务
|
||||
* @author zengbo
|
||||
* @date 2022/7/11 14:29 PM[
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@EnableTimeConsume
|
||||
//@ComponentScan("com.mosty")
|
||||
@EnableFeignClients(basePackages = "com.mosty.base.feign.service")
|
||||
@MapperScan("com.mosty.hczx.mapper")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
//@EnableScheduling
|
||||
public class MostyHczxApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(MostyHczxApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.mosty.hczx.config;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Configuration
|
||||
public class FeignConfig implements RequestInterceptor {
|
||||
|
||||
@Override
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attr != null) {
|
||||
HttpServletRequest request = attr.getRequest();
|
||||
// 添加token
|
||||
requestTemplate.header("Authorization", request.getHeader("Authorization"));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.mosty.hczx.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全局配置
|
||||
* @author kevin
|
||||
* @date 2022/5/25 1:56 上午
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties("exclude.path-patterns")
|
||||
public class GlobalYmlConfig {
|
||||
|
||||
/**
|
||||
* swagger 静态文件的放行列表
|
||||
*/
|
||||
private List<String> swagger;
|
||||
|
||||
}
|
120
mosty-hczx/src/main/java/com/mosty/hczx/config/WebMvcConfig.java
Normal file
120
mosty-hczx/src/main/java/com/mosty/hczx/config/WebMvcConfig.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.mosty.hczx.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
import com.mosty.common.token.SysUserInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单体服务拦截器
|
||||
* @author kevin
|
||||
* @date 2022/3/21 11:17 PM
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class WebMvcConfig implements WebMvcConfigurer, InitializingBean {
|
||||
|
||||
private static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
|
||||
private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
|
||||
private static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
@Value("${server.servlet.context-path:/}")
|
||||
private String contextPath;
|
||||
|
||||
@Autowired
|
||||
private GlobalYmlConfig globalYmlConfig;
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||
ObjectMapper objectMapper = converter.getObjectMapper();
|
||||
// 生成JSON时,将所有Long转换成String
|
||||
SimpleModule simpleModule = new SimpleModule();
|
||||
//日期格式化
|
||||
simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
|
||||
simpleModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
|
||||
simpleModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
|
||||
simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
|
||||
simpleModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
|
||||
simpleModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
|
||||
objectMapper.registerModule(simpleModule);
|
||||
// 时间格式化
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
objectMapper.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true);
|
||||
objectMapper.configure(JsonGenerator.Feature.IGNORE_UNKNOWN, true);
|
||||
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
// 设置格式化内容
|
||||
converter.setObjectMapper(objectMapper);
|
||||
converters.add(0, converter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
log.info("当前服务的 contextPath={}", contextPath);
|
||||
log.info("当前服务的 swaggerExcludePathPatterns={}", JSON.toJSONString(globalYmlConfig.getSwagger()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
||||
configurer.defaultContentType(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(userInfoInterceptor()).addPathPatterns("/**")
|
||||
.excludePathPatterns(globalYmlConfig.getSwagger());
|
||||
log.info("初始化WebMvcConfig 监控拦截器SysUserInterceptor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
if (!registry.hasMappingForPattern("/template/**")) {
|
||||
registry.addResourceHandler("/template/**").addResourceLocations("classpath:/template/");
|
||||
}
|
||||
registry.addResourceHandler("swagger-ui.html")
|
||||
.addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("docs.html")
|
||||
.addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
WebMvcConfigurer.super.addResourceHandlers(registry);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SysUserInterceptor userInfoInterceptor() {
|
||||
log.info("初始化WebMvcConfig 拦截器SysUserInterceptor");
|
||||
return new SysUserInterceptor();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.mosty.base.utils.Constant;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(path = "/hcSse")
|
||||
public class SseHcController {
|
||||
|
||||
|
||||
@RequestMapping(value = "test", method = RequestMethod.GET)
|
||||
public Object test() {
|
||||
return DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "subscribe")
|
||||
@JwtSysUser
|
||||
public SseEmitter push(String id) throws IOException {
|
||||
System.out.println(id);
|
||||
// 超时时间设置为1小时
|
||||
SseEmitter sseEmitter = new SseEmitter(3600_000L);
|
||||
// 设置前端的重试时间为1s
|
||||
sseEmitter.send(SseEmitter.event().reconnectTime(1000).data("连接成功"));
|
||||
Constant.HcSse.put(id, sseEmitter);
|
||||
sseEmitter.onTimeout(() -> Constant.HcSse.remove(id));
|
||||
sseEmitter.onCompletion(() -> System.out.println("完成!!!"));
|
||||
return sseEmitter;
|
||||
}
|
||||
|
||||
@PostMapping(path = "push")
|
||||
@ResponseBody
|
||||
@JwtSysUser
|
||||
public String push(String id, String content) throws IOException {
|
||||
SseEmitter sseEmitter = Constant.HcSse.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.send(content);
|
||||
}
|
||||
return "push over";
|
||||
}
|
||||
|
||||
@GetMapping(path = "close")
|
||||
@ResponseBody
|
||||
public String over(String id) throws IOException {
|
||||
SseEmitter sseEmitter = Constant.HcSse.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.send("close");
|
||||
sseEmitter.send(SseEmitter.event().name("close").id(id).data(""));
|
||||
sseEmitter.complete();
|
||||
Constant.HcSse.remove(id);
|
||||
}
|
||||
return "close over";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcclInsertDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcclQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcryQuery;
|
||||
import com.mosty.base.model.vo.hczx.TbHcBpcclVo;
|
||||
import com.mosty.base.model.vo.hczx.TbHcBpcryVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpccl;
|
||||
import com.mosty.base.model.query.hczx.TbHcTodayBpcclQuery;
|
||||
import com.mosty.hczx.service.TbHcBpcclService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/8/2
|
||||
**/
|
||||
@Api(tags = "核查中心-被盘查车辆接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbHcBpccl")
|
||||
public class TbHcBpcclController {
|
||||
|
||||
private final TbHcBpcclService tbHcBpcclService;
|
||||
|
||||
@ApiOperation("大屏-数据统计区(左上侧)查询盘查车辆数量")
|
||||
@GetMapping("/selectCarCount")
|
||||
@JwtSysUser
|
||||
public ResponseResult<Integer> selectCarCount() {
|
||||
return ResponseResult.success(tbHcBpcclService.selectCarCount());
|
||||
}
|
||||
|
||||
@ApiOperation("大屏-数据统计区(左上侧)-查询盘查车辆列表分页")
|
||||
@GetMapping("/selectCarList")
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbHcBpcclVo>> selectCarList(TbHcTodayBpcclQuery dto) {
|
||||
return ResponseResult.success(tbHcBpcclService.selectCarList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("APP_查询车辆信息")
|
||||
@PostMapping("/selectCl")
|
||||
@Log(title = "APP_查询车辆信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<TbHcBpcclVo> selectCl(@RequestBody TbHcBpcclQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.selectCl(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("保存被盘查车辆信息")
|
||||
@PostMapping("/saveBpccl")
|
||||
@Log(title = "保存被盘查车辆信息", businessType = BusinessType.UPDATE)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Void> saveBpccl(@RequestBody TbHcBpcclInsertDto dto) {
|
||||
this.tbHcBpcclService.saveBpccl(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("查询两个小时内没有被人员绑定的车辆")
|
||||
@PostMapping("/getClOf2h")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbHcBpcclVo>> getClOf2h() {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getClOf2h());
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询车辆盘查信息")
|
||||
@PostMapping("getClpcList")
|
||||
@Log(title = "条件查询人员盘查信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbHcBpcclVo>> getClpcList(@RequestBody TbHcBpcclQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getClpcList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询车辆盘查信息")
|
||||
@PostMapping("getClpcCount")
|
||||
@Log(title = "条件查询人员盘查信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Map<String, Integer>> getClpcCount(@RequestBody TbHcBpcclQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getClpcCount(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("大屏被盘查车辆统计")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/bpcclTj")
|
||||
public ResponseResult<Map<String, Integer>> bpcclTj() {
|
||||
return ResponseResult.success(this.tbHcBpcclService.bpcclTj());
|
||||
}
|
||||
|
||||
@ApiOperation("实际盘查车数")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/getSjpcc")
|
||||
public ResponseResult<Integer> getSjpcc(@RequestParam("ssbmdm") String ssbmdm,
|
||||
@RequestParam("time") String time) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getSjpcc(ssbmdm, time));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("盘查物品统计")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/getPcWptj")
|
||||
public ResponseResult<Integer> getPcWptj(@RequestParam("ssbmdm") String ssbmdm,
|
||||
@RequestParam("time") String time) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getPcWptj(ssbmdm, time));
|
||||
}
|
||||
|
||||
@ApiOperation("盘查统计")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/getPctj")
|
||||
public ResponseResult<Object> getPctj(@RequestBody HcTjQuery query) {
|
||||
return ResponseResult.success(this.tbHcBpcclService.getPctj(query));
|
||||
}
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcry;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import com.mosty.base.model.query.hczx.RyClTjQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcryQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcTodayBpcryQuery;
|
||||
import com.mosty.base.model.vo.hczx.RyZpSearchVo;
|
||||
import com.mosty.base.model.vo.hczx.TbHcBpcryVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.hczx.service.TbHcBpcryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/8/2
|
||||
* 核查中心-被盘查人员接口
|
||||
**/
|
||||
@Api(tags = "核查中心-被盘查人员接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbHcBpcry")
|
||||
public class TbHcBpcryController {
|
||||
|
||||
private final TbHcBpcryService tbHcBpcryService;
|
||||
|
||||
@ApiOperation("大屏-数据统计区(左上侧)-查询盘查人员数量")
|
||||
@GetMapping("/selectCrewCount")
|
||||
@JwtSysUser
|
||||
public ResponseResult<Integer> selectCrewCount() {
|
||||
return ResponseResult.success(tbHcBpcryService.selectCrewCount());
|
||||
}
|
||||
|
||||
@ApiOperation("大屏-数据统计区(左上侧)-查询盘查人员列表分页")
|
||||
@GetMapping("/selectCrewList")
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbHcBpcryVo>> selectCrewList(TbHcTodayBpcryQuery dto) {
|
||||
return ResponseResult.success(tbHcBpcryService.selectCrewList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("APP_查询人员信息")
|
||||
@PostMapping("/selectRy")
|
||||
@Log(title = "APP_查询人员信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<TbHcBpcryVo> selectRy(@RequestBody TbHcBpcryQuery dto) {
|
||||
return ResponseResult.success(tbHcBpcryService.selectRy(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询人员标签代码")
|
||||
@GetMapping("/getRyBq")
|
||||
@JwtSysUser
|
||||
public ResponseResult<Map<String, Object>> getRyBq(String id) {
|
||||
return ResponseResult.success(tbHcBpcryService.getRyBq(id));
|
||||
}
|
||||
|
||||
@ApiOperation("查询人员标签代码根据身份证查询")
|
||||
@GetMapping("/getRyBqBySfzh")
|
||||
@JwtSysUser
|
||||
public ResponseResult<Map<String, Object>> getRyBqBySfzh(String sfzh) {
|
||||
return ResponseResult.success(tbHcBpcryService.getRyBqBySfzh(sfzh));
|
||||
}
|
||||
|
||||
@ApiOperation("保存被盘查人员信息Nfc")
|
||||
@PostMapping("/saveBpcryNfc")
|
||||
@Log(title = "保存被盘查人员信息Nfc", businessType = BusinessType.UPDATE)
|
||||
@JwtSysUser
|
||||
public ResponseResult<TbHcBpcryVo> saveBpcryNfc(@RequestBody TbHcBpcry bpcry) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.saveBpcryNfc(bpcry));
|
||||
}
|
||||
|
||||
@ApiOperation("保存被盘查人员信息")
|
||||
@PostMapping("/saveBpcry")
|
||||
@Log(title = "保存被盘查人员信息", businessType = BusinessType.UPDATE)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Void> saveBpcry(@RequestBody TbHcBpcryInsertDto dto) {
|
||||
this.tbHcBpcryService.saveBpcry(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据人像查询人员列表信息")
|
||||
@PostMapping("/getRyListByZp")
|
||||
@Log(title = "根据人像查询人员列表信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<RyZpSearchVo>> getRyListByZp(@RequestParam(name = "file") MultipartFile file) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRyListByZp(file));
|
||||
}
|
||||
|
||||
@ApiOperation("根据人像查询人员列表信息-base64")
|
||||
@PostMapping("/getRyListByBase64")
|
||||
@Log(title = "根据人像查询人员列表信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<RyZpSearchVo>> getRyListByBase64(@RequestParam(name = "base64Str") String base64Str) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRyListByBase64(base64Str));
|
||||
}
|
||||
|
||||
@ApiOperation("根据手机号查询人员信息")
|
||||
@PostMapping("/getRyListBySjhm/{mobile}")
|
||||
@Log(title = "根据手机号查询人员信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<Map>> getRyListBySjhm(@PathVariable("mobile") String mobile) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRyListBySjhm(mobile));
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询人员盘查信息")
|
||||
@PostMapping("getRypcList")
|
||||
@Log(title = "条件查询人员盘查信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbHcBpcryVo>> getRypcList(@RequestBody TbHcBpcryQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRypcList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("条件查询人员盘查信息统计")
|
||||
@PostMapping("getRypcCount")
|
||||
@Log(title = "条件查询人员盘查信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Map<String, Integer>> getRypcCount(@RequestBody TbHcBpcryQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRypcCount(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询两个小时内没有被车辆绑定的人员")
|
||||
@PostMapping("getRyOf2h")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbHcBpcryVo>> getRyOf2h() {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRyOf2h());
|
||||
}
|
||||
|
||||
@ApiOperation("查询人员盘查列表--计算")
|
||||
@PostMapping("getRyList")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbHcBpcryVo>> getRyList() {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getRyOf2h());
|
||||
}
|
||||
|
||||
@ApiOperation("泸州态势统计-各区县盘查工作")
|
||||
@PostMapping("/getGqxpc")
|
||||
@JwtSysUser
|
||||
public ResponseResult<Map<String, Object>> getXfscAndLcTj(RyClTjQuery dto) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getGqxpc(dto));
|
||||
}
|
||||
@ApiOperation("大屏被盘查人员统计")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/bpcryTj")
|
||||
public ResponseResult<Map<String, Integer>> bpcryTj() {
|
||||
return ResponseResult.success(this.tbHcBpcryService.bpcryTj());
|
||||
}
|
||||
|
||||
@ApiOperation("巡防战果统计")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/xfzgtj")
|
||||
@Log(title = "巡防战果统计", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<IPage<Map<String, Object>>> xfzgtj(@RequestBody HcTjQuery query) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.xfzgtj(query));
|
||||
}
|
||||
|
||||
@ApiOperation("巡防战果统计All")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/xfzgtjAll")
|
||||
@Log(title = "巡防战果统计All", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<Map<String, Object>> xfzgtjAll(@RequestBody HcTjQuery query) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.xfzgtjAll(query));
|
||||
}
|
||||
|
||||
@ApiOperation("实际盘查人数")
|
||||
@JwtSysUser
|
||||
@PostMapping(value = "/getSjpcr")
|
||||
public ResponseResult<Integer> getSjpcr(@RequestParam("ssbmdm") String ssbmdm,
|
||||
@RequestParam("time") String time) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getSjpcr(ssbmdm, time));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("方正获取战果统计")
|
||||
// @JwtSysUser
|
||||
@PostMapping(value = "/getZgtj")
|
||||
// @Log(title = "方正获取战果统计", businessType = BusinessType.OTHER)
|
||||
public ResponseResult<Map<String, List<Map<String, Object>>>> getZgtj(@Validated @RequestBody HcTjQuery query) {
|
||||
return ResponseResult.success(this.tbHcBpcryService.getZgtj(query));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import com.mosty.base.model.dto.hczx.TbHcDtgzDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcDtgz;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.hczx.service.TbHcDtgzService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "动态核查数据接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbHcDtgz")
|
||||
public class TbHcDtgzController {
|
||||
|
||||
private final TbHcDtgzService tbHcDtgzService;
|
||||
|
||||
|
||||
@ApiOperation("条件查询动态核查数据信息")
|
||||
@PostMapping("/getList")
|
||||
@Log(title = "条件查询动态核查数据信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbHcDtgz>> getList(@RequestBody TbHcDtgzDto dto) {
|
||||
return ResponseResult.success(this.tbHcDtgzService.getList(dto));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.entity.hczx.TbHcRytzbq;
|
||||
import com.mosty.base.model.query.hczx.TbHcRytzbqQuery;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.hczx.service.TbHcRytzbqService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/17
|
||||
**/
|
||||
@Api(tags = "核查中心-人员特征标签接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbHcRytzbq")
|
||||
public class TbHcRytzbqController {
|
||||
|
||||
private final TbHcRytzbqService tbHcRytzbqService;
|
||||
|
||||
@ApiOperation("获取人员特征标签列表--分页")
|
||||
@PostMapping("/selectPage")
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbHcRytzbq>> selectList(@RequestBody TbHcRytzbqQuery dto) {
|
||||
return ResponseResult.success(this.tbHcRytzbqService.selectPage(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("获取人员特征标签列表--不分页")
|
||||
@PostMapping("/selectList")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbHcRytzbq>> selectList(@RequestBody TbHcRytzbq dto) {
|
||||
return ResponseResult.success(this.tbHcRytzbqService.selectList(dto));
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.mosty.hczx.controller;
|
||||
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjQueryDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjSaveDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcSydj;
|
||||
import com.mosty.base.model.vo.hczx.TbHcSydjVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.entity.log.BusinessType;
|
||||
import com.mosty.common.base.entity.log.Log;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.hczx.service.TbHcBpcryService;
|
||||
import com.mosty.hczx.service.TbHcSydjServer;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "核查中心-涉疫登记接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbHcRytzbq")
|
||||
public class TbHcSydjController {
|
||||
|
||||
private final TbHcSydjServer tbHcSydjServer;
|
||||
|
||||
@ApiOperation("保存或者修改涉疫登记信息")
|
||||
@PostMapping("/sydjSaveOrEdit")
|
||||
@Log(title = "保存或者修改涉疫登记信息", businessType = BusinessType.INSERT)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Void> sydjSaveOrEdit(@RequestBody TbHcSydjSaveDto dto) {
|
||||
this.tbHcSydjServer.sydjSaveOrEdit(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改涉疫登记信息")
|
||||
@PostMapping("/editSydj")
|
||||
@Log(title = "修改涉疫登记信息", businessType = BusinessType.INSERT)
|
||||
@JwtSysUser
|
||||
public ResponseResult<Void> editSydj(@RequestBody TbHcSydjSaveDto dto) {
|
||||
this.tbHcSydjServer.editSydj(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据身份证号码和盘查Id查询人员涉疫登记信息")
|
||||
@PostMapping("/getRySydjInfo")
|
||||
@Log(title = "根据身份证号码和盘查Id查询人员涉疫登记信息", businessType = BusinessType.OTHER)
|
||||
@JwtSysUser
|
||||
public ResponseResult<TbHcSydjVo> getRySydjInfo(@RequestBody TbHcSydjQueryDto dto) {
|
||||
return ResponseResult.success(this.tbHcSydjServer.getRySydjInfo(dto));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcclBq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbHcBpcclBqMapper extends BaseMapper<TbHcBpcclBq> {
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpccl;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface TbHcBpcclMapper extends BaseMapper<TbHcBpccl> {
|
||||
|
||||
Integer selectCarCount(@Param("ssbmdm") String ssbmdm);
|
||||
|
||||
@ApiOperation("查询今日盘查车辆列表")
|
||||
List<TbHcBpccl> getList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询今日盘查车辆数量")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("插入数据")
|
||||
void insertEntity(TbHcBpccl item);
|
||||
|
||||
@ApiOperation("修改盘查车辆对象")
|
||||
void updateEntity(TbHcBpccl cl);
|
||||
|
||||
@ApiOperation("查询两个小时内没有被人员绑定的车辆")
|
||||
List<TbHcBpccl> getClOf2h(@Param("sfzh") String sfzh, @Param("time") String time);
|
||||
|
||||
@ApiOperation("添加查询车辆盘查信息")
|
||||
int getCountCl(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("条件查询车辆盘车信息列表")
|
||||
List<TbHcBpccl> getListCl(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("统计被盘查车辆")
|
||||
List<Map<String, Object>> selectPcclTj(@Param("kssj") String kssj, @Param("jssj") String jssj);
|
||||
|
||||
@ApiOperation("查询重点车辆统计")
|
||||
List<Map<String, Object>> selectZdclTj(@Param("kssj") String kssj, @Param("jssj") String jssj);
|
||||
|
||||
@ApiOperation("盘查统计")
|
||||
IPage<Map<String, Object>> getPctj(@Param("page") IPage<HcTjQuery> page, @Param("query") HcTjQuery query);
|
||||
|
||||
int getPctjRy(@Param("query") HcTjQuery query);
|
||||
|
||||
int getPctjCl(@Param("query") HcTjQuery query);
|
||||
|
||||
@ApiOperation("盘查物品统计")
|
||||
int getPcWptj(@Param("ssbmdm") String ssbmdm, @Param("time") String time);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcclWp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/16
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcBpcclWpMapper extends BaseMapper<TbHcBpcclWp> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcry;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcryBq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/16
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcBpcryBqMapper extends BaseMapper<TbHcBpcryBq> {
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcry;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface TbHcBpcryMapper extends BaseMapper<TbHcBpcry> {
|
||||
|
||||
@ApiOperation("查询今日盘查数量")
|
||||
Integer selectCrewCount(@Param("ssbmdm") String ssbmdm);
|
||||
|
||||
@ApiOperation("查询今日盘查人员列表")
|
||||
List<TbHcBpcry> getList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询今日盘查数量")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询今日盘查人员列表")
|
||||
List<TbHcBpcry> getListRy(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询今日盘查数量")
|
||||
int getCountRy(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("添加人员信息")
|
||||
void insertEntity(TbHcBpcry ry);
|
||||
|
||||
@ApiOperation("修改被盘查人员信息")
|
||||
void updateEntity(TbHcBpcry ry);
|
||||
|
||||
@ApiOperation("查询两个小时内没有被车辆绑定的人员")
|
||||
List<TbHcBpcry> getRyOf2h(String sfzh, String time);
|
||||
|
||||
@ApiOperation("统计被盘查人员")
|
||||
List<Map<String, Object>> selectPcryTj(@Param("kssj") String kssj, @Param("jssj") String jssj);
|
||||
|
||||
@ApiOperation("查询重点人员")
|
||||
List<Map<String, Object>> selectZdryTj(@Param("kssj") String kssj, @Param("jssj") String jssj);
|
||||
|
||||
IPage<String> getSsbm(@Param("page") IPage<HcTjQuery> page, @Param("query") HcTjQuery query);
|
||||
|
||||
@ApiOperation("人员标签统计")
|
||||
List<Map<String, Object>> getRyBqtj(HcTjQuery query);
|
||||
|
||||
@ApiOperation("车辆标签统计")
|
||||
List<Map<String, Object>> getClBqtj(HcTjQuery query);
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcryTzbq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/16
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcBpcryTzbqMapper extends BaseMapper<TbHcBpcryTzbq> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcryWp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/16
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcBpcryWpMapper extends BaseMapper<TbHcBpcryWp> {
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcDtgz;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbHcDtgzMapper extends BaseMapper<TbHcDtgz> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcRytzbq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/17
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcRytzbqMapper extends BaseMapper<TbHcRytzbq> {
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjSaveDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcSydj;
|
||||
|
||||
public interface TbHcSydjMapper extends BaseMapper<TbHcSydj> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.hczx.TbHcTp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/16
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbHcTpMapper extends BaseMapper<TbHcTp> {
|
||||
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.mosty.hczx.mybatisplus;
|
||||
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import com.mosty.common.base.util.IpUtil;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* MybatisPlus注入处理器
|
||||
*
|
||||
* @author Lhh
|
||||
* @date 2021/4/25
|
||||
*/
|
||||
public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
try {
|
||||
UserInfo userInfo = UserInfoManager.getUser();
|
||||
//根据属性名字设置要填充的值
|
||||
if (metaObject.hasGetter("xtCjip")) {
|
||||
if (metaObject.getValue("xtCjip") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjip", String.class, IpUtil.getIpAddress());
|
||||
}
|
||||
}
|
||||
//根据属性名字设置要填充的值
|
||||
if (metaObject.hasGetter("xtSjzt")) {
|
||||
if (metaObject.getValue("xtSjzt") == null) {
|
||||
this.strictInsertFill(metaObject, "xtSjzt", String.class, "1");
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtScbz")) {
|
||||
if (metaObject.getValue("xtScbz") == null) {
|
||||
this.strictInsertFill(metaObject, "xtScbz", String.class, "0");
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtCjsj")) {
|
||||
if (metaObject.getValue("xtCjsj") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjsj", Timestamp.class, new Timestamp(System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(userInfo)) {
|
||||
if (metaObject.hasGetter("xtCjrId")) {
|
||||
if (metaObject.getValue("xtCjrId") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjrId", String.class, String.valueOf(userInfo.userId));
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtCjr")) {
|
||||
if (metaObject.getValue("xtCjr") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjr", String.class, String.valueOf(userInfo.userName));
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtCjbmdm")) {
|
||||
if (metaObject.getValue("xtCjbmdm") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjbmdm", String.class, String.valueOf(userInfo.getDeptId()));
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtCjbmmc")) {
|
||||
if (metaObject.getValue("xtCjbmmc") == null) {
|
||||
this.strictInsertFill(metaObject, "xtCjbmmc", String.class, userInfo.getDeptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
try {
|
||||
UserInfo userInfo = UserInfoManager.getUser();
|
||||
if (metaObject.hasGetter("xtZhgxip")) {
|
||||
if (metaObject.getValue("xtZhgxip") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxip", String.class, IpUtil.getIpAddress());
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtZhgxsj")) {
|
||||
if (metaObject.getValue("xtZhgxsj") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxsj", Timestamp.class, new Timestamp(System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(userInfo)) {
|
||||
if (metaObject.hasGetter("xtZhgxrid")) {
|
||||
if (metaObject.getValue("xtZhgxrid") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxrid", String.class, String.valueOf(userInfo.userId));
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtZhgxr")) {
|
||||
if (metaObject.getValue("xtZhgxr") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxr", String.class, userInfo.userName);
|
||||
}
|
||||
}
|
||||
|
||||
if (metaObject.hasGetter("xtZhgxbmdm")) {
|
||||
if (metaObject.getValue("xtZhgxbmdm") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxbmdm", String.class, String.valueOf(userInfo.getDeptId()));
|
||||
}
|
||||
}
|
||||
if (metaObject.hasGetter("xtZhgxbm")) {
|
||||
if (metaObject.getValue("xtZhgxbm") == null) {
|
||||
this.strictUpdateFill(metaObject, "xtZhgxbm", String.class, userInfo.getDeptName());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.mosty.hczx.mybatisplus;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* mybatis-plus配置类
|
||||
*
|
||||
* @author Lhh
|
||||
*/
|
||||
@EnableTransactionManagement(proxyTargetClass = true)
|
||||
@Configuration
|
||||
@MapperScan("com.mosty.wqzx.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 元对象字段填充控制器
|
||||
* https://baomidou.com/guide/auto-fill-metainfo.html
|
||||
*/
|
||||
@Bean
|
||||
public MetaObjectHandler metaObjectHandler() {
|
||||
return new CreateAndUpdateMetaObjectHandler();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.mosty.hczx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.model.dto.base.GetSsbmDto;
|
||||
import com.mosty.base.model.dto.base.SysDeptDTO;
|
||||
import com.mosty.base.feign.service.MostyBaseFeignService;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 调用部门信息远程适配层
|
||||
* @author kevin
|
||||
* @date 2022/7/6 10:37 上午
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbBaseAdaptRemoteService {
|
||||
|
||||
/** 部门信息 */
|
||||
@Resource
|
||||
private final MostyBaseFeignService mostyBaseFeignService;
|
||||
|
||||
/**
|
||||
* 根据部门编码查询部门信息
|
||||
* @param orgCode 部门编码
|
||||
* @return 部门信息
|
||||
*/
|
||||
public SysDeptDTO getDeptByOrgCode(String orgCode) {
|
||||
if (StringUtils.isBlank(orgCode)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<SysDeptDTO> responseResult = mostyBaseFeignService.getDeptByOrgCode(orgCode);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
return null;
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
|
||||
// 根据部门编码查询部门信息
|
||||
public DeptInfoVo getOrgByOrgcode(String orgcode) {
|
||||
if (StringUtils.isBlank(orgcode)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByOrgcode(orgcode);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("调用部门编码查询部门信息异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 获取权限查询条件
|
||||
public String getSsbm(String ssbmdm, String isChild) {
|
||||
GetSsbmDto dto = new GetSsbmDto(ssbmdm, isChild);
|
||||
ResponseResult<String> responseResult = mostyBaseFeignService.getSsbm(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("获取权限查询条件异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("获取权限查询条件异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.mosty.hczx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.feign.service.MostyJcglFeignService;
|
||||
import com.mosty.base.model.dto.jcgl.TbJcglXfllVo;
|
||||
import com.mosty.base.model.entity.jcgl.TbSbGzjr;
|
||||
import com.mosty.base.model.query.jcgl.TbJcglXfllQueryAllDto;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础管理远程调用
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbJcglAdaptRemoteService {
|
||||
|
||||
private final MostyJcglFeignService mostyJcglFeignService;
|
||||
|
||||
// 获取部门下的巡防力量信息
|
||||
public List<TbJcglXfllVo> getXfll(TbJcglXfllQueryAllDto dto) {
|
||||
ResponseResult<List<TbJcglXfllVo>> responseResult = mostyJcglFeignService.getXfll(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("获取部门下的巡防力量信息失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("获取部门下的巡防力量信息失败");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
|
||||
// 查询感知接入列表
|
||||
public List<TbSbGzjr> getGzjrList(TbSbGzjr dto) {
|
||||
ResponseResult<List<TbSbGzjr>> responseResult = mostyJcglFeignService.getGzjrList(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("获取部门下的巡防力量信息失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("获取部门下的巡防力量信息失败");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.mosty.hczx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.feign.service.MostyLzotherFeignService;
|
||||
import com.mosty.base.feign.service.MostyYszxFeignService;
|
||||
import com.mosty.base.model.dto.yszx.TbYsRyDto;
|
||||
import com.mosty.base.model.entity.lzother.TAlarmBkxxRy;
|
||||
import com.mosty.base.model.entity.lzother.TAlarmCkxx;
|
||||
import com.mosty.base.model.entity.lzother.TAlarmZtry;
|
||||
import com.mosty.base.model.entity.lzother.VJcxx;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyBqUpdateDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyDhUpdateDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyVo;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbLzotherAdapRemoteService {
|
||||
|
||||
private final MostyLzotherFeignService mostyLzotherFeignService;
|
||||
|
||||
|
||||
// 查询在逃人员信息
|
||||
public TAlarmZtry selectBySfzh(String sfzh) {
|
||||
ResponseResult<TAlarmZtry> responseResult = this.mostyLzotherFeignService.selectBySfzh(sfzh);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("查询警情类别类型细类中文异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
|
||||
// 查询常控人员信息
|
||||
public TAlarmCkxx selectCkBySfzh(String sfzh) {
|
||||
ResponseResult<TAlarmCkxx> responseResult = this.mostyLzotherFeignService.selectCkBySfzh(sfzh);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("查询警情类别类型细类中文异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
|
||||
// 查询布控人员信息
|
||||
public TAlarmBkxxRy selectBkBySfzh(String sfzh) {
|
||||
ResponseResult<TAlarmBkxxRy> responseResult = this.mostyLzotherFeignService.selectBkBySfzh(sfzh);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("查询警情类别类型细类中文异常Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("查询警情类别类型细类中文异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.mosty.hczx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.feign.service.MostyYszxFeignService;
|
||||
import com.mosty.base.model.dto.yszx.TbYsRyDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRy;
|
||||
import com.mosty.base.model.vo.yszx.*;
|
||||
import com.mosty.common.base.domain.ResponseResult;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbYszxAdapRemoteService {
|
||||
|
||||
private final MostyYszxFeignService mostyYszxFeignService;
|
||||
|
||||
// 查询人员要素
|
||||
public TbYsRyVo getRyInfo(String sfzh) {
|
||||
ResponseResult<TbYsRyVo> responseResult = this.mostyYszxFeignService.getRyInfo(sfzh);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("查询人员要素异常 Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("查询人员要素异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 添加人员要素
|
||||
public void addRyYs(TbYsRyDto dto) {
|
||||
ResponseResult<Void> responseResult = this.mostyYszxFeignService.addRyYs(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("添加人员要素异常 Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("添加人员要素异常");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改人员要素
|
||||
public void updateRyYs(TbYsRyDto dto) {
|
||||
ResponseResult<Void> responseResult = this.mostyYszxFeignService.updateRyYs(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("修改人员要素异常 Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("修改人员要素异常");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改人员标签要素
|
||||
public void updateRyBqYs(TbYsRyBqUpdateDto dto) {
|
||||
ResponseResult<Void> responseResult = this.mostyYszxFeignService.updateRyBqYs(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("修改人员标签要素异常 Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("修改人员标签要素异常");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改人员电话要素
|
||||
public void updateRyDhys(TbYsRyDhUpdateDto dto) {
|
||||
ResponseResult<Void> responseResult = this.mostyYszxFeignService.updateRyDhys(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("修改人员电话要素异常 Result = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("修改人员电话要素异常");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,607 @@
|
||||
package com.mosty.hczx.service.Impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.hczx.BpcclSaveDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcclInsertDto;
|
||||
import com.mosty.base.model.entity.hczx.*;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcclQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcryQuery;
|
||||
import com.mosty.base.model.vo.hczx.*;
|
||||
import com.mosty.base.utils.*;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import com.mosty.common.core.util.http.HttpUtils;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.common.util.PermissionsUtil;
|
||||
import com.mosty.base.model.query.hczx.TbHcTodayBpcclQuery;
|
||||
import com.mosty.hczx.mapper.*;
|
||||
import com.mosty.hczx.remote.TbBaseAdaptRemoteService;
|
||||
import com.mosty.hczx.service.TbHcBpcclService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbHcBpcclServiceImpl extends ServiceImpl<TbHcBpcclMapper, TbHcBpccl>
|
||||
implements TbHcBpcclService {
|
||||
|
||||
private final TbHcTpMapper tbHcTpMapper;
|
||||
private final TbHcBpcclWpMapper tbHcBpcclWpMapper;
|
||||
private final TbHcBpcclBqMapper tbHcBpcclBqMapper;
|
||||
private final TbHcBpcryMapper tbHcBpcryMapper;
|
||||
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer selectCarCount() {
|
||||
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(null, null);
|
||||
return this.baseMapper.selectCarCount(ssbm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbHcBpcclVo> selectCarList(TbHcTodayBpcclQuery dto) {
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
|
||||
|
||||
IPage<TbHcBpcclVo> page = new Page<>(dto.getPageCurrent(), dto.getPageSize());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("pageIndex", (dto.getPageCurrent() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
map.put("dto", dto);
|
||||
// UserInfo userInfo = UserInfoManager.get();
|
||||
// map.put("useSql", PermissionsUtil.createSql("a", userInfo));
|
||||
int count = this.baseMapper.getCount(map);
|
||||
List<TbHcBpccl> list = this.baseMapper.getList(map);
|
||||
page.setTotal(count);
|
||||
List<TbHcBpcclVo> voList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
// 查询车辆图片
|
||||
TbHcBpcclVo vo = new TbHcBpcclVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
List<TbHcTp> tpList = this.tbHcTpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcTp>()
|
||||
.eq(TbHcTp::getLyid, item.getId())
|
||||
.eq(TbHcTp::getLybm, "tb_hc_bpccl")
|
||||
);
|
||||
|
||||
if (!CollectionUtils.isEmpty(tpList)) {
|
||||
List<TbHcTpVo> collect = tpList.stream().map(v -> {
|
||||
TbHcTpVo tbHcTpVo = new TbHcTpVo();
|
||||
BeanUtils.copyProperties(v, tbHcTpVo);
|
||||
return tbHcTpVo;
|
||||
}).collect(Collectors.toList());
|
||||
vo.setTpList(collect);
|
||||
}
|
||||
|
||||
|
||||
// 查询车辆物品
|
||||
List<TbHcBpcclWp> wpList = this.tbHcBpcclWpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcBpcclWp>()
|
||||
.eq(TbHcBpcclWp::getPcywid, item.getId())
|
||||
);
|
||||
List<TbHcBpcclWpVo> wpVoList = new ArrayList<>();
|
||||
wpList.forEach(wp -> {
|
||||
TbHcBpcclWpVo wpVo = new TbHcBpcclWpVo();
|
||||
BeanUtils.copyProperties(wp, wpVo);
|
||||
// 查询物品图片
|
||||
List<TbHcTp> wpTpList = this.tbHcTpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcTp>()
|
||||
.eq(TbHcTp::getLyid, wp.getId())
|
||||
.eq(TbHcTp::getLybm, "tb_hc_bpccl_wp")
|
||||
);
|
||||
wpVo.setWpTpIdList(wpTpList.stream().map(TbHcTp::getFjid).collect(Collectors.toList()));
|
||||
wpVoList.add(wpVo);
|
||||
});
|
||||
vo.setWpVoList(wpVoList);
|
||||
voList.add(vo);
|
||||
});
|
||||
page.setRecords(voList);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbHcBpcclVo selectCl(TbHcBpcclQuery dto) {
|
||||
UserInfo user = UserInfoManager.get();
|
||||
|
||||
TbHcBpccl item = new TbHcBpccl();
|
||||
BeanUtils.copyProperties(dto, item);
|
||||
if (StringUtils.isNotBlank(dto.getHpzl()) && StringUtils.isNotBlank(dto.getHphm())) {
|
||||
if (dto.getJd() == null || dto.getWd() == null) {
|
||||
// 默认为县公安局经纬度
|
||||
dto.setJd(Constant.JD).setWd(Constant.WD);
|
||||
item.setJd(Constant.JD).setWd(Constant.WD);
|
||||
}
|
||||
ClpcVo vo = this.getClByHp(dto.getHpzl(), dto.getHphm(), user, item);
|
||||
if (vo != null && StringUtils.isNotBlank(vo.getHphm())) {
|
||||
item.setId(UUIDGenerator.getUUID()).setClsbdh(vo.getClsbdh())
|
||||
.setJdcsyr(vo.getJdcsyr()).setJdcsyrsfzh(vo.getSfzh())
|
||||
.setPcrq(new Date()).setPcsj(new Date())
|
||||
.setPcmjId(String.valueOf(user.getUserId())).setPcmjJh(user.getInDustRialId())
|
||||
.setPcmjSfzh(user.getIdEntityCard()).setPcmjXm(user.getUserName())
|
||||
.setSsbmdm(user.getDeptCode())
|
||||
.setSsbm(user.getDeptName())
|
||||
.setSsbmid(String.valueOf(user.getDeptId()))
|
||||
.setSsxgaj(user.getFxjDeptName())
|
||||
.setSsxgajid(String.valueOf(user.getFxjDeptId()))
|
||||
.setSsxgajdm(user.getFxjDeptCode())
|
||||
.setSssgaj(user.getDszDeptName())
|
||||
.setSssgajid(String.valueOf(user.getDszDeptId()))
|
||||
.setSssgajdm(user.getDszDeptCode()).setXtSjly("2");
|
||||
item.setZdch(dto.getZdch());
|
||||
item.setZdxh(dto.getZdxh());
|
||||
item.setZdsim(dto.getZdsim());
|
||||
item.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()))
|
||||
.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
StringBuilder rybqdm = new StringBuilder();
|
||||
StringBuilder rybq = new StringBuilder();
|
||||
// 查询是否盗抢车辆
|
||||
DqclVo dqclVo = this.getDqcl(dto.getHpzl(), dto.getHphm(), user);
|
||||
if (dqclVo != null) {
|
||||
rybqdm.append("盗抢车辆").append(",");
|
||||
rybq.append("DQCL").append(",");
|
||||
// 保存车辆标签信息
|
||||
TbHcBpcclBq bq = new TbHcBpcclBq();
|
||||
bq.setPcywid(item.getId());
|
||||
bq.setBqmc("盗抢车辆");
|
||||
bq.setBqbh("DQCL");
|
||||
bq.setXtSjly("1");
|
||||
bq.setSsbmdm(String.valueOf(user.getDeptId()));
|
||||
bq.setSsbm(user.getDeptName());
|
||||
bq.setSsxgajdm(String.valueOf(user.getFxjDeptId()));
|
||||
bq.setSsxgaj(user.getFxjDeptName());
|
||||
bq.setSssgajdm(String.valueOf(user.getDszDeptId()));
|
||||
bq.setSssgaj(user.getDszDeptName());
|
||||
this.tbHcBpcclBqMapper.insert(bq);
|
||||
}
|
||||
// 查询是否临控车辆
|
||||
BkclVo bkclVo = this.getBkcl(dto.getHpzl(), dto.getHphm(), user, item);
|
||||
if (bkclVo != null) {
|
||||
rybqdm.append("临控车辆").append(",");
|
||||
rybq.append("LKCL").append(",");
|
||||
// 保存车辆标签信息
|
||||
TbHcBpcclBq bq = new TbHcBpcclBq();
|
||||
bq.setPcywid(item.getId());
|
||||
bq.setBqmc("临控车辆");
|
||||
bq.setBqbh("LKCL");
|
||||
bq.setXtSjly("1");
|
||||
bq.setSsbmdm(String.valueOf(user.getDeptId()));
|
||||
bq.setSsbm(user.getDeptName());
|
||||
bq.setSsxgajdm(String.valueOf(user.getFxjDeptId()));
|
||||
bq.setSsxgaj(user.getFxjDeptName());
|
||||
bq.setSssgajdm(String.valueOf(user.getDszDeptId()));
|
||||
bq.setSssgaj(user.getDszDeptName());
|
||||
this.tbHcBpcclBqMapper.insert(bq);
|
||||
}
|
||||
item.setBqmc(rybq.toString().length() > 0 ? rybq.toString().substring(0, rybq.toString().length() - 1) : "");
|
||||
item.setBqxxsj(rybqdm.toString().length() > 0 ? rybqdm.toString().substring(0, rybqdm.toString().length() - 1) : "");
|
||||
item.setPcclJg("9");
|
||||
item.setPcclJgmc("盘查");
|
||||
this.baseMapper.insertEntity(item);
|
||||
// 保存信息到巡逻盘查库中
|
||||
this.saveClToXlpc(item, user);
|
||||
|
||||
TbHcBpcclVo clvo = new TbHcBpcclVo();
|
||||
BeanUtils.copyProperties(item, clvo);
|
||||
return clvo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBpccl(TbHcBpcclInsertDto dto) {
|
||||
UserInfo user = UserInfoManager.get();
|
||||
if (user == null) {
|
||||
throw new BusinessException("请重新登录");
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getId())) {
|
||||
throw new BusinessException("盘查Id不存在");
|
||||
}
|
||||
TbHcBpccl cl = this.baseMapper.selectById(dto.getId());
|
||||
if (cl == null) {
|
||||
throw new BusinessException("盘查对象不存在");
|
||||
}
|
||||
cl.setPcclJg(dto.getPcclJg());
|
||||
cl.setPcclJgmc(dto.getPcclJgmc());
|
||||
cl.setPcclYjdwdm(dto.getPcclYjdwdm());
|
||||
cl.setPcclYjdw(dto.getPcclYjdw());
|
||||
cl.setPcclYjyy(dto.getPcclYjyy());
|
||||
// 查询当月数量
|
||||
cl.setSsdwdycs(0);
|
||||
this.baseMapper.updateEntity(cl);
|
||||
// 保存图片信息
|
||||
List<String> tpIdList = dto.getTpIdList();
|
||||
this.saveTp(tpIdList, "tb_hc_bpccl", cl.getId());
|
||||
// 保存物品信息
|
||||
List<TbHcBpcclWpVo> clWpList = dto.getClWpList();
|
||||
this.saveClTp(clWpList, cl);
|
||||
// 保存同乘人员信息
|
||||
List<String> rypcidList = dto.getRypcidList();
|
||||
this.saveTcry(rypcidList, cl);
|
||||
// 保存信息到巡逻盘查库中
|
||||
this.saveClToXlpc(cl, user);
|
||||
}
|
||||
|
||||
// 保存同乘人员信息
|
||||
private void saveTcry(List<String> rypcidList, TbHcBpccl cl) {
|
||||
if (!CollectionUtils.isEmpty(rypcidList)) {
|
||||
rypcidList.forEach(item -> {
|
||||
TbHcBpcry ry = this.tbHcBpcryMapper.selectById(item);
|
||||
if (ry != null) {
|
||||
ry.setPcclId(cl.getId());
|
||||
this.tbHcBpcryMapper.updateById(ry);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbHcBpcclVo> getClOf2h() {
|
||||
UserInfo user = UserInfoManager.get();
|
||||
if (user != null) {
|
||||
String sfzh = user.getIdEntityCard();
|
||||
// 两小时之前
|
||||
String time = DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "H", -1), "02");
|
||||
List<TbHcBpccl> list = this.baseMapper.getClOf2h(sfzh, time);
|
||||
List<TbHcBpcclVo> voList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbHcBpcclVo vo = new TbHcBpcclVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
voList.add(vo);
|
||||
});
|
||||
return voList;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> getClpcCount(TbHcBpcclQuery dto) {
|
||||
if (StringUtils.isBlank(dto.getJssj()) && StringUtils.isBlank(dto.getKssj())) {
|
||||
String systemDateString = DateUtils.getSystemDateString();
|
||||
dto.setKssj(systemDateString);
|
||||
dto.setJssj(systemDateString);
|
||||
}
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Map<String, Integer> clMap = new HashMap<>();
|
||||
dto.setPcclJg("");
|
||||
map.put("dto", dto);
|
||||
int All = this.baseMapper.getCountCl(map);
|
||||
clMap.put("All", All);
|
||||
dto.setPcclJg("1");
|
||||
map.put("dto", dto);
|
||||
int fx = this.baseMapper.getCountCl(map);
|
||||
clMap.put("fx", fx);
|
||||
dto.setPcclJg("2");
|
||||
map.put("dto", dto);
|
||||
int yj = this.baseMapper.getCountCl(map);
|
||||
clMap.put("yj", yj);
|
||||
dto.setPcclJg("9");
|
||||
map.put("dto", dto);
|
||||
int pc = this.baseMapper.getCountCl(map);
|
||||
clMap.put("pc", pc);
|
||||
return clMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<TbHcBpcclVo> getClpcList(TbHcBpcclQuery dto) {
|
||||
if (StringUtils.isBlank(dto.getJssj()) && StringUtils.isBlank(dto.getKssj())) {
|
||||
String systemDateString = DateUtils.getSystemDateString();
|
||||
dto.setKssj(systemDateString);
|
||||
dto.setJssj(systemDateString);
|
||||
}
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
|
||||
IPage<TbHcBpcclVo> page = new Page<>(dto.getPageCurrent(), dto.getPageSize());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("pageIndex", (dto.getPageCurrent() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
map.put("dto", dto);
|
||||
// UserInfo userInfo = UserInfoManager.get();
|
||||
// map.put("useSql", PermissionsUtil.createSql("a", userInfo));
|
||||
int count = this.baseMapper.getCountCl(map);
|
||||
List<TbHcBpccl> list = this.baseMapper.getListCl(map);
|
||||
List<TbHcBpcclVo> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
// 查询盘查车辆图片
|
||||
TbHcBpcclVo vo = new TbHcBpcclVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
// 查询人员照片信息
|
||||
List<TbHcTp> tpList = this.tbHcTpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcTp>()
|
||||
.eq(TbHcTp::getLybm, "tb_hc_bpccl")
|
||||
.eq(TbHcTp::getLyid, item.getId())
|
||||
);
|
||||
|
||||
if (!CollectionUtils.isEmpty(tpList)) {
|
||||
List<TbHcTpVo> collect = tpList.stream().map(v -> {
|
||||
TbHcTpVo tbHcTpVo = new TbHcTpVo();
|
||||
BeanUtils.copyProperties(v, tbHcTpVo);
|
||||
return tbHcTpVo;
|
||||
}).collect(Collectors.toList());
|
||||
vo.setTpList(collect);
|
||||
}
|
||||
|
||||
// 查询物品信息
|
||||
List<TbHcBpcclWp> wpList = this.tbHcBpcclWpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcBpcclWp>()
|
||||
.eq(TbHcBpcclWp::getPcywid, item.getId())
|
||||
);
|
||||
// 车辆物品
|
||||
List<TbHcBpcclWpVo> wpVoList = new ArrayList<>();
|
||||
wpList.forEach(wp -> {
|
||||
TbHcBpcclWpVo wpVo = new TbHcBpcclWpVo();
|
||||
BeanUtils.copyProperties(wp, wpVo);
|
||||
// 获取物品图片
|
||||
List<TbHcTp> wpTpList = this.tbHcTpMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcTp>()
|
||||
.eq(TbHcTp::getLybm, "tb_hc_bpccl_wp")
|
||||
.eq(TbHcTp::getLyid, wp.getId())
|
||||
);
|
||||
List<String> wpTpIdList = wpTpList.stream().map(TbHcTp::getId).collect(Collectors.toList());
|
||||
wpVo.setWpTpIdList(wpTpIdList);
|
||||
wpVoList.add(wpVo);
|
||||
});
|
||||
vo.setWpVoList(wpVoList);
|
||||
// 同乘人员
|
||||
List<TbHcBpcry> ryList = this.tbHcBpcryMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcBpcry>()
|
||||
.eq(TbHcBpcry::getPcclId, item.getId())
|
||||
.eq(TbHcBpcry::getXtSjzt, "1")
|
||||
);
|
||||
List<TbHcBpcryVo> ryVoList = new ArrayList<>();
|
||||
ryList.forEach(ry -> {
|
||||
TbHcBpcryVo ryVo = new TbHcBpcryVo();
|
||||
BeanUtils.copyProperties(ry, ryVo);
|
||||
ryVoList.add(ryVo);
|
||||
});
|
||||
vo.setRyList(ryVoList);
|
||||
rList.add(vo);
|
||||
});
|
||||
page.setTotal(count);
|
||||
page.setRecords(rList);
|
||||
return page;
|
||||
}
|
||||
|
||||
// 保存人员物品列表信息
|
||||
private void saveClTp(List<TbHcBpcclWpVo> ryWpList, TbHcBpccl cl) {
|
||||
if (!CollectionUtils.isEmpty(ryWpList)) {
|
||||
ryWpList.forEach(wpVo -> {
|
||||
TbHcBpcclWp wp = new TbHcBpcclWp();
|
||||
BeanUtils.copyProperties(wpVo, wp);
|
||||
wp.setId(com.mosty.common.util.UUIDGenerator.getUUID());
|
||||
wp.setPcywid(cl.getId());
|
||||
wp.setXtSjly("2");
|
||||
wp.setSsbmdm(cl.getSsbmdm());
|
||||
wp.setSsbm(cl.getSsbm());
|
||||
wp.setSsbmid(cl.getSsbmid());
|
||||
wp.setSsxgajdm(cl.getSsxgajdm());
|
||||
wp.setSsxgaj(cl.getSsxgaj());
|
||||
wp.setSsxgajid(cl.getSsxgajid());
|
||||
wp.setSssgajdm(cl.getSssgajdm());
|
||||
wp.setSssgaj(cl.getSssgaj());
|
||||
wp.setSssgajid(cl.getSssgajid());
|
||||
this.tbHcBpcclWpMapper.insert(wp);
|
||||
// 保存物品图片
|
||||
List<String> wpTpIdList = wpVo.getWpTpIdList();
|
||||
this.saveTp(wpTpIdList, "tb_hc_bpccl_wp", wp.getId());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 保存图片信息
|
||||
private void saveTp(List<String> tpIdList, String lybm, String lyid) {
|
||||
if (!CollectionUtils.isEmpty(tpIdList)) {
|
||||
tpIdList.forEach(item -> {
|
||||
TbHcTp tp = new TbHcTp();
|
||||
tp.setId(com.mosty.common.util.UUIDGenerator.getUUID());
|
||||
tp.setLybm(lybm);
|
||||
tp.setLyid(lyid);
|
||||
tp.setXtSjly("2");
|
||||
tp.setFjid(item);
|
||||
this.tbHcTpMapper.insert(tp);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 保存车辆信息到巡逻盘查中
|
||||
private void saveClToXlpc(TbHcBpccl item, UserInfo user) {
|
||||
BpcclSaveDto dto = new BpcclSaveDto();
|
||||
BeanUtils.copyProperties(item, dto);
|
||||
dto.setPcsj(DateUtils.getQueryDateString(item.getPcsj(), "02"));
|
||||
dto.setPcdjd(item.getJd().doubleValue());
|
||||
dto.setPcdwd(item.getWd().doubleValue());
|
||||
dto.setIndustrialid(item.getPcmjJh());
|
||||
dto.setUserid(item.getPcmjSfzh());
|
||||
dto.setUsername(item.getPcmjXm());
|
||||
dto.setSsdwdm(user.getDeptCode());
|
||||
dto.setSsdwmc(user.getDeptName());
|
||||
dto.setSsfsxdm(user.getFxjDeptCode());
|
||||
dto.setSsfsxmc(user.getFxjDeptName());
|
||||
dto.setSsdszdm(user.getDszDeptCode());
|
||||
dto.setSsdszmc(user.getDszDeptName());
|
||||
dto.setPccljg(item.getPcclJg());
|
||||
dto.setPccljgmc(item.getPcclJgmc());
|
||||
dto.setGlxtdm("73"); //德阳巡防
|
||||
try {
|
||||
Map map = Kit.beanToMap(dto);
|
||||
HttpUtils.executePost(Constant.XLPC_URL + "kkpcPczqBpcclxxb/save", map);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取盗抢车辆信息
|
||||
private DqclVo getDqcl(String hpzl, String hphm, UserInfo user) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("hpzl", hpzl);
|
||||
params.put("hphm", hphm);
|
||||
params.put("userid", user.getIdEntityCard());
|
||||
params.put("username", user.getUserName());
|
||||
params.put("ssdwdm", user.getDeptCode());
|
||||
params.put("ssdwmc", user.getDeptName());
|
||||
params.put("ssfsxdm", user.getFxjDeptCode());
|
||||
params.put("ssfsxmc", user.getFxjDeptName());
|
||||
params.put("ssdszdm", user.getDszDeptCode());
|
||||
params.put("ssdszmc", user.getDszDeptName());
|
||||
params.put("industrialid", user.getInDustRialId());
|
||||
params.put("mobile", "");
|
||||
String result = HttpUtils.executePost(Constant.XLPC_URL + "requestservice/zhk_Bdqjdcxx/queryDetail", params);
|
||||
if (com.mosty.common.base.util.StringUtils.isNotBlank(result)) {
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
String code = json.getString("code");
|
||||
if ("0".equals(code)) {
|
||||
String dataStr = json.getString("data");
|
||||
return JSONObject.parseObject(dataStr, DqclVo.class);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取布控车辆信息
|
||||
private BkclVo getBkcl(String hpzl, String hphm, UserInfo user, TbHcBpccl item) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("hpzl", hpzl);
|
||||
params.put("hphm", hphm);
|
||||
params.put("kkid", "");
|
||||
params.put("kkmc", "");
|
||||
params.put("userid", user.getIdEntityCard());
|
||||
params.put("username", user.getUserName());
|
||||
params.put("ssdwdm", user.getDeptCode());
|
||||
params.put("ssdwmc", user.getDeptName());
|
||||
params.put("ssfsxdm", user.getFxjDeptCode());
|
||||
params.put("ssfsxmc", user.getFxjDeptName());
|
||||
params.put("ssdszdm", user.getDszDeptCode());
|
||||
params.put("ssdszmc", user.getDszDeptName());
|
||||
params.put("industrialid", user.getInDustRialId());
|
||||
params.put("mobile", "");
|
||||
params.put("zdxh", item.getZdxh());
|
||||
params.put("zdch", item.getZdch());
|
||||
params.put("zdsim", item.getZdsim());
|
||||
params.put("pcdjd", item.getJd().stripTrailingZeros().toPlainString());
|
||||
params.put("pcdwd", item.getWd().stripTrailingZeros().toPlainString());
|
||||
String result = HttpUtils.executePost(Constant.XLPC_URL + "lkClxx/queryDetail", params);
|
||||
if (com.mosty.common.base.util.StringUtils.isNotBlank(result)) {
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
String code = json.getString("code");
|
||||
if ("0".equals(code)) {
|
||||
String dataStr = json.getString("data");
|
||||
return JSONObject.parseObject(dataStr, BkclVo.class);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//查询车辆详情信息
|
||||
private ClpcVo getClByHp(String hpzl, String hphm, UserInfo user, TbHcBpccl item) {
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("hpzl", hpzl);
|
||||
params.put("hphm", hphm);
|
||||
params.put("userid", user.getIdEntityCard());
|
||||
params.put("username", user.getUserName());
|
||||
params.put("ssdwdm", user.getDeptCode());
|
||||
params.put("ssdwmc", user.getDeptName());
|
||||
params.put("ssfsxdm", user.getFxjDeptCode());
|
||||
params.put("ssfsxmc", user.getFxjDeptName());
|
||||
params.put("ssdszdm", user.getDszDeptCode());
|
||||
params.put("ssdszmc", user.getDszDeptName());
|
||||
params.put("industrialid", user.getInDustRialId());
|
||||
params.put("mobile", "");
|
||||
params.put("zdxh", item.getZdxh());
|
||||
params.put("zdch", item.getZdch());
|
||||
params.put("zdsim", item.getZdsim());
|
||||
params.put("pcdjd", item.getJd().stripTrailingZeros().toPlainString());
|
||||
params.put("pcdwd", item.getWd().stripTrailingZeros().toPlainString());
|
||||
String result = HttpUtils.executePost(Constant.XLPC_URL + "requestservice/jdc/queryDetail", params);
|
||||
if (com.mosty.common.base.util.StringUtils.isNotBlank(result)) {
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
String code = json.getString("code");
|
||||
String dataStr = json.getString("data");
|
||||
if ("0".equals(code)) {
|
||||
JSONObject resJson = JSONObject.parseObject(dataStr);
|
||||
return JSON.toJavaObject(resJson, ClpcVo.class);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> bpcclTj() {
|
||||
Map<String, Integer> ryMap = new HashMap();
|
||||
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(null, null);
|
||||
Integer integer = this.baseMapper.selectCount(new LambdaQueryWrapper<TbHcBpccl>()
|
||||
.likeRight(StringUtils.isNotBlank(ssbm), TbHcBpccl::getSsbmdm, ssbm)
|
||||
.ge(TbHcBpccl::getPcsj, DateUtils.getSystemDateString())
|
||||
);
|
||||
ryMap.put("all", integer);
|
||||
Integer dq = this.baseMapper.selectCount(new LambdaQueryWrapper<TbHcBpccl>()
|
||||
.likeRight(StringUtils.isNotBlank(ssbm), TbHcBpccl::getSsbmdm, ssbm)
|
||||
.ge(TbHcBpccl::getPcsj, DateUtils.getSystemDateString())
|
||||
.and(v -> v.like(TbHcBpccl::getBqmc, "DQ").or().like(TbHcBpccl::getBqmc, "盗抢"))
|
||||
);
|
||||
ryMap.put("dq", dq);
|
||||
Integer lk = this.baseMapper.selectCount(new LambdaQueryWrapper<TbHcBpccl>()
|
||||
.likeRight(StringUtils.isNotBlank(ssbm), TbHcBpccl::getSsbmdm, ssbm)
|
||||
.ge(TbHcBpccl::getPcsj, DateUtils.getSystemDateString())
|
||||
.and(v -> v.like(TbHcBpccl::getBqmc, "LK").or().like(TbHcBpccl::getBqmc, "临控"))
|
||||
);
|
||||
ryMap.put("lk", lk);
|
||||
return ryMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSjpcc(String ssbmdm, String time) {
|
||||
return this.baseMapper.selectCount(
|
||||
new LambdaQueryWrapper<TbHcBpccl>()
|
||||
.likeRight(!StringUtils.isEmpty(ssbmdm), TbHcBpccl::getSsbmdm, ssbmdm)
|
||||
.eq(TbHcBpccl::getPcrq, time)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPctj(HcTjQuery query) {
|
||||
Map map = new HashMap();
|
||||
IPage<HcTjQuery> page = PageUtils.buildPage(query.getPageSize(), query.getPageCurrent());
|
||||
query.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(query.getSsbmdm(), null));
|
||||
IPage<Map<String, Object>> bmdmList = this.baseMapper.getPctj(page, query);
|
||||
map.put("pageList", bmdmList);
|
||||
//统计人员数
|
||||
map.put("clsl", this.baseMapper.getPctjCl(query));
|
||||
map.put("rysl", this.baseMapper.getPctjRy(query));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPcWptj(String ssbmdm, String time) {
|
||||
return this.baseMapper.getPcWptj(ssbmdm, time);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,51 @@
|
||||
package com.mosty.hczx.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.hczx.TbHcDtgzDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcDtgz;
|
||||
import com.mosty.hczx.mapper.TbHcDtgzMapper;
|
||||
import com.mosty.hczx.service.TbHcDtgzService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbHcDtgzServiceImpl extends ServiceImpl<TbHcDtgzMapper, TbHcDtgz> implements TbHcDtgzService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<TbHcDtgz> getList(TbHcDtgzDto dtgz) {
|
||||
|
||||
LambdaQueryWrapper<TbHcDtgz> eq = new LambdaQueryWrapper<TbHcDtgz>();
|
||||
eq.eq(StringUtils.isNotBlank(dtgz.getGlid()), TbHcDtgz::getGlid, dtgz.getGlid())
|
||||
.eq(StringUtils.isNotBlank(dtgz.getJrlx()), TbHcDtgz::getJrlx, dtgz.getJrlx())
|
||||
.eq(StringUtils.isNotBlank(dtgz.getSbly()), TbHcDtgz::getSbly, dtgz.getSbly())
|
||||
.ge(StringUtils.isNotBlank(dtgz.getXsd()), TbHcDtgz::getXsd, dtgz.getXsd())
|
||||
.like(StringUtils.isNotBlank(dtgz.getBqmc()), TbHcDtgz::getBqmc, dtgz.getBqmc())
|
||||
.eq(StringUtils.isNotBlank(dtgz.getSbbm()), TbHcDtgz::getSbbm, dtgz.getSbbm())
|
||||
.eq(StringUtils.isNotBlank(dtgz.getSbmc()), TbHcDtgz::getSbmc, dtgz.getSbmc())
|
||||
.orderByDesc(TbHcDtgz::getXtCjsj)
|
||||
|
||||
;
|
||||
if (!CollectionUtils.isEmpty(dtgz.getBqList())) {
|
||||
for (String bq : dtgz.getBqList()) {
|
||||
eq.like(TbHcDtgz::getBqmc, bq);
|
||||
}
|
||||
}
|
||||
|
||||
List<TbHcDtgz> tbHcDtgzs = this.baseMapper.selectList(eq);
|
||||
if (!CollectionUtils.isEmpty(tbHcDtgzs)) {
|
||||
tbHcDtgzs = tbHcDtgzs.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbHcDtgz::getSfzh))), ArrayList::new));
|
||||
}
|
||||
return tbHcDtgzs;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.mosty.hczx.service.Impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.entity.hczx.TbHcRytzbq;
|
||||
import com.mosty.base.model.query.hczx.TbHcRytzbqQuery;
|
||||
import com.mosty.hczx.mapper.TbHcRytzbqMapper;
|
||||
import com.mosty.hczx.service.TbHcRytzbqService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/17
|
||||
**/
|
||||
@Service
|
||||
public class TbHcRytzbqServiceImpl extends ServiceImpl<TbHcRytzbqMapper, TbHcRytzbq>
|
||||
implements TbHcRytzbqService {
|
||||
|
||||
@Override
|
||||
public IPage<TbHcRytzbq> selectPage(TbHcRytzbqQuery dto) {
|
||||
dto.setPageCurrent(dto.getPageCurrent() == null ? 1 : dto.getPageCurrent());
|
||||
dto.setPageSize(dto.getPageSize() == null ? 10 : dto.getPageSize());
|
||||
return this.baseMapper.selectPage(
|
||||
new Page<>(dto.getPageCurrent(), dto.getPageSize()),
|
||||
new LambdaQueryWrapper<TbHcRytzbq>()
|
||||
.eq(StringUtils.isNotBlank(dto.getTzbqdm()), TbHcRytzbq::getTzbqdm, dto.getTzbqdm())
|
||||
.eq(StringUtils.isNotBlank(dto.getTzbqlb()), TbHcRytzbq::getTzbqlb, dto.getTzbqlb())
|
||||
.like(StringUtils.isNotBlank(dto.getTzbqmc()), TbHcRytzbq::getTzbqmc, dto.getTzbqmc())
|
||||
.eq(StringUtils.isNotBlank(dto.getTzsx()), TbHcRytzbq::getTzsx, dto.getTzsx())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbHcRytzbq> selectList(TbHcRytzbq dto) {
|
||||
return this.baseMapper.selectList(
|
||||
new LambdaQueryWrapper<TbHcRytzbq>()
|
||||
.eq(StringUtils.isNotBlank(dto.getTzbqdm()), TbHcRytzbq::getTzbqdm, dto.getTzbqdm())
|
||||
.eq(StringUtils.isNotBlank(dto.getTzbqlb()), TbHcRytzbq::getTzbqlb, dto.getTzbqlb())
|
||||
.like(StringUtils.isNotBlank(dto.getTzbqmc()), TbHcRytzbq::getTzbqmc, dto.getTzbqmc())
|
||||
.eq(StringUtils.isNotBlank(dto.getTzsx()), TbHcRytzbq::getTzsx, dto.getTzsx())
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.mosty.hczx.service.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjQueryDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjSaveDto;
|
||||
import com.mosty.base.model.entity.bkzx.TbBkCl;
|
||||
import com.mosty.base.model.entity.hczx.TbHcSydj;
|
||||
import com.mosty.base.model.vo.hczx.TbHcSydjVo;
|
||||
import com.mosty.common.base.exception.BusinessException;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.hczx.mapper.TbHcSydjMapper;
|
||||
import com.mosty.hczx.service.TbHcSydjServer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.reflection.wrapper.BaseWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbHcSydjServiceImpl extends ServiceImpl<TbHcSydjMapper, TbHcSydj> implements TbHcSydjServer {
|
||||
|
||||
@Override
|
||||
public void sydjSaveOrEdit(TbHcSydjSaveDto dto) {
|
||||
UserInfo user = UserInfoManager.get();
|
||||
if (user == null) {
|
||||
throw new BusinessException("请重新登录");
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getPcid())) {
|
||||
throw new BusinessException("盘查Id不存在");
|
||||
}
|
||||
TbHcSydj sydj = this.baseMapper.selectOne(new LambdaQueryWrapper<TbHcSydj>()
|
||||
.eq(TbHcSydj::getSfzh, dto.getSfzh())
|
||||
.eq(TbHcSydj::getPcid,dto.getPcid())
|
||||
.last(" limit 1"));
|
||||
if (null==sydj){
|
||||
TbHcSydj saveSydj = new TbHcSydj();
|
||||
BeanUtil.copyProperties(dto,saveSydj);
|
||||
saveSydj.setTjsj(new Date());
|
||||
saveSydj.setXtSjly("2");
|
||||
this.baseMapper.insert(saveSydj);
|
||||
}else {
|
||||
//人员姓名
|
||||
sydj.setRyxm(dto.getRyxm());
|
||||
//身份证号
|
||||
sydj.setSfzh(dto.getSfzh());
|
||||
//健康码状态
|
||||
sydj.setJkmzt(dto.getJkmzt());
|
||||
//疫苗接种情况
|
||||
sydj.setYmjzqk(dto.getYmjzqk());
|
||||
//通讯行程卡是否带*
|
||||
sydj.setTxxck(dto.getTxxck());
|
||||
//14天内到达或途径城市
|
||||
sydj.setDdhtjcs(dto.getDdhtjcs());
|
||||
//来自哪里
|
||||
sydj.setLz(dto.getLz());
|
||||
//去往哪里
|
||||
sydj.setQw(dto.getQw());
|
||||
//图片Id
|
||||
sydj.setTpid(dto.getTpid());
|
||||
sydj.setXtSjly("2");
|
||||
this.baseMapper.updateById(sydj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editSydj(TbHcSydjSaveDto dto) {
|
||||
UserInfo user = UserInfoManager.get();
|
||||
if (user == null) {
|
||||
throw new BusinessException("请重新登录");
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getId())){
|
||||
throw new BusinessException("需要修改的数据不存在");
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getPcid())) {
|
||||
throw new BusinessException("盘查Id不存在");
|
||||
}
|
||||
|
||||
TbHcSydj sydj = this.baseMapper.selectById((dto.getId()));
|
||||
if (null==sydj){
|
||||
throw new BusinessException("需要修改的数据不存在");
|
||||
}
|
||||
//盘查id
|
||||
sydj.setPcid(dto.getPcid());
|
||||
//人员姓名
|
||||
sydj.setRyxm(dto.getRyxm());
|
||||
//身份证号
|
||||
sydj.setSfzh(dto.getSfzh());
|
||||
//健康码状态
|
||||
sydj.setJkmzt(dto.getJkmzt());
|
||||
//疫苗接种情况
|
||||
sydj.setYmjzqk(dto.getYmjzqk());
|
||||
//通讯行程卡是否带*
|
||||
sydj.setTxxck(dto.getTxxck());
|
||||
//14天内到达或途径城市
|
||||
sydj.setDdhtjcs(dto.getDdhtjcs());
|
||||
//来自哪里
|
||||
sydj.setLz(dto.getLz());
|
||||
//去往哪里
|
||||
sydj.setQw(dto.getQw());
|
||||
//图片Id
|
||||
sydj.setTpid(dto.getTpid());
|
||||
sydj.setTjsj(new Date());
|
||||
sydj.setXtSjly("2");
|
||||
this.baseMapper.updateById(sydj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbHcSydjVo getRySydjInfo(TbHcSydjQueryDto dto) {
|
||||
TbHcSydj sydj = this.baseMapper.selectOne(new LambdaQueryWrapper<TbHcSydj>()
|
||||
.eq(TbHcSydj::getSfzh, dto.getSfzh())
|
||||
.eq(TbHcSydj::getPcid,dto.getPcid())
|
||||
.last(" limit 1"));
|
||||
TbHcSydjVo sydjVo = new TbHcSydjVo();
|
||||
BeanUtil.copyProperties(sydj,sydjVo);
|
||||
return sydjVo;
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.mosty.hczx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcclInsertDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpccl;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcclQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcTodayBpcclQuery;
|
||||
import com.mosty.base.model.vo.hczx.TbHcBpcclVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TbHcBpcclService {
|
||||
|
||||
@ApiOperation("查询被盘查车辆")
|
||||
Integer selectCarCount();
|
||||
|
||||
@ApiOperation("查询盘查车辆列表分页")
|
||||
IPage<TbHcBpcclVo> selectCarList(TbHcTodayBpcclQuery dto);
|
||||
|
||||
@ApiOperation("APP_查询车辆信息")
|
||||
TbHcBpcclVo selectCl(TbHcBpcclQuery dto);
|
||||
|
||||
@ApiOperation("保存被盘查车辆信息")
|
||||
void saveBpccl(TbHcBpcclInsertDto dto);
|
||||
|
||||
@ApiOperation("查询两个小时内没有被人员绑定的车辆")
|
||||
List<TbHcBpcclVo> getClOf2h();
|
||||
|
||||
@ApiOperation("条件查询车辆盘查信息")
|
||||
IPage<TbHcBpcclVo> getClpcList(TbHcBpcclQuery dto);
|
||||
|
||||
@ApiOperation("条件查询车辆盘查数据统计")
|
||||
Map<String, Integer> getClpcCount(TbHcBpcclQuery dto);
|
||||
|
||||
@ApiOperation("大屏被盘查车辆统计")
|
||||
Map<String, Integer> bpcclTj();
|
||||
|
||||
@ApiOperation("实际盘查车数")
|
||||
int getSjpcc(String ssbmdm, String time);
|
||||
|
||||
@ApiOperation("盘查统计")
|
||||
Object getPctj(HcTjQuery query);
|
||||
|
||||
@ApiOperation("盘查物品统计")
|
||||
int getPcWptj(String ssbmdm, String time);
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.mosty.hczx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcBpcry;
|
||||
import com.mosty.base.model.query.hczx.HcTjQuery;
|
||||
import com.mosty.base.model.query.hczx.RyClTjQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcBpcryQuery;
|
||||
import com.mosty.base.model.query.hczx.TbHcTodayBpcryQuery;
|
||||
import com.mosty.base.model.vo.hczx.RxSearchVo;
|
||||
import com.mosty.base.model.vo.hczx.RyZpSearchVo;
|
||||
import com.mosty.base.model.vo.hczx.TbHcBpcryVo;
|
||||
import com.mosty.common.core.business.entity.vo.Base64Str;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface TbHcBpcryService {
|
||||
|
||||
@ApiOperation("查询被盘查人员")
|
||||
Integer selectCrewCount();
|
||||
|
||||
@ApiOperation("大屏-数据统计区(左上侧)-查询盘查人员列表分页")
|
||||
IPage<TbHcBpcryVo> selectCrewList(TbHcTodayBpcryQuery dto);
|
||||
|
||||
@ApiOperation("APP_查询人员信息")
|
||||
TbHcBpcryVo selectRy(TbHcBpcryQuery dto);
|
||||
|
||||
@ApiOperation("根据人像查询人员列表信息")
|
||||
List<RyZpSearchVo> getRyListByZp(MultipartFile file);
|
||||
|
||||
@ApiOperation("根据手机号查询人员信息")
|
||||
List<Map> getRyListBySjhm(String mobile);
|
||||
|
||||
@ApiOperation("条件查询人员盘查信息")
|
||||
IPage<TbHcBpcryVo> getRypcList(TbHcBpcryQuery dto);
|
||||
|
||||
|
||||
@ApiOperation("条件查询人员盘查信息")
|
||||
Map<String, Integer> getRypcCount(TbHcBpcryQuery dto);
|
||||
|
||||
|
||||
@ApiOperation("查询两个小时内没有被车辆绑定的人员")
|
||||
List<TbHcBpcryVo> getRyOf2h();
|
||||
|
||||
@ApiOperation("保存被盘查人员信息")
|
||||
void saveBpcry(TbHcBpcryInsertDto dto);
|
||||
|
||||
@ApiOperation("保存被盘查人员信息Nfc")
|
||||
TbHcBpcryVo saveBpcryNfc(TbHcBpcry bpcry);
|
||||
|
||||
@ApiOperation("查询人员标签详情")
|
||||
Map<String, Object> getRyBq(String id);
|
||||
|
||||
@ApiOperation("查询人员标签代码根据身份证查询")
|
||||
Map<String, Object> getRyBqBySfzh(String sfzh);
|
||||
|
||||
|
||||
@ApiOperation("查询各区县盘查工作")
|
||||
Map<String, Object> getGqxpc(RyClTjQuery dto);
|
||||
|
||||
@ApiOperation("根据人像查询人员列表信息")
|
||||
List<RyZpSearchVo> getRyListByBase64(String base64Str);
|
||||
|
||||
|
||||
@ApiOperation("大屏被盘查人员统计")
|
||||
Map<String, Integer> bpcryTj();
|
||||
|
||||
@ApiOperation("巡防战果统计")
|
||||
IPage<Map<String, Object>> xfzgtj(HcTjQuery query);
|
||||
|
||||
@ApiOperation("巡防战果统计")
|
||||
Map<String, Object> xfzgtjAll(HcTjQuery query);
|
||||
|
||||
@ApiOperation("实际盘查人数")
|
||||
int getSjpcr(String ssbmdm, String time);
|
||||
|
||||
@ApiOperation("方正战果统计")
|
||||
Map<String, List<Map<String, Object>>> getZgtj(HcTjQuery query);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.hczx.service;
|
||||
|
||||
import com.mosty.base.model.dto.hczx.TbHcDtgzDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcDtgz;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbHcDtgzService {
|
||||
|
||||
@ApiOperation("列表查询接口")
|
||||
List<TbHcDtgz> getList(TbHcDtgzDto dtgz);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.mosty.hczx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.entity.hczx.TbHcRytzbq;
|
||||
import com.mosty.base.model.query.hczx.TbHcRytzbqQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/9/17
|
||||
**/
|
||||
public interface TbHcRytzbqService {
|
||||
|
||||
@ApiOperation("获取人员特征标签列表--分页")
|
||||
IPage<TbHcRytzbq> selectPage(TbHcRytzbqQuery dto);
|
||||
|
||||
@ApiOperation("获取人员特征标签列表--不分页")
|
||||
List<TbHcRytzbq> selectList(TbHcRytzbq dto);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mosty.hczx.service;
|
||||
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjQueryDto;
|
||||
import com.mosty.base.model.dto.hczx.TbHcSydjSaveDto;
|
||||
import com.mosty.base.model.entity.hczx.TbHcSydj;
|
||||
import com.mosty.base.model.vo.hczx.TbHcSydjVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
public interface TbHcSydjServer {
|
||||
|
||||
@ApiOperation("保存或者修改涉疫登记信息")
|
||||
void sydjSaveOrEdit(TbHcSydjSaveDto dto);
|
||||
@ApiOperation("保存涉疫登记信息")
|
||||
void editSydj(TbHcSydjSaveDto dto);
|
||||
@ApiOperation("根据身份证号码和盘查Id查询人员涉疫登记信息")
|
||||
TbHcSydjVo getRySydjInfo(TbHcSydjQueryDto dto);
|
||||
}
|
@ -0,0 +1,560 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.config.AuthSchemes;
|
||||
import org.apache.http.client.config.CookieSpecs;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.config.Registry;
|
||||
import org.apache.http.config.RegistryBuilder;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
public class HttpClientUtils {
|
||||
|
||||
|
||||
public static final String CHARSET = "UTF-8";
|
||||
private static final RequestConfig REQUEST_CONFIG = RequestConfig.custom().setSocketTimeout(15000).setConnectTimeout(15000).setConnectionRequestTimeout(15000).build();
|
||||
|
||||
public static String doGet(String url, Map<String, String> params) {
|
||||
return doGet(url, params, CHARSET);
|
||||
}
|
||||
|
||||
public static String doGetSSL(String url, Map<String, String> params) {
|
||||
return doGetSSL(url, params, CHARSET);
|
||||
}
|
||||
|
||||
public static String doPost(String url, Map<String, String> params) {
|
||||
return doPost(url, params, CHARSET);
|
||||
}
|
||||
|
||||
public static String doPostForJson(String url, String json) {
|
||||
return doPostForJson(url, json, CHARSET);
|
||||
}
|
||||
|
||||
public static String doPostForJson(String url, String json, Map<String, String> headersMap) {
|
||||
return doPostForJsonHeaders(url, json, CHARSET, headersMap);
|
||||
}
|
||||
|
||||
public static String doPostSSLForJson(String url, String json) {
|
||||
return doPostSSLForJson(url, json, CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP GET
|
||||
*
|
||||
* @param url
|
||||
* 请求的url地址 ?之前的地址
|
||||
* @param params
|
||||
* 请求的参数
|
||||
* @param charset
|
||||
* 编码格式
|
||||
* @return 页面内容
|
||||
*/
|
||||
public static String doGet(String url, Map<String, String> params, String charset) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
if (params != null && !params.isEmpty()) {
|
||||
List<NameValuePair> pairs = new ArrayList<NameValuePair>(params.size());
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value != null) {
|
||||
pairs.add(new BasicNameValuePair(entry.getKey(), value));
|
||||
}
|
||||
}
|
||||
// 将请求参数和url进行拼接
|
||||
url += "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs, charset));
|
||||
}
|
||||
HttpGet httpGet = new HttpGet(url);
|
||||
httpGet.setConfig(REQUEST_CONFIG);
|
||||
|
||||
// 创建默认的httpClient实例.
|
||||
httpClient = HttpClients.createDefault();
|
||||
response = httpClient.execute(httpGet);
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != 200) {
|
||||
httpGet.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: doGetSSL
|
||||
* @Description: get https
|
||||
* @param url
|
||||
* @param params
|
||||
* @param charset
|
||||
* @return String
|
||||
*/
|
||||
public static String doGetSSL(String url, Map<String, String> params, String charset) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
if (params != null && !params.isEmpty()) {
|
||||
List<NameValuePair> pairs = new ArrayList<NameValuePair>(params.size());
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value != null) {
|
||||
pairs.add(new BasicNameValuePair(entry.getKey(), value));
|
||||
}
|
||||
}
|
||||
// 将请求参数和url进行拼接
|
||||
url += "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs, charset));
|
||||
}
|
||||
HttpGet httpGet = new HttpGet(url);
|
||||
httpGet.setConfig(REQUEST_CONFIG);
|
||||
|
||||
// 创建默认的httpClient实例. 在调用SSL之前需要重写验证方法,取消检测SSL
|
||||
X509TrustManager trustManager = new X509TrustManager() {
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] xcs, String str) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] xcs, String str) {
|
||||
}
|
||||
};
|
||||
SSLContext ctx = SSLContext.getInstance(SSLConnectionSocketFactory.TLS);
|
||||
ctx.init(null, new TrustManager[] { trustManager }, null);
|
||||
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(ctx, NoopHostnameVerifier.INSTANCE);
|
||||
RequestConfig requestConfig = RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD_STRICT).setExpectContinueEnabled(Boolean.TRUE)
|
||||
.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST)).setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC)).build();
|
||||
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create().register("http", PlainConnectionSocketFactory.INSTANCE)
|
||||
.register("https", socketFactory).build();
|
||||
// 创建ConnectionManager,添加Connection配置信息
|
||||
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||
httpClient = HttpClients.custom().setConnectionManager(connectionManager).setDefaultRequestConfig(requestConfig).build();
|
||||
|
||||
httpGet.addHeader("AppKey", "679049566846189568");
|
||||
|
||||
response = httpClient.execute(httpGet);
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != 200) {
|
||||
httpGet.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP POST
|
||||
*
|
||||
* @param url
|
||||
* 请求的url地址 ?之前的地址
|
||||
* @param params
|
||||
* 请求的参数
|
||||
* @param charset
|
||||
* 编码格式
|
||||
* @return 页面内容
|
||||
*/
|
||||
public static String doPost(String url, Map<String, String> params, String charset) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
//log.info("doPost url: " + url);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
List<NameValuePair> pairs = null;
|
||||
if (params != null && !params.isEmpty()) {
|
||||
pairs = new ArrayList<NameValuePair>(params.size());
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value != null) {
|
||||
pairs.add(new BasicNameValuePair(entry.getKey(), value));
|
||||
}
|
||||
}
|
||||
//log.info("doPost pairs: " + JacksonUtils.objToJson(pairs));
|
||||
}
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
if (pairs != null && pairs.size() > 0) {
|
||||
httpPost.setEntity(new UrlEncodedFormEntity(pairs, CHARSET));
|
||||
}
|
||||
httpPost.setConfig(REQUEST_CONFIG);
|
||||
// 创建默认的httpClient实例.
|
||||
httpClient = HttpClients.createDefault();
|
||||
response = httpClient.execute(httpPost);
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
httpPost.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
log.info("doPost HttpEntity: " + result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP POST 参数为json
|
||||
*
|
||||
* @param url
|
||||
* @param json
|
||||
* @param charset
|
||||
* @return
|
||||
*/
|
||||
public static String doPostForJson(String url, String json, String charset) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
// log.info("doPostForJson url: " + url);
|
||||
// log.info("doPostForJson json: " + json);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
|
||||
StringEntity stringentity = new StringEntity(json, charset);
|
||||
stringentity.setContentType("application/json");
|
||||
|
||||
httpPost.setEntity(stringentity);
|
||||
httpPost.setConfig(REQUEST_CONFIG);
|
||||
// 创建默认的httpClient实例.
|
||||
httpClient = HttpClients.createDefault();
|
||||
// 执行请求
|
||||
response = httpClient.execute(httpPost);
|
||||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
httpPost.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
// log.info("doPostForJson HttpEntity: " + result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP POST 参数为json
|
||||
*
|
||||
* @param url
|
||||
* @param json
|
||||
* @param charset
|
||||
* @return
|
||||
*/
|
||||
public static String doPostForJsonHeaders(String url, String json, String charset, Map<String, String> headersMap) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
log.info("doPostForJson url: " + url);
|
||||
//log.info("doPostForJson json: " + json);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
|
||||
StringEntity stringentity = new StringEntity(json, charset);
|
||||
stringentity.setContentType("application/json");
|
||||
|
||||
//请求头部
|
||||
if(null != headersMap && !headersMap.isEmpty()){
|
||||
Iterator<Map.Entry<String, String>> itr = headersMap.entrySet().iterator();
|
||||
while(itr.hasNext()){
|
||||
Map.Entry<String, String> ent = itr.next();
|
||||
httpPost.addHeader(ent.getKey(), ent.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
httpPost.setEntity(stringentity);
|
||||
httpPost.setConfig(REQUEST_CONFIG);
|
||||
// 创建默认的httpClient实例.
|
||||
httpClient = HttpClients.createDefault();
|
||||
// 执行请求
|
||||
response = httpClient.execute(httpPost);
|
||||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
httpPost.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
log.info("doPostForJson HttpEntity: " + result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: doPostSSLForJson
|
||||
* @Description: post https
|
||||
* @param url
|
||||
* @param json
|
||||
* @param charset
|
||||
* @return String
|
||||
*/
|
||||
public static String doPostSSLForJson(String url, String json, String charset) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
|
||||
StringEntity stringentity = new StringEntity(json, charset);
|
||||
stringentity.setContentType("application/json");
|
||||
|
||||
httpPost.setEntity(stringentity);
|
||||
httpPost.setConfig(REQUEST_CONFIG);
|
||||
|
||||
// 在调用SSL之前需要重写验证方法,取消检测SSL
|
||||
X509TrustManager trustManager = new X509TrustManager() {
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] xcs, String str) {
|
||||
}
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] xcs, String str) {
|
||||
}
|
||||
};
|
||||
SSLContext ctx = SSLContext.getInstance(SSLConnectionSocketFactory.TLS);
|
||||
ctx.init(null, new TrustManager[] { trustManager }, null);
|
||||
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(ctx, NoopHostnameVerifier.INSTANCE);
|
||||
RequestConfig requestConfig = RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD_STRICT).setExpectContinueEnabled(Boolean.TRUE)
|
||||
.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST)).setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC)).build();
|
||||
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("http", PlainConnectionSocketFactory.INSTANCE).register("https", socketFactory).build();
|
||||
// 创建ConnectionManager,添加Connection配置信息
|
||||
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||
httpClient = HttpClients.custom().setConnectionManager(connectionManager).setDefaultRequestConfig(requestConfig).build();
|
||||
|
||||
// 执行请求
|
||||
response = httpClient.execute(httpPost);
|
||||
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
httpPost.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* doGetForJson(json方式的get请求)
|
||||
* @param url
|
||||
* @param params
|
||||
* @param charset
|
||||
* @return
|
||||
*/
|
||||
public static String doGetForJson(String url, Map<String, String> params, String charset) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
if (params != null && !params.isEmpty()) {
|
||||
List<NameValuePair> pairs = new ArrayList<NameValuePair>(params.size());
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value != null) {
|
||||
pairs.add(new BasicNameValuePair(entry.getKey(), value));
|
||||
}
|
||||
}
|
||||
// 将请求参数和url进行拼接
|
||||
url += "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs, charset));
|
||||
}
|
||||
HttpGet httpGet = new HttpGet(url);
|
||||
httpGet.setConfig(REQUEST_CONFIG);
|
||||
httpGet.setHeader("Content-Type", "application/json;charset=UTF-8");
|
||||
|
||||
// 创建默认的httpClient实例.
|
||||
httpClient = HttpClients.createDefault();
|
||||
response = httpClient.execute(httpGet);
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != 200) {
|
||||
httpGet.abort();
|
||||
return "HttpClient, error status code : " + statusCode;
|
||||
}
|
||||
HttpEntity entity = response.getEntity();
|
||||
String result = null;
|
||||
if (entity != null) {
|
||||
result = EntityUtils.toString(entity, "utf-8");
|
||||
}
|
||||
EntityUtils.consume(entity);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("2".contains("1,2"));
|
||||
}
|
||||
|
||||
}
|
307
mosty-hczx/src/main/java/com/mosty/hczx/utils/ImageUtils.java
Normal file
307
mosty-hczx/src/main/java/com/mosty/hczx/utils/ImageUtils.java
Normal file
@ -0,0 +1,307 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Decoder;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import javax.net.ssl.*;
|
||||
import java.awt.*;
|
||||
import java.awt.color.ColorSpace;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.*;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* 图片处理类<br>
|
||||
*
|
||||
* @author Esacpe
|
||||
* @version 2014-8-22
|
||||
*/
|
||||
|
||||
public class ImageUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 将图片缩放处理方法<br>
|
||||
*
|
||||
* @param source 源图片对象
|
||||
* @param targetW 转换后的宽度
|
||||
* @param targetH 转换后的高度
|
||||
* @param sameScale 是否等比例缩放
|
||||
* @return BufferedImage
|
||||
*/
|
||||
public static BufferedImage resize(BufferedImage source, int targetW,
|
||||
int targetH, boolean sameScale) { // targetW,targetH分别表示目标长和宽
|
||||
int type = source.getType();
|
||||
BufferedImage target = null;
|
||||
double sx = (double) targetW / source.getWidth();
|
||||
double sy = (double) targetH / source.getHeight();
|
||||
if (sameScale) { // 需要等比例缩放
|
||||
if (sx > sy) {
|
||||
sx = sy;
|
||||
targetW = (int) (sx * source.getWidth());
|
||||
} else {
|
||||
sy = sx;
|
||||
targetH = (int) (sy * source.getHeight());
|
||||
}
|
||||
}
|
||||
if (type == BufferedImage.TYPE_CUSTOM) { // handmade
|
||||
ColorModel cm = source.getColorModel();
|
||||
WritableRaster raster = cm.createCompatibleWritableRaster(targetW,
|
||||
targetH);
|
||||
boolean alphaPremultiplied = cm.isAlphaPremultiplied();
|
||||
target = new BufferedImage(cm, raster, alphaPremultiplied, null);
|
||||
} else {
|
||||
target = new BufferedImage(targetW, targetH, type);
|
||||
}
|
||||
Graphics2D g = target.createGraphics();
|
||||
// smoother than exlax:
|
||||
g.setRenderingHint(RenderingHints.KEY_RENDERING,
|
||||
RenderingHints.VALUE_RENDER_QUALITY);
|
||||
g.drawRenderedImage(source, AffineTransform.getScaleInstance(sx, sy));
|
||||
g.dispose();
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将图片放大与缩小<br>
|
||||
*
|
||||
* @param sourceByte 源图片的字节数组
|
||||
* @param width 转换后的宽度
|
||||
* @param height 转换后的高度
|
||||
* @param sameScale 是否等比例缩放
|
||||
* @return byte[]
|
||||
*/
|
||||
public static byte[] convertImageSize(byte[] sourceByte, int width,
|
||||
int height, boolean sameScale) throws Exception {
|
||||
byte[] returnValue = null;
|
||||
if (sourceByte != null && sourceByte.length > 0) {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(sourceByte);
|
||||
// BufferedImage srcImage = getReadImage(in);
|
||||
BufferedImage srcImage = null;
|
||||
try {
|
||||
srcImage = ImageIO.read(in); // RGB
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (srcImage != null) {
|
||||
BufferedImage srcImageTarget = resize(srcImage, width, height,
|
||||
sameScale);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
boolean flag = ImageIO.write(srcImageTarget, "JPEG", out);
|
||||
returnValue = out.toByteArray();
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将图片放大与缩小后另存<br>
|
||||
*
|
||||
* @param fromFileStr 来源文件名
|
||||
* @param saveToFileStr 目标文件名
|
||||
* @param width 转换后的宽度
|
||||
* @param height 转换后的高度
|
||||
* @param sameScale 是否等比例缩放
|
||||
*/
|
||||
public static void saveImageAsJpg(String fromFileStr, String saveToFileStr,
|
||||
int width, int height, boolean sameScale) throws Exception {
|
||||
String imgType = "JPEG";
|
||||
if (fromFileStr.toLowerCase().endsWith(".png")) {
|
||||
imgType = "PNG";
|
||||
}
|
||||
File saveFile = new File(saveToFileStr);
|
||||
File fromFile = new File(fromFileStr);
|
||||
BufferedImage srcImage = getReadImage(fromFile);
|
||||
if (srcImage != null) {
|
||||
if (width > 0 || height > 0) {
|
||||
srcImage = resize(srcImage, width, height, sameScale);
|
||||
}
|
||||
ImageIO.write(srcImage, imgType, saveFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件取得bufferedImage对象(自动识别RGB与CMYK)<br>
|
||||
*
|
||||
* @param file 来源文件名
|
||||
* @return BufferedImage
|
||||
*/
|
||||
private static BufferedImage getReadImage(File file) throws Exception {
|
||||
BufferedImage srcImage = null;
|
||||
ImageInputStream input = ImageIO.createImageInputStream(file); // 只能接收File或FileInputStream,ByteArrayInputStream无效
|
||||
Iterator readers = ImageIO.getImageReaders(input);
|
||||
if (readers == null || !readers.hasNext()) {
|
||||
throw new RuntimeException("1 No ImageReaders found");
|
||||
}
|
||||
ImageReader reader = (ImageReader) readers.next();
|
||||
reader.setInput(input);
|
||||
String format = reader.getFormatName();
|
||||
if ("JPEG".equalsIgnoreCase(format) || "JPG".equalsIgnoreCase(format)) {
|
||||
try {
|
||||
srcImage = ImageIO.read(file); // RGB
|
||||
} catch (Exception e) {
|
||||
Raster raster = reader.readRaster(0, null);// CMYK
|
||||
srcImage = createJPEG4(raster);
|
||||
}
|
||||
input.close();
|
||||
}
|
||||
return srcImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* RGB彩色空间转换为CMYK<br>
|
||||
*
|
||||
* @param raster
|
||||
* @return BufferedImage
|
||||
*/
|
||||
private static BufferedImage createJPEG4(Raster raster) {
|
||||
int w = raster.getWidth();
|
||||
int h = raster.getHeight();
|
||||
byte[] rgb = new byte[w * h * 3]; // 彩色空间转换
|
||||
float[] Y = raster.getSamples(0, 0, w, h, 0, (float[]) null);
|
||||
float[] Cb = raster.getSamples(0, 0, w, h, 1, (float[]) null);
|
||||
float[] Cr = raster.getSamples(0, 0, w, h, 2, (float[]) null);
|
||||
float[] K = raster.getSamples(0, 0, w, h, 3, (float[]) null);
|
||||
for (int i = 0, imax = Y.length, base = 0; i < imax; i++, base += 3) {
|
||||
float k = 220 - K[i], y = 255 - Y[i], cb = 255 - Cb[i], cr = 255 - Cr[i];
|
||||
double val = y + 1.402 * (cr - 128) - k;
|
||||
val = (val - 128) * .65f + 128;
|
||||
rgb[base] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff
|
||||
: (byte) (val + 0.5);
|
||||
val = y - 0.34414 * (cb - 128) - 0.71414 * (cr - 128) - k;
|
||||
val = (val - 128) * .65f + 128;
|
||||
rgb[base + 1] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff
|
||||
: (byte) (val + 0.5);
|
||||
val = y + 1.772 * (cb - 128) - k;
|
||||
val = (val - 128) * .65f + 128;
|
||||
rgb[base + 2] = val < 0.0 ? (byte) 0 : val > 255.0 ? (byte) 0xff
|
||||
: (byte) (val + 0.5);
|
||||
}
|
||||
raster = Raster.createInterleavedRaster(new DataBufferByte(rgb,
|
||||
rgb.length), w, h, w * 3, 3, new int[]{0, 1, 2}, null);
|
||||
ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
|
||||
ColorModel cm = new ComponentColorModel(cs, false, true,
|
||||
Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
|
||||
return new BufferedImage(cm, (WritableRaster) raster, true, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络图片转成base64 https
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encodeImageToBase64Https(String url) throws Exception {
|
||||
String base64 = null;
|
||||
SSLContext sslcontext = SSLContext.getInstance("SSL", "SunJSSE");
|
||||
sslcontext.init(null, new TrustManager[]{new MyX509TrustManager()}, new java.security.SecureRandom());
|
||||
URL urls = new URL(url);
|
||||
HostnameVerifier ignoreHostnameVerifier = new HostnameVerifier() {
|
||||
public boolean verify(String s, SSLSession sslsession) {
|
||||
System.out.println("WARNING: Hostname is not matched for cert.");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(ignoreHostnameVerifier);
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory());
|
||||
//之后任何Https协议网站皆能正常访问,同第一种情况
|
||||
HttpURLConnection conn = null;
|
||||
try {
|
||||
conn = (HttpURLConnection) urls.openConnection();
|
||||
//设置请求方式为"GET"
|
||||
conn.setRequestMethod("GET");
|
||||
//超时响应时间为5秒
|
||||
conn.setConnectTimeout(5 * 1000);
|
||||
if (conn.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM) {
|
||||
String location = conn.getHeaderField("Location");
|
||||
String s = encodeImageToBase64Https(location.trim());
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(s)) {
|
||||
return s;
|
||||
}
|
||||
|
||||
} else {
|
||||
//通过输入流获取图片数据
|
||||
InputStream inStream = conn.getInputStream();
|
||||
//得到图片的二进制数据,以二进制封装得到数据,具有通用性
|
||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||
//创建一个Buffer字符串
|
||||
byte[] buffer = new byte[1024];
|
||||
//每次读取的字符串长度,如果为-1,代表全部读取完毕
|
||||
int len = 0;
|
||||
//使用一个输入流从buffer里把数据读取出来
|
||||
while ((len = inStream.read(buffer)) != -1) {
|
||||
//用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
|
||||
outStream.write(buffer, 0, len);
|
||||
}
|
||||
//关闭输入流
|
||||
inStream.close();
|
||||
byte[] data = outStream.toByteArray();
|
||||
//对字节数组Base64编码
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
base64 = encoder.encode(data).replaceAll("[\\s*\t\n\r]", "");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new Exception("解析失败!");
|
||||
}
|
||||
return base64;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络图片转成base64
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encodeImageToBase64(String url) throws Exception {
|
||||
//打开链接
|
||||
URL urls = new URL(url);
|
||||
HttpURLConnection conn = null;
|
||||
try {
|
||||
conn = (HttpURLConnection) urls.openConnection();
|
||||
//设置请求方式为"GET"
|
||||
conn.setRequestMethod("GET");
|
||||
//超时响应时间为5秒
|
||||
conn.setConnectTimeout(5 * 1000);
|
||||
//通过输入流获取图片数据
|
||||
InputStream inStream = conn.getInputStream();
|
||||
//得到图片的二进制数据,以二进制封装得到数据,具有通用性
|
||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||
//创建一个Buffer字符串
|
||||
byte[] buffer = new byte[1024];
|
||||
//每次读取的字符串长度,如果为-1,代表全部读取完毕
|
||||
int len = 0;
|
||||
//使用一个输入流从buffer里把数据读取出来
|
||||
while ((len = inStream.read(buffer)) != -1) {
|
||||
//用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
|
||||
outStream.write(buffer, 0, len);
|
||||
}
|
||||
//关闭输入流
|
||||
inStream.close();
|
||||
byte[] data = outStream.toByteArray();
|
||||
//对字节数组Base64编码
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String base64 = encoder.encode(data).replaceAll("[\\s*\t\n\r]", "");
|
||||
return base64;//返回Base64编码过的字节数组字符串
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new Exception("解析失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String argv[]) throws Exception {
|
||||
|
||||
}
|
||||
}
|
204
mosty-hczx/src/main/java/com/mosty/hczx/utils/JacksonUtils.java
Normal file
204
mosty-hczx/src/main/java/com/mosty/hczx/utils/JacksonUtils.java
Normal file
@ -0,0 +1,204 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class JacksonUtils {
|
||||
private final static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
private JacksonUtils() {
|
||||
|
||||
}
|
||||
|
||||
public static ObjectMapper getInstance() {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* javaBean、列表数组转换为json字符串
|
||||
*/
|
||||
public static String objToJson(Object obj) throws Exception {
|
||||
return objectMapper.writeValueAsString(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* javaBean、列表数组转换为json字符串,忽略空值
|
||||
*/
|
||||
public static String objToJsonIgnoreNull(Object obj) throws Exception {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
return mapper.writeValueAsString(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* json 转JavaBean
|
||||
*/
|
||||
|
||||
public static <T> T jsonToPojo(String jsonString, Class<T> clazz) throws Exception {
|
||||
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
|
||||
return objectMapper.readValue(jsonString, clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* json字符串转换为map
|
||||
*/
|
||||
public static <T> Map<String, Object> jsonToMap(String jsonString) throws Exception {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
return mapper.readValue(jsonString, Map.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* json字符串转换为map
|
||||
*/
|
||||
public static <T> Map<String, T> jsonToMap(String jsonString, Class<T> clazz) throws Exception {
|
||||
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) objectMapper.readValue(jsonString, new TypeReference<Map<String, T>>() {
|
||||
});
|
||||
Map<String, T> result = new HashMap<String, T>();
|
||||
for (Map.Entry<String, Map<String, Object>> entry : map.entrySet()) {
|
||||
result.put(entry.getKey(), mapToPojo(entry.getValue(), clazz));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 深度转换json成map
|
||||
*
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Object> jsonToMapDeeply(String json) throws Exception {
|
||||
return jsonToMapRecursion(json, objectMapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把json解析成list,如果list内部的元素存在jsonString,继续解析
|
||||
*
|
||||
* @param json
|
||||
* @param mapper
|
||||
* 解析工具
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private static List<Object> jsonToListRecursion(String json, ObjectMapper mapper) throws Exception {
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Object> list = mapper.readValue(json, List.class);
|
||||
|
||||
for (Object obj : list) {
|
||||
if (obj != null && obj instanceof String) {
|
||||
String str = (String) obj;
|
||||
if (str.startsWith("[")) {
|
||||
obj = jsonToListRecursion(str, mapper);
|
||||
} else if (obj.toString().startsWith("{")) {
|
||||
obj = jsonToMapRecursion(str, mapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把json解析成map,如果map内部的value存在jsonString,继续解析
|
||||
*
|
||||
* @param json
|
||||
* @param mapper
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private static Map<String, Object> jsonToMapRecursion(String json, ObjectMapper mapper) throws Exception {
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, Object> map = mapper.readValue(json, Map.class);
|
||||
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
Object obj = entry.getValue();
|
||||
if (obj != null && obj instanceof String) {
|
||||
String str = ((String) obj);
|
||||
|
||||
if (str.startsWith("[")) {
|
||||
List<?> list = jsonToListRecursion(str, mapper);
|
||||
map.put(entry.getKey(), list);
|
||||
} else if (str.startsWith("{")) {
|
||||
Map<String, Object> mapRecursion = jsonToMapRecursion(str, mapper);
|
||||
map.put(entry.getKey(), mapRecursion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 与javaBean json数组字符串转换为列表
|
||||
*/
|
||||
public static <T> List<T> jsonToList(String jsonArrayStr, Class<T> clazz) throws Exception {
|
||||
JavaType javaType = getCollectionType(ArrayList.class, clazz);
|
||||
List<T> lst = (List<T>) objectMapper.readValue(jsonArrayStr, javaType);
|
||||
return lst;
|
||||
}
|
||||
|
||||
/**
|
||||
* 深度转换json成列表
|
||||
*/
|
||||
public static List<Object> jsonToListDeeply(String jsonArrayStr) throws Exception {
|
||||
return jsonToListRecursion(jsonArrayStr, objectMapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取泛型的Collection Type
|
||||
*
|
||||
* @param collectionClass
|
||||
* 泛型的Collection
|
||||
* @param elementClasses
|
||||
* 元素类
|
||||
* @return JavaType Java类型
|
||||
* @since 1.0
|
||||
*/
|
||||
public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
|
||||
return objectMapper.getTypeFactory().constructParametricType(collectionClass, elementClasses);
|
||||
}
|
||||
|
||||
/**
|
||||
* map 转JavaBean
|
||||
*/
|
||||
public static <T> T mapToPojo(Map map, Class<T> clazz) {
|
||||
return objectMapper.convertValue(map, clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* map 转json
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public static String mapToJson(Map map) {
|
||||
try {
|
||||
return objectMapper.writeValueAsString(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* map 转JavaBean
|
||||
*/
|
||||
public static <T> T objToPojo(Object obj, Class<T> clazz) {
|
||||
return objectMapper.convertValue(obj, clazz);
|
||||
}
|
||||
|
||||
}
|
87
mosty-hczx/src/main/java/com/mosty/hczx/utils/MD5Utils.java
Normal file
87
mosty-hczx/src/main/java/com/mosty/hczx/utils/MD5Utils.java
Normal file
@ -0,0 +1,87 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class MD5Utils {
|
||||
private static MessageDigest md5 = null;
|
||||
static {
|
||||
try {
|
||||
md5 = MessageDigest.getInstance("MD5");
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于获取一个String的md5值
|
||||
*
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
public static String getMd5(String str) {
|
||||
byte[] bs = md5.digest(str.getBytes());
|
||||
StringBuilder sb = new StringBuilder(40);
|
||||
for (byte x : bs) {
|
||||
if ((x & 0xff) >> 4 == 0) {
|
||||
sb.append("0").append(Integer.toHexString(x & 0xff));
|
||||
} else {
|
||||
sb.append(Integer.toHexString(x & 0xff));
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getMd5("abc@123"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过网站域名URL获取该网站的源码
|
||||
*
|
||||
* @param url
|
||||
* @return String
|
||||
* @throws Exception
|
||||
*/
|
||||
public static InputStream getURLinStream(String pathUrl) throws Exception {
|
||||
URL url = new URL(pathUrl);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
conn.setConnectTimeout(5 * 1000);
|
||||
return conn.getInputStream(); // 通过输入流获取html二进制数据
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取md5
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String getUrlMd5(String url) throws Exception {
|
||||
try {
|
||||
InputStream fis = getURLinStream(url);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] buffer = new byte[1024];
|
||||
int length = -1;
|
||||
while ((length = fis.read(buffer, 0, 1024)) != -1) {
|
||||
md.update(buffer, 0, length);
|
||||
}
|
||||
BigInteger bigInt = new BigInteger(1, md.digest());
|
||||
return bigInt.toString(16);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
public class MyX509TrustManager implements X509TrustManager {
|
||||
|
||||
// 检查客户端证书
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
// 检查服务器端证书
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
// 返回受信任的X509证书数组
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.mosty.hczx.utils;
|
||||
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* Created by 张海军 on 2022/4/12 10:52
|
||||
*
|
||||
* @ClassName PinYinUtil
|
||||
*/
|
||||
public class PinYinUtil {
|
||||
|
||||
|
||||
private PinYinUtil() {}
|
||||
|
||||
/**
|
||||
* 获取中文拼音首字母,其他字符不变
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public static String getShortPinyin(String str) {
|
||||
return getShortPinyin(str, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中文拼音首字母
|
||||
* @param str
|
||||
* @param retain 为true保留其他字符
|
||||
* @return String
|
||||
*/
|
||||
public static String getShortPinyin(String str, boolean retain) {
|
||||
return getPinyin(str, true, retain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中文拼音,其他字符不变
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public static String getFullPinyin(String str) {
|
||||
return getFullPinyin(str, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中文拼音
|
||||
* @param str
|
||||
* @param retain 为true保留其他字符
|
||||
* @return String
|
||||
*/
|
||||
public static String getFullPinyin(String str, boolean retain) {
|
||||
return getPinyin(str, false, retain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中文拼音
|
||||
*
|
||||
* @param str
|
||||
* @param shortPinyin 为true获取中文拼音首字母
|
||||
* @param retain 为true保留其他字符
|
||||
* @return String
|
||||
*/
|
||||
public static String getPinyin(String str, boolean shortPinyin, boolean retain) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
return "";
|
||||
}
|
||||
StringBuffer pinyinBuffer = new StringBuffer();
|
||||
char[] arr = str.toCharArray();
|
||||
for (char c : arr) {
|
||||
String[] temp = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||
if (ArrayUtils.isNotEmpty(temp)) {
|
||||
if (StringUtils.isNotBlank(temp[0])) {
|
||||
if (shortPinyin) {
|
||||
pinyinBuffer.append(temp[0].charAt(0));
|
||||
} else {
|
||||
pinyinBuffer.append(temp[0].replaceAll("\\d", ""));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (retain) {
|
||||
pinyinBuffer.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pinyinBuffer.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
1105
mosty-hczx/src/main/java/com/mosty/hczx/utils/StringUtils.java
Normal file
1105
mosty-hczx/src/main/java/com/mosty/hczx/utils/StringUtils.java
Normal file
File diff suppressed because it is too large
Load Diff
75
mosty-hczx/src/main/resources/application.yml
Normal file
75
mosty-hczx/src/main/resources/application.yml
Normal file
@ -0,0 +1,75 @@
|
||||
ribbon:
|
||||
ReadTimeout: 600000
|
||||
ConnectTimeout: 600000
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
# # 格式化返回时间 yyyy-MM-dd HH:mm:ss
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.200.131:3306/mosty_hczx?autoReconnect=true&failOverReadOnly=false&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: mosty888
|
||||
hikari:
|
||||
minimum-idle: 10 # ??????????10???0???maximum-pool-size??????maximum-pool-size
|
||||
maximum-pool-size: 20 # ??????????0????????10??????1?????minimum-idle??
|
||||
idle-timeout: 500000 # ????????????600000?10????????max-lifetime?max-lifetime>0??????0????0???10???????10??
|
||||
max-lifetime: 540000 # ????????????0???30??????????30??.?????mysql????????
|
||||
connection-timeout: 60000 # ????????????250????????????30?
|
||||
connection-test-query: SELECT 1 # ???????????????
|
||||
# Redis数据库索引(默认为0)
|
||||
redis:
|
||||
database: 8
|
||||
# Redis服务器地址
|
||||
host: 192.168.200.131
|
||||
# Redis服务器连接端口
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password: mosty888
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 2000
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 50
|
||||
|
||||
swagger:
|
||||
host: 80.155.0.84
|
||||
port: 8010
|
||||
|
||||
mybatis-plus:
|
||||
global-config:
|
||||
db-config:
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
magic-api:
|
||||
web: /magic/web
|
||||
#配置文件存储位置。当以classpath开头时,为只读模式
|
||||
resource:
|
||||
# location: /data/magic-api
|
||||
type: database
|
||||
table-name: magic_api # 数据库中的表名
|
||||
prefix: /magic-api # 前缀
|
||||
datasource:
|
||||
response-code:
|
||||
success: 10000
|
||||
exclude:
|
||||
pathPatterns:
|
||||
swagger:
|
||||
- /swagger-resources/**
|
||||
- /webjars/**
|
||||
- /v2/**
|
||||
- /swagger-ui.html/**
|
||||
- /docs.html/**
|
||||
|
||||
config:
|
||||
orgCode: 510600000000
|
39
mosty-hczx/src/main/resources/bootstrap.yml
Normal file
39
mosty-hczx/src/main/resources/bootstrap.yml
Normal file
@ -0,0 +1,39 @@
|
||||
server:
|
||||
port: 8014
|
||||
servlet:
|
||||
context-path: /mosty-hczx/
|
||||
spring:
|
||||
application:
|
||||
name: mosty-hczx
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
namespace: 657d1843-b590-41ac-b5e7-5d261bf00de9
|
||||
server-addr: 192.168.200.131:8848
|
||||
register-enabled: true
|
||||
|
||||
|
||||
# 开启健康监控
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
auditevents:
|
||||
enabled: true
|
||||
|
||||
#swagger:
|
||||
# enable: true
|
||||
# title: 基础微服务
|
||||
# version: 1.0.0
|
||||
# name: 基础微服务
|
||||
# url: ''
|
||||
# email: ''
|
||||
|
||||
# 日志
|
||||
#logging:
|
||||
# file: /application/applogs/admin.log
|
||||
|
114
mosty-hczx/src/main/resources/logback-spring.xml
Normal file
114
mosty-hczx/src/main/resources/logback-spring.xml
Normal file
@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<jmxConfigurator/>
|
||||
<property name="PROJECT_NAME" value="msxf-retail-sort" />
|
||||
<property name="LOG_FILE_INFO" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-info.log" />
|
||||
<property name="LOG_FILE_WARN" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-warn.log" />
|
||||
<property name="LOG_FILE_ERR" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/msxf-retail-sort-error.log" />
|
||||
<property name="LOG_BUSINESS" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/business/business-2de.log"/>
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
|
||||
<contextName>${PROJECT_NAME}</contextName>
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="LOG_FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>INFO</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_FILE_INFO}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_FILE_INFO}-7de.%d{yyyy-MM-dd}.%i</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>1024MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<appender name="LOG_FILE_WARN"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>WARN</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_FILE_WARN}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_FILE_WARN}-30de.%d{yyyy-MM-dd}.%i</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>1024MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<appender name="LOG_FILE_ERROR"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_FILE_ERR}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_FILE_ERR}.%d{yyyy-MM-dd}.%i</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>512MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<!--添加监控日志 -->
|
||||
<appender name="business-log-appender"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>info</level>
|
||||
</filter>
|
||||
<file>${LOG_BUSINESS}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_BUSINESS}.%d{yyyy-MM-dd}.%i
|
||||
</fileNamePattern>
|
||||
<maxFileSize>1024MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="business-log" additivity="false" level="info">
|
||||
<appender-ref ref="business-log-appender"/>
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</logger>
|
||||
<!-- show parameters for hibernate sql 专为 Hibernate 定制 -->
|
||||
<logger name="logging.level.jdbc" level="INFO" />
|
||||
<logger name="logging.level.jdbc.sqlonly" level="INFO" />
|
||||
<logger name="org.springframework" level="INFO" additivity="true" />
|
||||
<Logger name="jdbc.sqlonly" level="info" />
|
||||
<Logger name="jdbc.sqltiming" level="warn" />
|
||||
<Logger name="jdbc.audit" level="warn" />
|
||||
<Logger name="jdbc.resultset" level="warn" />
|
||||
<Logger name="jdbc.resultsettable" level="warn" />
|
||||
<logger name="jdbc.connection" level="warn" />
|
||||
<Logger name="log4jdbc.debug" level="warn" />
|
||||
<Logger name="org.apache.kafka.clients.NetworkClient" level="ERROR" />
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="LOG_FILE_INFO" />
|
||||
<appender-ref ref="LOG_FILE_WARN" />
|
||||
<appender-ref ref="LOG_FILE_ERROR" />
|
||||
</root>
|
||||
</configuration>
|
566
mosty-hczx/src/main/resources/mapper/TbHcBpcclMapper.xml
Normal file
566
mosty-hczx/src/main/resources/mapper/TbHcBpcclMapper.xml
Normal file
@ -0,0 +1,566 @@
|
||||
<?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.mosty.hczx.mapper.TbHcBpcclMapper">
|
||||
<resultMap type="com.mosty.base.model.entity.hczx.TbHcBpccl" id="tbHcBpccl">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="hpzl" column="hpzl" jdbcType="VARCHAR"/>
|
||||
<result property="hphm" column="hphm" jdbcType="VARCHAR"/>
|
||||
<result property="clsbdh" column="clsbdh" jdbcType="VARCHAR"/>
|
||||
<result property="jdcsyrsfzh" column="jdcsyrsfzh" jdbcType="VARCHAR"/>
|
||||
<result property="jdcsyr" column="jdcsyr" jdbcType="VARCHAR"/>
|
||||
<result property="pcrq" column="pcrq" jdbcType="TIMESTAMP"/>
|
||||
<result property="pcsj" column="pcsj" jdbcType="TIMESTAMP"/>
|
||||
<result property="pcsrlx" column="pcsrlx" jdbcType="VARCHAR"/>
|
||||
<result property="jd" column="jd" jdbcType="NUMERIC"/>
|
||||
<result property="wd" column="wd" jdbcType="NUMERIC"/>
|
||||
<result property="zb" column="zb" typeHandler="com.mosty.base.feign.handle.PointTypeHandler"/>
|
||||
<result property="zbhash" column="zbhash" jdbcType="VARCHAR"/>
|
||||
<result property="bqmc" column="bqmc" jdbcType="VARCHAR"/>
|
||||
<result property="bqxxsj" column="bqxxsj" jdbcType="VARCHAR"/>
|
||||
<result property="pcclJg" column="pccl_jg" jdbcType="VARCHAR"/>
|
||||
<result property="pcclJgmc" column="pccl_jgmc" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjdwdm" column="pccl_yjdwdm" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjdw" column="pccl_yjdw" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjyy" column="pccl_yjyy" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjId" column="pcmj_id" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjSfzh" column="pcmj_sfzh" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjXm" column="pcmj_xm" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjJh" column="pcmj_jh" jdbcType="VARCHAR"/>
|
||||
<result property="kkId" column="kk_id" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdwdm" column="kk_ssdwdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdwmc" column="kk_ssdwmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsfsxdm" column="kk_ssfsxdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsfsxmc" column="kk_ssfsxmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdszdm" column="kk_ssdszdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdszmc" column="kk_ssdszmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkLx" column="kk_lx" jdbcType="VARCHAR"/>
|
||||
<result property="kkMc" column="kk_mc" jdbcType="VARCHAR"/>
|
||||
<result property="kkXzqh" column="kk_xzqh" jdbcType="VARCHAR"/>
|
||||
<result property="kkSzmc" column="kk_szmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkHchrlx" column="kk_hchrlx" jdbcType="VARCHAR"/>
|
||||
<result property="kkSfsz" column="kk_sfsz" jdbcType="VARCHAR"/>
|
||||
<result property="sjly" column="sjly" jdbcType="VARCHAR"/>
|
||||
<result property="zdxh" column="zdxh" jdbcType="VARCHAR"/>
|
||||
<result property="zdch" column="zdch" jdbcType="VARCHAR"/>
|
||||
<result property="zdsim" column="zdsim" jdbcType="VARCHAR"/>
|
||||
<result property="ssdwdycs" column="ssdwdycs" jdbcType="INTEGER"/>
|
||||
<result property="glxtdm" column="glxtdm" jdbcType="VARCHAR"/>
|
||||
<result property="glxtid" column="glxtid" jdbcType="VARCHAR"/>
|
||||
<result property="xsd" column="xsd" jdbcType="VARCHAR"/>
|
||||
<result property="sfxf" column="sfxf" jdbcType="VARCHAR"/>
|
||||
<result property="yjzlid" column="yjzlid" jdbcType="VARCHAR"/>
|
||||
<result property="jzid" column="jzid" jdbcType="VARCHAR"/>
|
||||
<result property="bbid" column="bbid" jdbcType="VARCHAR"/>
|
||||
<result property="pcfs" column="pcfs" jdbcType="VARCHAR"/>
|
||||
<result property="ssbm" column="ssbm" jdbcType="VARCHAR"/>
|
||||
<result property="ssbmdm" column="ssbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgaj" column="ssxgaj" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgajdm" column="ssxgajdm" jdbcType="VARCHAR"/>
|
||||
<result property="sssgaj" column="sssgaj" jdbcType="VARCHAR"/>
|
||||
<result property="sssgajdm" column="sssgajdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
|
||||
<result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
|
||||
<result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjsj" column="xt_cjsj" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
|
||||
<result property="bz" column="bz" jdbcType="VARCHAR"/>
|
||||
<result property="sssgajid" column="sssgajid" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgajid" column="ssxgajid" jdbcType="VARCHAR"/>
|
||||
<result property="ssbmid" column="ssbmid" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_column_list">
|
||||
id,hpzl,hphm,clsbdh,jdcsyrsfzh,jdcsyr,pcrq,pcsj,pcsrlx,jd,wd,zbhash,bqmc,ssbmid,ssxgajid,sssgajid,
|
||||
bqxxsj,pccl_jg,pccl_jgmc,pccl_yjdwdm,pccl_yjdw,pccl_yjyy,pcmj_id,pcmj_sfzh,pcmj_xm,pcmj_jh,kk_id,
|
||||
kk_ssdwdm,kk_ssdwmc,kk_ssfsxdm,kk_ssfsxmc,kk_ssdszdm,kk_ssdszmc,kk_lx,kk_mc,kk_xzqh,kk_szmc,
|
||||
kk_hchrlx,kk_sfsz,sjly,zdxh,zdch,zdsim,ssdwdycs,glxtdm,glxtid,xsd,sfxf,yjzlid,jzid,bbid,pcfs,
|
||||
ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz,
|
||||
xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
|
||||
xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
|
||||
</sql>
|
||||
|
||||
<sql id="zb_sql">
|
||||
ST_ASWKT
|
||||
(zb)
|
||||
as zb
|
||||
</sql>
|
||||
|
||||
<insert id="insertEntity" parameterType="com.mosty.base.model.entity.hczx.TbHcBpccl">
|
||||
insert into tb_hc_bpccl(id, hpzl, hphm, clsbdh, jdcsyrsfzh, jdcsyr, pcrq, pcsj, pcsrlx, jd, wd, zb, zbhash,
|
||||
ssbmid, ssxgajid, sssgajid,
|
||||
bqmc, bqxxsj, pccl_jg, pccl_jgmc, pccl_yjdwdm, pccl_yjdw, pccl_yjyy,
|
||||
pcmj_id, pcmj_sfzh, pcmj_xm, pcmj_jh, kk_id, kk_ssdwdm, kk_ssdwmc, kk_ssfsxdm,
|
||||
kk_ssfsxmc, kk_ssdszdm, kk_ssdszmc, kk_lx, kk_mc, kk_xzqh, kk_szmc, kk_hchrlx,
|
||||
kk_sfsz, sjly, zdxh, zdch, zdsim, ssdwdycs, glxtdm, glxtid, xsd, sfxf, yjzlid, jzid,
|
||||
bbid, pcfs, ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz,
|
||||
xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj,
|
||||
xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz)
|
||||
values (#{id}, #{hpzl}, #{hphm}, #{clsbdh}, #{jdcsyrsfzh}, #{jdcsyr}, #{pcrq}, #{pcsj}, #{pcsrlx}, #{jd}, #{wd},
|
||||
ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
|
||||
#{zbhash}, #{ssbmid}, #{ssxgajid}, #{sssgajid}, #{bqmc}, #{bqxxsj}, #{pcclJg}, #{pcclJgmc},
|
||||
#{pcclYjdwdm}, #{pcclYjdw}, #{pcclYjyy},
|
||||
#{pcmjId}, #{pcmjSfzh}, #{pcmjXm}, #{pcmjJh}, #{kkId}, #{kkSsdwdm}, #{kkSsdwmc}, #{kkSsfsxdm},
|
||||
#{kkSsfsxmc}, #{kkSsdszdm}, #{kkSsdszmc}, #{kkLx}, #{kkMc}, #{kkXzqh}, #{kkSzmc}, #{kkHchrlx},
|
||||
#{kkSfsz}, #{sjly}, #{zdxh}, #{zdch}, #{zdsim}, #{ssdwdycs}, #{glxtdm}, #{glxtid}, #{xsd},
|
||||
#{sfxf}, #{yjzlid}, #{jzid}, #{bbid}, #{pcfs}, #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm},
|
||||
#{sssgaj}, #{sssgajdm}, #{xtSjly}, #{xtSjzt}, #{xtScbz}, #{xtCjip}, #{xtCjsj}, #{xtCjrId},
|
||||
#{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj}, #{xtZhgxrid}, #{xtZhgxr}, #{xtZhgxbmdm},
|
||||
#{xtZhgxbm}, #{bz})
|
||||
</insert>
|
||||
|
||||
<select id="selectCarCount" resultType="Integer">
|
||||
select count(*)
|
||||
from tb_hc_bpccl
|
||||
where DATE_FORMAT(pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getCount" resultType="Integer" parameterType="Map">
|
||||
select count(*)
|
||||
from tb_hc_bpccl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
and DATE_FORMAT(a.pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="dto.hpzl != null and dto.hpzl != ''">
|
||||
and hpzl = #{dto.hpzl}
|
||||
</if>
|
||||
<if test="dto.hphm != null and dto.hphm != ''">
|
||||
and hphm like concat('%',#{dto.hphm},'%')
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getList" resultType="com.mosty.base.model.entity.hczx.TbHcBpccl" parameterType="Map">
|
||||
select * from tb_hc_bpccl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
and DATE_FORMAT(a.pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="dto.hpzl != null and dto.hpzl != ''">
|
||||
and hpzl = #{dto.hpzl}
|
||||
</if>
|
||||
<if test="dto.hphm != null and dto.hphm != ''">
|
||||
and hphm like concat('%',#{dto.hphm},'%')
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
order by pcrq desc
|
||||
limit #{pageIndex},#{pageSize}
|
||||
</select>
|
||||
|
||||
<update id="updateEntity" parameterType="com.mosty.base.model.entity.hczx.TbHcBpccl">
|
||||
update tb_hc_bpccl
|
||||
<set>
|
||||
<if test="hpzl != null and hpzl != ''">
|
||||
hpzl = #{hpzl},
|
||||
</if>
|
||||
<if test="hphm != null and hphm != ''">
|
||||
hphm = #{hphm},
|
||||
</if>
|
||||
<if test="clsbdh != null and clsbdh != ''">
|
||||
clsbdh = #{clsbdh},
|
||||
</if>
|
||||
<if test="jdcsyrsfzh != null and jdcsyrsfzh != ''">
|
||||
jdcsyrsfzh = #{jdcsyrsfzh},
|
||||
</if>
|
||||
<if test="jdcsyr != null and jdcsyr != ''">
|
||||
jdcsyr = #{jdcsyr},
|
||||
</if>
|
||||
<if test="pcrq != null">
|
||||
pcrq = #{pcrq},
|
||||
</if>
|
||||
<if test="pcsj != null">
|
||||
pcsj = #{pcsj},
|
||||
</if>
|
||||
<if test="pcsrlx != null and pcsrlx != ''">
|
||||
pcsrlx = #{pcsrlx},
|
||||
</if>
|
||||
<if test="jd != null">
|
||||
jd = #{jd},
|
||||
</if>
|
||||
<if test="wd != null">
|
||||
wd = #{wd},
|
||||
</if>
|
||||
<if test="zb != null">
|
||||
zb = ST_GEOMFROMTEXT(#{zb,typeHandler=com.mosty.base.feign.handle.PointTypeHandler}),
|
||||
</if>
|
||||
<if test="zbhash != null and zbhash != ''">
|
||||
zbhash = #{zbhash},
|
||||
</if>
|
||||
<if test="bqmc != null and bqmc != ''">
|
||||
bqmc = #{bqmc},
|
||||
</if>
|
||||
<if test="bqxxsj != null and bqxxsj != ''">
|
||||
bqxxsj = #{bqxxsj},
|
||||
</if>
|
||||
<if test="pcclJg != null and pcclJg != ''">
|
||||
pccl_jg = #{pcclJg},
|
||||
</if>
|
||||
<if test="pcclJgmc != null and pcclJgmc != ''">
|
||||
pccl_jgmc = #{pcclJgmc},
|
||||
</if>
|
||||
<if test="pcclYjdwdm != null and pcclYjdwdm != ''">
|
||||
pccl_yjdwdm = #{pcclYjdwdm},
|
||||
</if>
|
||||
<if test="pcclYjdw != null and pcclYjdw != ''">
|
||||
pccl_yjdw = #{pcclYjdw},
|
||||
</if>
|
||||
<if test="pcclYjyy != null and pcclYjyy != ''">
|
||||
pccl_yjyy = #{pcclYjyy},
|
||||
</if>
|
||||
<if test="pcmjId != null and pcmjId != ''">
|
||||
pcmj_id = #{pcmjId},
|
||||
</if>
|
||||
<if test="pcmjSfzh != null and pcmjSfzh != ''">
|
||||
pcmj_sfzh = #{pcmjSfzh},
|
||||
</if>
|
||||
<if test="pcmjXm != null and pcmjXm != ''">
|
||||
pcmj_xm = #{pcmjXm},
|
||||
</if>
|
||||
<if test="pcmjJh != null and pcmjJh != ''">
|
||||
pcmj_jh = #{pcmjJh},
|
||||
</if>
|
||||
<if test="kkId != null and kkId != ''">
|
||||
kk_id = #{kkId},
|
||||
</if>
|
||||
<if test="kkSsdwdm != null and kkSsdwdm != ''">
|
||||
kk_ssdwdm = #{kkSsdwdm},
|
||||
</if>
|
||||
<if test="kkSsdwmc != null and kkSsdwmc != ''">
|
||||
kk_ssdwmc = #{kkSsdwmc},
|
||||
</if>
|
||||
<if test="kkSsfsxdm != null and kkSsfsxdm != ''">
|
||||
kk_ssfsxdm = #{kkSsfsxdm},
|
||||
</if>
|
||||
<if test="kkSsfsxmc != null and kkSsfsxmc != ''">
|
||||
kk_ssfsxmc = #{kkSsfsxmc},
|
||||
</if>
|
||||
<if test="kkSsdszdm != null and kkSsdszdm != ''">
|
||||
kk_ssdszdm = #{kkSsdszdm},
|
||||
</if>
|
||||
<if test="kkSsdszmc != null and kkSsdszmc != ''">
|
||||
kk_ssdszmc = #{kkSsdszmc},
|
||||
</if>
|
||||
<if test="kkLx != null and kkLx != ''">
|
||||
kk_lx = #{kkLx},
|
||||
</if>
|
||||
<if test="kkMc != null and kkMc != ''">
|
||||
kk_mc = #{kkMc},
|
||||
</if>
|
||||
<if test="kkXzqh != null and kkXzqh != ''">
|
||||
kk_xzqh = #{kkXzqh},
|
||||
</if>
|
||||
<if test="kkSzmc != null and kkSzmc != ''">
|
||||
kk_szmc = #{kkSzmc},
|
||||
</if>
|
||||
<if test="kkHchrlx != null and kkHchrlx != ''">
|
||||
kk_hchrlx = #{kkHchrlx},
|
||||
</if>
|
||||
<if test="kkSfsz != null and kkSfsz != ''">
|
||||
kk_sfsz = #{kkSfsz},
|
||||
</if>
|
||||
<if test="sjly != null and sjly != ''">
|
||||
sjly = #{sjly},
|
||||
</if>
|
||||
<if test="zdxh != null and zdxh != ''">
|
||||
zdxh = #{zdxh},
|
||||
</if>
|
||||
<if test="zdch != null and zdch != ''">
|
||||
zdch = #{zdch},
|
||||
</if>
|
||||
<if test="zdsim != null and zdsim != ''">
|
||||
zdsim = #{zdsim},
|
||||
</if>
|
||||
<if test="ssdwdycs != null">
|
||||
ssdwdycs = #{ssdwdycs},
|
||||
</if>
|
||||
<if test="glxtdm != null and glxtdm != ''">
|
||||
glxtdm = #{glxtdm},
|
||||
</if>
|
||||
<if test="glxtid != null and glxtid != ''">
|
||||
glxtid = #{glxtid},
|
||||
</if>
|
||||
<if test="xsd != null and xsd != ''">
|
||||
xsd = #{xsd},
|
||||
</if>
|
||||
<if test="sfxf != null and sfxf != ''">
|
||||
sfxf = #{sfxf},
|
||||
</if>
|
||||
<if test="yjzlid != null and yjzlid != ''">
|
||||
yjzlid = #{yjzlid},
|
||||
</if>
|
||||
<if test="jzid != null and jzid != ''">
|
||||
jzid = #{jzid},
|
||||
</if>
|
||||
<if test="bbid != null and bbid != ''">
|
||||
bbid = #{bbid},
|
||||
</if>
|
||||
<if test="pcfs != null and pcfs != ''">
|
||||
pcfs = #{pcfs},
|
||||
</if>
|
||||
<if test="ssbm != null and ssbm != ''">
|
||||
ssbm = #{ssbm},
|
||||
</if>
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
ssbmdm = #{ssbmdm},
|
||||
</if>
|
||||
<if test="ssxgaj != null and ssxgaj != ''">
|
||||
ssxgaj = #{ssxgaj},
|
||||
</if>
|
||||
<if test="ssxgajdm != null and ssxgajdm != ''">
|
||||
ssxgajdm = #{ssxgajdm},
|
||||
</if>
|
||||
<if test="sssgaj != null and sssgaj != ''">
|
||||
sssgaj = #{sssgaj},
|
||||
</if>
|
||||
<if test="sssgajdm != null and sssgajdm != ''">
|
||||
sssgajdm = #{sssgajdm},
|
||||
</if>
|
||||
<if test="ssbmid != null and ssbmid != ''">
|
||||
ssbmid = #{ssbmid},
|
||||
</if>
|
||||
<if test="ssxgajid != null and ssxgajid != ''">
|
||||
ssxgajid = #{ssxgajid},
|
||||
</if>
|
||||
<if test="sssgajid != null and sssgajid != ''">
|
||||
sssgajid = #{sssgajid},
|
||||
</if>
|
||||
<if test="xtSjly != null and xtSjly != ''">
|
||||
xt_sjly = #{xtSjly},
|
||||
</if>
|
||||
<if test="xtSjzt != null and xtSjzt != ''">
|
||||
xt_sjzt = #{xtSjzt},
|
||||
</if>
|
||||
<if test="xtScbz != null and xtScbz != ''">
|
||||
xt_scbz = #{xtScbz},
|
||||
</if>
|
||||
<if test="xtCjip != null and xtCjip != ''">
|
||||
xt_cjip = #{xtCjip},
|
||||
</if>
|
||||
<if test="xtCjsj != null">
|
||||
xt_cjsj = #{xtCjsj},
|
||||
</if>
|
||||
<if test="xtCjrId != null and xtCjrId != ''">
|
||||
xt_cjr_id = #{xtCjrId},
|
||||
</if>
|
||||
<if test="xtCjr != null and xtCjr != ''">
|
||||
xt_cjr = #{xtCjr},
|
||||
</if>
|
||||
<if test="xtCjbmdm != null and xtCjbmdm != ''">
|
||||
xt_cjbmdm = #{xtCjbmdm},
|
||||
</if>
|
||||
<if test="xtCjbmmc != null and xtCjbmmc != ''">
|
||||
xt_cjbmmc = #{xtCjbmmc},
|
||||
</if>
|
||||
<if test="xtZhgxip != null and xtZhgxip != ''">
|
||||
xt_zhgxip = #{xtZhgxip},
|
||||
</if>
|
||||
<if test="xtZhgxsj != null">
|
||||
xt_zhgxsj = #{xtZhgxsj},
|
||||
</if>
|
||||
<if test="xtZhgxrid != null and xtZhgxrid != ''">
|
||||
xt_zhgxrid = #{xtZhgxrid},
|
||||
</if>
|
||||
<if test="xtZhgxr != null and xtZhgxr != ''">
|
||||
xt_zhgxr = #{xtZhgxr},
|
||||
</if>
|
||||
<if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
|
||||
xt_zhgxbmdm = #{xtZhgxbmdm},
|
||||
</if>
|
||||
<if test="xtZhgxbm != null and xtZhgxbm != ''">
|
||||
xt_zhgxbm = #{xtZhgxbm},
|
||||
</if>
|
||||
<if test="bz != null and bz != ''">
|
||||
bz = #{bz}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getClOf2h" resultMap="tbHcBpccl">
|
||||
select
|
||||
<include refid="base_column_list"/>,
|
||||
<include refid="zb_sql"/>
|
||||
from (
|
||||
select b.hphm as hphm_b,max(b.pcsj) as pcsj_b from tb_hc_bpccl b where b.xt_sjzt = '1' and b.xt_scbz = '0'
|
||||
and b.id not in (
|
||||
select pccl_id from tb_hc_bpcry c where c.xt_scbz = '0' and c.xt_sjzt = '1' and c.pccl_id is not null
|
||||
)
|
||||
and b.pcmj_sfzh = #{sfzh}
|
||||
and DATE_FORMAT(b.pcsj,'%Y-%m-%d %H:%i:%s') >= #{time}
|
||||
group by b.hphm
|
||||
) t left join tb_hc_bpccl a on a.hphm = t.hphm_b and t.pcsj_b = a.pcsj
|
||||
and a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
</select>
|
||||
|
||||
<select id="getCountCl" resultType="int">
|
||||
select count(1) from tb_hc_bpccl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
<if test="dto.pcclJg != null and dto.pcclJg != ''">
|
||||
and pccl_jg = #{dto.pcclJg}
|
||||
</if>
|
||||
<if test="dto.hpzl != null and dto.hpzl != ''">
|
||||
and hpzl = #{dto.hpzl}
|
||||
</if>
|
||||
<if test="dto.pcsrlx != null and dto.pcsrlx != ''">
|
||||
and pcsrlx = #{dto.pcsrlx}
|
||||
</if>
|
||||
<if test="dto.hphm != null and dto.hphm != ''">
|
||||
and hphm like concat('%',#{dto.hphm},'%')
|
||||
</if>
|
||||
|
||||
<if test="dto.pcmjXm != null and dto.pcmjXm != ''">
|
||||
and pcmj_xm like concat('%',#{dto.pcmjXm},'%')
|
||||
</if>
|
||||
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
<if test="dto.kssj != null and dto.kssj != '' and dto.jssj != null and dto.jssj != ''">
|
||||
and DATE_FORMAT(pcrq,'%Y-%m-%d') between #{dto.kssj} and #{dto.jssj}
|
||||
</if>
|
||||
<if test="dto.bqmc != null and dto.bqmc != ''">
|
||||
and bqmc like concat('%',#{dto.bqmc}, '%')
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getListCl" resultMap="tbHcBpccl">
|
||||
select
|
||||
<include refid="base_column_list"/>
|
||||
from tb_hc_bpccl a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
<if test="dto.pcclJg != null and dto.pcclJg != ''">
|
||||
and pccl_jg = #{dto.pcclJg}
|
||||
</if>
|
||||
<if test="dto.hpzl != null and dto.hpzl != ''">
|
||||
and hpzl = #{dto.hpzl}
|
||||
</if>
|
||||
<if test="dto.pcsrlx != null and dto.pcsrlx != ''">
|
||||
and pcsrlx = #{dto.pcsrlx}
|
||||
</if>
|
||||
<if test="dto.hphm != null and dto.hphm != ''">
|
||||
and hphm like concat('%',#{dto.hphm},'%')
|
||||
</if>
|
||||
<if test="dto.pcmjXm != null and dto.pcmjXm != ''">
|
||||
and pcmj_xm like concat('%',#{dto.pcmjXm},'%')
|
||||
</if>
|
||||
|
||||
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
<if test="dto.kssj != null and dto.kssj != '' and dto.jssj != null and dto.jssj != ''">
|
||||
and DATE_FORMAT(pcrq,'%Y-%m-%d') between #{dto.kssj} and #{dto.jssj}
|
||||
</if>
|
||||
<if test="dto.bqmc != null and dto.bqmc != ''">
|
||||
and bqmc like concat('%',#{dto.bqmc}, '%')
|
||||
</if>
|
||||
order by pcrq desc
|
||||
limit #{pageIndex},#{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectPcclTj" resultType="java.util.Map">
|
||||
select count(1) count,ssxgaj, ssxgajid from tb_hc_bpccl where pcrq <= #{jssj} and pcrq >= #{kssj}
|
||||
and xt_sjzt = '1' and xt_scbz = '0'
|
||||
group by ssxgaj,ssxgajid
|
||||
</select>
|
||||
|
||||
<select id="selectZdclTj" resultType="java.util.Map">
|
||||
select count(1) count,ssxgaj,ssxgajid from tb_hc_bpccl where pcrq <= #{jssj} and pcrq >= #{kssj}
|
||||
and bqmc is not null and bqmc !=''
|
||||
and xt_sjzt = '1' and xt_scbz = '0'
|
||||
group by ssxgaj,ssxgajid
|
||||
</select>
|
||||
|
||||
<select id="getPctj" resultType="java.util.Map">
|
||||
|
||||
SELECT ssbmdm, ssbm,SUM(pcry) pcry, SUM(pccl) pccl FROM (
|
||||
|
||||
SELECT ssbmdm, ssbm,COUNT(1) pcry,0 pccl FROM tb_hc_bpcry
|
||||
where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="query.kssj != null and query.kssj != ''">
|
||||
and pcsj >= #{query.kssj}
|
||||
</if>
|
||||
<if test="query.jssj != null and query.jssj != ''">
|
||||
and pcsj >= #{query.jssj}
|
||||
</if>
|
||||
<if test="query.ssbmdm != null and query.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{query.ssbmdm},'%')
|
||||
</if>
|
||||
GROUP BY ssbmdm,ssbm
|
||||
|
||||
UNION ALL
|
||||
SELECT ssbmdm, ssbm,0 pcry,COUNT(1) pccl FROM tb_hc_bpccl
|
||||
where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="query.kssj != null and query.kssj != ''">
|
||||
and pcsj >= #{query.kssj}
|
||||
</if>
|
||||
<if test="query.jssj != null and query.jssj != ''">
|
||||
and pcsj >= #{query.jssj}
|
||||
</if>
|
||||
<if test="query.ssbmdm != null and query.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{query.ssbmdm},'%')
|
||||
</if>
|
||||
GROUP BY ssbmdm,ssbm
|
||||
) tj GROUP BY ssbmdm,ssbm
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getPctjRy" resultType="int">
|
||||
SELECT COUNT(1) FROM tb_hc_bpcry
|
||||
where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="query.kssj != null and query.kssj != ''">
|
||||
and pcsj >= #{query.kssj}
|
||||
</if>
|
||||
<if test="query.jssj != null and query.jssj != ''">
|
||||
and pcsj >= #{query.jssj}
|
||||
</if>
|
||||
<if test="query.ssbmdm != null and query.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{query.ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPctjCl" resultType="int">
|
||||
SELECT COUNT(1) FROM tb_hc_bpccl
|
||||
where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="query.kssj != null and query.kssj != ''">
|
||||
and pcsj >= #{query.kssj}
|
||||
</if>
|
||||
<if test="query.jssj != null and query.jssj != ''">
|
||||
and pcsj >= #{query.jssj}
|
||||
</if>
|
||||
<if test="query.ssbmdm != null and query.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{query.ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPcWptj" resultType="int">
|
||||
SELECT sum(sl) FROM (
|
||||
SELECT COUNT(1) sl FROM `tb_hc_bpcry_wp` where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="time != null and time != ''">
|
||||
and DATE_FORMAT(xt_cjsj,'%Y-%m-%d') = #{time}
|
||||
</if>
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
UNION ALL
|
||||
SELECT COUNT(1) sl FROM `tb_hc_bpccl_wp` where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="time != null and time != ''">
|
||||
and DATE_FORMAT(xt_cjsj,'%Y-%m-%d') = #{time}
|
||||
</if>
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
) t
|
||||
|
||||
</select>
|
||||
</mapper>
|
568
mosty-hczx/src/main/resources/mapper/TbHcBpcryMapper.xml
Normal file
568
mosty-hczx/src/main/resources/mapper/TbHcBpcryMapper.xml
Normal file
@ -0,0 +1,568 @@
|
||||
<?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.mosty.hczx.mapper.TbHcBpcryMapper">
|
||||
<resultMap type="com.mosty.base.model.entity.hczx.TbHcBpcry" id="tbHcBpcry">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sfzh" column="sfzh" jdbcType="VARCHAR"/>
|
||||
<result property="xm" column="xm" jdbcType="VARCHAR"/>
|
||||
<result property="xbdm" column="xbdm" jdbcType="VARCHAR"/>
|
||||
<result property="csrq" column="csrq" jdbcType="VARCHAR"/>
|
||||
<result property="mzdm" column="mzdm" jdbcType="VARCHAR"/>
|
||||
<result property="whcddm" column="whcddm" jdbcType="VARCHAR"/>
|
||||
<result property="jgdm" column="jgdm" jdbcType="VARCHAR"/>
|
||||
<result property="zzxz" column="zzxz" jdbcType="VARCHAR"/>
|
||||
<result property="lxdh" column="lxdh" jdbcType="VARCHAR"/>
|
||||
<result property="pcrq" column="pcrq" jdbcType="TIMESTAMP"/>
|
||||
<result property="pcsj" column="pcsj" jdbcType="TIMESTAMP"/>
|
||||
<result property="pcsrlx" column="pcsrlx" jdbcType="VARCHAR"/>
|
||||
<result property="jd" column="jd" jdbcType="NUMERIC"/>
|
||||
<result property="wd" column="wd" jdbcType="NUMERIC"/>
|
||||
<result property="zb" column="zb" typeHandler="com.mosty.base.feign.handle.PointTypeHandler"/>
|
||||
<result property="zbhash" column="zbhash" jdbcType="VARCHAR"/>
|
||||
<result property="pcclId" column="pccl_id" jdbcType="VARCHAR"/>
|
||||
<result property="bqmc" column="bqmc" jdbcType="VARCHAR"/>
|
||||
<result property="bqxxsj" column="bqxxsj" jdbcType="VARCHAR"/>
|
||||
<result property="pcclJg" column="pccl_jg" jdbcType="VARCHAR"/>
|
||||
<result property="pcclJgmc" column="pccl_jgmc" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjdwdm" column="pccl_yjdwdm" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjdw" column="pccl_yjdw" jdbcType="VARCHAR"/>
|
||||
<result property="pcclYjyy" column="pccl_yjyy" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjId" column="pcmj_id" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjSfzh" column="pcmj_sfzh" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjXm" column="pcmj_xm" jdbcType="VARCHAR"/>
|
||||
<result property="pcmjJh" column="pcmj_jh" jdbcType="VARCHAR"/>
|
||||
<result property="kkId" column="kk_id" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdwdm" column="kk_ssdwdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdwmc" column="kk_ssdwmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsfsxdm" column="kk_ssfsxdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsfsxmc" column="kk_ssfsxmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdszdm" column="kk_ssdszdm" jdbcType="VARCHAR"/>
|
||||
<result property="kkSsdszmc" column="kk_ssdszmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkLx" column="kk_lx" jdbcType="VARCHAR"/>
|
||||
<result property="kkMc" column="kk_mc" jdbcType="VARCHAR"/>
|
||||
<result property="kkXzqh" column="kk_xzqh" jdbcType="VARCHAR"/>
|
||||
<result property="kkSzmc" column="kk_szmc" jdbcType="VARCHAR"/>
|
||||
<result property="kkHchrlx" column="kk_hchrlx" jdbcType="VARCHAR"/>
|
||||
<result property="kkSfsz" column="kk_sfsz" jdbcType="VARCHAR"/>
|
||||
<result property="sjly" column="sjly" jdbcType="VARCHAR"/>
|
||||
<result property="zdxh" column="zdxh" jdbcType="VARCHAR"/>
|
||||
<result property="zdch" column="zdch" jdbcType="VARCHAR"/>
|
||||
<result property="zdsim" column="zdsim" jdbcType="VARCHAR"/>
|
||||
<result property="ssdwdycs" column="ssdwdycs" jdbcType="INTEGER"/>
|
||||
<result property="glxtdm" column="glxtdm" jdbcType="VARCHAR"/>
|
||||
<result property="glxtid" column="glxtid" jdbcType="VARCHAR"/>
|
||||
<result property="xsd" column="xsd" jdbcType="VARCHAR"/>
|
||||
<result property="sfxf" column="sfxf" jdbcType="VARCHAR"/>
|
||||
<result property="yjzlid" column="yjzlid" jdbcType="VARCHAR"/>
|
||||
<result property="jzid" column="jzid" jdbcType="VARCHAR"/>
|
||||
<result property="bbid" column="bbid" jdbcType="VARCHAR"/>
|
||||
<result property="pcfs" column="pcfs" jdbcType="VARCHAR"/>
|
||||
<result property="ssbm" column="ssbm" jdbcType="VARCHAR"/>
|
||||
<result property="ssbmid" column="ssbmid" jdbcType="VARCHAR"/>
|
||||
<result property="ssbmdm" column="ssbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgaj" column="ssxgaj" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgajid" column="ssxgajid" jdbcType="VARCHAR"/>
|
||||
<result property="ssxgajdm" column="ssxgajdm" jdbcType="VARCHAR"/>
|
||||
<result property="sssgaj" column="sssgaj" jdbcType="VARCHAR"/>
|
||||
<result property="sssgajid" column="sssgajid" jdbcType="VARCHAR"/>
|
||||
<result property="sssgajdm" column="sssgajdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
|
||||
<result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
|
||||
<result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjsj" column="xt_cjsj" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
|
||||
<result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
|
||||
<result property="bz" column="bz" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_column_list">
|
||||
id
|
||||
,sfzh,xm,xbdm,csrq,mzdm,whcddm,jgdm,zzxz,lxdh,pcrq,pcsj,pcsrlx,jd,wd,zbhash,pccl_id,bqmc,
|
||||
ssbmid,ssxgajid,sssgajid,
|
||||
bqxxsj,pccl_jg,pccl_jgmc,pccl_yjdwdm,pccl_yjdw,pccl_yjyy,pcmj_id,pcmj_sfzh,pcmj_xm,pcmj_jh,kk_id,
|
||||
kk_ssdwdm,kk_ssdwmc,kk_ssfsxdm,kk_ssfsxmc,kk_ssdszdm,kk_ssdszmc,kk_lx,kk_mc,kk_xzqh,kk_szmc,
|
||||
kk_hchrlx,kk_sfsz,sjly,zdxh,zdch,zdsim,ssdwdycs,glxtdm,glxtid,xsd,sfxf,yjzlid,jzid,bbid,pcfs,
|
||||
ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz,
|
||||
xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
|
||||
xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
|
||||
</sql>
|
||||
|
||||
<sql id="zb_sql">
|
||||
ST_ASWKT
|
||||
(zb)
|
||||
as zb
|
||||
</sql>
|
||||
|
||||
<insert id="insertEntity" parameterType="com.mosty.base.model.entity.hczx.TbHcBpcry">
|
||||
insert into tb_hc_bpcry(id, sfzh, xm, xbdm, csrq, mzdm, whcddm, jgdm, zzxz, lxdh, pcrq, pcsj, pcsrlx, jd, wd,
|
||||
zb, zbhash, pccl_id, bqmc, bqxxsj, pccl_jg, pccl_jgmc, pccl_yjdwdm, pccl_yjdw,
|
||||
pccl_yjyy,ssbmid,ssxgajid,sssgajid,
|
||||
pcmj_id, pcmj_sfzh, pcmj_xm, pcmj_jh, kk_id, kk_ssdwdm, kk_ssdwmc, kk_ssfsxdm,
|
||||
kk_ssfsxmc, kk_ssdszdm, kk_ssdszmc, kk_lx, kk_mc, kk_xzqh, kk_szmc, kk_hchrlx,
|
||||
kk_sfsz, sjly, zdxh, zdch, zdsim, ssdwdycs, glxtdm, glxtid, xsd, sfxf, yjzlid, jzid,
|
||||
bbid, pcfs, ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz,
|
||||
xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj,
|
||||
xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz, xjzdz)
|
||||
values (#{id}, #{sfzh}, #{xm}, #{xbdm}, #{csrq}, #{mzdm}, #{whcddm}, #{jgdm}, #{zzxz}, #{lxdh}, #{pcrq},
|
||||
#{pcsj}, #{pcsrlx}, #{jd}, #{wd},
|
||||
ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PointTypeHandler}), #{zbhash},
|
||||
#{pcclId}, #{bqmc}, #{bqxxsj}, #{pcclJg}, #{pcclJgmc}, #{pcclYjdwdm}, #{pcclYjdw}, #{pcclYjyy},
|
||||
#{ssbmid},#{ssxgajid},#{sssgajid},
|
||||
#{pcmjId}, #{pcmjSfzh}, #{pcmjXm}, #{pcmjJh}, #{kkId}, #{kkSsdwdm}, #{kkSsdwmc}, #{kkSsfsxdm},
|
||||
#{kkSsfsxmc}, #{kkSsdszdm}, #{kkSsdszmc}, #{kkLx}, #{kkMc}, #{kkXzqh}, #{kkSzmc}, #{kkHchrlx},
|
||||
#{kkSfsz}, #{sjly}, #{zdxh}, #{zdch}, #{zdsim}, #{ssdwdycs}, #{glxtdm}, #{glxtid}, #{xsd},
|
||||
#{sfxf}, #{yjzlid}, #{jzid}, #{bbid}, #{pcfs}, #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm},
|
||||
#{sssgaj}, #{sssgajdm}, #{xtSjly}, #{xtSjzt}, #{xtScbz}, #{xtCjip}, #{xtCjsj}, #{xtCjrId},
|
||||
#{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj}, #{xtZhgxrid}, #{xtZhgxr}, #{xtZhgxbmdm},
|
||||
#{xtZhgxbm}, #{bz}, #{xjzdz})
|
||||
</insert>
|
||||
|
||||
<select id="selectCrewCount" resultType="Integer">
|
||||
select count(*)
|
||||
from tb_hc_bpcry a
|
||||
where a.xt_scbz = '0'
|
||||
and a.xt_sjzt = '1'
|
||||
and DATE_FORMAT(a.pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getCount" resultType="Integer" parameterType="Map">
|
||||
select count(*)
|
||||
from tb_hc_bpcry a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
and DATE_FORMAT(a.pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="dto.xm != null and dto.xm != ''">
|
||||
and xm like concat('%',#{dto.xm},'%')
|
||||
</if>
|
||||
<if test="dto.sfzh != null and dto.sfzh != ''">
|
||||
and sfzh like concat('%',#{dto.sfzh},'%')
|
||||
</if>
|
||||
<if test="dto.lxdh != null and dto.lxdh != ''">
|
||||
and lxdh like concat('%',#{dto.lxdh},'%')
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getList" resultType="com.mosty.base.model.entity.hczx.TbHcBpcry" parameterType="Map">
|
||||
select * from tb_hc_bpcry a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
and DATE_FORMAT(a.pcrq, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
||||
<if test="dto.xm != null and dto.xm != ''">
|
||||
and xm like concat('%',#{dto.xm},'%')
|
||||
</if>
|
||||
<if test="dto.sfzh != null and dto.sfzh != ''">
|
||||
and sfzh like concat('%',#{dto.sfzh},'%')
|
||||
</if>
|
||||
<if test="dto.lxdh != null and dto.lxdh != ''">
|
||||
and lxdh like concat('%',#{dto.lxdh},'%')
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm},'%')
|
||||
</if>
|
||||
order by pcsj desc
|
||||
limit #{pageIndex},#{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="getCountRy" resultType="Integer" parameterType="Map">
|
||||
select count(*)
|
||||
from tb_hc_bpcry a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
<if test="dto.xm != null and dto.xm != ''">
|
||||
and xm like concat('%',#{dto.xm},'%')
|
||||
</if>
|
||||
|
||||
<if test="dto.pcmjXm != null and dto.pcmjXm != ''">
|
||||
and pcmj_xm like concat('%',#{dto.pcmjXm},'%')
|
||||
</if>
|
||||
|
||||
<if test="dto.sfzh != null and dto.sfzh != ''">
|
||||
and sfzh like concat('%',#{dto.sfzh},'%')
|
||||
</if>
|
||||
<if test="dto.lxdh != null and dto.lxdh != ''">
|
||||
and lxdh like concat('%',#{dto.lxdh},'%')
|
||||
</if>
|
||||
<if test="dto.pcclJg != null and dto.pcclJg != ''">
|
||||
and pccl_jg = #{dto.pcclJg}
|
||||
</if>
|
||||
<if test="dto.kssj != null and dto.kssj != '' and dto.jssj != null and dto.jssj != ''">
|
||||
and DATE_FORMAT(pcrq,'%Y-%m-%d') between #{dto.kssj} and #{dto.jssj}
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm}, '%')
|
||||
</if>
|
||||
<if test="dto.bqmc != null and dto.bqmc != ''">
|
||||
and bqmc like concat('%',#{dto.bqmc}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getListRy" resultType="com.mosty.base.model.entity.hczx.TbHcBpcry" parameterType="Map">
|
||||
select * from tb_hc_bpcry a where a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
<if test="dto.xm != null and dto.xm != ''">
|
||||
and xm like concat('%',#{dto.xm},'%')
|
||||
</if>
|
||||
|
||||
<if test="dto.pcmjXm != null and dto.pcmjXm != ''">
|
||||
and pcmj_xm like concat('%',#{dto.pcmjXm},'%')
|
||||
</if>
|
||||
|
||||
|
||||
<if test="dto.sfzh != null and dto.sfzh != ''">
|
||||
and sfzh like concat('%',#{dto.sfzh},'%')
|
||||
</if>
|
||||
<if test="dto.lxdh != null and dto.lxdh != ''">
|
||||
and lxdh like concat('%',#{dto.lxdh},'%')
|
||||
</if>
|
||||
<if test="dto.pcclJg != null and dto.pcclJg != ''">
|
||||
and pccl_jg = #{dto.pcclJg}
|
||||
</if>
|
||||
<if test="dto.kssj != null and dto.kssj != '' and dto.jssj != null and dto.jssj != ''">
|
||||
and DATE_FORMAT(pcrq,'%Y-%m-%d') between #{dto.kssj} and #{dto.jssj}
|
||||
</if>
|
||||
<if test="dto.ssbmdm != null and dto.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{dto.ssbmdm}, '%')
|
||||
</if>
|
||||
<if test="dto.bqmc != null and dto.bqmc != ''">
|
||||
and bqmc like concat('%',#{dto.bqmc}, '%')
|
||||
</if>
|
||||
order by pcsj desc
|
||||
limit #{pageIndex},#{pageSize}
|
||||
</select>
|
||||
|
||||
<update id="updateEntity" parameterType="com.mosty.base.model.entity.hczx.TbHcBpcry">
|
||||
update tb_hc_bpcry
|
||||
<set>
|
||||
<if test="sfzh != null and sfzh != ''">
|
||||
sfzh = #{sfzh},
|
||||
</if>
|
||||
<if test="xm != null and xm != ''">
|
||||
xm = #{xm},
|
||||
</if>
|
||||
<if test="xbdm != null and xbdm != ''">
|
||||
xbdm = #{xbdm},
|
||||
</if>
|
||||
<if test="csrq != null and csrq != ''">
|
||||
csrq = #{csrq},
|
||||
</if>
|
||||
<if test="mzdm != null and mzdm != ''">
|
||||
mzdm = #{mzdm},
|
||||
</if>
|
||||
<if test="whcddm != null and whcddm != ''">
|
||||
whcddm = #{whcddm},
|
||||
</if>
|
||||
<if test="jgdm != null and jgdm != ''">
|
||||
jgdm = #{jgdm},
|
||||
</if>
|
||||
<if test="zzxz != null and zzxz != ''">
|
||||
zzxz = #{zzxz},
|
||||
</if>
|
||||
<if test="xjzdz != null and xjzdz != ''">
|
||||
xjzdz = #{xjzdz},
|
||||
</if>
|
||||
<if test="lxdh != null and lxdh != ''">
|
||||
lxdh = #{lxdh},
|
||||
</if>
|
||||
<if test="pcrq != null">
|
||||
pcrq = #{pcrq},
|
||||
</if>
|
||||
<if test="pcsj != null">
|
||||
pcsj = #{pcsj},
|
||||
</if>
|
||||
<if test="pcsrlx != null and pcsrlx != ''">
|
||||
pcsrlx = #{pcsrlx},
|
||||
</if>
|
||||
<if test="jd != null">
|
||||
jd = #{jd},
|
||||
</if>
|
||||
<if test="wd != null">
|
||||
wd = #{wd},
|
||||
</if>
|
||||
<if test="zb != null">
|
||||
zb = ST_GEOMFROMTEXT(#{zb,typeHandler=com.mosty.base.feign.handle.PointTypeHandler}),
|
||||
</if>
|
||||
<if test="zbhash != null and zbhash != ''">
|
||||
zbhash = #{zbhash},
|
||||
</if>
|
||||
<if test="pcclId != null and pcclId != ''">
|
||||
pccl_id = #{pcclId},
|
||||
</if>
|
||||
<if test="bqmc != null and bqmc != ''">
|
||||
bqmc = #{bqmc},
|
||||
</if>
|
||||
<if test="bqxxsj != null and bqxxsj != ''">
|
||||
bqxxsj = #{bqxxsj},
|
||||
</if>
|
||||
<if test="pcclJg != null and pcclJg != ''">
|
||||
pccl_jg = #{pcclJg},
|
||||
</if>
|
||||
<if test="pcclJgmc != null and pcclJgmc != ''">
|
||||
pccl_jgmc = #{pcclJgmc},
|
||||
</if>
|
||||
<if test="pcclYjdwdm != null and pcclYjdwdm != ''">
|
||||
pccl_yjdwdm = #{pcclYjdwdm},
|
||||
</if>
|
||||
<if test="pcclYjdw != null and pcclYjdw != ''">
|
||||
pccl_yjdw = #{pcclYjdw},
|
||||
</if>
|
||||
<if test="pcclYjyy != null and pcclYjyy != ''">
|
||||
pccl_yjyy = #{pcclYjyy},
|
||||
</if>
|
||||
<if test="pcmjId != null and pcmjId != ''">
|
||||
pcmj_id = #{pcmjId},
|
||||
</if>
|
||||
<if test="pcmjSfzh != null and pcmjSfzh != ''">
|
||||
pcmj_sfzh = #{pcmjSfzh},
|
||||
</if>
|
||||
<if test="pcmjXm != null and pcmjXm != ''">
|
||||
pcmj_xm = #{pcmjXm},
|
||||
</if>
|
||||
<if test="pcmjJh != null and pcmjJh != ''">
|
||||
pcmj_jh = #{pcmjJh},
|
||||
</if>
|
||||
<if test="kkId != null and kkId != ''">
|
||||
kk_id = #{kkId},
|
||||
</if>
|
||||
<if test="kkSsdwdm != null and kkSsdwdm != ''">
|
||||
kk_ssdwdm = #{kkSsdwdm},
|
||||
</if>
|
||||
<if test="kkSsdwmc != null and kkSsdwmc != ''">
|
||||
kk_ssdwmc = #{kkSsdwmc},
|
||||
</if>
|
||||
<if test="kkSsfsxdm != null and kkSsfsxdm != ''">
|
||||
kk_ssfsxdm = #{kkSsfsxdm},
|
||||
</if>
|
||||
<if test="kkSsfsxmc != null and kkSsfsxmc != ''">
|
||||
kk_ssfsxmc = #{kkSsfsxmc},
|
||||
</if>
|
||||
<if test="kkSsdszdm != null and kkSsdszdm != ''">
|
||||
kk_ssdszdm = #{kkSsdszdm},
|
||||
</if>
|
||||
<if test="kkSsdszmc != null and kkSsdszmc != ''">
|
||||
kk_ssdszmc = #{kkSsdszmc},
|
||||
</if>
|
||||
<if test="kkLx != null and kkLx != ''">
|
||||
kk_lx = #{kkLx},
|
||||
</if>
|
||||
<if test="kkMc != null and kkMc != ''">
|
||||
kk_mc = #{kkMc},
|
||||
</if>
|
||||
<if test="kkXzqh != null and kkXzqh != ''">
|
||||
kk_xzqh = #{kkXzqh},
|
||||
</if>
|
||||
<if test="kkSzmc != null and kkSzmc != ''">
|
||||
kk_szmc = #{kkSzmc},
|
||||
</if>
|
||||
<if test="kkHchrlx != null and kkHchrlx != ''">
|
||||
kk_hchrlx = #{kkHchrlx},
|
||||
</if>
|
||||
<if test="kkSfsz != null and kkSfsz != ''">
|
||||
kk_sfsz = #{kkSfsz},
|
||||
</if>
|
||||
<if test="sjly != null and sjly != ''">
|
||||
sjly = #{sjly},
|
||||
</if>
|
||||
<if test="zdxh != null and zdxh != ''">
|
||||
zdxh = #{zdxh},
|
||||
</if>
|
||||
<if test="zdch != null and zdch != ''">
|
||||
zdch = #{zdch},
|
||||
</if>
|
||||
<if test="zdsim != null and zdsim != ''">
|
||||
zdsim = #{zdsim},
|
||||
</if>
|
||||
<if test="ssdwdycs != null">
|
||||
ssdwdycs = #{ssdwdycs},
|
||||
</if>
|
||||
<if test="glxtdm != null and glxtdm != ''">
|
||||
glxtdm = #{glxtdm},
|
||||
</if>
|
||||
<if test="glxtid != null and glxtid != ''">
|
||||
glxtid = #{glxtid},
|
||||
</if>
|
||||
<if test="xsd != null and xsd != ''">
|
||||
xsd = #{xsd},
|
||||
</if>
|
||||
<if test="sfxf != null and sfxf != ''">
|
||||
sfxf = #{sfxf},
|
||||
</if>
|
||||
<if test="yjzlid != null and yjzlid != ''">
|
||||
yjzlid = #{yjzlid},
|
||||
</if>
|
||||
<if test="jzid != null and jzid != ''">
|
||||
jzid = #{jzid},
|
||||
</if>
|
||||
<if test="bbid != null and bbid != ''">
|
||||
bbid = #{bbid},
|
||||
</if>
|
||||
<if test="pcfs != null and pcfs != ''">
|
||||
pcfs = #{pcfs},
|
||||
</if>
|
||||
<if test="ssbm != null and ssbm != ''">
|
||||
ssbm = #{ssbm},
|
||||
</if>
|
||||
<if test="ssbmid != null and ssbmid != ''">
|
||||
ssbmid = #{ssbmid},
|
||||
</if>
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
ssbmdm = #{ssbmdm},
|
||||
</if>
|
||||
<if test="ssxgaj != null and ssxgaj != ''">
|
||||
ssxgaj = #{ssxgaj},
|
||||
</if>
|
||||
<if test="ssxgajid != null and ssxgajid != ''">
|
||||
ssxgajid = #{ssxgajid},
|
||||
</if>
|
||||
<if test="ssxgajdm != null and ssxgajdm != ''">
|
||||
ssxgajdm = #{ssxgajdm},
|
||||
</if>
|
||||
<if test="sssgaj != null and sssgaj != ''">
|
||||
sssgaj = #{sssgaj},
|
||||
</if>
|
||||
<if test="sssgajid != null and sssgajid != ''">
|
||||
sssgajid = #{sssgajid},
|
||||
</if>
|
||||
<if test="sssgajdm != null and sssgajdm != ''">
|
||||
sssgajdm = #{sssgajdm},
|
||||
</if>
|
||||
<if test="xtSjly != null and xtSjly != ''">
|
||||
xt_sjly = #{xtSjly},
|
||||
</if>
|
||||
<if test="xtSjzt != null and xtSjzt != ''">
|
||||
xt_sjzt = #{xtSjzt},
|
||||
</if>
|
||||
<if test="xtScbz != null and xtScbz != ''">
|
||||
xt_scbz = #{xtScbz},
|
||||
</if>
|
||||
<if test="xtCjip != null and xtCjip != ''">
|
||||
xt_cjip = #{xtCjip},
|
||||
</if>
|
||||
<if test="xtCjsj != null">
|
||||
xt_cjsj = #{xtCjsj},
|
||||
</if>
|
||||
<if test="xtCjrId != null and xtCjrId != ''">
|
||||
xt_cjr_id = #{xtCjrId},
|
||||
</if>
|
||||
<if test="xtCjr != null and xtCjr != ''">
|
||||
xt_cjr = #{xtCjr},
|
||||
</if>
|
||||
<if test="xtCjbmdm != null and xtCjbmdm != ''">
|
||||
xt_cjbmdm = #{xtCjbmdm},
|
||||
</if>
|
||||
<if test="xtCjbmmc != null and xtCjbmmc != ''">
|
||||
xt_cjbmmc = #{xtCjbmmc},
|
||||
</if>
|
||||
<if test="xtZhgxip != null and xtZhgxip != ''">
|
||||
xt_zhgxip = #{xtZhgxip},
|
||||
</if>
|
||||
<if test="xtZhgxsj != null">
|
||||
xt_zhgxsj = #{xtZhgxsj},
|
||||
</if>
|
||||
<if test="xtZhgxrid != null and xtZhgxrid != ''">
|
||||
xt_zhgxrid = #{xtZhgxrid},
|
||||
</if>
|
||||
<if test="xtZhgxr != null and xtZhgxr != ''">
|
||||
xt_zhgxr = #{xtZhgxr},
|
||||
</if>
|
||||
<if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
|
||||
xt_zhgxbmdm = #{xtZhgxbmdm},
|
||||
</if>
|
||||
<if test="xtZhgxbm != null and xtZhgxbm != ''">
|
||||
xt_zhgxbm = #{xtZhgxbm},
|
||||
</if>
|
||||
<if test="bz != null and bz != ''">
|
||||
bz = #{bz}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getRyOf2h" resultMap="tbHcBpcry">
|
||||
select
|
||||
<include refid="base_column_list"/>,
|
||||
<include refid="zb_sql"/>
|
||||
from (
|
||||
select b.sfzh as sfzh_b,max(b.pcsj) as pcsj_b from tb_hc_bpcry b where b.xt_sjzt = '1' and b.xt_scbz = '0'
|
||||
and b.pccl_id is null
|
||||
and b.pcmj_sfzh = #{sfzh}
|
||||
and DATE_FORMAT(b.pcsj,'%Y-%m-%d %H:%i:%s') >= #{time}
|
||||
group by b.sfzh
|
||||
) t left join tb_hc_bpcry a on a.sfzh = t.sfzh_b and t.pcsj_b = a.pcsj
|
||||
and a.xt_scbz = '0' and a.xt_sjzt = '1'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPcryTj" resultType="java.util.Map">
|
||||
select count(1) count,ssxgaj,ssxgajid from tb_hc_bpcry where pcrq <= #{jssj} and pcrq >= #{kssj}
|
||||
and xt_sjzt = '1' and xt_scbz = '0'
|
||||
group by ssxgaj,ssxgajid
|
||||
</select>
|
||||
|
||||
<select id="selectZdryTj" resultType="java.util.Map">
|
||||
select count(1) count,ssxgaj,ssxgajid from tb_hc_bpcry where pcrq <= #{jssj} and pcrq >= #{kssj}
|
||||
and bqmc is not null
|
||||
and xt_sjzt = '1' and xt_scbz = '0'
|
||||
group by ssxgaj,ssxgajid
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSsbm" resultType="java.lang.String">
|
||||
SELECT DISTINCT ssbmdm FROM `tb_hc_bpcry_bq` where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="query.ssbmdm != null and query.ssbmdm != ''">
|
||||
and ssbmdm like concat(#{query.ssbmdm},'%')
|
||||
</if>
|
||||
|
||||
<if test="query.kssj != null and query.kssj != ''">
|
||||
and xt_cjsj >= #{query.kssj}
|
||||
</if>
|
||||
<if test="query.jssj != null and query.jssj != ''">
|
||||
and xt_cjsj <= #{query.jssj}
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getRyBqtj" resultType="java.util.Map">
|
||||
SELECT IFNULL( bqmc, 'ZCRY' ) bqmc, IFNULL( bqxxsj, '正常人员' ) bqxxsj, COUNT( 1 ) sl
|
||||
FROM `tb_hc_bpcry` where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
<if test="kssj != null and kssj != ''">
|
||||
and pcsj >= #{kssj}
|
||||
</if>
|
||||
<if test="jssj != null and jssj != ''">
|
||||
and xt_cjsj <= #{jssj}
|
||||
</if>
|
||||
GROUP BY bqmc, bqxxsj
|
||||
</select>
|
||||
|
||||
<select id="getClBqtj" resultType="java.util.Map">
|
||||
SELECT
|
||||
( CASE WHEN bqmc = '' THEN 'ZCCL' ELSE bqmc END ) AS bqmc,
|
||||
( CASE WHEN bqxxsj = '' THEN '正常车辆' ELSE bqxxsj END ) AS bqxxsj,
|
||||
COUNT( 1 ) sl
|
||||
FROM `tb_hc_bpccl` where xt_sjzt = '1' and xt_scbz = '0'
|
||||
<if test="ssbmdm != null and ssbmdm != ''">
|
||||
and ssbmdm like concat(#{ssbmdm},'%')
|
||||
</if>
|
||||
<if test="kssj != null and kssj != ''">
|
||||
and pcsj >= #{kssj}
|
||||
</if>
|
||||
<if test="jssj != null and jssj != ''">
|
||||
and xt_cjsj <= #{jssj}
|
||||
</if>
|
||||
GROUP BY bqmc, bqxxsj
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
16
mosty-hczx/src/main/resources/rebel.xml
Normal file
16
mosty-hczx/src/main/resources/rebel.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
|
||||
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
|
||||
-->
|
||||
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
|
||||
|
||||
<id>mosty-hczx</id>
|
||||
|
||||
<classpath>
|
||||
<dir name="E:/project/rs/mosty-dyga-cloud/mosty-hczx/target/classes">
|
||||
</dir>
|
||||
</classpath>
|
||||
|
||||
</application>
|
Reference in New Issue
Block a user