Commit 6966445f by shiwenbo

新建费用调整增加日志

parent e245438d
......@@ -9,15 +9,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.beecode.amino.core.Amino;
import com.beecode.bap.log.LogConstants;
import com.beecode.bap.log.service.LogService;
import com.beecode.bap.staff.BapContext;
import com.beecode.bcp.core.context.AminoContextHolder;
import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject;
import com.beecode.bcp.type.Null;
import com.beecode.bcp.type.json.JSONObjectUtils;
import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.xyst.dinas.biz.dao.DinasOrganizationDao;
import com.xyst.dinas.contract.internal.dao.ContractDao;
import com.xyst.dinas.finance.constant.BankRechargeDetailConstant;
import com.xyst.dinas.finance.constant.ExpenseAdjustConstant;
import com.xyst.dinas.finance.dao.ExpenseAdjustDao;
import com.xyst.dinas.finance.service.ExpenseAdjustService;
......@@ -41,6 +42,12 @@ public class ExpenseAdjustServiceImpl implements ExpenseAdjustService {
@Autowired
private DinasOrganizationDao dinasOrganizationDao;
@Autowired
private LogService logService;
@Autowired
private BapContext bapContext;
@Override
@Transactional
public Object create(JSONObject jsonObject) {
......@@ -65,6 +72,13 @@ public class ExpenseAdjustServiceImpl implements ExpenseAdjustService {
contractDao.update(contract);
expenseAdjust.set("contract", contract);
expenseAdjustDao.save(expenseAdjust);
KObject log = Amino.getApplicationContext()
.getBean(LogConstants.LOG_ENTIY_NAME, KClass.class).newInstance();
KObject currentStaff = bapContext.getCurrentStaff();
log.set("module", ExpenseAdjustConstant.ENTITY);
log.set("businessObjectId", expenseAdjust.getUuid("id"));
log.set("logContent", currentStaff.getString("name") + "新建了这条数据");
logService.addLog(log);
return ResponseObj.success();
} catch (Exception e) {
e.printStackTrace();
......
......@@ -2,14 +2,12 @@ package com.xyst.dinas.finance.web;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.xyst.dinas.finance.service.BankRechargeDetailService;
import com.xyst.dinas.finance.service.ExpenseAdjustService;
/**
......
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