Commit 7f03ec98 authored by 廖旭伟's avatar 廖旭伟

绩效授权修改

parent b806ae94
......@@ -126,41 +126,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
}
@Override
protected void updateAfter(StaffEntity entity, Context context) throws AppException {
//OtherCheck作为绩效总开关,启用时新增当月绩效初始值,关闭时删除当月绩效数据
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(entity.getId());
summaryQuery.setYear(year);
summaryQuery.setMonth(month);
StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery);
if(entity.getOtherCheck() == 1){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
staffPerformSummaryEntity.setStaffId(entity.getId());
staffPerformSummaryEntity.setStaffName(entity.getName());
staffPerformSummaryEntity.setDeptId(entity.getDeptId());
staffPerformSummaryEntity.setDeptName(entity.getDeptName());
staffPerformSummaryEntity.setSalaId(entity.getSalaId());
staffPerformSummaryEntity.setSalaName(entity.getSalaName());
staffPerformSummaryEntity.setYear(year);
staffPerformSummaryEntity.setMonth(month);
staffPerformSummaryEntity.setTotalScore(new BigDecimal(100));
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
if (tempSummary == null) {
staffPerformSummaryService.save(staffPerformSummaryEntity);
}
}else {
if (tempSummary != null) {
staffPerformSummaryService.remove(tempSummary.getId(),null);
}
}
}
@Override
protected void saveBefore(StaffEntity entity, Context context) throws AppException {
int count = this.count(new StaffQuery().workNum(entity.getWorkNum()), context);
......
......@@ -35,10 +35,7 @@ import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
......@@ -258,7 +255,7 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
}
@PostMapping(value = "check/authorize")
public String checkAuthorize(StaffCheckAuthorizePdu pdu) {
public String checkAuthorize(@RequestBody StaffCheckAuthorizePdu pdu) {
Map<String, Object> model = new HashMap();
if (pdu.getStaffId() == null) {
return this.createFailJsonResp("请选择待授权" + this.getModuleDesc() + "信息");
......
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