Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
customer-service
Commits
c58cbc5b
Commit
c58cbc5b
authored
May 19, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线下文本合同:货主合同-增加
parent
6278fb78
Changes
26
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
965 additions
and
112 deletions
+965
-112
ErrorMessageComponent.java
...ight/customer/common/component/ErrorMessageComponent.java
+5
-0
ContractOfflineGoodsOwnerController.java
...tract/controller/ContractOfflineGoodsOwnerController.java
+53
-0
ContractOfflineCarrierDao.java
...stomer/module/contract/dao/ContractOfflineCarrierDao.java
+17
-0
ContractOfflineGoodsOwnerDao.java
...mer/module/contract/dao/ContractOfflineGoodsOwnerDao.java
+17
-0
ContractOfflineGoodsOwnerDto.java
...mer/module/contract/dto/ContractOfflineGoodsOwnerDto.java
+99
-0
ContractOfflineCarrierEntity.java
.../module/contract/entity/ContractOfflineCarrierEntity.java
+98
-0
ContractOfflineGoodsOwnerEntity.java
...dule/contract/entity/ContractOfflineGoodsOwnerEntity.java
+98
-0
ContractOfflineGoodsOwnerForm.java
...r/module/contract/form/ContractOfflineGoodsOwnerForm.java
+86
-0
ContractOfflineCarrierService.java
...odule/contract/service/ContractOfflineCarrierService.java
+16
-0
ContractOfflineGoodsOwnerService.java
...le/contract/service/ContractOfflineGoodsOwnerService.java
+26
-0
ContractOfflineCarrierServiceImpl.java
...tract/service/impl/ContractOfflineCarrierServiceImpl.java
+14
-0
ContractOfflineGoodsOwnerServiceImpl.java
...ct/service/impl/ContractOfflineGoodsOwnerServiceImpl.java
+56
-0
ContractOfflineGoodsOwnerVO.java
...tomer/module/contract/vo/ContractOfflineGoodsOwnerVO.java
+70
-0
GoodsOwnerController.java
...er/module/goodsowner/controller/GoodsOwnerController.java
+16
-16
AccountDao.java
...sv/freight/customer/module/goodsowner/dao/AccountDao.java
+2
-2
GoodsOwnerAccountEntity.java
...mer/module/goodsowner/entity/GoodsOwnerAccountEntity.java
+1
-1
GoodsOwnerAccountService.java
...r/module/goodsowner/service/GoodsOwnerAccountService.java
+6
-6
AccountAndAddressServiceIpml.java
...goodsowner/service/impl/AccountAndAddressServiceIpml.java
+5
-5
GoodsOwnerAccountServiceImpl.java
...goodsowner/service/impl/GoodsOwnerAccountServiceImpl.java
+69
-69
RegularlyRouteServiceImpl.java
...le/goodsowner/service/impl/RegularlyRouteServiceImpl.java
+7
-7
VehicleController.java
...customer/module/vehicle/controller/VehicleController.java
+1
-5
application-dev.yml
src/main/resources/application-dev.yml
+6
-0
ContractOfflineCarrierDao.xml
...n/resources/mapper/contract/ContractOfflineCarrierDao.xml
+27
-0
ContractOfflineGoodsOwnerDao.xml
...esources/mapper/contract/ContractOfflineGoodsOwnerDao.xml
+27
-0
AccountDao.xml
src/main/resources/mapper/goodsowner/AccountDao.xml
+1
-1
ContractOfflineGoodsOwnerControllerTest.java
...t/controller/ContractOfflineGoodsOwnerControllerTest.java
+142
-0
No files found.
src/main/java/com/esv/freight/customer/common/component/ErrorMessageComponent.java
View file @
c58cbc5b
...
@@ -271,4 +271,9 @@ public class ErrorMessageComponent {
...
@@ -271,4 +271,9 @@ public class ErrorMessageComponent {
private
String
carrierDriverVehicleCheckBind1002
;
private
String
carrierDriverVehicleCheckBind1002
;
@Value
(
"${error-message.carrier.driver.vehicle-check-bind.1003}"
)
@Value
(
"${error-message.carrier.driver.vehicle-check-bind.1003}"
)
private
String
carrierDriverVehicleCheckBind1003
;
private
String
carrierDriverVehicleCheckBind1003
;
@Value
(
"${error-message.contract.offline.goods-owner.add.1001}"
)
private
String
contractOfflineGoodsOwnerAdd1001
;
@Value
(
"${error-message.contract.offline.goods-owner.add.1002}"
)
private
String
contractOfflineGoodsOwnerAdd1002
;
}
}
src/main/java/com/esv/freight/customer/module/contract/controller/ContractOfflineGoodsOwnerController.java
0 → 100644
View file @
c58cbc5b
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.module.contract.form.ContractOfflineGoodsOwnerForm
;
import
com.esv.freight.customer.module.contract.service.ContractOfflineGoodsOwnerService
;
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.ContractOfflineGoodsOwnerController
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/19 16:06
* @version:1.0
*/
@Slf4j
@RestController
@RequestMapping
(
"/contract/offline/goodsowner"
)
@Validated
public
class
ContractOfflineGoodsOwnerController
{
private
ContractOfflineGoodsOwnerService
contractOfflineGoodsOwnerService
;
@Autowired
public
ContractOfflineGoodsOwnerController
(
ContractOfflineGoodsOwnerService
contractOfflineGoodsOwnerService
)
{
this
.
contractOfflineGoodsOwnerService
=
contractOfflineGoodsOwnerService
;
}
/**
* description 新增合同
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author Administrator
* createTime 2020/05/19 16:10
**/
@PostMapping
(
"/add"
)
public
EResponse
add
(
@RequestBody
@Validated
(
ValidatorInsert
.
class
)
ContractOfflineGoodsOwnerForm
form
)
throws
EException
{
Long
id
=
contractOfflineGoodsOwnerService
.
addOfflineContract
(
form
);
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"id"
,
id
);
return
EResponse
.
ok
(
data
);
}
}
src/main/java/com/esv/freight/customer/module/contract/dao/ContractOfflineCarrierDao.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
dao
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 线下文本合同(承运商)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
@Mapper
public
interface
ContractOfflineCarrierDao
extends
BaseMapper
<
ContractOfflineCarrierEntity
>
{
}
src/main/java/com/esv/freight/customer/module/contract/dao/ContractOfflineGoodsOwnerDao.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
dao
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineGoodsOwnerEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 线下文本合同(货主)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
@Mapper
public
interface
ContractOfflineGoodsOwnerDao
extends
BaseMapper
<
ContractOfflineGoodsOwnerEntity
>
{
}
src/main/java/com/esv/freight/customer/module/contract/dto/ContractOfflineGoodsOwnerDto.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
dto
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.dto.ContractOfflineGoodsOwnerDto
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/19 14:16
* @version:1.0
*/
@Data
public
class
ContractOfflineGoodsOwnerDto
{
/**
*
*/
private
Long
id
;
/**
* 租户ID
*/
private
Long
tenantId
;
/**
* 部门ID
*/
private
Long
departmentId
;
/**
* 货主帐号ID
*/
private
Long
goodsOwnerId
;
/**
* 合同编号
*/
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
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建者
*/
private
String
createUser
;
/**
* 修改者
*/
private
String
updateUser
;
/**
* 创建时间
*/
private
Long
createTime
;
/**
* 修改时间
*/
private
Long
updateTime
;
/**
* 货主类型:1-个人、2-企业
*/
private
Integer
ownerType
;
/**
* 客户名称
*/
private
String
ownerFullName
;
/**
* (个人或企业)联系人
*/
private
String
contactor
;
}
src/main/java/com/esv/freight/customer/module/contract/entity/ContractOfflineCarrierEntity.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 线下文本合同(承运商)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
@Data
@TableName
(
"contract_offline_carrier"
)
public
class
ContractOfflineCarrierEntity
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
;
/**
* 承运商帐号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-已删除
*/
@TableLogic
private
Boolean
deleted
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建者
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
String
createUser
;
/**
* 修改者
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
String
updateUser
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
/**
* 修改时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateTime
;
}
src/main/java/com/esv/freight/customer/module/contract/entity/ContractOfflineGoodsOwnerEntity.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 线下文本合同(货主)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
@Data
@TableName
(
"contract_offline_goods_owner"
)
public
class
ContractOfflineGoodsOwnerEntity
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
;
/**
* 货主帐号ID
*/
private
Long
goodsOwnerId
;
/**
* 合同编号
*/
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-已删除
*/
@TableLogic
private
Boolean
deleted
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建者
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
String
createUser
;
/**
* 修改者
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
String
updateUser
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
/**
* 修改时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateTime
;
}
src/main/java/com/esv/freight/customer/module/contract/form/ContractOfflineGoodsOwnerForm.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
form
;
import
com.esv.freight.customer.common.validator.groups.ValidatorInsert
;
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.ContractOfflineGoodsOwnerForm
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/19 14:22
* @version:1.0
*/
@Data
public
class
ContractOfflineGoodsOwnerForm
{
/**
*
*/
private
Long
id
;
/**
* 货主帐号ID
*/
@NotNull
(
message
=
"参数goodsOwnerId不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Long
goodsOwnerId
;
/**
* 合同编号
*/
@Length
(
max
=
50
,
message
=
"参数contractNumber长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数contractNumber不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
contractNumber
;
/**
* 合同名称
*/
@Length
(
max
=
50
,
message
=
"参数contractName长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数contractName不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
contractName
;
/**
* 合同类型:1-主合同、2-补充合同、3-临时合同
*/
@Range
(
min
=
1
,
max
=
3
,
message
=
"参数contractType不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotNull
(
message
=
"参数contractType不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Integer
contractType
;
/**
* 合同签订日期
*/
@Length
(
min
=
10
,
max
=
10
,
message
=
"参数signDate长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数signDate不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
signDate
;
/**
* 合同起始日期
*/
@Length
(
min
=
10
,
max
=
10
,
message
=
"参数startDate长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数startDate不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
startDate
;
/**
* 合同截止日期
*/
@Length
(
min
=
10
,
max
=
10
,
message
=
"参数endDate长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数endDate不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
endDate
;
/**
* 合同文件URL
*/
@Length
(
max
=
200
,
message
=
"参数fileUrl长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
@NotBlank
(
message
=
"参数fileUrl不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
fileUrl
;
/**
* 备注
*/
@Length
(
max
=
200
,
message
=
"参数remark长度不合法"
,
groups
=
{
ValidatorInsert
.
class
})
private
String
remark
;
@Override
public
String
toString
()
{
return
ToStringBuilder
.
reflectionToString
(
this
,
ToStringStyle
.
JSON_STYLE
);
}
}
src/main/java/com/esv/freight/customer/module/contract/service/ContractOfflineCarrierService.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity
;
/**
* 线下文本合同(承运商)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
public
interface
ContractOfflineCarrierService
extends
IService
<
ContractOfflineCarrierEntity
>
{
}
src/main/java/com/esv/freight/customer/module/contract/service/ContractOfflineGoodsOwnerService.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineGoodsOwnerEntity
;
import
com.esv.freight.customer.module.contract.form.ContractOfflineGoodsOwnerForm
;
/**
* 线下文本合同(货主)
*
* @author 黄朝斌
* @email huangchaobin@esvtek.com
* @date 2020-05-19 14:05:38
*/
public
interface
ContractOfflineGoodsOwnerService
extends
IService
<
ContractOfflineGoodsOwnerEntity
>
{
/**
* description 新增线下文本合同(货主)
* param [form]
* return java.lang.Integer
* author Administrator
* createTime 2020/05/19 14:49
**/
Long
addOfflineContract
(
ContractOfflineGoodsOwnerForm
form
);
}
src/main/java/com/esv/freight/customer/module/contract/service/impl/ContractOfflineCarrierServiceImpl.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.esv.freight.customer.module.contract.dao.ContractOfflineCarrierDao
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity
;
import
com.esv.freight.customer.module.contract.service.ContractOfflineCarrierService
;
import
org.springframework.stereotype.Service
;
@Service
(
"contractOfflineCarrierService"
)
public
class
ContractOfflineCarrierServiceImpl
extends
ServiceImpl
<
ContractOfflineCarrierDao
,
ContractOfflineCarrierEntity
>
implements
ContractOfflineCarrierService
{
}
\ No newline at end of file
src/main/java/com/esv/freight/customer/module/contract/service/impl/ContractOfflineGoodsOwnerServiceImpl.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
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.common.util.DateUtils
;
import
com.esv.freight.customer.module.contract.dao.ContractOfflineGoodsOwnerDao
;
import
com.esv.freight.customer.module.contract.entity.ContractOfflineGoodsOwnerEntity
;
import
com.esv.freight.customer.module.contract.form.ContractOfflineGoodsOwnerForm
;
import
com.esv.freight.customer.module.contract.service.ContractOfflineGoodsOwnerService
;
import
com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerAccountEntity
;
import
com.esv.freight.customer.module.goodsowner.service.GoodsOwnerAccountService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
(
"contractOfflineGoodsOwnerService"
)
public
class
ContractOfflineGoodsOwnerServiceImpl
extends
ServiceImpl
<
ContractOfflineGoodsOwnerDao
,
ContractOfflineGoodsOwnerEntity
>
implements
ContractOfflineGoodsOwnerService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
GoodsOwnerAccountService
goodsOwnerAccountService
;
@Autowired
public
ContractOfflineGoodsOwnerServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
GoodsOwnerAccountService
goodsOwnerAccountService
)
{
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
goodsOwnerAccountService
=
goodsOwnerAccountService
;
}
@Override
public
Long
addOfflineContract
(
ContractOfflineGoodsOwnerForm
form
)
{
// 1:校验
GoodsOwnerAccountEntity
goodsOwnerAccountEntity
=
goodsOwnerAccountService
.
getAccountRecordById
(
form
.
getGoodsOwnerId
());
if
(
null
==
goodsOwnerAccountEntity
)
{
throw
new
EException
(
1001
,
errorMessageComponent
.
getContractOfflineGoodsOwnerAdd1001
());
}
int
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
ContractOfflineGoodsOwnerEntity
>()
.
eq
(
ContractOfflineGoodsOwnerEntity:
:
getGoodsOwnerId
,
form
.
getGoodsOwnerId
())
.
eq
(
ContractOfflineGoodsOwnerEntity:
:
getContractNumber
,
form
.
getContractNumber
()));
if
(
0
<
count
)
{
throw
new
EException
(
1002
,
errorMessageComponent
.
getContractOfflineGoodsOwnerAdd1002
());
}
// 2:新增记录
ContractOfflineGoodsOwnerEntity
contractOfflineGoodsOwnerEntity
=
new
ContractOfflineGoodsOwnerEntity
();
BeanUtils
.
copyProperties
(
form
,
contractOfflineGoodsOwnerEntity
);
contractOfflineGoodsOwnerEntity
.
setSignDate
(
DateUtils
.
parse
(
form
.
getSignDate
(),
DateUtils
.
DATE_FORMAT3
));
contractOfflineGoodsOwnerEntity
.
setStartDate
(
DateUtils
.
parse
(
form
.
getStartDate
(),
DateUtils
.
DATE_FORMAT3
));
contractOfflineGoodsOwnerEntity
.
setEndDate
(
DateUtils
.
parse
(
form
.
getEndDate
(),
DateUtils
.
DATE_FORMAT3
));
this
.
baseMapper
.
insert
(
contractOfflineGoodsOwnerEntity
);
return
contractOfflineGoodsOwnerEntity
.
getId
();
}
}
\ No newline at end of file
src/main/java/com/esv/freight/customer/module/contract/vo/ContractOfflineGoodsOwnerVO.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
vo
;
import
lombok.Data
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.vo.ContractOfflineGoodsOwnerVO
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/19 14:24
* @version:1.0
*/
@Data
public
class
ContractOfflineGoodsOwnerVO
{
/**
*
*/
private
Long
id
;
/**
* 货主帐号ID
*/
private
Long
goodsOwnerId
;
/**
* 合同编号
*/
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
ownerName
;
}
src/main/java/com/esv/freight/customer/module/goodsowner/controller/GoodsOwnerController.java
View file @
c58cbc5b
...
@@ -19,7 +19,7 @@ import com.esv.freight.customer.module.goodsowner.entity.AuditHistoryEntity;
...
@@ -19,7 +19,7 @@ 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.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
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.AccountQueryForm
;
import
com.esv.freight.customer.module.goodsowner.service.AccountService
;
import
com.esv.freight.customer.module.goodsowner.service.
GoodsOwner
AccountService
;
import
com.esv.freight.customer.module.goodsowner.validator.groups.*
;
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.AccountInfoVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AuditHistoryVO
;
import
com.esv.freight.customer.module.goodsowner.vo.AuditHistoryVO
;
...
@@ -51,15 +51,15 @@ import java.util.List;
...
@@ -51,15 +51,15 @@ import java.util.List;
@Validated
@Validated
public
class
GoodsOwnerController
{
public
class
GoodsOwnerController
{
private
AccountService
a
ccountService
;
private
GoodsOwnerAccountService
goodsOwnerA
ccountService
;
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
private
PasswordComponent
passwordComponent
;
private
PasswordComponent
passwordComponent
;
@Autowired
@Autowired
public
GoodsOwnerController
(
AccountService
a
ccountService
,
ErrorMessageComponent
errorMessageComponent
,
PasswordComponent
passwordComponent
)
{
public
GoodsOwnerController
(
GoodsOwnerAccountService
goodsOwnerA
ccountService
,
ErrorMessageComponent
errorMessageComponent
,
PasswordComponent
passwordComponent
)
{
this
.
accountService
=
a
ccountService
;
this
.
goodsOwnerAccountService
=
goodsOwnerA
ccountService
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
passwordComponent
=
passwordComponent
;
this
.
passwordComponent
=
passwordComponent
;
}
}
...
@@ -85,7 +85,7 @@ public class GoodsOwnerController {
...
@@ -85,7 +85,7 @@ public class GoodsOwnerController {
}
}
/****************************** 参数校验 ******************************/
/****************************** 参数校验 ******************************/
return
EResponse
.
ok
(
a
ccountService
.
createAccountByManager
(
form
));
return
EResponse
.
ok
(
goodsOwnerA
ccountService
.
createAccountByManager
(
form
));
}
}
/**
/**
...
@@ -104,7 +104,7 @@ public class GoodsOwnerController {
...
@@ -104,7 +104,7 @@ public class GoodsOwnerController {
}
}
/****************************** 参数校验 ******************************/
/****************************** 参数校验 ******************************/
a
ccountService
.
updateAccountInfo
(
form
);
goodsOwnerA
ccountService
.
updateAccountInfo
(
form
);
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
@@ -117,7 +117,7 @@ public class GoodsOwnerController {
...
@@ -117,7 +117,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/block"
)
@PostMapping
(
"/block"
)
public
EResponse
blockAccount
(
@RequestBody
@Validated
(
ValidatorBlock
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
blockAccount
(
@RequestBody
@Validated
(
ValidatorBlock
.
class
)
AccountForm
form
)
throws
EException
{
a
ccountService
.
blockAccount
(
form
.
getId
());
goodsOwnerA
ccountService
.
blockAccount
(
form
.
getId
());
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
@@ -130,7 +130,7 @@ public class GoodsOwnerController {
...
@@ -130,7 +130,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/unblock"
)
@PostMapping
(
"/unblock"
)
public
EResponse
unblockAccount
(
@RequestBody
@Validated
(
ValidatorUnblock
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
unblockAccount
(
@RequestBody
@Validated
(
ValidatorUnblock
.
class
)
AccountForm
form
)
throws
EException
{
a
ccountService
.
unblockAccount
(
form
.
getId
());
goodsOwnerA
ccountService
.
unblockAccount
(
form
.
getId
());
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
@@ -150,7 +150,7 @@ public class GoodsOwnerController {
...
@@ -150,7 +150,7 @@ public class GoodsOwnerController {
}
}
/****************************** 参数校验 ******************************/
/****************************** 参数校验 ******************************/
a
ccountService
.
auditAccount
(
form
);
goodsOwnerA
ccountService
.
auditAccount
(
form
);
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
@@ -164,7 +164,7 @@ public class GoodsOwnerController {
...
@@ -164,7 +164,7 @@ public class GoodsOwnerController {
@PostMapping
(
"/audit/history"
)
@PostMapping
(
"/audit/history"
)
public
EResponse
getAccountAuditHistory
(
@RequestBody
@Validated
(
ValidatorAuditHistory
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
getAccountAuditHistory
(
@RequestBody
@Validated
(
ValidatorAuditHistory
.
class
)
AccountForm
form
)
throws
EException
{
// 查询审核历史
// 查询审核历史
List
<
AuditHistoryEntity
>
auditHistoryEntityList
=
a
ccountService
.
getAuditHistory
(
form
.
getId
());
List
<
AuditHistoryEntity
>
auditHistoryEntityList
=
goodsOwnerA
ccountService
.
getAuditHistory
(
form
.
getId
());
// 数据转换
// 数据转换
List
<
AuditHistoryVO
>
auditHistoryVOList
=
new
ArrayList
<>();
List
<
AuditHistoryVO
>
auditHistoryVOList
=
new
ArrayList
<>();
...
@@ -193,7 +193,7 @@ public class GoodsOwnerController {
...
@@ -193,7 +193,7 @@ public class GoodsOwnerController {
}
}
/****************************** 参数校验 ******************************/
/****************************** 参数校验 ******************************/
AccountInfoDto
accountInfoDto
=
a
ccountService
.
getAccountInfo
(
form
);
AccountInfoDto
accountInfoDto
=
goodsOwnerA
ccountService
.
getAccountInfo
(
form
);
// 查询结果处理
// 查询结果处理
if
(
null
!=
form
.
getId
())
{
if
(
null
!=
form
.
getId
())
{
if
(
null
==
accountInfoDto
)
{
if
(
null
==
accountInfoDto
)
{
...
@@ -221,7 +221,7 @@ public class GoodsOwnerController {
...
@@ -221,7 +221,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/password/check"
)
@PostMapping
(
"/password/check"
)
public
EResponse
checkAccountPwd
(
@RequestBody
@Validated
(
ValidatorPasswordCheck
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
checkAccountPwd
(
@RequestBody
@Validated
(
ValidatorPasswordCheck
.
class
)
AccountForm
form
)
throws
EException
{
AccountInfoDto
accountInfoDto
=
a
ccountService
.
getAccountInfo
(
form
);
AccountInfoDto
accountInfoDto
=
goodsOwnerA
ccountService
.
getAccountInfo
(
form
);
// 校验帐号是否存在
// 校验帐号是否存在
if
(
null
==
accountInfoDto
)
{
if
(
null
==
accountInfoDto
)
{
throw
new
EException
(
1001
,
errorMessageComponent
.
getGoodsOwnerAccountPasswordCheck1001
());
throw
new
EException
(
1001
,
errorMessageComponent
.
getGoodsOwnerAccountPasswordCheck1001
());
...
@@ -245,7 +245,7 @@ public class GoodsOwnerController {
...
@@ -245,7 +245,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/password/reset"
)
@PostMapping
(
"/password/reset"
)
public
EResponse
resetAccountPwd
(
@RequestBody
@Validated
(
ValidatorPasswordReset
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
resetAccountPwd
(
@RequestBody
@Validated
(
ValidatorPasswordReset
.
class
)
AccountForm
form
)
throws
EException
{
a
ccountService
.
resetAccountPwd
(
form
);
goodsOwnerA
ccountService
.
resetAccountPwd
(
form
);
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
@@ -258,7 +258,7 @@ public class GoodsOwnerController {
...
@@ -258,7 +258,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/register"
)
@PostMapping
(
"/register"
)
public
EResponse
accountRegister
(
@RequestBody
@Validated
(
ValidatorRegister
.
class
)
AccountForm
form
)
throws
EException
{
public
EResponse
accountRegister
(
@RequestBody
@Validated
(
ValidatorRegister
.
class
)
AccountForm
form
)
throws
EException
{
Long
id
=
a
ccountService
.
registerAccount
(
form
.
getAccount
());
Long
id
=
goodsOwnerA
ccountService
.
registerAccount
(
form
.
getAccount
());
JSONObject
data
=
new
JSONObject
();
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"id"
,
id
);
data
.
put
(
"id"
,
id
);
return
EResponse
.
ok
(
data
);
return
EResponse
.
ok
(
data
);
...
@@ -273,7 +273,7 @@ public class GoodsOwnerController {
...
@@ -273,7 +273,7 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
EResponse
getAccountList
(
@RequestBody
@Validated
(
ValidatorList
.
class
)
AccountQueryForm
form
)
throws
EException
{
public
EResponse
getAccountList
(
@RequestBody
@Validated
(
ValidatorList
.
class
)
AccountQueryForm
form
)
throws
EException
{
PageResultVO
pageResult
=
a
ccountService
.
selectAccountInfoList
(
form
);
PageResultVO
pageResult
=
goodsOwnerA
ccountService
.
selectAccountInfoList
(
form
);
return
EResponse
.
ok
(
pageResult
);
return
EResponse
.
ok
(
pageResult
);
}
}
...
@@ -286,6 +286,6 @@ public class GoodsOwnerController {
...
@@ -286,6 +286,6 @@ public class GoodsOwnerController {
**/
**/
@PostMapping
(
"/getAllAvailable"
)
@PostMapping
(
"/getAllAvailable"
)
public
EResponse
getAllAvailable
()
throws
EException
{
public
EResponse
getAllAvailable
()
throws
EException
{
return
EResponse
.
ok
(
a
ccountService
.
selectAllAvailableAccount
());
return
EResponse
.
ok
(
goodsOwnerA
ccountService
.
selectAllAvailableAccount
());
}
}
}
}
src/main/java/com/esv/freight/customer/module/goodsowner/dao/AccountDao.java
View file @
c58cbc5b
...
@@ -3,7 +3,7 @@ package com.esv.freight.customer.module.goodsowner.dao;
...
@@ -3,7 +3,7 @@ package com.esv.freight.customer.module.goodsowner.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.esv.freight.customer.module.goodsowner.dto.AccountInfoDto
;
import
com.esv.freight.customer.module.goodsowner.dto.AccountInfoDto
;
import
com.esv.freight.customer.module.goodsowner.entity.AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.form.AccountQueryForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountQueryForm
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -17,7 +17,7 @@ import java.util.List;
...
@@ -17,7 +17,7 @@ import java.util.List;
* @date 2020-04-17 13:54:57
* @date 2020-04-17 13:54:57
*/
*/
@Mapper
@Mapper
public
interface
AccountDao
extends
BaseMapper
<
AccountEntity
>
{
public
interface
AccountDao
extends
BaseMapper
<
GoodsOwner
AccountEntity
>
{
/**
/**
* description 通过帐号id获取帐号信息
* description 通过帐号id获取帐号信息
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/entity/AccountEntity.java
→
src/main/java/com/esv/freight/customer/module/goodsowner/entity/
GoodsOwner
AccountEntity.java
View file @
c58cbc5b
...
@@ -18,7 +18,7 @@ import java.util.Date;
...
@@ -18,7 +18,7 @@ import java.util.Date;
*/
*/
@Data
@Data
@TableName
(
"goods_owner_account"
)
@TableName
(
"goods_owner_account"
)
public
class
AccountEntity
implements
Serializable
{
public
class
GoodsOwner
AccountEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5500989619988830120L
;
private
static
final
long
serialVersionUID
=
5500989619988830120L
;
/**
/**
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/AccountService.java
→
src/main/java/com/esv/freight/customer/module/goodsowner/service/
GoodsOwner
AccountService.java
View file @
c58cbc5b
...
@@ -3,7 +3,7 @@ package com.esv.freight.customer.module.goodsowner.service;
...
@@ -3,7 +3,7 @@ package com.esv.freight.customer.module.goodsowner.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.common.vo.PageResultVO
;
import
com.esv.freight.customer.module.goodsowner.dto.AccountInfoDto
;
import
com.esv.freight.customer.module.goodsowner.dto.AccountInfoDto
;
import
com.esv.freight.customer.module.goodsowner.entity.AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.AuditHistoryEntity
;
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.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
...
@@ -19,25 +19,25 @@ import java.util.List;
...
@@ -19,25 +19,25 @@ import java.util.List;
* @email huangchaobin@esvtek.com
* @email huangchaobin@esvtek.com
* @date 2020-04-17 13:54:57
* @date 2020-04-17 13:54:57
*/
*/
public
interface
AccountService
extends
IService
<
AccountEntity
>
{
public
interface
GoodsOwnerAccountService
extends
IService
<
GoodsOwner
AccountEntity
>
{
/**
/**
* description 通过帐号查询帐号记录
* description 通过帐号查询帐号记录
* param [account]
* param [account]
* return com.esv.freight.customer.module.goodsowner.entity.AccountEntity
* return com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity
* author Administrator
* author Administrator
* createTime 2020/04/17 15:46
* createTime 2020/04/17 15:46
**/
**/
AccountEntity
getAccountRecordByAccount
(
String
account
);
GoodsOwner
AccountEntity
getAccountRecordByAccount
(
String
account
);
/**
/**
* description 通过ID查询帐号记录
* description 通过ID查询帐号记录
* param [id]
* param [id]
* return com.esv.freight.customer.module.goodsowner.entity.AccountEntity
* return com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity
* author Administrator
* author Administrator
* createTime 2020/04/17 15:46
* createTime 2020/04/17 15:46
**/
**/
AccountEntity
getAccountRecordById
(
Long
id
);
GoodsOwner
AccountEntity
getAccountRecordById
(
Long
id
);
/**
/**
* description 通过管理平台创建帐号
* description 通过管理平台创建帐号
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/AccountAndAddressServiceIpml.java
View file @
c58cbc5b
...
@@ -10,7 +10,7 @@ import com.esv.freight.customer.module.goodsowner.entity.ReceiveAddressEntity;
...
@@ -10,7 +10,7 @@ import com.esv.freight.customer.module.goodsowner.entity.ReceiveAddressEntity;
import
com.esv.freight.customer.module.goodsowner.form.AccountAndAddressForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountAndAddressForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.service.AccountAndAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.AccountAndAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.AccountService
;
import
com.esv.freight.customer.module.goodsowner.service.
GoodsOwner
AccountService
;
import
com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.AccountAndAddressVO
;
import
com.esv.freight.customer.module.goodsowner.vo.account4address.AccountAndAddressVO
;
...
@@ -35,17 +35,17 @@ public class AccountAndAddressServiceIpml implements AccountAndAddressService {
...
@@ -35,17 +35,17 @@ public class AccountAndAddressServiceIpml implements AccountAndAddressService {
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
private
AccountService
a
ccountService
;
private
GoodsOwnerAccountService
goodsOwnerA
ccountService
;
private
DeliveryAddressService
deliveryAddressService
;
private
DeliveryAddressService
deliveryAddressService
;
private
ReceiveAddressService
receiveAddressService
;
private
ReceiveAddressService
receiveAddressService
;
@Autowired
@Autowired
public
AccountAndAddressServiceIpml
(
ErrorMessageComponent
errorMessageComponent
,
AccountService
a
ccountService
,
public
AccountAndAddressServiceIpml
(
ErrorMessageComponent
errorMessageComponent
,
GoodsOwnerAccountService
goodsOwnerA
ccountService
,
DeliveryAddressService
deliveryAddressService
,
ReceiveAddressService
receiveAddressService
)
{
DeliveryAddressService
deliveryAddressService
,
ReceiveAddressService
receiveAddressService
)
{
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
accountService
=
a
ccountService
;
this
.
goodsOwnerAccountService
=
goodsOwnerA
ccountService
;
this
.
deliveryAddressService
=
deliveryAddressService
;
this
.
deliveryAddressService
=
deliveryAddressService
;
this
.
receiveAddressService
=
receiveAddressService
;
this
.
receiveAddressService
=
receiveAddressService
;
}
}
...
@@ -55,7 +55,7 @@ public class AccountAndAddressServiceIpml implements AccountAndAddressService {
...
@@ -55,7 +55,7 @@ public class AccountAndAddressServiceIpml implements AccountAndAddressService {
// 1.校验货主ID是否有效
// 1.校验货主ID是否有效
AccountForm
accountForm
=
new
AccountForm
();
AccountForm
accountForm
=
new
AccountForm
();
accountForm
.
setId
(
form
.
getOwnerId
());
accountForm
.
setId
(
form
.
getOwnerId
());
AccountInfoDto
accountInfoDto
=
this
.
a
ccountService
.
getAccountInfo
(
accountForm
);
AccountInfoDto
accountInfoDto
=
this
.
goodsOwnerA
ccountService
.
getAccountInfo
(
accountForm
);
if
(
null
==
accountInfoDto
)
{
if
(
null
==
accountInfoDto
)
{
throw
new
EException
(
1001
,
errorMessageComponent
.
getGoodsOwnerExtAccountAddress1001
());
throw
new
EException
(
1001
,
errorMessageComponent
.
getGoodsOwnerExtAccountAddress1001
());
}
}
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/AccountServiceImpl.java
→
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/
GoodsOwner
AccountServiceImpl.java
View file @
c58cbc5b
This diff is collapsed.
Click to expand it.
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/RegularlyRouteServiceImpl.java
View file @
c58cbc5b
...
@@ -13,14 +13,14 @@ import com.esv.freight.customer.feign.FeignBaseService;
...
@@ -13,14 +13,14 @@ import com.esv.freight.customer.feign.FeignBaseService;
import
com.esv.freight.customer.module.goodsowner.GoodsOwnerConstants
;
import
com.esv.freight.customer.module.goodsowner.GoodsOwnerConstants
;
import
com.esv.freight.customer.module.goodsowner.dao.RegularlyRouteDao
;
import
com.esv.freight.customer.module.goodsowner.dao.RegularlyRouteDao
;
import
com.esv.freight.customer.module.goodsowner.dto.RouteDetailDto
;
import
com.esv.freight.customer.module.goodsowner.dto.RouteDetailDto
;
import
com.esv.freight.customer.module.goodsowner.entity.AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.DeliveryAddressEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.DeliveryAddressEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.ReceiveAddressEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.ReceiveAddressEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.RegularlyRouteEntity
;
import
com.esv.freight.customer.module.goodsowner.entity.RegularlyRouteEntity
;
import
com.esv.freight.customer.module.goodsowner.form.DeleteAddressForm
;
import
com.esv.freight.customer.module.goodsowner.form.DeleteAddressForm
;
import
com.esv.freight.customer.module.goodsowner.form.RegularlyRouteForm
;
import
com.esv.freight.customer.module.goodsowner.form.RegularlyRouteForm
;
import
com.esv.freight.customer.module.goodsowner.form.RegularlyRouteListForm
;
import
com.esv.freight.customer.module.goodsowner.form.RegularlyRouteListForm
;
import
com.esv.freight.customer.module.goodsowner.service.AccountService
;
import
com.esv.freight.customer.module.goodsowner.service.
GoodsOwner
AccountService
;
import
com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.DeliveryAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.ReceiveAddressService
;
import
com.esv.freight.customer.module.goodsowner.service.RegularlyRouteService
;
import
com.esv.freight.customer.module.goodsowner.service.RegularlyRouteService
;
...
@@ -43,7 +43,7 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
...
@@ -43,7 +43,7 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
private
FeignBaseService
feignBaseService
;
private
FeignBaseService
feignBaseService
;
private
AccountService
a
ccountService
;
private
GoodsOwnerAccountService
goodsOwnerA
ccountService
;
private
DeliveryAddressService
deliveryAddressService
;
private
DeliveryAddressService
deliveryAddressService
;
...
@@ -51,10 +51,10 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
...
@@ -51,10 +51,10 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
@Autowired
@Autowired
public
RegularlyRouteServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
FeignBaseService
feignBaseService
,
public
RegularlyRouteServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
FeignBaseService
feignBaseService
,
AccountService
a
ccountService
,
DeliveryAddressService
deliveryAddressService
,
ReceiveAddressService
receiveAddressService
)
{
GoodsOwnerAccountService
goodsOwnerA
ccountService
,
DeliveryAddressService
deliveryAddressService
,
ReceiveAddressService
receiveAddressService
)
{
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
feignBaseService
=
feignBaseService
;
this
.
feignBaseService
=
feignBaseService
;
this
.
accountService
=
a
ccountService
;
this
.
goodsOwnerAccountService
=
goodsOwnerA
ccountService
;
this
.
deliveryAddressService
=
deliveryAddressService
;
this
.
deliveryAddressService
=
deliveryAddressService
;
this
.
receiveAddressService
=
receiveAddressService
;
this
.
receiveAddressService
=
receiveAddressService
;
}
}
...
@@ -68,8 +68,8 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
...
@@ -68,8 +68,8 @@ public class RegularlyRouteServiceImpl extends ServiceImpl<RegularlyRouteDao, Re
}
}
// 2.校验获取ID是否有效
// 2.校验获取ID是否有效
AccountEntity
accountEntity
=
this
.
a
ccountService
.
getById
(
form
.
getOwnerId
());
GoodsOwnerAccountEntity
goodsOwnerAccountEntity
=
this
.
goodsOwnerA
ccountService
.
getById
(
form
.
getOwnerId
());
if
(
null
==
a
ccountEntity
)
{
if
(
null
==
goodsOwnerA
ccountEntity
)
{
throw
new
EException
(
1002
,
errorMessageComponent
.
getGoodsOwnerRegularlyRouteAdd1002
());
throw
new
EException
(
1002
,
errorMessageComponent
.
getGoodsOwnerRegularlyRouteAdd1002
());
}
}
...
...
src/main/java/com/esv/freight/customer/module/vehicle/controller/VehicleController.java
View file @
c58cbc5b
...
@@ -10,7 +10,6 @@ import com.esv.freight.customer.common.validator.groups.ValidatorInsert;
...
@@ -10,7 +10,6 @@ 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.ValidatorList
;
import
com.esv.freight.customer.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.customer.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.customer.module.carrier.CarrierConstants
;
import
com.esv.freight.customer.module.carrier.CarrierConstants
;
import
com.esv.freight.customer.module.carrier.service.CarrierInfoService
;
import
com.esv.freight.customer.module.vehicle.VehicleConstants
;
import
com.esv.freight.customer.module.vehicle.VehicleConstants
;
import
com.esv.freight.customer.module.vehicle.dto.VehicleDetailDto
;
import
com.esv.freight.customer.module.vehicle.dto.VehicleDetailDto
;
import
com.esv.freight.customer.module.vehicle.entity.VehicleAuditHistoryEntity
;
import
com.esv.freight.customer.module.vehicle.entity.VehicleAuditHistoryEntity
;
...
@@ -59,15 +58,12 @@ public class VehicleController {
...
@@ -59,15 +58,12 @@ public class VehicleController {
private
VehicleAuditHistoryService
vehicleAuditHistoryService
;
private
VehicleAuditHistoryService
vehicleAuditHistoryService
;
private
CarrierInfoService
carrierInfoService
;
@Autowired
@Autowired
public
VehicleController
(
ErrorMessageComponent
errorMessageComponent
,
VehicleService
vehicleService
,
public
VehicleController
(
ErrorMessageComponent
errorMessageComponent
,
VehicleService
vehicleService
,
VehicleAuditHistoryService
vehicleAuditHistoryService
,
CarrierInfoService
carrierInfoService
)
{
VehicleAuditHistoryService
vehicleAuditHistoryService
)
{
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
vehicleService
=
vehicleService
;
this
.
vehicleService
=
vehicleService
;
this
.
vehicleAuditHistoryService
=
vehicleAuditHistoryService
;
this
.
vehicleAuditHistoryService
=
vehicleAuditHistoryService
;
this
.
carrierInfoService
=
carrierInfoService
;
}
}
/**
/**
...
...
src/main/resources/application-dev.yml
View file @
c58cbc5b
...
@@ -218,3 +218,9 @@ error-message:
...
@@ -218,3 +218,9 @@ error-message:
1001
:
司机与车辆未绑定
1001
:
司机与车辆未绑定
1002
:
无效的司机ID
1002
:
无效的司机ID
1003
:
无效的车辆ID
1003
:
无效的车辆ID
contract
:
offline
:
goods-owner
:
add
:
1001
:
无效的货主ID
1002
:
合同编号已存在
\ No newline at end of file
src/main/resources/mapper/contract/ContractOfflineCarrierDao.xml
0 → 100644
View file @
c58cbc5b
<?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.contract.dao.ContractOfflineCarrierDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.esv.freight.customer.module.contract.entity.ContractOfflineCarrierEntity"
id=
"contractOfflineCarrierMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"tenantId"
column=
"tenant_id"
/>
<result
property=
"departmentId"
column=
"department_id"
/>
<result
property=
"carrierId"
column=
"carrier_id"
/>
<result
property=
"contractNumber"
column=
"contract_number"
/>
<result
property=
"contractName"
column=
"contract_name"
/>
<result
property=
"contractType"
column=
"contract_type"
/>
<result
property=
"signDate"
column=
"sign_date"
/>
<result
property=
"startDate"
column=
"start_date"
/>
<result
property=
"endDate"
column=
"end_date"
/>
<result
property=
"fileUrl"
column=
"file_url"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/contract/ContractOfflineGoodsOwnerDao.xml
0 → 100644
View file @
c58cbc5b
<?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.contract.dao.ContractOfflineGoodsOwnerDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.esv.freight.customer.module.contract.entity.ContractOfflineGoodsOwnerEntity"
id=
"contractOfflineGoodsOwnerMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"tenantId"
column=
"tenant_id"
/>
<result
property=
"departmentId"
column=
"department_id"
/>
<result
property=
"goodsOwnerId"
column=
"goods_owner_id"
/>
<result
property=
"contractNumber"
column=
"contract_number"
/>
<result
property=
"contractName"
column=
"contract_name"
/>
<result
property=
"contractType"
column=
"contract_type"
/>
<result
property=
"signDate"
column=
"sign_date"
/>
<result
property=
"startDate"
column=
"start_date"
/>
<result
property=
"endDate"
column=
"end_date"
/>
<result
property=
"fileUrl"
column=
"file_url"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/goodsowner/AccountDao.xml
View file @
c58cbc5b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<mapper
namespace=
"com.esv.freight.customer.module.goodsowner.dao.AccountDao"
>
<mapper
namespace=
"com.esv.freight.customer.module.goodsowner.dao.AccountDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.esv.freight.customer.module.goodsowner.entity.AccountEntity"
id=
"accountMap"
>
<resultMap
type=
"com.esv.freight.customer.module.goodsowner.entity.
GoodsOwner
AccountEntity"
id=
"accountMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"tenantId"
column=
"tenant_id"
/>
<result
property=
"tenantId"
column=
"tenant_id"
/>
<result
property=
"departmentId"
column=
"department_id"
/>
<result
property=
"departmentId"
column=
"department_id"
/>
...
...
src/test/java/com/esv/freight/customer/module/contract/controller/ContractOfflineGoodsOwnerControllerTest.java
0 → 100644
View file @
c58cbc5b
package
com
.
esv
.
freight
.
customer
.
module
.
contract
.
controller
;
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.contract.form.ContractOfflineGoodsOwnerForm
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Assert
;
import
org.junit.FixMethodOrder
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.MethodSorters
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.annotation.Rollback
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MvcResult
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.result.MockMvcResultHandlers
;
import
org.springframework.test.web.servlet.result.MockMvcResultMatchers
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.contract.controller.ContractOfflineGoodsOwnerControllerTest
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/05/19 16:11
* @version:1.0
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@Slf4j
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
@Transactional
@Rollback
(
false
)
public
class
ContractOfflineGoodsOwnerControllerTest
extends
BaseTestController
{
/**
* 新增合同
**/
@Test
public
void
a1_add_success_test
()
throws
Exception
{
String
url
=
"/contract/offline/goodsowner/add"
;
// 构造数据
ContractOfflineGoodsOwnerForm
form
=
new
ContractOfflineGoodsOwnerForm
();
form
.
setGoodsOwnerId
(
4L
);
form
.
setContractNumber
(
"202005191001"
);
form
.
setContractName
(
"黄朝斌测试有限公司01-运输业务框架合同"
);
form
.
setContractType
(
1
);
// 合同类型:1-主合同、2-补充合同、3-临时合同
form
.
setSignDate
(
"2020-05-19"
);
form
.
setStartDate
(
"2020-05-20"
);
form
.
setEndDate
(
"2021-05-19"
);
form
.
setFileUrl
(
"http://192.168.31.248:8082/file/download/direct/6FB1DC2B9961B3AFFDE452A479766F6C2E5B46D3534376A8C40ACB4987D0602B85D1E1739AF93D52A92AEB7ACABB90DC"
);
form
.
setRemark
(
"这是一条测试数据"
);
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"
));
Assert
.
assertTrue
(
result
.
getJSONObject
(
"data"
).
containsKey
(
"id"
));
}
/**
* 新增合同:无效的货主ID
**/
@Test
public
void
a2_add_wrong_goodsOwnerId_failure_test
()
throws
Exception
{
String
url
=
"/contract/offline/goodsowner/add"
;
// 构造数据
ContractOfflineGoodsOwnerForm
form
=
new
ContractOfflineGoodsOwnerForm
();
form
.
setGoodsOwnerId
(
99999L
);
form
.
setContractNumber
(
"202005191001"
);
form
.
setContractName
(
"黄朝斌测试有限公司01-运输业务框架合同"
);
form
.
setContractType
(
1
);
// 合同类型:1-主合同、2-补充合同、3-临时合同
form
.
setSignDate
(
"2020-05-19"
);
form
.
setStartDate
(
"2020-05-20"
);
form
.
setEndDate
(
"2021-05-19"
);
form
.
setFileUrl
(
"http://192.168.31.248:8082/file/download/direct/6FB1DC2B9961B3AFFDE452A479766F6C2E5B46D3534376A8C40ACB4987D0602B85D1E1739AF93D52A92AEB7ACABB90DC"
);
form
.
setRemark
(
"这是一条测试数据"
);
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"
));
}
/**
* 新增合同:合同编号已存在
**/
@Test
public
void
a3_add_wrong_contractNumber_failure_test
()
throws
Exception
{
String
url
=
"/contract/offline/goodsowner/add"
;
// 构造数据
ContractOfflineGoodsOwnerForm
form
=
new
ContractOfflineGoodsOwnerForm
();
form
.
setGoodsOwnerId
(
4L
);
form
.
setContractNumber
(
"202005191001"
);
form
.
setContractName
(
"黄朝斌测试有限公司01-运输业务框架合同"
);
form
.
setContractType
(
1
);
// 合同类型:1-主合同、2-补充合同、3-临时合同
form
.
setSignDate
(
"2020-05-19"
);
form
.
setStartDate
(
"2020-05-20"
);
form
.
setEndDate
(
"2021-05-19"
);
form
.
setFileUrl
(
"http://192.168.31.248:8082/file/download/direct/6FB1DC2B9961B3AFFDE452A479766F6C2E5B46D3534376A8C40ACB4987D0602B85D1E1739AF93D52A92AEB7ACABB90DC"
);
form
.
setRemark
(
"这是一条测试数据"
);
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
(
1002
,
result
.
getIntValue
(
"code"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment