Commit 802de6d9 authored by huangcb's avatar huangcb

货主/司机增加评分字段

parent 2734290c
......@@ -21,7 +21,7 @@
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
<alibaba-nacos-discovery.version>2.1.1.RELEASE</alibaba-nacos-discovery.version>
<alibaba-nacos-config.version>2.1.1.RELEASE</alibaba-nacos-config.version>
<alibaba-fastjson.version>1.2.62</alibaba-fastjson.version>
<alibaba-fastjson.version>1.2.70</alibaba-fastjson.version>
<alibaba-druid.version>1.1.22</alibaba-druid.version>
<apache-commons-lang3.version>3.7</apache-commons-lang3.version>
<mybatisplus.version>3.3.1</mybatisplus.version>
......@@ -83,6 +83,10 @@
<artifactId>commons-lang3</artifactId>
<version>${apache-commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
......
package com.esv.freight.customer.common.component;
import com.esv.freight.customer.common.unionpay.SDKConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
......@@ -25,5 +26,8 @@ public class ApplicationLoadRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments var) {
log.info("-------------------- [{}]初始化完成 --------------------", applicationName);
// 从classpath加载acp_sdk.properties文件
SDKConfig.getConfig().loadPropertiesFromSrc();
}
}
......@@ -102,6 +102,9 @@ public class ErrorMessageComponent {
@Value("${error-message.goodsowner.regularly-route.detail.1001}")
private String goodsOwnerRegularlyRouteDetail1001;
@Value("${error-message.goodsowner.score.overall.update.1001}")
private String goodsOwnerScoreOverallUpdate1001;
@Value("${error-message.goodsowner.ext.account-address.1001}")
private String goodsOwnerExtAccountAddress1001;
@Value("${error-message.goodsowner.ext.account-address.1002}")
......@@ -234,6 +237,9 @@ public class ErrorMessageComponent {
@Value("${error-message.carrier.driver.vehicle-can-bind.1001}")
private String carrierDriverVehicleCanBind1001;
@Value("${error-message.carrier.driver.score.overall.update.1001}")
private String carrierDriverScoreOverallUpdate1001;
@Value("${error-message.carrier.driver.vehicle-bind.1001}")
private String carrierDriverVehicleBind1001;
@Value("${error-message.carrier.driver.vehicle-bind.1002}")
......
......@@ -16,10 +16,12 @@ import com.esv.freight.customer.module.carrier.CarrierConstants;
import com.esv.freight.customer.module.driver.DriverConstants;
import com.esv.freight.customer.module.driver.dto.DriverDetailDto;
import com.esv.freight.customer.module.driver.entity.DriverAuditHistoryEntity;
import com.esv.freight.customer.module.driver.form.AccountScoreForm;
import com.esv.freight.customer.module.driver.form.DriverAuditForm;
import com.esv.freight.customer.module.driver.form.DriverInfoForm;
import com.esv.freight.customer.module.driver.form.DriverQueryForm;
import com.esv.freight.customer.module.driver.service.DriverAccountService;
import com.esv.freight.customer.module.driver.service.DriverInfoService;
import com.esv.freight.customer.module.driver.validator.groups.ValidatorDetailAccount;
import com.esv.freight.customer.module.driver.validator.groups.ValidatorLogin;
import com.esv.freight.customer.module.driver.validator.groups.ValidatorPasswordReset;
......@@ -55,17 +57,17 @@ import java.util.List;
public class DriverController {
private ErrorMessageComponent errorMessageComponent;
private PasswordComponent passwordComponent;
private DriverAccountService driverAccountService;
private DriverInfoService driverInfoService;
@Autowired
public DriverController(ErrorMessageComponent errorMessageComponent, PasswordComponent passwordComponent,
DriverAccountService driverAccountService) {
DriverAccountService driverAccountService, DriverInfoService driverInfoService) {
this.errorMessageComponent = errorMessageComponent;
this.passwordComponent = passwordComponent;
this.driverAccountService = driverAccountService;
this.driverInfoService = driverInfoService;
}
/**
......@@ -312,4 +314,17 @@ public class DriverController {
driverAccountService.resetDriverPwd(form);
return EResponse.ok();
}
/**
* description 更新司机整体评分
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author HuangChaobin
* createTime 2020/06/01 13:32
**/
@PostMapping("/score/overall/update")
public EResponse updateOverallScore(@RequestBody @Validated(ValidatorUpdate.class) AccountScoreForm form) throws EException {
driverInfoService.updateOverallScore(form);
return EResponse.ok();
}
}
......@@ -206,4 +206,8 @@ public class DriverDetailDto {
* 备注
*/
private String remark;
/**
* 综合评分
*/
private Integer overallScore;
}
......@@ -138,6 +138,10 @@ public class DriverInfoEntity implements Serializable {
* 备注
*/
private String remark;
/**
* 综合评分
*/
private Integer overallScore;
/**
* 创建者
*/
......
package com.esv.freight.customer.module.driver.form;
import com.esv.freight.customer.common.validator.groups.ValidatorUpdate;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.driver.form.AccountScoreForm
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/06/01 13:21
* @version:1.0
*/
@Data
public class AccountScoreForm {
@NotNull(message = "参数id不能为空", groups = {ValidatorUpdate.class})
private Long id;
@NotNull(message = "参数score不能为空", groups = {ValidatorUpdate.class})
@Range(min = 0, message = "无效的score", groups = {ValidatorUpdate.class})
private Integer score;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
......@@ -2,6 +2,7 @@ package com.esv.freight.customer.module.driver.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.module.driver.entity.DriverInfoEntity;
import com.esv.freight.customer.module.driver.form.AccountScoreForm;
/**
* 司机信息表
......@@ -12,5 +13,14 @@ import com.esv.freight.customer.module.driver.entity.DriverInfoEntity;
*/
public interface DriverInfoService extends IService<DriverInfoEntity> {
/**
* description 更新司机整体评分
* param [form]
* return java.lang.Integer
* author HuangChaobin
* createTime 2020/06/01 13:24
**/
Integer updateOverallScore(AccountScoreForm form);
}
package com.esv.freight.customer.module.driver.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.common.component.ErrorMessageComponent;
import com.esv.freight.customer.common.exception.EException;
import com.esv.freight.customer.module.driver.dao.DriverInfoDao;
import com.esv.freight.customer.module.driver.entity.DriverInfoEntity;
import com.esv.freight.customer.module.driver.form.AccountScoreForm;
import com.esv.freight.customer.module.driver.service.DriverInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("driverInfoService")
public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoDao, DriverInfoEntity> implements DriverInfoService {
private ErrorMessageComponent errorMessageComponent;
@Autowired
public DriverInfoServiceImpl(ErrorMessageComponent errorMessageComponent) {
this.errorMessageComponent = errorMessageComponent;
}
@Override
public Integer updateOverallScore(AccountScoreForm form) {
DriverInfoEntity dbEntity = this.baseMapper.selectOne(new LambdaQueryWrapper<DriverInfoEntity>().eq(DriverInfoEntity::getDriverId, form.getId()));
if (null == dbEntity) {
throw new EException(1001, errorMessageComponent.getCarrierDriverScoreOverallUpdate1001());
}
DriverInfoEntity entity = new DriverInfoEntity();
entity.setId(dbEntity.getId());
entity.setOverallScore(form.getScore());
return this.baseMapper.updateById(entity);
}
}
\ No newline at end of file
......@@ -150,6 +150,10 @@ public class DriverDetailVO {
* 备注
*/
private String remark;
/**
* 综合评分
*/
private Integer overallScore;
/**
* 创建者
*/
......
......@@ -19,7 +19,9 @@ import com.esv.freight.customer.module.goodsowner.entity.AuditHistoryEntity;
import com.esv.freight.customer.module.goodsowner.form.AccountForm;
import com.esv.freight.customer.module.goodsowner.form.AccountInfoForm;
import com.esv.freight.customer.module.goodsowner.form.AccountQueryForm;
import com.esv.freight.customer.module.goodsowner.form.AccountScoreForm;
import com.esv.freight.customer.module.goodsowner.service.GoodsOwnerAccountService;
import com.esv.freight.customer.module.goodsowner.service.GoodsOwnerInfoService;
import com.esv.freight.customer.module.goodsowner.validator.groups.*;
import com.esv.freight.customer.module.goodsowner.vo.AccountInfoVO;
import com.esv.freight.customer.module.goodsowner.vo.AuditHistoryVO;
......@@ -51,17 +53,18 @@ import java.util.List;
@Validated
public class GoodsOwnerController {
private GoodsOwnerAccountService goodsOwnerAccountService;
private ErrorMessageComponent errorMessageComponent;
private PasswordComponent passwordComponent;
private GoodsOwnerAccountService goodsOwnerAccountService;
private GoodsOwnerInfoService goodsOwnerInfoService;
@Autowired
public GoodsOwnerController(GoodsOwnerAccountService goodsOwnerAccountService, ErrorMessageComponent errorMessageComponent, PasswordComponent passwordComponent) {
public GoodsOwnerController(GoodsOwnerAccountService goodsOwnerAccountService, ErrorMessageComponent errorMessageComponent,
PasswordComponent passwordComponent, GoodsOwnerInfoService goodsOwnerInfoService) {
this.goodsOwnerAccountService = goodsOwnerAccountService;
this.errorMessageComponent = errorMessageComponent;
this.passwordComponent = passwordComponent;
this.goodsOwnerInfoService = goodsOwnerInfoService;
}
/**
......@@ -288,4 +291,17 @@ public class GoodsOwnerController {
public EResponse getAllAvailable() throws EException {
return EResponse.ok(goodsOwnerAccountService.selectAllAvailableAccount());
}
/**
* description 更新货主整体评分
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author HuangChaobin
* createTime 2020/06/01 11:01
**/
@PostMapping("/score/overall/update")
public EResponse updateOverallScore(@RequestBody @Validated(ValidatorUpdate.class) AccountScoreForm form) throws EException {
goodsOwnerInfoService.updateOverallScore(form);
return EResponse.ok();
}
}
......@@ -153,4 +153,8 @@ public class AccountInfoDto {
* 身份证背面图片URL
*/
private String idCardBackUrl;
/**
* 整体评分
*/
private Integer overallScore;
}
......@@ -104,5 +104,9 @@ public class InfoEntity implements Serializable {
* 身份证背面图片URL
*/
private String idCardBackUrl;
/**
* 综合评分
*/
private Integer overallScore;
}
package com.esv.freight.customer.module.goodsowner.form;
import com.esv.freight.customer.common.validator.groups.ValidatorUpdate;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.form.AccountScoreForm
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/06/01 10:18
* @version:1.0
*/
@Data
public class AccountScoreForm {
@NotNull(message = "参数id不能为空", groups = {ValidatorUpdate.class})
private Long id;
@NotNull(message = "参数score不能为空", groups = {ValidatorUpdate.class})
@Range(min = 0, message = "无效的score", groups = {ValidatorUpdate.class})
private Integer score;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
......@@ -2,6 +2,7 @@ package com.esv.freight.customer.module.goodsowner.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.module.goodsowner.entity.InfoEntity;
import com.esv.freight.customer.module.goodsowner.form.AccountScoreForm;
/**
* 货主信息表
......@@ -10,7 +11,16 @@ import com.esv.freight.customer.module.goodsowner.entity.InfoEntity;
* @email huangchaobin@esvtek.com
* @date 2020-04-17 13:54:57
*/
public interface InfoService extends IService<InfoEntity> {
public interface GoodsOwnerInfoService extends IService<InfoEntity> {
/**
* description 更新货主整体评分
* param [form]
* return java.lang.Integer
* author HuangChaobin
* createTime 2020/06/01 10:20
**/
Integer updateOverallScore(AccountScoreForm form);
}
......@@ -25,7 +25,7 @@ import com.esv.freight.customer.module.goodsowner.form.AccountInfoForm;
import com.esv.freight.customer.module.goodsowner.form.AccountQueryForm;
import com.esv.freight.customer.module.goodsowner.service.GoodsOwnerAccountService;
import com.esv.freight.customer.module.goodsowner.service.AuditHistoryService;
import com.esv.freight.customer.module.goodsowner.service.InfoService;
import com.esv.freight.customer.module.goodsowner.service.GoodsOwnerInfoService;
import com.esv.freight.customer.module.goodsowner.vo.AccountAvailableVO;
import com.esv.freight.customer.module.goodsowner.vo.AccountListVO;
import com.esv.gateway.common.GatewayHeaders;
......@@ -51,17 +51,17 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
private ErrorMessageComponent errorMessageComponent;
private InfoService infoService;
private GoodsOwnerInfoService goodsOwnerInfoService;
private AuditHistoryService auditHistoryService;
@Autowired
public GoodsOwnerAccountServiceImpl(FeignBaseService feignBaseService, PasswordComponent passwordComponent,
ErrorMessageComponent errorMessageComponent, InfoService infoService, AuditHistoryService auditHistoryService) {
ErrorMessageComponent errorMessageComponent, GoodsOwnerInfoService goodsOwnerInfoService, AuditHistoryService auditHistoryService) {
this.feignBaseService = feignBaseService;
this.passwordComponent = passwordComponent;
this.errorMessageComponent = errorMessageComponent;
this.infoService = infoService;
this.goodsOwnerInfoService = goodsOwnerInfoService;
this.auditHistoryService = auditHistoryService;
}
......@@ -134,7 +134,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
}
infoEntity.setOwnerNumber(ownerNumber);
infoEntity.setAccountId(accountId);
infoService.getBaseMapper().insert(infoEntity);
goodsOwnerInfoService.getBaseMapper().insert(infoEntity);
// 5.新增帐号审核记录
AuditHistoryEntity auditHistoryEntity = new AuditHistoryEntity();
......@@ -185,7 +185,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
InfoEntity infoEntityWrapper = new InfoEntity();
infoEntityWrapper.setAccountId(accountId);
Wrapper<InfoEntity> InfoUpdateWrapper = new UpdateWrapper<>(infoEntityWrapper);
infoService.getBaseMapper().update(infoEntity, InfoUpdateWrapper);
goodsOwnerInfoService.getBaseMapper().update(infoEntity, InfoUpdateWrapper);
}
@Override
......@@ -320,7 +320,7 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
InfoEntity infoEntity = new InfoEntity();
infoEntity.setOwnerNumber(ownerNumber);
infoEntity.setAccountId(accountId);
infoService.getBaseMapper().insert(infoEntity);
goodsOwnerInfoService.getBaseMapper().insert(infoEntity);
// 5.新增帐号审核记录
AuditHistoryEntity auditHistoryEntity = new AuditHistoryEntity();
......
package com.esv.freight.customer.module.goodsowner.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.common.component.ErrorMessageComponent;
import com.esv.freight.customer.common.exception.EException;
import com.esv.freight.customer.module.goodsowner.dao.InfoDao;
import com.esv.freight.customer.module.goodsowner.entity.InfoEntity;
import com.esv.freight.customer.module.goodsowner.form.AccountScoreForm;
import com.esv.freight.customer.module.goodsowner.service.GoodsOwnerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("goodsOwnerInfoService")
public class GoodsOwnerInfoServiceImpl extends ServiceImpl<InfoDao, InfoEntity> implements GoodsOwnerInfoService {
private ErrorMessageComponent errorMessageComponent;
@Autowired
public GoodsOwnerInfoServiceImpl(ErrorMessageComponent errorMessageComponent) {
this.errorMessageComponent = errorMessageComponent;
}
@Override
public Integer updateOverallScore(AccountScoreForm form) {
InfoEntity dbEntity = this.baseMapper.selectOne(new LambdaQueryWrapper<InfoEntity>().eq(InfoEntity::getAccountId, form.getId()));
if (null == dbEntity) {
throw new EException(1001, errorMessageComponent.getGoodsOwnerScoreOverallUpdate1001());
}
InfoEntity infoEntity = new InfoEntity();
infoEntity.setId(dbEntity.getId());
infoEntity.setOverallScore(form.getScore());
return this.baseMapper.updateById(infoEntity);
}
}
\ No newline at end of file
package com.esv.freight.customer.module.goodsowner.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.module.goodsowner.dao.InfoDao;
import com.esv.freight.customer.module.goodsowner.entity.InfoEntity;
import com.esv.freight.customer.module.goodsowner.service.InfoService;
import org.springframework.stereotype.Service;
@Service("infoService")
public class InfoServiceImpl extends ServiceImpl<InfoDao, InfoEntity> implements InfoService {
}
\ No newline at end of file
......@@ -114,6 +114,10 @@ public class AccountInfoVO implements Serializable {
* 身份证背面图片URL
*/
private String idCardBackUrl;
/**
* 整体评分
*/
private Integer overallScore;
@Override
public String toString() {
......
package com.esv.freight.customer.module.pay.dao;
import com.esv.freight.customer.module.pay.entity.GoodsOwnerPayOrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 货主支付订单表
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-30 13:41:51
*/
@Mapper
public interface GoodsOwnerPayOrderDao extends BaseMapper<GoodsOwnerPayOrderEntity> {
}
package com.esv.freight.customer.module.pay.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 货主支付订单表
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-30 13:41:51
*/
@Data
@TableName("goods_owner_pay_order")
public class GoodsOwnerPayOrderEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
private Long id;
/**
* 租户ID
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* 部门ID
*/
@TableField(fill = FieldFill.INSERT)
private Long departmentId;
/**
* 支付方式:10-银联
*/
private Integer payType;
/**
* 商户代码(网络货运平台在支付平台的商户号)
*/
private String merId;
/**
* 业务订单号
*/
private String orderId;
/**
* 请求支付平台订单发送时间
*/
private String txnTime;
/**
* 交易金额(单位为分)
*/
private Long txnAmt;
/**
* 订单描述
*/
private String orderDesc;
/**
* 支付平台受理订单号
*/
private String tn;
/**
* 订单状态:1-支付中、2-支付成功、3-支付失败
*/
private Long orderStatus;
/**
* 查询流水号(消费交易的流水号,供后续查询用)
*/
private String queryId;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 支付平台回调时间
*/
private Date callbackTime;
}
package com.esv.freight.customer.module.pay.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.module.pay.entity.GoodsOwnerPayOrderEntity;
/**
* 货主支付订单表
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-30 13:41:51
*/
public interface GoodsOwnerPayOrderService extends IService<GoodsOwnerPayOrderEntity> {
}
package com.esv.freight.customer.module.pay.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.module.pay.dao.GoodsOwnerPayOrderDao;
import com.esv.freight.customer.module.pay.entity.GoodsOwnerPayOrderEntity;
import com.esv.freight.customer.module.pay.service.GoodsOwnerPayOrderService;
import org.springframework.stereotype.Service;
@Service("goodsOwnerPayOrderService")
public class GoodsOwnerPayOrderServiceImpl extends ServiceImpl<GoodsOwnerPayOrderDao, GoodsOwnerPayOrderEntity> implements GoodsOwnerPayOrderService {
}
\ No newline at end of file
......@@ -124,6 +124,10 @@ error-message:
1004: 无效的收货地址ID
detail:
1001: 无效的常跑线路ID
score:
overall:
update:
1001: 无效的帐号ID
ext:
account-address:
1001: 无效的货主ID
......@@ -228,6 +232,10 @@ error-message:
1001: 司机与车辆未绑定
1002: 无效的司机ID
1003: 无效的车辆ID
score:
overall:
update:
1001: 无效的帐号ID
contract:
offline:
goods-owner:
......
......@@ -124,6 +124,10 @@ error-message:
1004: 无效的收货地址ID
detail:
1001: 无效的常跑线路ID
score:
overall:
update:
1001: 无效的帐号ID
ext:
account-address:
1001: 无效的货主ID
......@@ -228,6 +232,10 @@ error-message:
1001: 司机与车辆未绑定
1002: 无效的司机ID
1003: 无效的车辆ID
score:
overall:
update:
1001: 无效的帐号ID
contract:
offline:
goods-owner:
......
......@@ -28,7 +28,7 @@
select ab.*, b.name, b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url, b.settlement_type, b.sex, b.birth_date,
b.nation, b.native_place, b.province_code, b.city_code, b.district_code, b.detail_address, b.driving_license, b.driving_license_type,
b.driving_license_start_date, b.driving_license_end_date, b.driving_license_issue_department, b.driving_license_init_date, b.driving_license_url,
b.certificate_vehicle, b.certificate_end_date, b.certificate_number, b.certificate_url, b.remark
b.certificate_vehicle, b.certificate_end_date, b.certificate_number, b.certificate_url, b.remark, b.overall_score
from (
select a.*, c.carrier_type as carrierType, c.carrier_full_name as carrierFullName, c.contactor as carrierContactor
from driver_account a, carrier_info c
......@@ -42,7 +42,7 @@
select ab.*, b.name, b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url, b.settlement_type, b.sex, b.birth_date,
b.nation, b.native_place, b.province_code, b.city_code, b.district_code, b.detail_address, b.driving_license, b.driving_license_type,
b.driving_license_start_date, b.driving_license_end_date, b.driving_license_issue_department, b.driving_license_init_date, b.driving_license_url,
b.certificate_vehicle, b.certificate_end_date, b.certificate_number, b.certificate_url, b.remark
b.certificate_vehicle, b.certificate_end_date, b.certificate_number, b.certificate_url, b.remark, b.overall_score
from (
select a.*, c.carrier_type as carrierType, c.carrier_full_name as carrierFullName, c.contactor as carrierContactor
from driver_account a, carrier_info c
......
......@@ -72,7 +72,7 @@
select a.*,
b.owner_type, b.owner_number, b.owner_full_name, b.owner_brief_name, b.uni_credit_code, b.credit_expire_date, b.credit_original_url,
b.credit_copy_url, b.legal_person, b.legal_phone, b.province_code, b.city_code, b.district_code, b.detail_address, b.contactor,
b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url
b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url, b.overall_score
from goods_owner_account a
left join goods_owner_info b
on a.id = b.account_id
......@@ -83,7 +83,7 @@
select a.*,
b.owner_type, b.owner_number, b.owner_full_name, b.owner_brief_name, b.uni_credit_code, b.credit_expire_date, b.credit_original_url,
b.credit_copy_url, b.legal_person, b.legal_phone, b.province_code, b.city_code, b.district_code, b.detail_address, b.contactor,
b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url
b.id_card, b.id_card_expire_date, b.id_card_front_url, b.id_card_back_url, b.overall_score
from goods_owner_account a
left join goods_owner_info b
on a.id = b.account_id
......
<?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.esv.freight.customer.module.pay.dao.GoodsOwnerPayOrderDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.esv.freight.customer.module.pay.entity.GoodsOwnerPayOrderEntity" id="goodsOwnerPayOrderMap">
<result property="id" column="id"/>
<result property="tenantId" column="tenant_id"/>
<result property="departmentId" column="department_id"/>
<result property="payType" column="pay_type"/>
<result property="merId" column="mer_id"/>
<result property="orderId" column="order_id"/>
<result property="txnTime" column="txn_time"/>
<result property="txnAmt" column="txn_amt"/>
<result property="orderDesc" column="order_desc"/>
<result property="tn" column="tn"/>
<result property="orderStatus" column="order_status"/>
<result property="queryId" column="query_id"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="callbackTime" column="callback_time"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.esv.freight.customer.BaseTestController;
import com.esv.freight.customer.common.response.ECode;
import com.esv.freight.customer.module.driver.DriverConstants;
import com.esv.freight.customer.module.driver.form.AccountScoreForm;
import com.esv.freight.customer.module.driver.form.DriverAuditForm;
import com.esv.freight.customer.module.driver.form.DriverInfoForm;
import com.esv.freight.customer.module.driver.form.DriverQueryForm;
......@@ -751,4 +752,59 @@ public class DriverAccountTest extends BaseTestController {
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(1001, result.getIntValue("code"));
}
/**
* 更新司机整体评分
**/
@Test
public void j1_updateOverallScore_success_test() throws Exception {
String url = "/carrier/driver/score/overall/update";
// 构造数据
AccountScoreForm form = new AccountScoreForm();
form.setId(1L);
form.setScore(60);
MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.headers(this.getDefaultHttpHeaders())
.content(form.toString()))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andReturn();
String responseStr = mvcResult.getResponse().getContentAsString();
log.info(responseStr);
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(ECode.SUCCESS.code(), result.getIntValue("code"));
}
/**
* 更新司机整体评分
**/
@Test
@Rollback
public void j2_updateOverallScore_wrong_id_failure_test() throws Exception {
String url = "/carrier/driver/score/overall/update";
// 构造数据
AccountScoreForm form = new AccountScoreForm();
form.setId(99999L);
form.setScore(60);
MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.headers(this.getDefaultHttpHeaders())
.content(form.toString()))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andReturn();
String responseStr = mvcResult.getResponse().getContentAsString();
log.info(responseStr);
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(1001, result.getIntValue("code"));
}
}
......@@ -7,6 +7,7 @@ import com.esv.freight.customer.module.goodsowner.GoodsOwnerConstants;
import com.esv.freight.customer.module.goodsowner.form.AccountForm;
import com.esv.freight.customer.module.goodsowner.form.AccountInfoForm;
import com.esv.freight.customer.module.goodsowner.form.AccountQueryForm;
import com.esv.freight.customer.module.goodsowner.form.AccountScoreForm;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.FixMethodOrder;
......@@ -39,6 +40,7 @@ import java.util.UUID;
@Slf4j
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Transactional
@Rollback(false)
public class GoodsOwnerControllerTest extends BaseTestController {
@Test
......@@ -821,4 +823,59 @@ public class GoodsOwnerControllerTest extends BaseTestController {
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(1001, result.getIntValue("code"));
}
/**
* 更新货主整体评分
**/
@Test
public void j1_updateOverallScore_success_test() throws Exception {
String url = "/goodsowner/account/score/overall/update";
// 构造数据
AccountScoreForm form = new AccountScoreForm();
form.setId(1L);
form.setScore(60);
MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.headers(this.getDefaultHttpHeaders())
.content(form.toString()))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andReturn();
String responseStr = mvcResult.getResponse().getContentAsString();
log.info(responseStr);
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(ECode.SUCCESS.code(), result.getIntValue("code"));
}
/**
* 更新货主整体评分:无效的帐号ID
**/
@Test
@Rollback
public void j1_updateOverallScore_wrong_id_failure_test() throws Exception {
String url = "/goodsowner/account/score/overall/update";
// 构造数据
AccountScoreForm form = new AccountScoreForm();
form.setId(99999L);
form.setScore(60);
MvcResult mvcResult = this.getMockMvc().perform(MockMvcRequestBuilders.post(url)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.headers(this.getDefaultHttpHeaders())
.content(form.toString()))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andReturn();
String responseStr = mvcResult.getResponse().getContentAsString();
log.info(responseStr);
JSONObject result = JSONObject.parseObject(responseStr);
Assert.assertEquals(1001, result.getIntValue("code"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment