Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 503c2be2
authored
Jan 10, 2024
by
yangxiujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改上传
1 parent
9562cedc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
201 additions
and
183 deletions
project-order/pom.xml
project-order/src/main/java/com/dituhui/pea/order/controller/FileController.java
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/resources/application.yaml
project-order/pom.xml
View file @
503c2be
...
...
@@ -141,11 +141,6 @@
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
3.17
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
project-order/src/main/java/com/dituhui/pea/order/controller/FileController.java
View file @
503c2be
...
...
@@ -101,6 +101,11 @@ public class FileController {
throw
new
BusinessException
(
"用户未登录"
);
}
FileRateDTO
rate
=
orderCreateService
.
getsuccessRate
(
token
);
if
(
rate
!=
null
&&
(
rate
.
getSuccessCount
()
==
rate
.
getTotalCount
())){
//上传成功,删除上传的进度条
orderCreateService
.
delRate
(
token
);
}
if
(
rate
==
null
)
{
rate
=
new
FileRateDTO
();
rate
.
setRate
(
"100%"
);
...
...
@@ -112,7 +117,7 @@ public class FileController {
/**
* 订单批量模版下载
*
* @param
response
* @param
*/
@GetMapping
(
value
=
"/file/downOrder"
)
public
ResponseEntity
<
byte
[]>
downOrderTemplate
()
{
...
...
@@ -127,7 +132,7 @@ public class FileController {
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
EasyExcel
.
write
(
outputStream
,
OrderInfoExcelDTO
.
class
)
//不设置字体
.registerWriteHandler(ExcelUtil.getDefaultWriteHandler())
.
registerWriteHandler
(
ExcelUtil
.
getDefaultWriteHandler
())
.
registerConverter
(
new
DateStringConverter
())
.
registerConverter
(
new
BigDecimalStringConverter
())
.
sheet
(
"工单列表"
).
doWrite
(
arrayList
);
...
...
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
View file @
503c2be
...
...
@@ -7,7 +7,7 @@ import com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
@FeignClient
(
url
=
"${SaaS.url}"
,
name
=
"saasService"
)
@FeignClient
(
url
=
"${SaaS.url
Back
}"
,
name
=
"saasService"
)
public
interface
ISaaSRemoteService
{
@PostMapping
(
"/v1/bsh/area/add"
)
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
View file @
503c2be
...
...
@@ -228,7 +228,7 @@ public class FendanServiceImpl implements FendanService {
@Override
public
Result
<
OrgTeamInfo
>
fendanToGroupCapacity
(
OrderDTO
.
OrderCreateRequest
request
,
Integer
isDate
,
LocalDate
targetDate
,
LocalTime
startTime
,
LocalTime
endTime
)
{
List
<
OrgGroupInfo
>
orgGroupTeamInfos
=
new
ArrayList
<>();
String
peaBrand
=
fixBrand
(
request
.
getBrand
()
);
String
peaBrand
=
request
.
getBrand
(
);
SkillInfoEntity
skillInfo
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
request
.
getProductType
(),
request
.
getServiceType
());
if
(
ObjectUtil
.
isNull
(
skillInfo
))
{
return
Result
.
failed
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
503c2be
...
...
@@ -137,6 +137,11 @@ public class OrderCreateServiceImpl implements OrderCreateService {
return
tokenCount
.
get
(
token
);
}
public
static
void
delRate
(
String
token
)
{
//上传成功,删除上传的进度条
tokenCount
.
remove
(
token
);
}
private
List
<
LabelValueDTO
>
getPriorities
()
{
String
[]
priorities
=
{
"紧急"
,
"正常"
};
List
<
LabelValueDTO
>
listPriorities
=
new
ArrayList
<>();
...
...
@@ -275,194 +280,206 @@ public class OrderCreateServiceImpl implements OrderCreateService {
}
fileRateDTO
.
setTotalCount
(
cachedDataList
.
size
());
tokenCount
.
put
(
token
,
fileRateDTO
);
for
(
OrderInfoExcelDTO
req
:
cachedDataList
)
{
OrderInfoEntity
byOrderId
=
orderInfoDao
.
getByOrderId
(
req
.
getOrderId
());
String
peaBrand
=
CommonUtil
.
fixBrand
(
req
.
getBrand
());
if
(
ObjectUtil
.
isNotNull
(
byOrderId
))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_EXISTS
.
getDesc
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
req
.
getType
(),
req
.
getSkill
());
if
(
ObjectUtil
.
isNull
(
skillInfoEntity
))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getDesc
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
OrderInfoEntity
entity
=
new
OrderInfoEntity
();
entity
.
setExpectTimeBegin
(
DateUtil
.
fromDate
(
req
.
getExpectBegin
()));
entity
.
setExpectTimeEnd
(
DateUtil
.
fromDate
(
req
.
getExpectEnd
()));
entity
.
setAppointmentStatus
(
OrderFlowEnum
.
INIT
.
name
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_BATCH
.
name
());
entity
.
setDt
(
entity
.
getExpectTimeBegin
().
toLocalDate
());
entity
.
setOrderId
(
req
.
getOrderId
());
FendanDTO
fendanDTO
=
new
FendanDTO
();
fendanDTO
.
setAddress
(
req
.
getDetail
());
//获取地址的信息
SaasAddressResult
saasByAddresss
=
null
;
try
{
saasByAddresss
=
saasUtils
.
getSaasByAddresss
(
fendanDTO
);
}
catch
(
Exception
e
)
{
//上传成功,删除上传的进度条
tokenCount
.
remove
(
token
);
throw
new
BusinessException
(
e
.
getMessage
());
}
entity
.
setProvince
(
saasByAddresss
.
getProvince
());
entity
.
setCity
(
saasByAddresss
.
getCity
());
entity
.
setCounty
(
saasByAddresss
.
getCounty
());
// 处理技能和标签
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
entity
.
setBeanPriority
(
req
.
getBeanPriority
());
if
(
req
.
getBeanPriority
().
equals
(
"1"
))
{
if
(!
DateUtil
.
judgeTimeIsToday
(
entity
.
getExpectTimeBegin
()))
{
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_NOW
.
name
());
try
{
for
(
OrderInfoExcelDTO
req
:
cachedDataList
)
{
OrderInfoEntity
byOrderId
=
orderInfoDao
.
getByOrderId
(
req
.
getOrderId
());
String
peaBrand
=
req
.
getBrand
();
if
(
ObjectUtil
.
isNotNull
(
byOrderId
))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_EXISTS
.
getDesc
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
}
//一家多单
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
saasByAddresss
.
getId
(),
req
.
getOrderId
());
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
//构建参数
OrderDTO
.
OrderCreateRequest
request
=
new
OrderDTO
.
OrderCreateRequest
();
request
.
setOrderId
(
req
.
getOrderId
());
request
.
setBrand
(
req
.
getBrand
());
request
.
setProductType
(
req
.
getType
());
request
.
setServiceType
(
req
.
getSkill
());
Location
location
=
new
Location
();
if
(
saasByAddresss
.
getX
()
==
null
||
saasByAddresss
.
getY
()
==
null
)
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
"地址解析失败"
);
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
location
.
setLongitude
(
saasByAddresss
.
getX
());
location
.
setLatitude
(
saasByAddresss
.
getY
());
location
.
setAddress
(
req
.
getAddress
());
location
.
setAddressId
(
saasByAddresss
.
getId
());
request
.
setLocation
(
location
);
// 分单处理
Result
<
OrgTeamInfo
>
fendanResult
=
fendanService
.
fendanToGroupCapacity
(
request
,
2
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
());
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getCode
()))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getCode
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
SkillInfoEntity
skillInfoEntity
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
peaBrand
,
req
.
getType
(),
req
.
getSkill
());
if
(
ObjectUtil
.
isNull
(
skillInfoEntity
))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getDesc
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
if
(!
fendanResult
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getCode
())
||
ObjectUtil
.
isNull
(
fendanResult
.
getResult
()))
{
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
// 处理超派
entity
.
setTranscend
(
1
);
}
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND_AND_SPECIAL
.
getCode
()))
{
// 处理超派和特殊时间
entity
.
setTranscend
(
1
);
entity
.
setIsSpecialTime
(
1
);
OrderInfoEntity
entity
=
new
OrderInfoEntity
();
entity
.
setExpectTimeBegin
(
DateUtil
.
fromDate
(
req
.
getExpectBegin
()));
entity
.
setExpectTimeEnd
(
DateUtil
.
fromDate
(
req
.
getExpectEnd
()));
entity
.
setAppointmentStatus
(
OrderFlowEnum
.
INIT
.
name
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_BATCH
.
name
());
entity
.
setDt
(
entity
.
getExpectTimeBegin
().
toLocalDate
());
entity
.
setOrderId
(
req
.
getOrderId
());
FendanDTO
fendanDTO
=
new
FendanDTO
();
fendanDTO
.
setAddress
(
req
.
getDetail
());
//获取地址的信息
SaasAddressResult
saasByAddresss
=
null
;
try
{
saasByAddresss
=
saasUtils
.
getSaasByAddresss
(
fendanDTO
);
}
catch
(
Exception
e
)
{
//上传成功,删除上传的进度条
tokenCount
.
remove
(
token
);
throw
new
BusinessException
(
e
.
getMessage
());
}
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
saasByAddresss
.
getCity
()
+
"%"
);
if
(
branchEntity
!=
null
)
{
entity
.
setOrgClusterId
(
branchEntity
.
getClusterId
());
entity
.
setOrgBranchId
(
branchEntity
.
getBranchId
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
entity
.
setProvince
(
saasByAddresss
.
getProvince
());
entity
.
setCity
(
saasByAddresss
.
getCity
());
entity
.
setCounty
(
saasByAddresss
.
getCounty
());
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
null
);
entity
.
setIsCutoff
(
cutoff
);
//发送通知分部消息
sendMsg
(
branchEntity
.
getBranchId
(),
req
.
getOrderId
(),
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
// 处理技能和标签
entity
.
setTakeTime
(
skillInfoEntity
.
getTakeTime
());
entity
.
setBeanPriority
(
req
.
getBeanPriority
());
if
(
req
.
getBeanPriority
().
equals
(
"1"
))
{
if
(!
DateUtil
.
judgeTimeIsToday
(
entity
.
getExpectTimeBegin
()))
{
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_NOW
.
name
());
}
}
}
else
{
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
entity
.
setOrgClusterId
(
teamInfo
.
getClusterId
());
entity
.
setOrgBranchId
(
teamInfo
.
getBranchId
());
entity
.
setOrgGroupId
(
teamInfo
.
getGroupId
());
entity
.
setOrgTeamId
(
teamInfo
.
getTeamId
());
//特殊时间段
Integer
special
=
CommonUtil
.
isSpecial
(
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
(),
teamInfo
.
getWorkOn
(),
teamInfo
.
getWorkOff
());
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
teamInfo
.
getWorkOff
());
// 处理cutoff 动态排班结束后创建的当日单和次日单
boolean
isTomorrow
=
DateUtil
.
judgeTimeIsisTomorrow
(
entity
.
getExpectTimeBegin
());
//次日单自动批量
if
(
isTomorrow
)
{
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_BATCH
.
name
());
//一家多单
Result
<
String
>
addMultipleOrders
=
orderInfoService
.
addMultipleOrders
(
entity
.
getDt
(),
saasByAddresss
.
getId
(),
req
.
getOrderId
());
entity
.
setMultipleOrders
(
addMultipleOrders
.
getResult
());
//构建参数
OrderDTO
.
OrderCreateRequest
request
=
new
OrderDTO
.
OrderCreateRequest
();
request
.
setOrderId
(
req
.
getOrderId
());
request
.
setBrand
(
req
.
getBrand
());
request
.
setProductType
(
req
.
getType
());
request
.
setServiceType
(
req
.
getSkill
());
Location
location
=
new
Location
();
if
(
saasByAddresss
.
getX
()
==
null
||
saasByAddresss
.
getY
()
==
null
)
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
"地址解析失败"
);
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
// 特殊时间段,当天单,cutoff需要人工处理
if
(
cutoff
==
1
||
special
==
1
)
{
//判断是否在今天cutoff之后
entity
.
setIsCutoff
(
cutoff
);
entity
.
setIsSpecialTime
(
special
);
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
//发送通知分部消息
sendMsg
(
teamInfo
.
getBranchId
(),
req
.
getOrderId
(),
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
location
.
setLongitude
(
saasByAddresss
.
getX
());
location
.
setLatitude
(
saasByAddresss
.
getY
());
location
.
setAddress
(
req
.
getAddress
());
location
.
setAddressId
(
saasByAddresss
.
getId
());
request
.
setLocation
(
location
);
// 分单处理
Result
<
OrgTeamInfo
>
fendanResult
=
null
;
try
{
fendanResult
=
fendanService
.
fendanToGroupCapacity
(
request
,
2
,
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
());
}
catch
(
Exception
e
)
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
"地址解析失败"
);
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
}
// 字段转换
entity
.
setSource
(
req
.
getSource
());
entity
.
setName
(
req
.
getName
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setBeanBrand
(
req
.
getBrand
());
entity
.
setBrand
(
peaBrand
);
entity
.
setType
(
req
.
getType
());
entity
.
setSkill
(
req
.
getSkill
());
entity
.
setFaultDescribe
(
req
.
getFaultDescribe
());
entity
.
setExpectTimeDesc
(
req
.
getExpectTimeDesc
());
// 使用期望时间来初始化计划时间,后面在指派环节更新为真正的有效的计划时间
entity
.
setPlanStartTime
(
entity
.
getExpectTimeBegin
());
entity
.
setPlanEndTime
(
entity
.
getExpectTimeEnd
());
// order_request的description字段,仅仅用于内部备注,不对外
entity
.
setApplyNote
(
req
.
getDescription
());
entity
.
setSubId
(
newSubId
(
entity
.
getOrderId
(),
entity
.
getDt
()));
entity
.
setX
(
location
.
getLongitude
().
toString
());
entity
.
setY
(
location
.
getLatitude
().
toString
());
entity
.
setAddress
(
location
.
getAddress
());
entity
.
setAddressId
(
location
.
getAddressId
());
// 默认值
// entity.setAppointmentStatus(OrderFlowEnum.INIT.name());
entity
.
setBeanStatus
(
"OPEN"
);
entity
.
setBeanSubStatus
(
""
);
entity
.
setWorkshop
(
false
);
// 记录订单和节点
orderInfoDao
.
save
(
entity
);
commonService
.
addOrderEvent
(
req
.
getOrderId
(),
""
,
req
.
getSource
(),
"API"
,
OrderEventEnum
.
createOrder
.
getEvent
(),
String
.
format
(
OrderEventEnum
.
createOrder
.
getMsg
(),
req
.
getSource
(),
"BEAN"
,
req
.
getOrderId
()),
""
);
successCount
++;
//每次上传成功更新上传进度条
fileRateDTO
.
setSuccessCount
((
fileRateDTO
.
getSuccessCount
()
==
null
?
0
:
fileRateDTO
.
getSuccessCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
try
{
Thread
.
sleep
(
1000
*
20
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getCode
()))
{
OrderInfoErrorExcelDTO
orderInfoError
=
new
OrderInfoErrorExcelDTO
();
BeanUtil
.
copyProperties
(
req
,
orderInfoError
);
orderInfoError
.
setError
(
StatusCodeEnum
.
ORDER_SKILL_NOT_EXISTS
.
getCode
());
errorList
.
add
(
orderInfoError
);
fileRateDTO
.
setErrorCount
((
fileRateDTO
.
getErrorCount
()
==
null
?
0
:
fileRateDTO
.
getErrorCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
continue
;
}
if
(
successCount
==
cachedDataList
.
size
())
{
}
if
(!
fendanResult
.
getCode
().
equals
(
ResultEnum
.
SUCCESS
.
getCode
())
||
ObjectUtil
.
isNull
(
fendanResult
.
getResult
()))
{
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND
.
getCode
()))
{
// 处理超派
entity
.
setTranscend
(
1
);
}
if
(
fendanResult
.
getCode
().
equals
(
StatusCodeEnum
.
FENDAN_IS_TRANSCEND_AND_SPECIAL
.
getCode
()))
{
// 处理超派和特殊时间
entity
.
setTranscend
(
1
);
entity
.
setIsSpecialTime
(
1
);
}
OrgBranchEntity
branchEntity
=
orgBranchDao
.
findByCitycodeListLike
(
"%"
+
saasByAddresss
.
getCity
()
+
"%"
);
if
(
branchEntity
!=
null
)
{
entity
.
setOrgClusterId
(
branchEntity
.
getClusterId
());
entity
.
setOrgBranchId
(
branchEntity
.
getBranchId
());
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
null
);
entity
.
setIsCutoff
(
cutoff
);
//发送通知分部消息
sendMsg
(
branchEntity
.
getBranchId
(),
req
.
getOrderId
(),
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
//上传成功,删除上传的进度条
}
}
else
{
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等
OrgTeamInfo
teamInfo
=
fendanResult
.
getResult
();
entity
.
setOrgClusterId
(
teamInfo
.
getClusterId
());
entity
.
setOrgBranchId
(
teamInfo
.
getBranchId
());
entity
.
setOrgGroupId
(
teamInfo
.
getGroupId
());
entity
.
setOrgTeamId
(
teamInfo
.
getTeamId
());
//特殊时间段
Integer
special
=
CommonUtil
.
isSpecial
(
entity
.
getExpectTimeBegin
().
toLocalTime
(),
entity
.
getExpectTimeEnd
().
toLocalTime
(),
teamInfo
.
getWorkOn
(),
teamInfo
.
getWorkOff
());
Integer
cutoff
=
CommonUtil
.
isCutoff
(
entity
.
getExpectTimeBegin
(),
teamInfo
.
getWorkOff
());
// 处理cutoff 动态排班结束后创建的当日单和次日单
boolean
isTomorrow
=
DateUtil
.
judgeTimeIsisTomorrow
(
entity
.
getExpectTimeBegin
());
//次日单自动批量
if
(
isTomorrow
)
{
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
AUTO_BATCH
.
name
());
}
// 特殊时间段,当天单,cutoff需要人工处理
if
(
cutoff
==
1
||
special
==
1
)
{
//判断是否在今天cutoff之后
entity
.
setIsCutoff
(
cutoff
);
entity
.
setIsSpecialTime
(
special
);
entity
.
setAppointmentMethod
(
AppointmentMethodEnum
.
MANUAL
.
name
());
//发送通知分部消息
sendMsg
(
teamInfo
.
getBranchId
(),
req
.
getOrderId
(),
entity
.
getExpectTimeBegin
().
toLocalDate
(),
entity
);
}
}
// 字段转换
entity
.
setSource
(
req
.
getSource
());
entity
.
setName
(
req
.
getName
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setBeanBrand
(
req
.
getBrand
());
entity
.
setBrand
(
peaBrand
);
entity
.
setType
(
req
.
getType
());
entity
.
setSkill
(
req
.
getSkill
());
entity
.
setFaultDescribe
(
req
.
getFaultDescribe
());
entity
.
setExpectTimeDesc
(
req
.
getExpectTimeDesc
());
// 使用期望时间来初始化计划时间,后面在指派环节更新为真正的有效的计划时间
entity
.
setPlanStartTime
(
entity
.
getExpectTimeBegin
());
entity
.
setPlanEndTime
(
entity
.
getExpectTimeEnd
());
// order_request的description字段,仅仅用于内部备注,不对外
entity
.
setApplyNote
(
req
.
getDescription
());
entity
.
setSubId
(
newSubId
(
entity
.
getOrderId
(),
entity
.
getDt
()));
entity
.
setX
(
location
.
getLongitude
().
toString
());
entity
.
setY
(
location
.
getLatitude
().
toString
());
entity
.
setAddress
(
location
.
getAddress
());
entity
.
setAddressId
(
location
.
getAddressId
());
// 默认值
// entity.setAppointmentStatus(OrderFlowEnum.INIT.name());
entity
.
setBeanStatus
(
"OPEN"
);
entity
.
setBeanSubStatus
(
""
);
entity
.
setWorkshop
(
false
);
// 记录订单和节点
orderInfoDao
.
save
(
entity
);
commonService
.
addOrderEvent
(
req
.
getOrderId
(),
""
,
req
.
getSource
(),
"API"
,
OrderEventEnum
.
createOrder
.
getEvent
(),
String
.
format
(
OrderEventEnum
.
createOrder
.
getMsg
(),
req
.
getSource
(),
"BEAN"
,
req
.
getOrderId
()),
""
);
successCount
++;
//每次上传成功更新上传进度条
fileRateDTO
.
setSuccessCount
((
fileRateDTO
.
getSuccessCount
()
==
null
?
0
:
fileRateDTO
.
getSuccessCount
()
)+
1
);
tokenCount
.
put
(
token
,
fileRateDTO
);
try
{
Thread
.
sleep
(
1000
*
5
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
catch
(
Exception
e
)
{
tokenCount
.
remove
(
token
);
throw
new
BusinessException
(
"订单上传异常"
);
}
if
(
errorList
.
size
()
>
0
)
{
tokenCount
.
remove
(
token
);
if
(
errorList
!=
null
&&
errorList
.
size
()
>
0
)
{
try
{
...
...
project-order/src/main/resources/application.yaml
View file @
503c2be
...
...
@@ -62,6 +62,7 @@ sentry:
exception-resolver-order
:
-2147483647
SaaS
:
urlBack
:
http://119.3.39.114:8034
url
:
http://119.3.39.114:8100
ak
:
216d013687ba46f5ad990e9380ec56c6
userAccount
:
1YL+MfLj/Oy70Dvbvn3mYg==
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment