Commit 7dd42df7 by mobh Committed by chenzg

修改问题

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