Commit e6005286 by ilal

Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into develop

parents fb5903e8 1211ee25
...@@ -159,31 +159,31 @@ public class SalaryManagementController { ...@@ -159,31 +159,31 @@ public class SalaryManagementController {
//考勤组 //考勤组
@Autowired @Resource
private AttendanceGroupMapper attendancegroupservice; private AttendanceGroupMapper attendancegroupservice;
//打卡明细表 //打卡明细表
@Autowired @Resource
private PunchCardDetailsMapper punchcarddetailsservice; private PunchCardDetailsMapper punchcarddetailsservice;
//打卡记录 //打卡记录
@Autowired @Resource
private PunchRecordMapper punchrecordservice; private PunchRecordMapper punchrecordservice;
@Autowired @Resource
private SpecialDateMapper specialdateservice; private SpecialDateMapper specialdateservice;
//考勤周排班 //考勤周排班
@Autowired @Resource
private AttendanceWeeklySchMapper attendanceweeklyschservice; private AttendanceWeeklySchMapper attendanceweeklyschservice;
//排班明细 //排班明细
@Autowired @Resource
private ScheduleMapper scheduleservice; private ScheduleMapper scheduleservice;
//专项附加扣除 //专项附加扣除
@Autowired @Resource
private XcglAssoZxfjkcMapper xcglassozxfjkcmapper; private XcglAssoZxfjkcMapper xcglassozxfjkcmapper;
//工资条组内成员状态 //工资条组内成员状态
@Autowired @Resource
private XcglAssoGztztMapper xcglassogztztmapper; private XcglAssoGztztMapper xcglassogztztmapper;
//工资条组-设置 //工资条组-设置
@Autowired @Resource
private XcglAssoGztszMapper xcglassogztszmapper; private XcglAssoGztszMapper xcglassogztszmapper;
static SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd"); static SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd");
...@@ -1455,20 +1455,20 @@ public class SalaryManagementController { ...@@ -1455,20 +1455,20 @@ public class SalaryManagementController {
*/ */
@PostMapping(value = "/payimport") @PostMapping(value = "/payimport")
@ApiOperation(value = "导入薪资", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "导入薪资", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult ImportSalaryData(@CurrentUser UserBean userBean,@RequestBody ImportSalarySetDto impor) { public Result<ImportDescriptionDto> ImportSalaryData(@CurrentUser UserBean userBean,@RequestBody ImportSalarySetDto impor) {
int toinsert = 0;//新增
int toupdate = 0;//更新
int failure = 0;//失败
List<Map<String, String>> reasons = Lists.newArrayList();
ImportSalaryDto[] ims = impor.getImsalary();// ImportSalaryDto[] ims = impor.getImsalary();//
if(ims.length>0){ if (ims.length > 0) {
for(int p=0;p<ims.length;p++){ for( int p=0; p < ims.length; p++) {
Map<String, String> map = Maps.newHashMap();
String name = ims[0].getUsername();
try {
//用户工号来匹配入库 //用户工号来匹配入库
XcglAssoXzury xzuryone = new LambdaQueryChainWrapper<XcglAssoXzury>(xcglassoxzurymapper).eq(XcglAssoXzury::getQyid, userBean.getOrgCode()) XcglAssoXzury xzuryone = new LambdaQueryChainWrapper<XcglAssoXzury>(xcglassoxzurymapper).eq(XcglAssoXzury::getQyid, userBean.getOrgCode())
.eq(XcglAssoXzury::getXzzid, impor.getGid()).eq(XcglAssoXzury::getUserid, ims[p].getUsernum()).one(); .eq(XcglAssoXzury::getXzzid, impor.getGid()).eq(XcglAssoXzury::getUserid, ims[p].getUsernum()).one();
//用户名称来匹配入库
// XcglAssoXzury yhmpp = xcglassoxzurymapper.selectImportedSalary(impor.getGid(),ims[p].getUsername(),String.valueOf(userBean.getOrgCode()));
int k = 0;
if(xzuryone != null) { if(xzuryone != null) {
XcglAssoXzb xzb = XcglAssoXzb.builder().build(); XcglAssoXzb xzb = XcglAssoXzb.builder().build();
xzb.setUserid(xzuryone.getUserid());// xzb.setUserid(xzuryone.getUserid());//
...@@ -1477,21 +1477,24 @@ public class SalaryManagementController { ...@@ -1477,21 +1477,24 @@ public class SalaryManagementController {
xzb.setXzxjg(ims[p].getSrz());// xzb.setXzxjg(ims[p].getSrz());//
xzb.setQyid(userBean.getOrgCode()); xzb.setQyid(userBean.getOrgCode());
xcglassoxzbmapper.ModifyImportedSalary(xzb); xcglassoxzbmapper.ModifyImportedSalary(xzb);
k++; toupdate++;
} }
// if(yhmpp != null && k == 0) { } catch (Exception e) {
// XcglAssoXzb xzb = XcglAssoXzb.builder().build(); failure++;
// xzb.setUserid(yhmpp.getUserid());// map.put("name", name);
// xzb.setXzyf(impor.getSxrq());// map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
// xzb.setXzxid(ims[p].getJsgzzx());// } finally {
// xzb.setXzxjg(Double.valueOf(ims[p].getSrz()));// reasons.add(map);
// xzb.setQyid(userBean.getOrgCode());
// xcglassoxzbmapper.ModifyImportedSalary(xzb);
// }
} }
} }
return new ResponseResult().success("导入成功"); }
ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
imds.setToupdate(toupdate);//更新
imds.setFailure(failure);//失败
imds.setReasons(reasons);
return ResultUtil.data(imds,"导入成功");
} }
@PostMapping(value = "/determinesalaryrules") @PostMapping(value = "/determinesalaryrules")
...@@ -3193,16 +3196,21 @@ public class SalaryManagementController { ...@@ -3193,16 +3196,21 @@ public class SalaryManagementController {
*/ */
@PostMapping(value = "/import_special_additional_deduction") @PostMapping(value = "/import_special_additional_deduction")
@ApiOperation(value = "导入专项附加扣除", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "导入专项附加扣除", httpMethod = "POST", notes = "接口发布说明")
public Result<JSONObject> importSpecialAdditionalDeduction(@CurrentUser UserBean userBean, public Result<ImportDescriptionDto> importSpecialAdditionalDeduction(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<SpecialDeductionDto> specialdeductiondto) throws Exception { @Validated @RequestBody ValidList<SpecialDeductionDto> specialdeductiondto) throws Exception {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
int toinsert = 0;//新增
int toupdate = 0;//更新
int failure = 0;//失败
List<Map<String, String>> reasons = Lists.newArrayList();
for (SpecialDeductionDto spec : specialdeductiondto) { for (SpecialDeductionDto spec : specialdeductiondto) {
String name = spec.getName(); String name = spec.getName();
String phone = spec.getPhone(); String phone = spec.getPhone();
String date = spec.getDate(); String date = spec.getDate();
Map<String, String> map = Maps.newHashMap();
try {
YgglMainEmp ygl = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, name) YgglMainEmp ygl = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, name)
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode)); .eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
...@@ -3238,6 +3246,7 @@ public class SalaryManagementController { ...@@ -3238,6 +3246,7 @@ public class SalaryManagementController {
xcglas.setQyid(userBean.getOrgCode()); xcglas.setQyid(userBean.getOrgCode());
xcglas.setAddtime(new Date().getTime()); xcglas.setAddtime(new Date().getTime());
xcglassozxfjkcmapper.insertXcglAssoZxfjkc(xcglas); xcglassozxfjkcmapper.insertXcglAssoZxfjkc(xcglas);
toinsert++;
}else { }else {
XcglAssoZxfjkc fjkc = XcglAssoZxfjkc.builder().build(); XcglAssoZxfjkc fjkc = XcglAssoZxfjkc.builder().build();
fjkc.setId(xcg.getId()); fjkc.setId(xcg.getId());
...@@ -3264,10 +3273,23 @@ public class SalaryManagementController { ...@@ -3264,10 +3273,23 @@ public class SalaryManagementController {
fjkc.setTotalmoney(Double.valueOf(result));//累计专项附加扣除 fjkc.setTotalmoney(Double.valueOf(result));//累计专项附加扣除
xcglassozxfjkcmapper.updateXcglAssoZxfjkc(fjkc); xcglassozxfjkcmapper.updateXcglAssoZxfjkc(fjkc);
toupdate++;
} }
} catch (Exception e) {
failure++;
map.put("name", name);
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
} finally {
reasons.add(map);
} }
}
return ResultUtil.success("成功"); ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
imds.setToupdate(toupdate);//更新
imds.setFailure(failure);//失败
imds.setReasons(reasons);
return ResultUtil.data(imds, "成功");
} }
...@@ -3765,54 +3787,12 @@ public class SalaryManagementController { ...@@ -3765,54 +3787,12 @@ public class SalaryManagementController {
} }
spe.setDetailed(detailed); spe.setDetailed(detailed);
} }
specific.add(spe); specific.add(spe);
} }
top.setSpecific(specific); top.setSpecific(specific);
} }
} }
return ResultUtil.data(top,"操作成功!"); return ResultUtil.data(top,"操作成功!");
} }
} }
...@@ -253,7 +253,7 @@ public class YgglController { ...@@ -253,7 +253,7 @@ public class YgglController {
String phone = addygdaDto.getPhone(); String phone = addygdaDto.getPhone();
Integer zjType = addygdaDto.getZjType(); Integer zjType = addygdaDto.getZjType();
String zjNum = addygdaDto.getZjNum(); String zjNum = addygdaDto.getZjNum();
int attgroupid = addygdaDto.getAttgroupid();//考勤组id Integer attgroupid = addygdaDto.getAttgroupid();//考勤组id
boolean isvalid = true; boolean isvalid = true;
switch (zjType) { switch (zjType) {
case 0: case 0:
......
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