Commit f8f980d1 authored by huangcb's avatar huangcb

线下文本合同:承运商合同

parent 4f8a5329
...@@ -284,4 +284,17 @@ public class ErrorMessageComponent { ...@@ -284,4 +284,17 @@ public class ErrorMessageComponent {
@Value("${error-message.contract.offline.goods-owner.delete.1001}") @Value("${error-message.contract.offline.goods-owner.delete.1001}")
private String contractOfflineGoodsOwnerDelete1001; private String contractOfflineGoodsOwnerDelete1001;
@Value("${error-message.contract.offline.carrier.add.1001}")
private String contractOfflineCarrierAdd1001;
@Value("${error-message.contract.offline.carrier.add.1002}")
private String contractOfflineCarrierAdd1002;
@Value("${error-message.contract.offline.carrier.edit.1001}")
private String contractOfflineCarrierEdit1001;
@Value("${error-message.contract.offline.carrier.edit.1002}")
private String contractOfflineCarrierEdit1002;
@Value("${error-message.contract.offline.carrier.delete.1001}")
private String contractOfflineCarrierDelete1001;
} }
package com.esv.freight.customer.module.contract.controller;
import com.alibaba.fastjson.JSONObject;
import com.esv.freight.customer.common.exception.EException;
import com.esv.freight.customer.common.response.EResponse;
import com.esv.freight.customer.common.validator.groups.ValidatorInsert;
import com.esv.freight.customer.common.validator.groups.ValidatorList;
import com.esv.freight.customer.common.validator.groups.ValidatorUpdate;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm;
import com.esv.freight.customer.module.contract.service.ContractOfflineCarrierService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.controller.ContractOfflineCarrierController
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/20 15:50
* @version:1.0
*/
@Slf4j
@RestController
@RequestMapping("/contract/offline/carrier")
@Validated
public class ContractOfflineCarrierController {
private ContractOfflineCarrierService contractOfflineCarrierService;
@Autowired
public ContractOfflineCarrierController(ContractOfflineCarrierService contractOfflineCarrierService) {
this.contractOfflineCarrierService = contractOfflineCarrierService;
}
/**
* description 承运商合同-增加
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author Administrator
* createTime 2020/05/20 15:52
**/
@PostMapping("/add")
public EResponse add(@RequestBody @Validated(ValidatorInsert.class) ContractOfflineCarrierForm form) throws EException {
Long id = contractOfflineCarrierService.addOfflineContract(form);
JSONObject data = new JSONObject();
data.put("id", id);
return EResponse.ok(data);
}
/**
* description 承运商合同-编辑
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author Administrator
* createTime 2020/05/20 15:52
**/
@PostMapping("/edit")
public EResponse edit(@RequestBody @Validated(ValidatorUpdate.class) ContractOfflineCarrierForm form) throws EException {
contractOfflineCarrierService.editOfflineContract(form);
return EResponse.ok();
}
/**
* description 承运商合同-删除
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author Administrator
* createTime 2020/05/20 15:53
**/
@PostMapping("/delete")
public EResponse delete(@RequestBody @Validated(ValidatorUpdate.class) ContractOfflineCarrierForm form) throws EException {
contractOfflineCarrierService.deleteOfflineContract(form);
return EResponse.ok();
}
/**
* description 承运商合同-分页查询
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author Administrator
* createTime 2020/05/20 15:54
**/
@PostMapping("/list")
public EResponse list(@RequestBody @Validated(ValidatorList.class) ContractOfflineCarrierQueryForm form) throws EException {
return EResponse.ok(contractOfflineCarrierService.selectContractList(form));
}
}
package com.esv.freight.customer.module.contract.dao; package com.esv.freight.customer.module.contract.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity; import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineGoodsOwnerQueryForm;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
...@@ -14,4 +17,13 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +17,13 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ContractOfflineCarrierDao extends BaseMapper<ContractOfflineCarrierEntity> { public interface ContractOfflineCarrierDao extends BaseMapper<ContractOfflineCarrierEntity> {
/**
* description 分页查询合同列表
* param [page, queryObj]
* return com.baomidou.mybatisplus.core.metadata.IPage
* author Administrator
* createTime 2020/05/20 15:34
**/
IPage selectContractList(IPage page, ContractOfflineCarrierQueryForm queryObj);
} }
package com.esv.freight.customer.module.contract.dto;
import lombok.Data;
import java.util.Date;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.dto.ContractOfflineCarrierDto
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/20 15:21
* @version:1.0
*/
@Data
public class ContractOfflineCarrierDto {
/**
*
*/
private Long id;
/**
* 租户ID
*/
private Long tenantId;
/**
* 部门ID
*/
private Long departmentId;
/**
* 承运商帐号ID
*/
private Long carrierId;
/**
* 合同编号
*/
private String contractNumber;
/**
* 合同名称
*/
private String contractName;
/**
* 合同类型:1-主合同、2-补充合同、3-临时合同
*/
private Integer contractType;
/**
* 合同签订日期
*/
private Date signDate;
/**
* 合同起始日期
*/
private Date startDate;
/**
* 合同截止日期
*/
private Date endDate;
/**
* 合同文件URL
*/
private String fileUrl;
/**
* 删除标识:0-未删除,1-已删除
*/
private Boolean deleted;
/**
* 备注
*/
private String remark;
/**
* 创建者
*/
private String createUser;
/**
* 修改者
*/
private String updateUser;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 承运商名称
*/
private String carrierFullName;
/**
* 承运商类别:1-企业承运人、2-个体承运人
*/
private Integer carrierType;
/**
* 联系人
*/
private String contactor;
}
package com.esv.freight.customer.module.contract.form;
import com.esv.freight.customer.common.validator.groups.ValidatorDelete;
import com.esv.freight.customer.common.validator.groups.ValidatorInsert;
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.Length;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.form.ContractOfflineCarrierForm
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/20 15:24
* @version:1.0
*/
@Data
public class ContractOfflineCarrierForm {
/**
*
*/
@NotNull(message = "参数id不能为空", groups = {ValidatorUpdate.class, ValidatorDelete.class})
private Long id;
/**
* 承运商ID
*/
@NotNull(message = "参数carrierId不能为空", groups = {ValidatorInsert.class})
private Long carrierId;
/**
* 合同编号
*/
@Length(max = 50, message = "参数contractNumber长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数contractNumber不能为空", groups = {ValidatorInsert.class})
private String contractNumber;
/**
* 合同名称
*/
@Length(max = 50, message = "参数contractName长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数contractName不能为空", groups = {ValidatorInsert.class})
private String contractName;
/**
* 合同类型:1-主合同、2-补充合同、3-临时合同
*/
@Range(min = 1, max = 3, message = "参数contractType不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotNull(message = "参数contractType不能为空", groups = {ValidatorInsert.class})
private Integer contractType;
/**
* 合同签订日期
*/
@Length(min = 10, max = 10, message = "参数signDate长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数signDate不能为空", groups = {ValidatorInsert.class})
private String signDate;
/**
* 合同起始日期
*/
@Length(min = 10, max = 10, message = "参数startDate长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数startDate不能为空", groups = {ValidatorInsert.class})
private String startDate;
/**
* 合同截止日期
*/
@Length(min = 10, max = 10, message = "参数endDate长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数endDate不能为空", groups = {ValidatorInsert.class})
private String endDate;
/**
* 合同文件URL
*/
@Length(max = 200, message = "参数fileUrl长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
@NotBlank(message = "参数fileUrl不能为空", groups = {ValidatorInsert.class})
private String fileUrl;
/**
* 备注
*/
@Length(max = 200, message = "参数remark长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class})
private String remark;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
package com.esv.freight.customer.module.contract.form;
import com.esv.freight.customer.common.validator.groups.ValidatorList;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/20 15:26
* @version:1.0
*/
@Data
public class ContractOfflineCarrierQueryForm {
/**
* 关键字
*/
@Length(max = 50, message = "参数keywords长度不合法", groups = {ValidatorList.class})
private String keywords;
/**
* 页码
**/
@Range(min = 1, max = 65535, message = "无效的pageNum", groups = {ValidatorList.class})
@NotNull(message = "参数pageNum不能为空", groups = {ValidatorList.class})
private Integer pageNum;
/**
* 每页记录条数
**/
@Range(min = 1, max = 100, message = "pageSize", groups = {ValidatorList.class})
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Integer pageSize;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
package com.esv.freight.customer.module.contract.service; package com.esv.freight.customer.module.contract.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.common.vo.PageResultVO;
import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity; import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineGoodsOwnerForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineGoodsOwnerQueryForm;
/** /**
* 线下文本合同(承运商) * 线下文本合同(承运商)
...@@ -12,5 +17,41 @@ import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEnt ...@@ -12,5 +17,41 @@ import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEnt
*/ */
public interface ContractOfflineCarrierService extends IService<ContractOfflineCarrierEntity> { public interface ContractOfflineCarrierService extends IService<ContractOfflineCarrierEntity> {
/**
* description 新增线下文本合同(承运商)
* param [form]
* return java.lang.Integer
* author Administrator
* createTime 2020/05/19 14:49
**/
Long addOfflineContract(ContractOfflineCarrierForm form);
/**
* description 编辑线下文本合同(承运商)
* param [form]
* return java.lang.Integer
* author Administrator
* createTime 2020/05/19 19:34
**/
Integer editOfflineContract(ContractOfflineCarrierForm form);
/**
* description 删除线下文本合同(承运商)
* param [form]
* return java.lang.Integer
* author Administrator
* createTime 2020/05/20 9:24
**/
Integer deleteOfflineContract(ContractOfflineCarrierForm form);
/**
* description 分页查询合同列表
* param [queryForm]
* return com.esv.freight.customer.common.vo.PageResultVO
* author Administrator
* createTime 2020/05/20 11:18
**/
PageResultVO selectContractList(ContractOfflineCarrierQueryForm queryForm);
} }
package com.esv.freight.customer.module.contract.service.impl; package com.esv.freight.customer.module.contract.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.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.common.util.DateUtils;
import com.esv.freight.customer.common.vo.PageResultVO;
import com.esv.freight.customer.module.carrier.CarrierConstants;
import com.esv.freight.customer.module.carrier.entity.CarrierAccountEntity;
import com.esv.freight.customer.module.carrier.service.CarrierAccountService;
import com.esv.freight.customer.module.contract.dao.ContractOfflineCarrierDao; import com.esv.freight.customer.module.contract.dao.ContractOfflineCarrierDao;
import com.esv.freight.customer.module.contract.dto.ContractOfflineCarrierDto;
import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity; import com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierForm;
import com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm;
import com.esv.freight.customer.module.contract.service.ContractOfflineCarrierService; import com.esv.freight.customer.module.contract.service.ContractOfflineCarrierService;
import com.esv.freight.customer.module.contract.vo.ContractOfflineCarrierVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("contractOfflineCarrierService") @Service("contractOfflineCarrierService")
public class ContractOfflineCarrierServiceImpl extends ServiceImpl<ContractOfflineCarrierDao, ContractOfflineCarrierEntity> implements ContractOfflineCarrierService { public class ContractOfflineCarrierServiceImpl extends ServiceImpl<ContractOfflineCarrierDao, ContractOfflineCarrierEntity> implements ContractOfflineCarrierService {
private ErrorMessageComponent errorMessageComponent;
private CarrierAccountService carrierAccountService;
@Autowired
public ContractOfflineCarrierServiceImpl(ErrorMessageComponent errorMessageComponent, CarrierAccountService carrierAccountService) {
this.errorMessageComponent = errorMessageComponent;
this.carrierAccountService = carrierAccountService;
}
@Override
public Long addOfflineContract(ContractOfflineCarrierForm form) {
// 1:校验
CarrierAccountEntity carrierAccountEntity = carrierAccountService.getCarrierById(form.getCarrierId());
if (null == carrierAccountEntity) {
throw new EException(1001, errorMessageComponent.getContractOfflineCarrierAdd1001());
}
int count = this.baseMapper.selectCount(new LambdaQueryWrapper<ContractOfflineCarrierEntity>()
.eq(ContractOfflineCarrierEntity::getCarrierId, form.getCarrierId())
.eq(ContractOfflineCarrierEntity::getContractNumber, form.getContractNumber()));
if (0 < count) {
throw new EException(1002, errorMessageComponent.getContractOfflineCarrierAdd1002());
}
// 2:新增记录
ContractOfflineCarrierEntity contractOfflineCarrierEntity = new ContractOfflineCarrierEntity();
BeanUtils.copyProperties(form, contractOfflineCarrierEntity);
contractOfflineCarrierEntity.setSignDate(DateUtils.parse(form.getSignDate(), DateUtils.DATE_FORMAT3));
contractOfflineCarrierEntity.setStartDate(DateUtils.parse(form.getStartDate(), DateUtils.DATE_FORMAT3));
contractOfflineCarrierEntity.setEndDate(DateUtils.parse(form.getEndDate(), DateUtils.DATE_FORMAT3));
this.baseMapper.insert(contractOfflineCarrierEntity);
return contractOfflineCarrierEntity.getId();
}
@Override
public Integer editOfflineContract(ContractOfflineCarrierForm form) {
// 1:校验
ContractOfflineCarrierEntity dbEntity = this.baseMapper.selectById(form.getId());
if (null == dbEntity) {
throw new EException(1001, errorMessageComponent.getContractOfflineCarrierEdit1001());
}
int count = this.baseMapper.selectCount(new LambdaQueryWrapper<ContractOfflineCarrierEntity>()
.ne(ContractOfflineCarrierEntity::getId, form.getId())
.eq(ContractOfflineCarrierEntity::getCarrierId, dbEntity.getCarrierId())
.eq(ContractOfflineCarrierEntity::getContractNumber, form.getContractNumber()));
if (0 < count) {
throw new EException(1002, errorMessageComponent.getContractOfflineCarrierEdit1002());
}
// 2:更新记录
ContractOfflineCarrierEntity contractOfflineCarrierEntity = new ContractOfflineCarrierEntity();
BeanUtils.copyProperties(form, contractOfflineCarrierEntity);
contractOfflineCarrierEntity.setCarrierId(null);
contractOfflineCarrierEntity.setSignDate(DateUtils.parse(form.getSignDate(), DateUtils.DATE_FORMAT3));
contractOfflineCarrierEntity.setStartDate(DateUtils.parse(form.getStartDate(), DateUtils.DATE_FORMAT3));
contractOfflineCarrierEntity.setEndDate(DateUtils.parse(form.getEndDate(), DateUtils.DATE_FORMAT3));
return this.baseMapper.updateById(contractOfflineCarrierEntity);
}
@Override
public Integer deleteOfflineContract(ContractOfflineCarrierForm form) {
ContractOfflineCarrierEntity dbEntity = this.baseMapper.selectById(form.getId());
if (null == dbEntity) {
throw new EException(1001, errorMessageComponent.getContractOfflineCarrierDelete1001());
}
return this.baseMapper.deleteById(form.getId());
}
@Override
public PageResultVO selectContractList(ContractOfflineCarrierQueryForm queryForm) {
IPage<ContractOfflineCarrierDto> page = new Page<>(queryForm.getPageNum(), queryForm.getPageSize());
this.baseMapper.selectContractList(page, queryForm);
// 数据转换
List<ContractOfflineCarrierDto> dtoList = page.getRecords();
List<ContractOfflineCarrierVO> targetRecordList = new ArrayList<>();
for (ContractOfflineCarrierDto dto : dtoList) {
ContractOfflineCarrierVO vo = new ContractOfflineCarrierVO();
BeanUtils.copyProperties(dto, vo);
if (CarrierConstants.CARRIER_TYPE_PERSONAL.equals(dto.getCarrierType())) {
vo.setCarrierName(dto.getCarrierFullName());
} else {
vo.setCarrierName(dto.getContactor());
}
vo.setSignDate(dto.getSignDate().getTime());
vo.setStartDate(dto.getStartDate().getTime());
vo.setEndDate(dto.getEndDate().getTime());
vo.setCreateTime(dto.getCreateTime().getTime());
targetRecordList.add(vo);
}
return new PageResultVO(page, targetRecordList);
}
} }
\ No newline at end of file
package com.esv.freight.customer.module.contract.vo;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.vo.ContractOfflineCarrierVO
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/20 15:28
* @version:1.0
*/
@Data
public class ContractOfflineCarrierVO {
/**
*
*/
private Long id;
/**
* 承运商ID
*/
private Long carrierId;
/**
* 合同编号
*/
private String contractNumber;
/**
* 合同名称
*/
private String contractName;
/**
* 合同类型:1-主合同、2-补充合同、3-临时合同
*/
private Integer contractType;
/**
* 合同签订日期
*/
private Long signDate;
/**
* 合同起始日期
*/
private Long startDate;
/**
* 合同截止日期
*/
private Long endDate;
/**
* 合同文件URL
*/
private String fileUrl;
/**
* 备注
*/
private String remark;
/**
* 创建者
*/
private String createUser;
/**
* 创建时间
*/
private Long createTime;
/**
* 客户名称
*/
private String carrierName;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
package com.esv.freight.customer.module.contract.vo; package com.esv.freight.customer.module.contract.vo;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* @description: * @description:
...@@ -67,4 +69,9 @@ public class ContractOfflineGoodsOwnerVO { ...@@ -67,4 +69,9 @@ public class ContractOfflineGoodsOwnerVO {
*/ */
private String goodsOwnerName; private String goodsOwnerName;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
} }
...@@ -229,3 +229,12 @@ error-message: ...@@ -229,3 +229,12 @@ error-message:
1002: 合同编号已存在 1002: 合同编号已存在
delete: delete:
1001: 无效的合同ID 1001: 无效的合同ID
carrier:
add:
1001: 无效的承运商ID
1002: 合同编号已存在
edit:
1001: 无效的合同ID
1002: 合同编号已存在
delete:
1001: 无效的合同ID
\ No newline at end of file
...@@ -23,5 +23,19 @@ ...@@ -23,5 +23,19 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<!-- 分页查询合同列表 -->
<select id="selectContractList" parameterType="com.esv.freight.customer.module.contract.form.ContractOfflineCarrierQueryForm"
resultType="com.esv.freight.customer.module.contract.dto.ContractOfflineCarrierDto">
select a.*, b.carrier_type as carrierType, b.carrier_full_name as carrierFullName, b.contactor as contactor
from contract_offline_carrier a, carrier_info b
where a.carrier_id = b.account_id
<if test="queryObj.keywords != null">
and (a.contract_number like CONCAT('%',#{queryObj.keywords},'%')
or a.contract_name like CONCAT('%',#{queryObj.keywords},'%')
or b.carrier_full_name like CONCAT('%',#{queryObj.keywords},'%')
or b.contactor like CONCAT('%',#{queryObj.keywords},'%'))
</if>
ORDER BY a.update_time DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -77,6 +77,7 @@ public class ContractOfflineGoodsOwnerControllerTest extends BaseTestController ...@@ -77,6 +77,7 @@ public class ContractOfflineGoodsOwnerControllerTest extends BaseTestController
* 新增合同:无效的货主ID * 新增合同:无效的货主ID
**/ **/
@Test @Test
@Rollback
public void a2_add_wrong_goodsOwnerId_failure_test() throws Exception { public void a2_add_wrong_goodsOwnerId_failure_test() throws Exception {
String url = "/contract/offline/goodsowner/add"; String url = "/contract/offline/goodsowner/add";
...@@ -111,6 +112,7 @@ public class ContractOfflineGoodsOwnerControllerTest extends BaseTestController ...@@ -111,6 +112,7 @@ public class ContractOfflineGoodsOwnerControllerTest extends BaseTestController
* 新增合同:合同编号已存在 * 新增合同:合同编号已存在
**/ **/
@Test @Test
@Rollback
public void a3_add_wrong_contractNumber_failure_test() throws Exception { public void a3_add_wrong_contractNumber_failure_test() throws Exception {
String url = "/contract/offline/goodsowner/add"; String url = "/contract/offline/goodsowner/add";
......
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