Commit 96ba70b5 by ilal Committed by chenzg

提交

parent e582ef85
...@@ -7,7 +7,9 @@ import java.text.SimpleDateFormat; ...@@ -7,7 +7,9 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -25,6 +27,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -25,6 +27,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.sbgjj.SbgjjAdminCbry; import cn.timer.api.bean.sbgjj.SbgjjAdminCbry;
...@@ -59,6 +63,7 @@ import cn.timer.api.dto.sbgjj.SocialfundDto; ...@@ -59,6 +63,7 @@ import cn.timer.api.dto.sbgjj.SocialfundDto;
import cn.timer.api.dto.sbgjj.StopimmediatelyDto; import cn.timer.api.dto.sbgjj.StopimmediatelyDto;
import cn.timer.api.dto.sbgjj.VerifyInsuredDto; import cn.timer.api.dto.sbgjj.VerifyInsuredDto;
import cn.timer.api.dto.sbgjj.VerifyInsuredDtoListDto; import cn.timer.api.dto.sbgjj.VerifyInsuredDtoListDto;
import cn.timer.api.dto.xcgl.ImportDescriptionDto;
import cn.timer.api.utils.ResponseResult; import cn.timer.api.utils.ResponseResult;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -1521,25 +1526,57 @@ public class SocialSecurityFundController { ...@@ -1521,25 +1526,57 @@ public class SocialSecurityFundController {
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
public Result<Object> Verifytheinsured(@CurrentUser UserBean userBean,@RequestBody VerifyInsuredDtoListDto verinlist) { public Result<Object> Verifytheinsured(@CurrentUser UserBean userBean,@RequestBody VerifyInsuredDtoListDto verinlist) {
int toinsert = 0;//新增
int toupdate = 0;//更新
int failure = 0;//失败
List<Map<String, String>> reasons = Lists.newArrayList();
List<YgglMainEmp> ygs = new ArrayList<YgglMainEmp>(); List<YgglMainEmp> ygs = new ArrayList<YgglMainEmp>();
VerifyInsuredDto[] verin = verinlist.getVerin(); VerifyInsuredDto[] verin = verinlist.getVerin();
if(verin.length>0){ if(verin.length>0){
for(int n=0;n<verin.length;n++){ for(int n=0;n<verin.length;n++){
YgglMainEmp yg = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, verin[n].getEmpname()).eq(YgglMainEmp::getPhone, verin[n].getPhone()) Map<String, String> map = Maps.newHashMap();
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(yg != null) { String name = verin[n].getEmpname();
YgglMainEmp ygl = YgglMainEmp.builder().build();
ygl.setName(yg.getName()); try {
ygl.setEmpNum(yg.getEmpNum()); YgglMainEmp yg = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, verin[n].getEmpname()).eq(YgglMainEmp::getPhone, verin[n].getPhone())
ygs.add(ygl); .eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(yg != null) {
YgglMainEmp ygl = YgglMainEmp.builder().build();
ygl.setName(yg.getName());
ygl.setEmpNum(yg.getEmpNum());
ygs.add(ygl);
toinsert++;
}else {
failure++;
map.put("name", name);
map.put("msg", "该员工不存在");
reasons.add(map);
}
} catch (Exception e) {
failure++;
map.put("name", name);
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
reasons.add(map);
} }
} }
} }
return ResultUtil.data(ygs, "成功"); ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
imds.setToupdate(toupdate);//更新
imds.setFailure(failure);//失败
imds.setReasons(reasons);
// return ResultUtil.data(ygs, "成功");
return ResultUtil.datas(ygs, imds, "成功");
} }
......
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