Commit a8539f54 by zhengxj

finish 图片识别 on 20200407 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@26282 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent d6e0d886
package com.glsx.ordercenter.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
*
* @ClassName: ThreadPoolConfig
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2020年3月20日
*
*/
@Configuration
public class ThreadPoolConfig {
@Bean("taskExecutor")
public Executor defaultThreadPool() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(200);
executor.setThreadNamePrefix("taskExecutor_");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.setKeepAliveSeconds(60);
executor.initialize();
return executor;
}
}
...@@ -162,4 +162,9 @@ public interface BizConstants { ...@@ -162,4 +162,9 @@ public interface BizConstants {
// 已结算 // 已结算
public static final int ORDER_SETTLEMENT_STATUS_YES = 1; public static final int ORDER_SETTLEMENT_STATUS_YES = 1;
// 车身照
public static final int PICTURE_TYPE_CAR_BODY = 1;
// sn照
public static final int PICTURE_TYPE_DEVICE_SN = 2;
} }
package com.glsx.ordercenter.constants;
/**
* 费用类型枚举
*
* @author dengtt
* @date 2020年1月7日14:07:06
*/
public enum CarOcrStatusEnum {
NO_PASS("200", "不通过"),
PASS("100", "通过"),
NO_CAR_BODY("202", "无车身照"),
NO_PLATE("203", "无车牌号"),
PLATE_INDISTINCT("204", "车牌号模糊"),
IS_NOT_VECHILE("205", "非四轮机动车辆"),
NO_ENGINE_NUMBER("206", "无发动机号"),
NO_SN("207", "无设备SN码"),
EXCEEDING_THRESHOLD("208", "超出阈值"),
UNRECOGNIZED("300", "无法取到数据");
private String code;
private String msg;
CarOcrStatusEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static String getMsgByCode(String code) {
for (CarOcrStatusEnum e : values()) {
if (code.equals(e.getCode())) {
return e.getMsg();
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
...@@ -39,6 +39,16 @@ public class OrderDeviceReq { ...@@ -39,6 +39,16 @@ public class OrderDeviceReq {
*/ */
private String mechanicAddress; private String mechanicAddress;
/**
* 订单号
*/
private String orderSn;
/**
* 订单号
*/
private String serviceCode;
public Integer getOrderId() { public Integer getOrderId() {
return orderId; return orderId;
} }
...@@ -79,6 +89,22 @@ public class OrderDeviceReq { ...@@ -79,6 +89,22 @@ public class OrderDeviceReq {
this.mechanicAddress = mechanicAddress; this.mechanicAddress = mechanicAddress;
} }
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public String getServiceCode() {
return serviceCode;
}
public void setServiceCode(String serviceCode) {
this.serviceCode = serviceCode;
}
@Override @Override
public String toString() { public String toString() {
return "OrderDeviceReq [orderId=" + orderId + ", orderDeviceList=" return "OrderDeviceReq [orderId=" + orderId + ", orderDeviceList="
......
package com.glsx.ordercenter.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysArea;
import com.glsx.ordercenter.pojo.SysAreaExample;
import com.glsx.ordercenter.pojo.SysCarOcr;
public interface SysCarOcrMapper {
void insertSelective(SysCarOcr sysCarOcr);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.io.Serializable;
import java.util.Date;
public class SysCarOcr implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Integer id;
/**
* 请求id
*/
private String requestId;
/**
* 订单号
*/
private String orderSn;
/**
* 订单类型
*/
private Integer orderType;
/**
* 图片类型
*/
private Integer pictureType;
/**
* 图片类型
*/
private String picturePath;
/**
* 服务编码
*/
private String serviceCode;
/**
* 识别失败理由
*/
private String reason;
/**
* 第三方返回码
*/
private String resultCode;
/**
* 创建时间
*/
private Date createTime;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getPictureType() {
return pictureType;
}
public void setPictureType(Integer pictureType) {
this.pictureType = pictureType;
}
public String getServiceCode() {
return serviceCode;
}
public void setServiceCode(String serviceCode) {
this.serviceCode = serviceCode;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
@Override
public String toString() {
return "SysCarOcr [id=" + id + ", requestId=" + requestId + ", orderSn=" + orderSn + ", orderType=" + orderType
+ ", pictureType=" + pictureType + ", serviceCode=" + serviceCode + ", reason=" + reason
+ ", resultCode=" + resultCode + ", createTime=" + createTime + ", remark=" + remark + "]";
}
}
...@@ -439,4 +439,6 @@ public interface IOrderService { ...@@ -439,4 +439,6 @@ public interface IOrderService {
ResultObject saveOrderSubSidyInfo(SaveOrderSubsidyInfoReq saveOrderSubsidyInfoReq); ResultObject saveOrderSubSidyInfo(SaveOrderSubsidyInfoReq saveOrderSubsidyInfoReq);
ResultObject getOrderSubSidyInfo(Integer orderId); ResultObject getOrderSubSidyInfo(Integer orderId);
void carOcr(OrderDeviceReq orderDeviceReq);
} }
<?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.glsx.ordercenter.mapper.SysCarOcrMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysCarOcr">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
<result column="request_id" jdbcType="VARCHAR" property="requestId" />
<result column="order_type" jdbcType="TINYINT" property="orderType" />
<result column="picture_path" jdbcType="VARCHAR" property="picturePath" />
<result column="picture_type" jdbcType="TINYINT" property="pictureType" />
<result column="service_code" jdbcType="VARCHAR" property="serviceCode" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="result_code" jdbcType="VARCHAR" property="resultCode" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
id, order_sn, request_id, order_type,picture_path, picture_type, service_code, reason,result_code,create_time,remark
</sql>
<select id="getYesterdayCarOcrResult" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM sys_car_ocr
WHERE DATEDIFF(create_time,NOW())=-1
ORDER BY order_sn desc,id desc
</select>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysCarOcr" >
insert into sys_car_ocr
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="orderSn != null" >
order_sn,
</if>
<if test="orderType != null" >
order_type,
</if>
<if test="picturePath != null" >
picture_path,
</if>
<if test="pictureType != null" >
picture_type,
</if>
<if test="serviceCode != null" >
service_code,
</if>
<if test="reason != null" >
reason,
</if>
<if test="resultCode != null" >
result_code,
</if>
<if test="remark != null" >
remark,
</if>
<if test="createTime != null" >
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="orderSn != null" >
#{orderSn,jdbcType=VARCHAR},
</if>
<if test="orderType != null" >
#{orderType,jdbcType=INTEGER},
</if>
<if test="picturePath != null" >
#{picturePath,jdbcType=VARCHAR},
</if>
<if test="pictureType != null" >
#{pictureType,jdbcType=INTEGER},
</if>
<if test="serviceCode != null" >
#{serviceCode,jdbcType=VARCHAR},
</if>
<if test="reason != null" >
#{reason,jdbcType=VARCHAR},
</if>
<if test="resultCode != null" >
#{resultCode,jdbcType=VARCHAR},
</if>
<if test="remark != null" >
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!