Commit 13ba8374 by 翁国栋

导入被保人员bug修复

parent 2438b968
......@@ -167,3 +167,6 @@ SET FOREIGN_KEY_CHECKS = 1;
INSERT INTO `timer_test`.`admin_menu_template`(`id`, `parentId`, `menu_code`, `menu_name`, `sort_number`, `path`, `enable`, `distribution`) VALUES (23, 0, 'policy', '保单管理', 23, '/policy', 1, 1);
INSERT INTO `timer_test`.`qyzx_admin_menu`(`id`, `menu_code`, `menu_name`, `sort_number`, `org_code`, `addtime`) VALUES (364, 'policy', '保单管理', 17, 1, 1648712195019);
ALTER TABLE `timer_test`.`insure_user`
ADD COLUMN `reason` varchar(255) NULL COMMENT '批改原因' AFTER `apply_type`;
......@@ -155,5 +155,7 @@ public class InsureUser extends Model<InsureUser> {
@ApiModelProperty(value = "申请类型:1新增 2投保 3批增")
private Integer applyType;
@ApiModelProperty(value = "批改原因")
private String reason;
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.gson.JsonObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
......@@ -589,6 +590,22 @@ public class InsureContorll {
if (insurePolicy == null) {
return ResultUtil.error("保单不存在");
}
/*单个替换*/
if(insureDto.getLimit()==1){
if(!StringUtils.isNullOrEmpty(insureDto.getUserName())&&!StringUtils.isNullOrEmpty(insureDto.getIdCardNo())){
YgglMainEmp y = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getName,insureDto.getUserName()).eq(YgglMainEmp::getZjNum,insureDto.getIdCardNo()));
if(y==null){
y=new YgglMainEmp();
y.setName(insureDto.getUserName());
y.setZjType(0);
y.setZjNum(insureDto.getIdCardNo());
y.setOrgCode(Integer.parseInt(insureDto.getOrgCode()));
y.insert();
}
insureDto.setUserIds(new String[]{String.valueOf(y.getId())});
}
}
List<InsureUser> oldInsureUserList = insureUserMapper.selectListByIds(insureDto.getOldIds());
String[] oldUser = new String[oldInsureUserList.size()];
for (int i = 0; i < oldInsureUserList.size(); i++) {
......@@ -879,6 +896,7 @@ public class InsureContorll {
}
List<YgglMainEmp> yg = Lists.newArrayList();
List<YgglMainEmp> selectUserList=Lists.newArrayList();
List<YgglMainEmp> allList=Lists.newArrayList();
try {
XSSFWorkbook xw = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheetAt = xw.getSheetAt(0);
......@@ -951,7 +969,8 @@ public class InsureContorll {
if (newList.size() > 0) {
newList.forEach(u -> u.insert());
}
selectUserList=ygglMainEmpMapper.selectListByIZjNum(yg.stream().map(YgglMainEmp::getZjNum).toArray(String[]::new),company.getId()).stream().filter(s->s.getIsInsure()==0).collect(Collectors.toList());
allList=ygglMainEmpMapper.selectListByIZjNum(yg.stream().map(YgglMainEmp::getZjNum).toArray(String[]::new),company.getId());
selectUserList=allList.stream().filter(s->s.getIsInsure()==0).collect(Collectors.toList());
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
......@@ -959,8 +978,12 @@ public class InsureContorll {
} catch (IOException e) {
e.printStackTrace();
}
return ResultUtil.data(selectUserList,selectUserList.stream().filter(s->s.getIsInsure()==1).map(YgglMainEmp::getName).collect(Collectors.toList()).toString()+"已投过保");
}
List<String> message =allList.stream().filter(s->s.getIsInsure()==1).map(YgglMainEmp::getName).collect(Collectors.toList());
if(message.size()>0){
return ResultUtil.data(selectUserList, JSONObject.toJSONString(message)+"已投过保");
}
return ResultUtil.data(selectUserList, "导入成功");
}
@PostMapping(value = "/importPolicy")
@ApiOperation(value = "导入保单--运营后台", httpMethod = "POST", notes = "导入用户")
......
......@@ -34,6 +34,10 @@ public class InsureDto {
private String[] userIds;
private Double totalPrice;
private MultipartFile file;
private Integer limit =0;/*代表是单独替换*/
private String userName;
private String idCardNo;
private String reason;/*批改原因*/
// private String
}
......@@ -276,6 +276,9 @@
select count(ip.id)
from insure_policy ip
<where>
<if test="policy.productId!=null and policy.productId!=''">
and ip.product_id = #{policy.productId}
</if>
<if test="policy.status!=null and policy.status!=''">
and ip.status = #{policy.status}
</if>
......
......@@ -30,6 +30,7 @@
<result property="policyId" column="policy_id"/>
<result property="replaceTransId" column="replace_trans_id"/>
<result property="applyType" column="apply_type"/>
<result property="reason" column="reason"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureUser">
......
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