Commit 7dd42df7 by mobh Committed by chenzg

修改问题

parent 81e3a48f
......@@ -11,6 +11,8 @@ import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import cn.timer.api.dto.xcgl.*;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -3280,29 +3282,25 @@ public class SalaryManagementController {
Integer orgCode = userBean.getOrgCode();
int success = 0;//成功
int failure = 0;//失败
int toinsert = 0;//新增
int toupdate = 0;//更新
int failure = 0;//失败
String[] names = new String[individualtaxdetailsdto.size()];
int i = 0;
List<Map<String, String>> reasons = Lists.newArrayList();
for (IndividualTaxDetailsDto indv : individualtaxdetailsdto) {
XcglAssoBszqsz bssz = XcglAssoBszqsz.builder().build().selectOne(new QueryWrapper<XcglAssoBszqsz>().lambda().eq(XcglAssoBszqsz::getQyid, orgCode));
String taxmonth = "";
if(bssz.getTaxReturnCycle().equals(1)) {
taxmonth = indv.getTaxMonth();
}else{
taxmonth = SalaryTool.getfirstnextMo(indv.getTaxMonth()+"-01 00:00:00");
}
String name = indv.getUserName();
String userName = indv.getUserName();
String phone = indv.getPhone();
String date = indv.getSalaryMonth();//薪资月
String date = indv.getSalaryMonth();//薪资月
Map<String, String> map = Maps.newHashMap();
try {
YgglMainEmp ygl = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, name)
XcglAssoBszqsz bssz = XcglAssoBszqsz.builder().build().selectOne(new QueryWrapper<XcglAssoBszqsz>().lambda().eq(XcglAssoBszqsz::getQyid, orgCode));
String taxmonth = "";
if(bssz.getTaxReturnCycle().equals(1)) {
taxmonth = indv.getTaxMonth();
}else{
taxmonth = SalaryTool.getfirstnextMo(indv.getTaxMonth()+"-01 00:00:00");
}
YgglMainEmp ygl = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, userName)
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
if(ygl != null) {
......@@ -3337,7 +3335,7 @@ public class SalaryManagementController {
gsgs.setCumYbtse(indv.getCumYbtse() == null ? null : Double.valueOf(indv.getCumYbtse()));
gsgs.setQyid(ygl.getOrgCode());
gsgs.insert();
success++;
toinsert++;
}else {
XcglAssoGsjsmx gsgs = XcglAssoGsjsmx.builder().build();
gsgs.setUserNum(String.valueOf(ygl.getEmpNum()));
......@@ -3371,27 +3369,26 @@ public class SalaryManagementController {
}
}else {
failure++;
int j = 5 / 0;
map.put("name", userName);
map.put("msg", "员工不存在");
}
} catch (Exception e) {
// e.printStackTrace();
names[i] = indv.getUserName();
i++;
failure++;
map.put("name", userName);
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
}finally {
reasons.add(map);
}
}
ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(success);//成功
imds.setFailure(failure);//失败
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
imds.setToupdate(toupdate);//更新
imds.setNames(ClockInTool.deleteArrayNull(names));
return ResultUtil.data(imds,"编辑员工权限成功");
imds.setFailure(failure);//失败
imds.setReasons(reasons);
// return ResultUtil.success("成功");
return ResultUtil.data(imds,"导入个税明细");
}
......
......@@ -4,13 +4,31 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImportDescriptionDto {
int success = 0;//成功
int failure = 0;//失败
int toupdate = 0;//更新
String[] names;
/**
* 成功(包含新增和更新)
*/
int success = 0;
/**
* 成功新增
*/
int toinsert = 0;
/**
* 成功更新
*/
int toupdate = 0;
/**
* 失败
*/
int failure = 0;
/**
* 失败原因
*/
List<Map<String, String>> reasons;
}
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