Commit fe7007e7 authored by huyuchen's avatar huyuchen

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

parent 85c5657e
......@@ -8,6 +8,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
/**
* 含风险项目不购买申请表
......@@ -62,7 +63,7 @@ public class TInsuranceUnpurchaseApply extends BaseEntity {
@Schema(description = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过")
private String status;
@Schema(description ="是否含风险")
@Schema(description ="是否含风险 0 是 1 否")
private String hasContainRisks;
@Schema(description ="事业部条线")
......@@ -99,9 +100,15 @@ public class TInsuranceUnpurchaseApply extends BaseEntity {
@TableField(exist = false)
private String saveFlag;
// /**
// * 印章附件
// */
// @TableField(exist = false)
// private List<TAttaInfo> attaInfoList;
/**
* 详情就职岗位和人数
*/
@TableField(exist = false)
private Map<String,Long> personMap;
/**
* 印章附件
*/
@TableField(exist = false)
private List<TSalaryAtta> attaInfoList;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -16,6 +17,7 @@ import java.time.LocalDateTime;
* @date 2025-01-10 11:24:38
*/
@Data
@ColumnWidth(25)
public class TInsuranceUnpurchaseApplyVo implements Serializable {
/**
......@@ -67,9 +69,9 @@ public class TInsuranceUnpurchaseApplyVo implements Serializable {
@ExcelProperty("申请时间")
private LocalDateTime createTime;
@ExcelAttribute(name = "当前审核人")
@Schema(description = "当前审核人")
@ExcelProperty("当前审核人")
@ExcelAttribute(name = "当前处理人")
@Schema(description = "当前处理人")
@ExcelProperty("当前处理人")
private String auditUser;
/**
......@@ -83,9 +85,9 @@ public class TInsuranceUnpurchaseApplyVo implements Serializable {
/**
* 申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过
*/
@ExcelAttribute(name = "审状态")
@Schema(description = "审状态")
@ExcelProperty("审状态")
@ExcelAttribute(name = "审状态")
@Schema(description = "审状态")
@ExcelProperty("审状态")
private String status;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -16,6 +17,7 @@ import java.time.LocalDateTime;
* @date 2025-01-10 11:23:21
*/
@Data
@ColumnWidth(25)
public class TInsuranceUnpurchasePersonVo implements Serializable {
/**
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -40,4 +41,11 @@ public interface TInsuranceUnpurchasePersonMapper extends BaseMapper<TInsuranceU
* @return
*/
List<TInsuranceUnpurchasePersonVo> getTInsuranceUnpurchaseInfoExportList(@Param("tInsuranceUnpurchasePerson") TInsuranceUnpurchasePersonSearchVo tInsuranceUnpurchasePerson);
/**
* 含风险项目不购买申请表简单导出查询
* @param id 含风险项目不购买申请表id
* @return
*/
List<TInsuranceUnpurchasePersonAddVo> getTInsuranceUnpurchasePersonList(@Param("id") String id);
}
......@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 含风险项目不购买申请明细表
......@@ -23,4 +25,6 @@ public interface TInsuranceUnpurchasePersonService extends IService<TInsuranceUn
IPage<TInsuranceUnpurchasePerson> getTInsuranceUnpurchasePersonPage(Page<TInsuranceUnpurchasePerson> page, TInsuranceUnpurchasePersonSearchVo tInsuranceUnpurchasePerson);
void listExport(HttpServletResponse response, TInsuranceUnpurchasePersonSearchVo searchVo);
List<TInsuranceUnpurchasePersonAddVo> getTInsuranceUnpurchasePersonList(String id);
}
......@@ -13,15 +13,18 @@ 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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
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.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
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.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.service.impl.process.TInsuranceUnpurchaseApplyAuditProcess;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplyVo;
......@@ -40,12 +43,14 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 含风险项目不购买申请表
......@@ -59,13 +64,14 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource
private TInsuranceUnpurchasePersonService personService;
@Resource
private SocialDaprUtils socialDaprUtil;
@Resource
private CacheManager cacheManager;
@Resource
private TSalaryAttaService tSalaryAttaService;
@Resource
private OSSUtil ossUtil;
@Resource
@Lazy
private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
......@@ -87,6 +93,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if (Common.isNotNull(apply)) {
apply.setDeleteFlag(CommonConstants.ONE_STRING);
baseMapper.updateById(apply);
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>query().lambda().eq(TInsuranceUnpurchasePerson::getParnetId, id));
return R.ok();
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
......@@ -161,8 +168,10 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setCreateTime(null);
tInsuranceUnpurchaseApply.setUpdateTime(null);
baseMapper.insert(tInsuranceUnpurchaseApply);
//更新附件
updateFileId(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList())) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
......@@ -242,7 +251,22 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if (Common.isEmpty(apply)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return R.ok();
List<TInsuranceUnpurchasePersonAddVo> personList = personService.getTInsuranceUnpurchasePersonList(id);
apply.setPersonList(personList);
//查询就职岗位和人数
if (Common.isNotNull(personList) && !personList.isEmpty()) {
Map<String, Long> map = personList.stream().collect(Collectors.groupingBy(TInsuranceUnpurchasePersonAddVo::getPost,Collectors.counting()));
apply.setPersonMap(map);
}
List<TSalaryAtta> attaInfo = tSalaryAttaService.list(Wrappers.<TSalaryAtta>query().lambda().eq(TSalaryAtta::getLinkId, id));
if (attaInfo != null && !attaInfo.isEmpty()) {
URL url;
for (TSalaryAtta a: attaInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(url.toString());
}
}
return R.ok(apply);
}
public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
......@@ -299,6 +323,16 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
person.setCreateUserDeptId(tInsuranceUnpurchaseApply.getCreateUserDeptId());
}
private void updateFileId(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
if (Common.isNotNull(tInsuranceUnpurchaseApply.getAttaIdList())) {
for (String id : tInsuranceUnpurchaseApply.getAttaIdList()) {
TSalaryAtta atta = tSalaryAttaService.getById(id);
atta.setLinkId(tInsuranceUnpurchaseApply.getId());
tSalaryAttaService.updateById(atta);
}
}
}
//获取申请编码
@Lock4j(expire = 60000, acquireTimeout = 1000)
public String getCode() {
......
......@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TInsuranceUnpurchasePersonMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonVo;
import lombok.extern.log4j.Log4j2;
......@@ -87,4 +88,9 @@ public class TInsuranceUnpurchasePersonServiceImpl extends ServiceImpl<TInsuranc
}
}
@Override
public List<TInsuranceUnpurchasePersonAddVo> getTInsuranceUnpurchasePersonList(String id) {
return baseMapper.getTInsuranceUnpurchasePersonList(id);
}
}
......@@ -171,4 +171,15 @@
<include refid="tInsuranceUnpurchasePerson_where"/>
</where>
</select>
<select id="getTInsuranceUnpurchasePersonList" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo">
SELECT
a.ID,
a.EMP_NAME empName,
a.EMP_IDCARD_NO empIdcardNo,
if(a.POST = '--','',post) post
FROM t_insurance_unpurchase_person a
where a.PARNET_ID = #{id}
</select>
</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