|
@@ -290,7 +290,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
|
|
|
// 获取结算零工
|
|
|
GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
|
|
|
- if (gigTypeEnum == null){
|
|
|
+ if (gigTypeEnum == null) {
|
|
|
return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
|
|
|
}
|
|
|
|
|
@@ -298,7 +298,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
.eq(SysUserSub::getUserId, user.getUserId())
|
|
|
);
|
|
|
|
|
|
- if (userSub == null){
|
|
|
+ if (userSub == null) {
|
|
|
return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
|
|
|
}
|
|
|
|
|
@@ -445,7 +445,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
// 获取结算零工
|
|
|
GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
|
|
|
|
|
|
- if (gigTypeEnum == null){
|
|
|
+ if (gigTypeEnum == null) {
|
|
|
return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
|
|
|
}
|
|
|
|
|
@@ -453,7 +453,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
.eq(SysUserSub::getUserId, user.getUserId())
|
|
|
);
|
|
|
|
|
|
- if (userSub == null){
|
|
|
+ if (userSub == null) {
|
|
|
return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
|
|
|
}
|
|
|
|
|
@@ -698,7 +698,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
for (WmScorePackageSettleNote note : notes) {
|
|
|
note.setInvoiceType(input.getInvoiceCategory());
|
|
|
// note.setCategoryName(input.toCategoryName());
|
|
|
- note.setCategoryName(input.getCategoryName());
|
|
|
+ note.setCategoryName(StrUtil.isNotBlank(input.getCategoryName()) ? input.getCategoryName() : note.getCategoryName());
|
|
|
note.setSubToGigTime(LocalDateTime.now());
|
|
|
}
|
|
|
noteService.updateBatchById(notes);
|
|
@@ -754,13 +754,13 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
|
|
|
String.valueOf(operator.getDeptId()), "settle", String.valueOf(operator.getId()));
|
|
|
log.warn("获取结算token:{}", tokenResult.getBody());
|
|
|
- if (!JSONUtil.isJson(tokenResult.getBody())){
|
|
|
+ if (!JSONUtil.isJson(tokenResult.getBody())) {
|
|
|
return R.failed("获取结算token失败");
|
|
|
}
|
|
|
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(tokenResult.getBody());
|
|
|
|
|
|
- if (jsonObject.getInt("code") != 0 || StrUtil.isBlank(jsonObject.getStr("data"))){
|
|
|
+ if (jsonObject.getInt("code") != 0 || StrUtil.isBlank(jsonObject.getStr("data"))) {
|
|
|
return R.failed("获取结算token失败");
|
|
|
}
|
|
|
|
|
@@ -801,7 +801,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
HttpEntity<String> result = new RestTemplate().exchange(gigSettleUrl, HttpMethod.POST, new HttpEntity<>(params, headers), String.class);
|
|
|
log.warn("阿拉丁结算: {}", result.getBody());
|
|
|
- if (!JSONUtil.isJson(result.getBody())){
|
|
|
+ if (!JSONUtil.isJson(result.getBody())) {
|
|
|
return R.failed("结算失败");
|
|
|
}
|
|
|
JSONObject settelObj = JSONUtil.parseObj(result.getBody());
|
|
@@ -829,7 +829,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
|
|
|
|
|
|
}
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
log.warn("自由职家结算提交失败: {}", note.getSettleNo());
|
|
|
note.setUpdateTime(LocalDateTime.now());
|
|
|
note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
|
|
@@ -1095,7 +1095,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
.eq(SysUserSub::getUserId, sysUser.getUserId())
|
|
|
);
|
|
|
|
|
|
- if (userSub == null){
|
|
|
+ if (userSub == null) {
|
|
|
log.info("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
return R.failed("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
}
|
|
@@ -1248,7 +1248,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
.eq(SysUserSub::getUserId, sysUser.getUserId())
|
|
|
);
|
|
|
|
|
|
- if (userSub == null){
|
|
|
+ if (userSub == null) {
|
|
|
log.info("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
return R.failed("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
}
|