|
@@ -283,6 +283,7 @@ public class UserLogic {
|
|
|
*
|
|
|
* @param user
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void userTypeInit(User user) {
|
|
|
String mobile = user.getMobile();
|
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
@@ -300,6 +301,17 @@ public class UserLogic {
|
|
|
for (UserWait userWait : list) {
|
|
|
user.setWorkerNumber(userWait.getWorkerNumber());
|
|
|
user.setNickName(userWait.getName());
|
|
|
+
|
|
|
+ user.setWorkerNumber(userWait.getWorkerNumber());
|
|
|
+ user.setBankAccount(userWait.getBrank());
|
|
|
+ user.setIdCard(userWait.getIdcard());
|
|
|
+ user.setIdCardStartTime(userWait.getIdCardStartTime());
|
|
|
+ user.setIdCardEndTime(userWait.getIdCardEndTime());
|
|
|
+ user.setNumber(userWait.getNumber());
|
|
|
+ user.setStartTime(userWait.getStartTime());
|
|
|
+ user.setEndTime(userWait.getEndTime());
|
|
|
+ user.setHightExamineTime(userWait.getHightExamineTime());
|
|
|
+
|
|
|
if (StringUtils.isBlank(user.getIdCard())) {
|
|
|
user.setIdCard(userWait.getIdcard());
|
|
|
}
|
|
@@ -330,6 +342,92 @@ public class UserLogic {
|
|
|
websitUser.setBankAccount(userWait.getBankAccount());
|
|
|
websitUser.setWorkerNumber(userWait.getWorkerNumber());
|
|
|
websitUser.insert();
|
|
|
+
|
|
|
+ //新意外增保险
|
|
|
+ if (!StringUtil.isEmpty(userWait.getPolicyOrder())){
|
|
|
+ WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
+ workerPolicy.setWorkerId(websitUser.getWorkerNumber());
|
|
|
+ workerPolicy.setType("LINE");
|
|
|
+ workerPolicy.setOrderId(userWait.getPolicyOrder());
|
|
|
+ workerPolicy.setPolicyName(userWait.getPolicyName());
|
|
|
+ workerPolicy.setCompany(userWait.getCompany());
|
|
|
+ workerPolicy.setPolicyOrder(userWait.getPolicyOrder());
|
|
|
+ workerPolicy.setPolicyType("AC");
|
|
|
+ workerPolicy.setStartTime(userWait.getPolicyStartTime());
|
|
|
+ workerPolicy.setEndTime(userWait.getPolicyEndTime());
|
|
|
+ workerPolicy.setWebsitUserId(websitUser.getId());
|
|
|
+ workerPolicy.setWebsitId(websitUser.getWebsitId());
|
|
|
+ workerPolicy.setWebsitName(websitUser.getWebsitName());
|
|
|
+ workerPolicy.setWorkerName(user.getNickName());
|
|
|
+
|
|
|
+ if (new Date().after(userWait.getPolicyStartTime()) && new Date().before(userWait.getPolicyEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.BZZ.getKey());
|
|
|
+ else if (new Date().after(userWait.getPolicyEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.YSX.getKey());
|
|
|
+ else {
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.DSX.getKey());
|
|
|
+ }
|
|
|
+ workerPolicy.insert();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //新增雇主保险
|
|
|
+ if (!StringUtil.isEmpty(userWait.getEmPolicyOrder())){
|
|
|
+ WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
+ workerPolicy.setWorkerId(websitUser.getWorkerNumber());
|
|
|
+ workerPolicy.setType("LINE");
|
|
|
+ workerPolicy.setOrderId(userWait.getEmPolicyOrder());
|
|
|
+ workerPolicy.setPolicyName(userWait.getPolicyName());
|
|
|
+ workerPolicy.setCompany(userWait.getCompany());
|
|
|
+ workerPolicy.setPolicyOrder(userWait.getEmPolicyOrder());
|
|
|
+ workerPolicy.setPolicyType("EM");
|
|
|
+ workerPolicy.setStartTime(userWait.getEmPolicyStartTime());
|
|
|
+ workerPolicy.setEndTime(userWait.getEmPolicyEndTime());
|
|
|
+ workerPolicy.setWebsitUserId(websitUser.getId());
|
|
|
+ workerPolicy.setWebsitId(websitUser.getWebsitId());
|
|
|
+ workerPolicy.setWebsitName(websitUser.getWebsitName());
|
|
|
+ workerPolicy.setWorkerName(user.getNickName());
|
|
|
+
|
|
|
+ if (new Date().after(workerPolicy.getStartTime()) && new Date().before(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.BZZ.getKey());
|
|
|
+ else if (new Date().after(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.YSX.getKey());
|
|
|
+ else {
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.DSX.getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ workerPolicy.insert();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //新增工伤保险
|
|
|
+ if (!StringUtil.isEmpty(userWait.getInPolicyOrder())){
|
|
|
+ WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
+ workerPolicy.setWorkerId(websitUser.getWorkerNumber());
|
|
|
+ workerPolicy.setType("LINE");
|
|
|
+ workerPolicy.setOrderId(userWait.getInPolicyOrder());
|
|
|
+ workerPolicy.setPolicyName(userWait.getPolicyName());
|
|
|
+ workerPolicy.setCompany(userWait.getCompany());
|
|
|
+ workerPolicy.setPolicyOrder(userWait.getInPolicyOrder());
|
|
|
+ workerPolicy.setPolicyType("IN");
|
|
|
+ workerPolicy.setStartTime(userWait.getInPolicyStartTime());
|
|
|
+ workerPolicy.setEndTime(userWait.getInPolicyEndTime());
|
|
|
+ workerPolicy.setWebsitUserId(websitUser.getId());
|
|
|
+ workerPolicy.setWebsitId(websitUser.getWebsitId());
|
|
|
+ workerPolicy.setWebsitName(websitUser.getWebsitName());
|
|
|
+ workerPolicy.setWorkerName(user.getNickName());
|
|
|
+
|
|
|
+ if (new Date().after(workerPolicy.getStartTime()) && new Date().before(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.BZZ.getKey());
|
|
|
+ else if (new Date().after(workerPolicy.getEndTime()))
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.YSX.getKey());
|
|
|
+ else {
|
|
|
+ workerPolicy.setStatus(PolicyOrderStutasEnum.DSX.getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ workerPolicy.insert();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1143,7 +1241,7 @@ public class UserLogic {
|
|
|
}
|
|
|
//入驻师傅
|
|
|
if (type.equals(UserTypeEnum.WORKER.getKey())) {
|
|
|
- if (StringUtils.isAnyBlank(idCard, idCardImg)) {
|
|
|
+ if (StringUtils.isAnyBlank(idCard)) {
|
|
|
throw new RemoteServiceException("缺乏必填的参数");
|
|
|
}
|
|
|
if (StringUtils.isBlank(websitId)) {
|
|
@@ -1164,8 +1262,11 @@ public class UserLogic {
|
|
|
|
|
|
websitUserService.lambdaUpdate().eq(WebsitUser::getUserId, user.getUserId()).eq(WebsitUser::getWebsitId, websitId).remove();
|
|
|
|
|
|
+ AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
|
|
|
+
|
|
|
WebsitUser websitUser = new WebsitUser();
|
|
|
websitUser.setWebsitId(websitId);
|
|
|
+ websitUser.setWebsitName(adminWebsit.getName());
|
|
|
websitUser.setUserId(user.getUserId());
|
|
|
websitUser.setCompanyWechatId(user.getCompanyWechatId());
|
|
|
websitUser.setCompanyWechatName(user.getCompanyName());
|
|
@@ -1173,6 +1274,15 @@ public class UserLogic {
|
|
|
websitUser.setExamineStatus(OrderExamineEnum.WAIT.toString());
|
|
|
websitUser.setBankAccount(bankAccount);
|
|
|
websitUser.insert();
|
|
|
+
|
|
|
+ userApplyBean.getWorkerPolicy().setWebsitUserId(websitUser.getId());
|
|
|
+ userApplyBean.getWorkerPolicy().setWebsitId(websitUser.getWebsitId());
|
|
|
+ userApplyBean.getWorkerPolicy().setWebsitName(websitUser.getWebsitName());
|
|
|
+ userApplyBean.getWorkerPolicy().setWorkerName(user.getNickName());
|
|
|
+ userApplyBean.getWorkerPolicy().setType("AC");
|
|
|
+ userApplyBean.getWorkerPolicy().setStatus("YSX");
|
|
|
+ userApplyBean.getWorkerPolicy().setWorkerId(websitUser.getWorkerNumber());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(idCard) && idCard.length() != 18) {
|
|
@@ -1183,9 +1293,17 @@ public class UserLogic {
|
|
|
user.setIdCardImg(idCardImg);
|
|
|
//user.setWebsitId(websitId);
|
|
|
user.setApplyType(type);
|
|
|
+ user.setBankAccount(bankAccount);
|
|
|
user.setApplyWebsitId(websitId);
|
|
|
user.setApplyTime(new Date());
|
|
|
user.setIsBuy(userApplyBean.getIsBuy());
|
|
|
+
|
|
|
+ user.setIdCardEndTime(userApplyBean.getIdCardEndTime());
|
|
|
+ user.setIdCardStartTime(userApplyBean.getIdCardStartTime());
|
|
|
+ user.setNumber(userApplyBean.getNumber());
|
|
|
+ user.setStartTime(userApplyBean.getStartTime());
|
|
|
+ user.setEndTime(userApplyBean.getEndTime());
|
|
|
+ user.setHightExamineTime(userApplyBean.getHightExamineTime());
|
|
|
user.updateById();
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(workerImgs)) {
|
|
@@ -1196,7 +1314,9 @@ public class UserLogic {
|
|
|
workerImgService.saveBatch(workerImgs);
|
|
|
}
|
|
|
|
|
|
- userApplyBean.getWorkerPolicy().insert();
|
|
|
+ if (userApplyBean.getWorkerPolicy()!= null) {
|
|
|
+ userApplyBean.getWorkerPolicy().insert();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|