Commit 98e5de57 authored by 周亚武's avatar 周亚武

Merge remote-tracking branch 'origin/master'

parents 4f50dc6b 629c53a3
......@@ -90,8 +90,8 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
@Override
protected void updateAfter(AttendanceRecordErrorEntity entity, Context context) throws AppException {
entity= this.get(entity.getId());
if (YesNoEnum.YES.getValue() == entity.getProcessStatus()) {
entity= this.get(entity.getId());
//判断后打绩效
String ruleCode = "";
if (ErrorStatusEnum.早退.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
......
package com.mortals.xhx.module.attendance.web;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.model.*;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.utils.BeanUtil;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.busiz.h5.req.AttendSaveReq;
......@@ -20,11 +21,11 @@ import com.mortals.xhx.module.attendance.service.*;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -227,6 +228,70 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
super.saveBefore(entity, model, context);
}
@Override
@PostMapping({"save"})
@RepeatSubmit
public String save(@RequestBody AttendanceRecordErrorEntity entity) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "保存" + this.getModuleDesc();
int code =1;
try {
this.saveBefore(entity, model, context);
if (entity.newEntity()) {
Class<AttendanceRecordErrorEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
AttendanceRecordErrorEntity initEntity = (AttendanceRecordErrorEntity)tClass.newInstance();
initEntity.initAttrValue();
BeanUtils.copyProperties(entity, initEntity, BeanUtil.getNullPropertyNames(entity));
entity = initEntity;
busiDesc = "新增" + this.getModuleDesc();
initEntity.setCreateTime(new Date());
IUser user = this.getCurUser();
if (user != null) {
initEntity.setCreateUserId(user.getId());
initEntity.setCreateUser(user.getLoginName());
initEntity.setCreateUserName(user.getRealName());
initEntity.setCreateUserDeptId(user.getDeptId());
initEntity.setCreateUserDeptName(user.getDeptName());
}
this.service.save(initEntity, context);
} else {
// busiDesc = "修改" + this.getModuleDesc();
// entity.setUpdateTime(new Date());
// IUser user = this.getCurUser();
// if (user != null) {
// entity.setUpdateUserId(user.getId());
// entity.setUpdateUser(user.getLoginName());
// entity.setUpdateUserName(user.getRealName());
// entity.setUpdateUserDeptId(user.getDeptId());
// entity.setUpdateUserDeptName(user.getDeptName());
// }
//this.service.update(entity, context);
}
model.put("id", entity.getId());
code = this.saveAfter(entity, model, context);
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
@Override
protected int editAfter(Long id, Map<String, Object> model, AttendanceRecordErrorEntity entity, Context context) throws AppException {
......
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