Commit bbde3214 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 30f3f48c 8814b9b9
package com.mortals.xhx.module.check.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
......@@ -13,4 +15,13 @@ import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
public interface CheckWindowPerformService extends ICRUDService<CheckWindowPerformEntity,Long>{
CheckWindowPerformDao getDao();
/**
* 核查人工审核
* @param entity
* @param context
* @throws AppException
*/
void examine(CheckWindowPerformEntity entity, Context context) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.check.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
/**
* CheckWindowWorkmanPerformService
*
......@@ -13,4 +16,12 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
public interface CheckWindowWorkmanPerformService extends ICRUDService<CheckWindowWorkmanPerformEntity,Long>{
CheckWindowWorkmanPerformDao getDao();
/**
* 核查人工审核
* @param entity
* @param context
* @throws AppException
*/
void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* CheckWindowPerformService
* 窗口考核核查 service实现
......@@ -18,4 +25,35 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CheckWindowPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowPerformDao, CheckWindowPerformEntity, Long> implements CheckWindowPerformService {
@Override
public void examine(CheckWindowPerformEntity entity, Context context) throws AppException {
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckWindowPerformEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if(StringUtils.isNotEmpty(entity.getLeaderCheckResult())){
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setLeaderCheckPerson(user.getRealName());
}
entity.setLeaderCheckTime(new Date());
}
if(StringUtils.isNotEmpty(entity.getManageCheckResult())){
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setManageCheckPerson(user.getRealName());
}
entity.setManageCheckTime(new Date());
}
entity.setUpdateTime(new Date());
if(StringUtils.isNotEmpty(entity.getLeaderCheckResult())&&StringUtils.isNotEmpty(entity.getManageCheckResult())) {
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
}
dao.update(entity);
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,6 +10,9 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
/**
* CheckWindowWorkmanPerformService
* 窗口人员考核汇总核查 service实现
......@@ -18,4 +24,24 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowWorkmanPerformDao, CheckWindowWorkmanPerformEntity, Long> implements CheckWindowWorkmanPerformService {
@Override
public void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException {
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckWindowWorkmanPerformEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setManageCheckPerson(user.getRealName());
}
entity.setManageCheckTime(new Date());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
}
}
\ No newline at end of file
......@@ -49,5 +49,37 @@ public class CheckWindowPerformController extends BaseCRUDJsonBodyMappingControl
super.init(model, context);
}
/**
* 审核
*
* @param entity
* @return
*/
@PostMapping({"examine"})
public String examine(@RequestBody CheckWindowPerformEntity entity){
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "窗口考核核查";
try {
this.service.examine(entity, context);
model.put("id", entity.getId());
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();
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -48,5 +49,36 @@ public class CheckWindowWorkmanPerformController extends BaseCRUDJsonBodyMapping
super.init(model, context);
}
/**
* 审核
*
* @param entity
* @return
*/
@PostMapping({"examine"})
public String examine(@RequestBody CheckWindowWorkmanPerformEntity entity){
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "窗口人员考核汇总核查";
try {
this.service.examine(entity, context);
model.put("id", entity.getId());
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();
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
......@@ -42,11 +44,20 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
private CheckWindowPerformService checkWindowPerformService;
@Autowired
private WindowWorkmanPerformService windowWorkmanPerformService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(WindowPerformEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
StaffEntity staff = staffService.get(entity.getOwnerId());
if(staff!=null){
entity.setDeptId(staff.getDeptId());
entity.setDeptName(staff.getDeptName());
entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName());
}
deleteExistBill(entity, context);
}
......
......@@ -12,6 +12,8 @@ import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService;
......@@ -47,6 +49,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService;
@Autowired
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Autowired
private StaffService staffService;
@Autowired
......@@ -56,7 +60,13 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
@Override
protected void saveBefore(WindowWorkmanPerformEntity entity, Context context) throws AppException {
buildWindowInfo(entity);
StaffEntity staff = staffService.get(entity.getOwnerId());
if(staff!=null){
entity.setDeptId(staff.getDeptId());
entity.setDeptName(staff.getDeptName());
entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName());
}
super.saveBefore(entity, context);
}
......
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