Commit 0540ec2f authored by 赵啸非's avatar 赵啸非

修改每日考勤记录重复多条情况

parent e8638bff
package com.mortals.xhx.base.system.param.service.impl; package com.mortals.xhx.base.system.param.service.impl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.IParam; import com.mortals.framework.service.IParam;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
...@@ -183,6 +184,14 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par ...@@ -183,6 +184,14 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
log.debug("cannot conver key[" + key + "]'s value[" + value + "] to boolean, use default value[" + defaultValue + "]"); log.debug("cannot conver key[" + key + "]'s value[" + value + "] to boolean, use default value[" + defaultValue + "]");
return defaultValue; return defaultValue;
} }
}
@Override
protected void saveBefore(ParamEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
} }
} }
\ No newline at end of file
...@@ -5,10 +5,12 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,10 +5,12 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.code.PageDisplayType; import com.mortals.framework.common.code.PageDisplayType;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.util.FileUtil; import com.mortals.framework.util.FileUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.model.ParamQuery;
import com.mortals.xhx.common.pdu.WeightPdu; import com.mortals.xhx.common.pdu.WeightPdu;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -88,6 +90,21 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -88,6 +90,21 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
@Override
protected void saveBefore(ParamEntity entity, Map<String, Object> model, Context context) throws AppException {
super.saveBefore(entity, model, context);
String paramKey = entity.getParamKey();
ParamQuery paramQuery = new ParamQuery();
paramQuery.setParamKey(paramKey);
ParamEntity paramEntity = this.service.selectOne(paramQuery);
if (!ObjectUtils.isEmpty(paramEntity)) {
entity.setCreateUserId(paramEntity.getId());
}
}
public static void main(String[] args) { public static void main(String[] args) {
FileUtil.delete("E:\\pic\\1.png"); FileUtil.delete("E:\\pic\\1.png");
} }
......
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