Commit 17d8cebc authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.5' into MVP1.7.5

parents cedbb902 bf5d08ad
......@@ -105,7 +105,7 @@ public class MSetttleCustomerUserController {
*/
@Inner
@PostMapping("/inner/getCustomerUserMap")
public Map<String,String> getCustomerUserMap(@RequestBody List<Integer> userIdList) {
public Map<String,String> getCustomerUserMap(@RequestBody List<String> userIdList) {
return mSetttleCustomerUserService.getCustomerUser(userIdList);
}
/**
......
......@@ -27,7 +27,7 @@ public interface MSetttleCustomerUserMapper extends BaseMapper<MSetttleCustomerU
IPage<MSetttleCustomerUser> getMSetttleCustomerUserPage(Page<MSetttleCustomerUser> page, @Param("mSetttleCustomerUser") MSetttleCustomerUser mSetttleCustomerUser);
List<MSetttleCustomerUserVo> getCustomerUser(@Param("userIdList")List<Integer> userIdList);
List<MSetttleCustomerUserVo> getCustomerUser(@Param("userIdList")List<String> userIdList);
Integer getCustomerCount();
......
......@@ -26,7 +26,7 @@ public interface MSetttleCustomerUserService extends IService<MSetttleCustomerUs
IPage<MSetttleCustomerUser> getMSetttleCustomerUserPage(Page<MSetttleCustomerUser> page, MSetttleCustomerUser mSetttleCustomerUser);
Map<String,String> getCustomerUser(List<Integer> userIdList);
Map<String,String> getCustomerUser(List<String> userIdList);
Integer getCustomerCount();
......
......@@ -40,7 +40,7 @@ public class MSetttleCustomerUserServiceImpl extends ServiceImpl<MSetttleCustome
}
@Override
public Map<String, String> getCustomerUser(List<Integer> userIdList) {
public Map<String, String> getCustomerUser(List<String> userIdList) {
Map<String,String> map = new HashMap<>();
List<MSetttleCustomerUserVo> list = baseMapper.getCustomerUser(userIdList);
if(Common.isNotNull(list)){
......
......@@ -39,6 +39,6 @@ spring:
template-loader-path: classpath:/templates/
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: kFG3_g_Ce0bpZt6mByx524
corpsecret: R0nKkvsY-oF41fuQvUXZ-kFG3_g_Ce0bpZt6mByx524
agentid: 1000009
authUrl: https://wx.worfu.com/auth/oauth/wxLogin
\ No newline at end of file
authUrl: https://wx.worfu.com/yifu-auth/method/oauth/wxLogin
\ No newline at end of file
......@@ -102,6 +102,10 @@ public interface CacheConstants {
**/
String EVERYDAY_SALARY_FORM_CODE = "everyday_salary_form_code";
String EVERYDAY_UNBUY_FORM_CODE = "everyday_unbuy_form_code";
String EVERYDAY_UNBUYINFO_FORM_CODE = "everyday_unbuyinfo_form_code";
/**
* @Description: 派单申请编码
* @Author: fxj
......@@ -178,6 +182,8 @@ public interface CacheConstants {
String EMP_ADD_LOCK ="emp_add_lock";
String UNBUY_ADD_LOCK ="unbuy_add_lock";
String SALARY_ACCOUNT_EXPORT_LOCK ="salary_account_export_lock";
String SALARY_ACCOUNT_AUDIT_EXPORT_LOCK ="salary_account_audit_export_lock";
......
......@@ -343,7 +343,7 @@ public interface CommonConstants {
String NO_DATA_TO_HANDLE = "无数据可操作!";
String DATA_TOO_LARGER_FOR_DOWN = "下载数据超出100M,请重选择下载条件!";
String DATA_TOO_LARGER_FOR_DOWN = "下载数据超出100M,请重选择下载条件!";
String PLEASE_LOG_IN = "请登录!";
......
......@@ -22,6 +22,8 @@ public class ResultConstants {
public static final String NO_GETLOCK_DATA = "当前用户操作处理中,请稍后重试!";
public static final String NO_GETLOCK_DATA_SEARCH = "多用户同时请求中,请稍后重试!";
public static final String NO_UNBUY_GETLOCK_DATA = "当前项目编码和不购买类型的数据处理中,请稍后重试!";
public static final String NO_ID = "操作失败,id不能为空!";
public static final String FILE_UPLOADING_DATA = "附件排队上传中,请稍后重试!";
public static final String FILE_DOWN_LOAD_DATA = "导出排队下载中,请稍后重试!";
......
......@@ -124,11 +124,11 @@ public class WxConfig {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.info("发企业微信===请求:{}", gson.toJson(requestMap));
log.debug("发企业微信===请求:{}", gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.info("发企业微信===返回:{}",JSON.toJSONString(responseEntity));
log.error("发企业微信===返回:{}",JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
......
......@@ -45,6 +45,10 @@ public interface TInsuranceUnpurchaseApplyMapper extends BaseMapper<TInsuranceUn
String getMaxInusuranceDetailCode();
long selectSocialCount(@Param("deptNo") String deptNo,@Param("cardNo") String cardNo,@Param("id") String id);
long selectArchCount(@Param("deptNo") String deptNo,@Param("cardNo") String cardNo,@Param("id") String id);
/**
* 待审核分页查询
* @param page 分页信息
......
......@@ -210,7 +210,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
* @return R<List<SysUser>>
**/
public R<List<SysUser>> getAuditUserList(String entityId, YifuUser loginUser, String departId, String processType, String auditType,
String reason, String entityName, T entity, Class<T> clazz) {
String reason, String entityName, T entity) {
// 获取审批流程完整配置
ProcessVo processVo = this.getProcessVoByType(processType);
if (Common.isEmpty(processVo)) {
......
......@@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
......@@ -20,10 +22,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TInsuranceUnpurchaseApplyMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
......@@ -35,6 +39,9 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -70,10 +77,16 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource
private TSalaryAttaService tSalaryAttaService;
@Resource
@Lazy
private TAuditRecordService auditRecordService;
@Resource
private OSSUtil ossUtil;
@Resource
@Lazy
private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
// 缓存信息
@Resource
private CacheManager cacheManager;
/**
* 含风险项目不购买申请表简单分页查询
......@@ -153,112 +166,128 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Override
public R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
YifuUser user = SecurityUtils.getUser();
//字段长度校验
if (Common.isNotNull(tInsuranceUnpurchaseApply.getReasonInfo()) && tInsuranceUnpurchaseApply.getReasonInfo().length() > 200) {
return R.failed("原因说明不能超过两百个字符");
// 获取redis分布式事务锁
String key = CacheConstants.UNBUY_ADD_LOCK + CommonConstants.DOWN_LINE_STRING
+ tInsuranceUnpurchaseApply.getDeptNo() + CommonConstants.DOWN_LINE_STRING
+ tInsuranceUnpurchaseApply.getReasonType();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_UNBUY_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
//申请编号
String applyNo = getCode();
//获取明细当日最大申请编号
String applyDetail = baseMapper.getMaxInusuranceDetailCode();
//暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getId())) {
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
baseMapper.insert(tInsuranceUnpurchaseApply);
}else {
baseMapper.updateById(tInsuranceUnpurchaseApply);
}
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
}
List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList()) && !tInsuranceUnpurchaseApply.getPersonList().isEmpty()) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personList.add(person);
}
personService.saveBatch(personList);
if (Common.isNotNull(requestId)) {
//字段长度校验
if (Common.isNotNull(tInsuranceUnpurchaseApply.getReasonInfo()) && tInsuranceUnpurchaseApply.getReasonInfo().length() > 200) {
return R.failed("原因说明不能超过两百个字符");
}
return R.ok();
} else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
tInsuranceUnpurchaseApply.setUnbuyNum(String.valueOf(personList.size()));
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply,user);
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getApplyNo())) {
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
}
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
//暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getId())) {
// tInsuranceUnpurchaseApply.setApplyNo(applyNo);
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
} else {
baseMapper.updateById(tInsuranceUnpurchaseApply);
}
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
}
List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList()) && !tInsuranceUnpurchaseApply.getPersonList().isEmpty()) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail, vo.getRowIndex()));
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
personList.add(person);
}
personService.saveBatch(personInfoList);
personService.saveBatch(personList);
}
return R.ok();
} else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
//申请编号
String applyNo = getCode();
tInsuranceUnpurchaseApply.setUnbuyNum(String.valueOf(personList.size()));
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
if (Common.isEmpty(tInsuranceUnpurchaseApply.getApplyNo())) {
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply, user);
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
createProcessLog(tInsuranceUnpurchaseApply, user);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getCodeDetail());
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply, user);
tInsuranceUnpurchaseApply.setCreateTimeZc(LocalDateTime.now());
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
createProcessLog(tInsuranceUnpurchaseApply, user);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getCodeDetail());
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
}
} else {
return R.failed(personList);
}
} else {
return R.failed(personList);
}
return R.ok(tInsuranceUnpurchaseApply);
}else {
return R.failed(ResultConstants.NO_UNBUY_GETLOCK_DATA);
}
} catch (Exception e) {
e.printStackTrace();
return R.failed("系统异常,保存、更新失败!");
} finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
return R.ok(tInsuranceUnpurchaseApply);
}
@Override
......@@ -288,8 +317,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
Map<String,String> sameCheckMap = new HashMap<>();
TInsuranceUnpurchaseApply exitApply;
TInsuranceUnpurchasePerson exit;
List<TInsuranceUnpurchasePersonAddVo> personList = tInsuranceUnpurchaseApply.getPersonList();
if (Common.isNotNull(personList) && !personList.isEmpty()) {
R<Boolean> flagSocial;
......@@ -305,23 +333,16 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":存在重复的身份证+姓名信息,可删除后再提交");
}
exitApply = baseMapper.selectOne(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchaseApply::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TInsuranceUnpurchaseApply::getReasonType, tInsuranceUnpurchaseApply.getReasonType())
.ne(TInsuranceUnpurchaseApply::getStatus, CommonConstants.ZERO_STRING)
.ne(TInsuranceUnpurchaseApply::getId, tInsuranceUnpurchaseApply.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exitApply)) {
exit = personService.getOne(Wrappers.<TInsuranceUnpurchasePerson>query().lambda()
.eq(TInsuranceUnpurchasePerson::getParnetId, exitApply.getId())
.eq(TInsuranceUnpurchasePerson::getEmpIdcardNo, vo.getEmpIdcardNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
continue;
}
long count = 0;
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getReasonType())) {
count = baseMapper.selectSocialCount(tInsuranceUnpurchaseApply.getDeptNo(), vo.getEmpIdcardNo(), tInsuranceUnpurchaseApply.getId());
} else {
count = baseMapper.selectArchCount(tInsuranceUnpurchaseApply.getDeptNo(), vo.getEmpIdcardNo(), tInsuranceUnpurchaseApply.getId());
}
if (count > 0) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
continue;
}
//人员有项目档案且未减项拦截
TInsuranceUnpurchasePersonCardVo cardVo = new TInsuranceUnpurchasePersonCardVo();
......@@ -346,6 +367,37 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return personList;
}
private void createProcessLog(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,YifuUser user){
if (Common.isNotNull(tInsuranceUnpurchaseApply.getAuditFlag()) &&
tInsuranceUnpurchaseApply.getAuditFlag().equals(CommonConstants.ZERO_STRING)) {
// 记录提交审核日志
TAuditRecord submitAuditRecord = new TAuditRecord();
submitAuditRecord.setDomainId(tInsuranceUnpurchaseApply.getId());
submitAuditRecord.setFlowId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setNodeId(CommonConstants.EMPTY_STRING);
submitAuditRecord.setApprovalMan(user.getId());
submitAuditRecord.setApprovalManName(user.getNickname());
// 审批结果为“提交”
submitAuditRecord.setApprovalResult(CommonConstants.dingleDigitStrArray[3]);
submitAuditRecord.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG);
submitAuditRecord.setApprovalTime(LocalDateTime.now());
// 审核记录标识 1当前审核记录
submitAuditRecord.setPreFlag(CommonConstants.ONE_STRING);
submitAuditRecord.setSubmitMan(user.getId());
submitAuditRecord.setSubmitManName(user.getNickname());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord.setAuditType(CommonConstants.ZERO_STRING);
submitAuditRecord.setCreateTime(LocalDateTime.now());
// 提交节点名称
submitAuditRecord.setNodeName("提交即审核通过");
submitAuditRecord.setSubmitCreateTime(LocalDateTime.now());
submitAuditRecord.setEntityName(tInsuranceUnpurchaseApply.getApplyNo());
auditRecordService.save(submitAuditRecord);
}
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
private void setValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,YifuUser user) {
if (Common.isNotNull(tInsuranceUnpurchaseApply.getDeptNo())) {
......@@ -365,7 +417,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
private void initValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,TInsuranceUnpurchasePerson person) {
person.setCreateTime(tInsuranceUnpurchaseApply.getCreateTimeZc());
person.setParnetId(tInsuranceUnpurchaseApply.getId());
person.setApplyNo(tInsuranceUnpurchaseApply.getApplyNo());
person.setDeptId(tInsuranceUnpurchaseApply.getDeptId());
......@@ -400,27 +451,56 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
//获取申请编码
public String getCode() {
public synchronized String getCode() {
String nowDay = DateUtil.getThisDay();
int nowNums = 1;
int nowNums;
String empCode = null;
try {
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_UNBUY_FORM_CODE);
if (cache != null) {
try {
Object nowNumObj = cache.get(nowDay);
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} else {
empCode = baseMapper.getMaxInusuranceCode();
nowNums = Integer.parseInt(empCode) + 1;
}
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请时出错:" + empCode);
nowNums = 1;
}
cache.put(nowDay, nowNums);
} else {
empCode = baseMapper.getMaxInusuranceCode();
nowNums = Integer.parseInt(empCode) + 1;
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请时出错:" + empCode);
}
return "SXBGM" + nowDay + this.getThreeNum(String.valueOf(nowNums));
}
//获取申请编码
public String getDetailCode(String empCode,String row) {
public synchronized String getCodeDetail() {
String nowDay = DateUtil.getThisDay();
int nowNums = 1;
try {
nowNums = Integer.parseInt(empCode) + Integer.parseInt(row);
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请明细时出错:" + empCode);
int nowNums;
String empCode = null;
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_UNBUYINFO_FORM_CODE);
if (cache != null) {
try {
Object nowNumObj = cache.get(nowDay);
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} else {
empCode = baseMapper.getMaxInusuranceDetailCode();
nowNums = Integer.parseInt(empCode) + 1;
}
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请明细时出错:" + empCode);
nowNums = 1;
}
cache.put(nowDay, nowNums);
} else {
empCode = baseMapper.getMaxInusuranceDetailCode();
nowNums = Integer.parseInt(empCode) + 1;
}
return "SXBGMMX" + nowDay + this.getFiveNum(String.valueOf(nowNums));
}
......@@ -534,7 +614,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
// 传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
R<List<SysUser>> auditUserListR = tInsuranceUnpurchaseApplyAuditProcess.getAuditUserList(id, user, entity.getCreateUserDeptId(),
CommonConstants.ONE_STRING, CommonConstants.ZERO_STRING,
"", entity.getApplyNo(), entity, TInsuranceUnpurchaseApply.class);
"", entity.getApplyNo(), entity);
if (auditUserListR == null || auditUserListR.getCode() != CommonConstants.SUCCESS || auditUserListR.getData() == null) {
throw new CheckedException("获取审批人失败,请联系管理员");
}
......
......@@ -27,6 +27,10 @@ spring:
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: R0nKkvsY-oF41fuQvUXZ-kFG3_g_Ce0bpZt6mByx524
agentid: 1000009
authUrl: https://wx.worfu.com/yifu-auth/method/oauth/wxLogin
......@@ -118,6 +118,34 @@
</where>
</select>
<select id="selectSocialCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_insurance_unpurchase_apply a
inner join t_insurance_unpurchase_person b
on a.id = b.PARNET_ID
where
1=1 and a.DELETE_FLAG = '0' and a.reason_type = '1' and a.status in ('2','3')
<if test="id != null ">
AND a.id != #{id}
</if>
and a.DEPT_NO = #{deptNo} and b.EMP_IDCARD_NO = #{cardNo}
</select>
<select id="selectArchCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_insurance_unpurchase_apply a
inner join t_insurance_unpurchase_person b
on a.id = b.PARNET_ID
where
1=1 and a.DELETE_FLAG = '0' and a.reason_type = '2' and a.status in ('2','3') and b.SALARY_NUM = 0
<if test="id != null ">
AND a.id != #{id}
</if>
and a.DEPT_NO = #{deptNo} and b.EMP_IDCARD_NO = #{cardNo}
</select>
<!-- tInsuranceUnpurchaseApply简单分页查询 -->
<select id="getTInsuranceUnpurchaseApplyExportList" resultMap="tInsuranceUnpurchaseApplyExportMap">
SELECT
......@@ -126,7 +154,7 @@
a.DEPT_NO,
a.CREATE_NAME,
a.CREATE_USER_DEPT_NAME,
a.CREATE_TIME,
a.CREATE_TIME_ZC as CREATE_TIME,
a.AUDIT_USER,
if(a.REASON_TYPE = '1','已购买社保','人员已离职') REASON_TYPE,
CASE WHEN a.STATUS=0 THEN "草稿"
......
......@@ -130,7 +130,31 @@
<!--tInsuranceUnpurchasePerson简单分页查询-->
<select id="getTInsuranceUnpurchasePersonPage" resultMap="tInsuranceUnpurchasePersonMap">
SELECT
<include refid="Base_Column_List"/>
a.ID,
a.PARNET_ID,
a.EMP_NAME,
a.EMP_IDCARD_NO,
a.POST,
a.APPLY_NO_DETAIL,
a.DEPT_ID,
a.DEPT_NO,
a.DEPT_NAME,
a.CREATE_USER_DEPT_ID,
a.CREATE_USER_DEPT_NAME,
a.REASON_TYPE,
a.REASON_INFO,
a.APPLY_NO,
if(a.REASON_TYPE = '2','',a.SOCIAL_STATUS) SOCIAL_STATUS,
a.SALARY_NUM,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.HAS_CONTAIN_RISKS,
a.NEW_LINE,
a.DIVISION,
a.INSURANCE_FLAG
FROM t_insurance_unpurchase_person a
<where>
1=1 and STATUS = '3'
......@@ -162,7 +186,7 @@
EMP_NAME,
EMP_IDCARD_NO,
if(a.REASON_TYPE = '1','已购买社保','人员已离职') REASON_TYPE,
if(a.SOCIAL_STATUS='0','在保','不在保') SOCIAL_STATUS,
if(a.REASON_TYPE = '2','',if(a.SOCIAL_STATUS='0','在保','不在保')) SOCIAL_STATUS,
SALARY_NUM,
CREATE_NAME,
CREATE_TIME
......
......@@ -454,7 +454,8 @@ public class UserController {
@Inner
@PostMapping(value = {"/inner/getSimpleUserByLoginName"})
public SysUser getSimpleUserByLoginName(@RequestBody String loginName) {
return userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername,loginName).last(CommonConstants.LAST_ONE_SQL));
return userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername,loginName)
.eq(SysUser::getDelFlag,CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment