Commit fc217373 authored by huyuchen's avatar huyuchen

huych-含风险项目商险不购买申请提交

parent 17d8cebc
...@@ -118,4 +118,15 @@ public class UpmsDaprUtils { ...@@ -118,4 +118,15 @@ public class UpmsDaprUtils {
} }
return allUserVoR; return allUserVoR;
} }
/**
* @Author huyc
* @Description 判断部门是否属于分公司
* @Date 10:38 2025/1/20
* @Param
* @return
**/
public R<Boolean> selectExitDeptCompany(String deptName) {
return HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/user/inner/selectExitDeptCompany", deptName, Boolean.class, SecurityConstants.FROM_IN);
}
} }
...@@ -21,6 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -21,6 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; 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.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; 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.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply; import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
...@@ -77,6 +78,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance ...@@ -77,6 +78,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource @Resource
private TSalaryAttaService tSalaryAttaService; private TSalaryAttaService tSalaryAttaService;
@Resource @Resource
private UpmsDaprUtils upmsDaprUtils;
@Resource
@Lazy @Lazy
private TAuditRecordService auditRecordService; private TAuditRecordService auditRecordService;
@Resource @Resource
...@@ -215,6 +218,11 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance ...@@ -215,6 +218,11 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
} }
return R.ok(); return R.ok();
} else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) { } else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
TInsuranceUnpurchaseApply apply = baseMapper.selectById(tInsuranceUnpurchaseApply.getId());
if (Common.isNotNull(apply) && (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getStatus()) ||
CommonConstants.THREE_STRING.equals(tInsuranceUnpurchaseApply.getStatus()))) {
return R.failed("当前数据已被提交!");
}
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交; //校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!” //校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
...@@ -401,8 +409,14 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance ...@@ -401,8 +409,14 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
//申请人是否属于子分公司和该项目是否有审批通过记录赋值 //申请人是否属于子分公司和该项目是否有审批通过记录赋值
private void setValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,YifuUser user) { private void setValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,YifuUser user) {
if (Common.isNotNull(tInsuranceUnpurchaseApply.getDeptNo())) { if (Common.isNotNull(tInsuranceUnpurchaseApply.getDeptNo())) {
List<String> deptList = CommonConstants.deptList; String deptName = user.getDeptName();
tInsuranceUnpurchaseApply.setCompanyFlag(deptList.stream().noneMatch(e -> e.equals(user.getDeptName())) ? CommonConstants.ONE_STRING : CommonConstants.ZERO_STRING);
R<Boolean> booleanR = upmsDaprUtils.selectExitDeptCompany(deptName);
if (Common.isEmpty(booleanR) || Boolean.FALSE.equals(booleanR.getData())) {
tInsuranceUnpurchaseApply.setCompanyFlag(CommonConstants.ONE_STRING);
} else {
tInsuranceUnpurchaseApply.setCompanyFlag(CommonConstants.ZERO_STRING);
}
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getReasonType())) { if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getReasonType())) {
long count = baseMapper.selectCount(Wrappers.<TInsuranceUnpurchaseApply>query().lambda() long count = baseMapper.selectCount(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo()) .eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
......
...@@ -617,4 +617,10 @@ public class UserController { ...@@ -617,4 +617,10 @@ public class UserController {
} }
return naVo; return naVo;
} }
@Inner
@PostMapping(value = {"/inner/selectExitDeptCompany"})
public Boolean selectExitDeptCompany(@RequestBody String deptName) {
return userService.selectExitDeptCompany(deptName);
}
} }
...@@ -81,4 +81,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -81,4 +81,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
List<SysUser> getUserByRoleIdForCrm(@Param("departId") Integer departId, @Param("roleId") String roleId); List<SysUser> getUserByRoleIdForCrm(@Param("departId") Integer departId, @Param("roleId") String roleId);
List<SysUser> getUserManagerByUpDepartIdUp(@Param("departId") Integer departId, @Param("roleId")String roleId); List<SysUser> getUserManagerByUpDepartIdUp(@Param("departId") Integer departId, @Param("roleId")String roleId);
String selectExitDeptCompany(@Param("deptName") String deptName);
} }
...@@ -190,4 +190,6 @@ public interface SysUserService extends IService<SysUser> { ...@@ -190,4 +190,6 @@ public interface SysUserService extends IService<SysUser> {
List<SysUser> getUserManagerByUpDepartIdUp(Integer departId, String roleId); List<SysUser> getUserManagerByUpDepartIdUp(Integer departId, String roleId);
Boolean selectExitDeptCompany(String deptName);
} }
...@@ -952,4 +952,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -952,4 +952,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return baseMapper.getUserManagerByUpDepartIdUp(departId,roleId); return baseMapper.getUserManagerByUpDepartIdUp(departId,roleId);
} }
@Override
public Boolean selectExitDeptCompany(String deptName) {
String dn = baseMapper.selectExitDeptCompany(deptName);
if (Common.isEmpty(dn)) {
return false;
}
List<String> deptList = CommonConstants.deptList;
return deptList.stream().anyMatch(dn::contains);
}
} }
...@@ -379,4 +379,11 @@ ...@@ -379,4 +379,11 @@
AND approval_role_id = #{roleId} AND approval_role_id = #{roleId}
) )
</select> </select>
<select id="selectExitDeptCompany" resultType="java.lang.String">
SELECT
dept_dn
from
sys_dept where dept_name = #{deptName} limit 1
</select>
</mapper> </mapper>
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