|
@@ -11,10 +11,12 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.winsea.svc.base.base.entity.CommonDepartment;
|
|
import com.winsea.svc.base.base.entity.CommonDepartment;
|
|
|
|
+import com.winsea.svc.base.base.entity.CommonRole;
|
|
import com.winsea.svc.base.base.entity.CommonRoleResource;
|
|
import com.winsea.svc.base.base.entity.CommonRoleResource;
|
|
import com.winsea.svc.base.base.entity.CommonStaff;
|
|
import com.winsea.svc.base.base.entity.CommonStaff;
|
|
import com.winsea.svc.base.base.service.ICommonDepartmentService;
|
|
import com.winsea.svc.base.base.service.ICommonDepartmentService;
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
|
|
+import com.winsea.svc.base.base.service.ICommonRoleService;
|
|
import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
import com.winsea.svc.base.base.util.DateUtils;
|
|
import com.winsea.svc.base.base.util.DateUtils;
|
|
import com.winsea.svc.base.security.entity.User;
|
|
import com.winsea.svc.base.security.entity.User;
|
|
@@ -110,6 +112,10 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
private ICommonDepartmentService commonDepartmentService;
|
|
private ICommonDepartmentService commonDepartmentService;
|
|
@Autowired
|
|
@Autowired
|
|
private ICommonUserService commonUserService;
|
|
private ICommonUserService commonUserService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICommonRoleService commonRoleService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPettyCashInfoService pettyCashInfoService;
|
|
@Value("${file-root-path}")
|
|
@Value("${file-root-path}")
|
|
private String localPath;
|
|
private String localPath;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -137,7 +143,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
// return listRedis;
|
|
// return listRedis;
|
|
// }
|
|
// }
|
|
if (expenseInfo.getCompId() == null || expenseInfo.getCompId().isEmpty()) {
|
|
if (expenseInfo.getCompId() == null || expenseInfo.getCompId().isEmpty()) {
|
|
- expenseInfo.setCompId(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId());
|
|
|
|
|
|
+ expenseInfo.setCompId(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId());
|
|
}
|
|
}
|
|
//查询所有费用集合
|
|
//查询所有费用集合
|
|
List<ExpenseInfo> expenseInfoList = this.selectList(new EntityWrapper<ExpenseInfo>().eq("delete_flag", "0").eq("comp_id", expenseInfo.getCompId()).groupBy("agent"));
|
|
List<ExpenseInfo> expenseInfoList = this.selectList(new EntityWrapper<ExpenseInfo>().eq("delete_flag", "0").eq("comp_id", expenseInfo.getCompId()).groupBy("agent"));
|
|
@@ -330,7 +336,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
//费用分配列表 查看不显示已驳回和分配已完成的数据
|
|
//费用分配列表 查看不显示已驳回和分配已完成的数据
|
|
List<ExpenseAllocationInfo> expenseAllocationInfos = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
|
|
List<ExpenseAllocationInfo> expenseAllocationInfos = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
|
|
.eq("info_id", id)
|
|
.eq("info_id", id)
|
|
- .ne("status", "已驳回")
|
|
|
|
|
|
+ .ne("status", "已驳回").or()
|
|
.ne("complete_flag","1"));
|
|
.ne("complete_flag","1"));
|
|
if (!CollectionUtils.isEmpty(expenseAllocationInfos)) {
|
|
if (!CollectionUtils.isEmpty(expenseAllocationInfos)) {
|
|
expenseInfo.setExpenseAllocationInfoList(expenseAllocationInfos);
|
|
expenseInfo.setExpenseAllocationInfoList(expenseAllocationInfos);
|
|
@@ -433,6 +439,22 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
if ("1".equals(expenseInfo.getExpensesType())) {
|
|
if ("1".equals(expenseInfo.getExpensesType())) {
|
|
expenseInfo.setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
expenseInfo.setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
expenseInfo.setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
expenseInfo.setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
|
|
+ //收款类型为备用金
|
|
|
|
+ if("7".equals(expenseInfo.getExpensesPurpose())){
|
|
|
|
+ //查询当前账户备用金余额
|
|
|
|
+ PettyCashInfo pettyCashInfo = pettyCashInfoService.selectOne(new EntityWrapper<PettyCashInfo>()
|
|
|
|
+ .eq("common_id",AuthSecurityUtils.getCurrentUserId())
|
|
|
|
+ .eq("delete_flag","0")
|
|
|
|
+ .eq("comp_id",AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId())
|
|
|
|
+ .eq("user_name",AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffName()));
|
|
|
|
+ if(pettyCashInfo != null){
|
|
|
|
+ //收款金额大于备用金账户余额
|
|
|
|
+ if(expenseInfo.getAmountMoney().compareTo(pettyCashInfo.getAmountMoney()) > 0 ){
|
|
|
|
+ //备用金账户余额不足
|
|
|
|
+ throw new YException(YExceptionEnum.PETTY_ACCOUNT_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.insert(expenseInfo);
|
|
this.insert(expenseInfo);
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
// 插入操作历史
|
|
// 插入操作历史
|
|
@@ -441,10 +463,15 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
}
|
|
}
|
|
//支出
|
|
//支出
|
|
else {
|
|
else {
|
|
- expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
|
|
|
|
- expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
|
|
|
|
|
|
+ if("1".equals(expenseInfo.getNoPaymentFlag())){
|
|
|
|
+ expenseInfo.setStatusFlag(StatusEnum.NO_PAYMENT.getFlag());
|
|
|
|
+ expenseInfo.setStatus(StatusEnum.NO_PAYMENT.getName());
|
|
|
|
+ }else{
|
|
|
|
+ expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
|
|
|
|
+ expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
|
|
|
|
+ }
|
|
//合同非粮款和库点费用自动分配的情况,未分配金额默认等于费用金额
|
|
//合同非粮款和库点费用自动分配的情况,未分配金额默认等于费用金额
|
|
- if (("3".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose())) || ("3".equals(expenseInfo.getExpensesPurpose()) && !"1".equals(expenseInfo.getAutoAssign())) || "7".equals(expenseInfo.getExpensesPurpose())) {
|
|
|
|
|
|
+ if (("3".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose())) || ("3".equals(expenseInfo.getExpensesPurpose()) && !"1".equals(expenseInfo.getAutoAssign())) || "7".equals(expenseInfo.getExpensesPurpose())|| ("7".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose()))) {
|
|
expenseInfo.setUnallocatedAmount(expenseInfo.getAmountMoney());
|
|
expenseInfo.setUnallocatedAmount(expenseInfo.getAmountMoney());
|
|
}
|
|
}
|
|
//合同粮款校验
|
|
//合同粮款校验
|
|
@@ -491,6 +518,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
expenseAllocationInfoList.get(i).setInfoId(expenseInfo.getId());
|
|
expenseAllocationInfoList.get(i).setInfoId(expenseInfo.getId());
|
|
expenseAllocationInfoList.get(i).setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
expenseAllocationInfoList.get(i).setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
expenseAllocationInfoList.get(i).setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
expenseAllocationInfoList.get(i).setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
|
|
+ expenseAllocationInfoList.get(i).setCompleteFlag("0");
|
|
Double distributionMoney = 0d;
|
|
Double distributionMoney = 0d;
|
|
List<ExpenseAllocationInfo> expenseAllocationInfoList1 = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
|
|
List<ExpenseAllocationInfo> expenseAllocationInfoList1 = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
|
|
.eq("order_id", expenseAllocationInfoList.get(i).getOrderId())
|
|
.eq("order_id", expenseAllocationInfoList.get(i).getOrderId())
|
|
@@ -556,6 +584,28 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
return "ok";
|
|
return "ok";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 财务点击修改任务状态
|
|
|
|
+ * @param expenseInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String editCollectionStatus(ExpenseInfo expenseInfo) {
|
|
|
|
+ List<NoticeTaskInfo> noticeTaskInfoList = noticeTaskService.selectList(new EntityWrapper<NoticeTaskInfo>()
|
|
|
|
+ .eq("business_id",expenseInfo.getId())
|
|
|
|
+ .eq("vessel_id","点击切换任务状态")
|
|
|
|
+ .eq("business_code","FEIYONGGUANLI-APPROVE"));
|
|
|
|
+ if(!CollectionUtils.isEmpty(noticeTaskInfoList)){
|
|
|
|
+ for(int i = 0;i<noticeTaskInfoList.size();i++){
|
|
|
|
+ noticeTaskInfoList.get(i).setDeleteFlag("1");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ noticeTaskService.updateBatchById(noticeTaskInfoList);
|
|
|
|
+ expenseInfo.setNoticeTaskInfoList(noticeTaskInfoList);
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public String editInfo(ExpenseInfo expenseInfo) {
|
|
public String editInfo(ExpenseInfo expenseInfo) {
|
|
@@ -607,26 +657,49 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
contractExpensesInfo.setWarehouseName(expenseInfo1.getWarehouseName());
|
|
contractExpensesInfo.setWarehouseName(expenseInfo1.getWarehouseName());
|
|
contractExpensesInfo.setCostType("3");
|
|
contractExpensesInfo.setCostType("3");
|
|
}
|
|
}
|
|
|
|
+ //备用金
|
|
|
|
+ else if("7".equals(expenseInfo1.getExpensesPurpose())){
|
|
|
|
+ //查询当前账户备用金余额
|
|
|
|
+ PettyCashInfo pettyCashInfo = pettyCashInfoService.selectOne(new EntityWrapper<PettyCashInfo>()
|
|
|
|
+ .eq("common_id",expenseInfo1.getCreateUserId())
|
|
|
|
+ .eq("delete_flag","0")
|
|
|
|
+ .eq("comp_id",expenseInfo1.getCompId())
|
|
|
|
+ .eq("user_name",expenseInfo1.getAgent()));
|
|
|
|
+ if(pettyCashInfo != null){
|
|
|
|
+ pettyCashInfo.setAmountMoney(pettyCashInfo.getAmountMoney() - expenseInfo1.getAmountMoney());
|
|
|
|
+ pettyCashInfoService.updateById(pettyCashInfo);
|
|
|
|
+ expenseInfo1.setPettyRelationId(pettyCashInfo.getPettyRelationId());
|
|
|
|
+ expenseInfo1.setPettyShowFlag("1");
|
|
|
|
+ this.updateById(expenseInfo1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
contractExpensesInfoService.insert(contractExpensesInfo);
|
|
contractExpensesInfoService.insert(contractExpensesInfo);
|
|
// 插入操作历史
|
|
// 插入操作历史
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
// 插入操作历史
|
|
// 插入操作历史
|
|
this.billOperateHisService.saveBillOperateHis(expenseInfo.getId(), NumberConstant.EXPENSE_MANAGEMENT, staffName, null,
|
|
this.billOperateHisService.saveBillOperateHis(expenseInfo.getId(), NumberConstant.EXPENSE_MANAGEMENT, staffName, null,
|
|
"确认", null, expenseInfo1.getRemark());
|
|
"确认", null, expenseInfo1.getRemark());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 先删除任务
|
|
|
|
+ noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
|
|
|
|
+ expenseInfo1.getId(), null);
|
|
|
|
+ CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
|
|
|
|
+ String taskContent = "";
|
|
|
|
+ if("1".equals(expenseInfo1.getIdentification())){
|
|
|
|
+ taskContent = expenseInfo1.getFieldName() + "收取" + expenseInfo1.getExpenseName() + expenseInfo1.getAmountMoney() + "元";
|
|
|
|
+ }else{
|
|
|
|
+ taskContent = expenseInfo1.getAgent() + "收取" + expenseInfo1.getExpenseName() + expenseInfo1.getAmountMoney() + "元";
|
|
|
|
+ }
|
|
|
|
+ NoticeTaskInfo taskInfo = new NoticeTaskInfo();
|
|
|
|
+ taskInfo.setCompId(commitUserInfo.getCompId());
|
|
|
|
+ taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
|
|
|
|
+ taskInfo.setBusinessId(expenseInfo1.getId());
|
|
|
|
+ taskInfo.setBusinessType("WAREHOUSE");
|
|
|
|
+ taskInfo.setMessageContent(taskContent);
|
|
|
|
+ taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
|
|
//外勤提交的请款出纳确认时需要给内勤发通知
|
|
//外勤提交的请款出纳确认时需要给内勤发通知
|
|
if ("1".equals(expenseInfo1.getIdentification())) {
|
|
if ("1".equals(expenseInfo1.getIdentification())) {
|
|
- // 先删除任务
|
|
|
|
- noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "FEIYONGGUANLI-APPROVE",
|
|
|
|
- expenseInfo1.getId(), null);
|
|
|
|
- CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
|
|
|
|
- String taskContent = expenseInfo1.getFieldName() + "收取" + expenseInfo1.getExpenseName() + expenseInfo1.getAmountMoney() + "元";
|
|
|
|
- NoticeTaskInfo taskInfo = new NoticeTaskInfo();
|
|
|
|
- taskInfo.setCompId(commitUserInfo.getCompId());
|
|
|
|
- taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
|
|
|
|
- taskInfo.setBusinessId(expenseInfo1.getId());
|
|
|
|
- taskInfo.setBusinessType("WAREHOUSE");
|
|
|
|
- taskInfo.setMessageContent(taskContent);
|
|
|
|
- taskInfo.setBusinessCode("FEIYONGGUANLI-APPROVE");
|
|
|
|
//查询内勤
|
|
//查询内勤
|
|
List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
|
|
List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
|
|
.eq("dept_id", "7a0b63a0f07a4fc38136b10e8514d8de")
|
|
.eq("dept_id", "7a0b63a0f07a4fc38136b10e8514d8de")
|
|
@@ -635,6 +708,19 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
noticeTaskService.createNoticeTask(staffIds,
|
|
noticeTaskService.createNoticeTask(staffIds,
|
|
null, taskInfo);
|
|
null, taskInfo);
|
|
}
|
|
}
|
|
|
|
+ //确认收款时给财务发通知
|
|
|
|
+ CommonRole commonRole = commonRoleService.selectOne(new EntityWrapper<CommonRole>()
|
|
|
|
+ .eq("comp_id", commitUserInfo.getCompId())
|
|
|
|
+ .eq("role_name", "财务")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (commonRole != null) {
|
|
|
|
+ //查询财务
|
|
|
|
+ List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
|
|
|
|
+ .eq("dept_id", commonRole.getDeptId())
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
|
|
|
|
+ noticeTaskService.createNoticeTask(staffIds, "点击切换任务状态", taskInfo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//完成收款
|
|
//完成收款
|
|
else if ("1".equals(expenseInfo.getFlag())) {
|
|
else if ("1".equals(expenseInfo.getFlag())) {
|
|
@@ -1024,6 +1110,27 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
expenseInfo.setStatusFlag(StatusEnum.COST_PAID.getFlag());
|
|
expenseInfo.setStatusFlag(StatusEnum.COST_PAID.getFlag());
|
|
expenseInfo.setStatus(StatusEnum.COST_PAID.getName());
|
|
expenseInfo.setStatus(StatusEnum.COST_PAID.getName());
|
|
expenseInfo.setPaymentDate(new Date());
|
|
expenseInfo.setPaymentDate(new Date());
|
|
|
|
+ //备用金支付标识为1
|
|
|
|
+ if ("1".equals(expenseInfo.getPaymentIdentifi())) {
|
|
|
|
+ CommonStaff commonStaff = staffService.selectOne(new EntityWrapper<CommonStaff>()
|
|
|
|
+ .eq("staff_name", expenseInfo.getPettyName())
|
|
|
|
+ .eq("comp_id", expenseInfo.getCompId()));
|
|
|
|
+ if (commonStaff != null) {
|
|
|
|
+ //查询所选账户备用金余额
|
|
|
|
+ PettyCashInfo pettyCashInfo = pettyCashInfoService.selectOne(new EntityWrapper<PettyCashInfo>()
|
|
|
|
+ .eq("common_id", commonStaff.getStaffId())
|
|
|
|
+ .eq("delete_flag", "0")
|
|
|
|
+ .eq("comp_id", commonStaff.getCompId())
|
|
|
|
+ .eq("user_name", expenseInfo.getPettyName()));
|
|
|
|
+ if (pettyCashInfo != null) {
|
|
|
|
+ pettyCashInfo.setAmountMoney(pettyCashInfo.getAmountMoney() - expenseInfo.getAmountMoney());
|
|
|
|
+ pettyCashInfoService.updateById(pettyCashInfo);
|
|
|
|
+ expenseInfo.setPettyRelationId(pettyCashInfo.getPettyRelationId());
|
|
|
|
+ expenseInfo.setPettyShowFlag("1");
|
|
|
|
+ this.updateById(expenseInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.updateById(expenseInfo);
|
|
this.updateById(expenseInfo);
|
|
ExpenseInfo expenseInfo1 = this.selectById(expenseInfo.getId());
|
|
ExpenseInfo expenseInfo1 = this.selectById(expenseInfo.getId());
|
|
//合同费用
|
|
//合同费用
|
|
@@ -1112,6 +1219,47 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
expenseInfo1.setStatus(StatusEnum.COMPLETED.getName());
|
|
expenseInfo1.setStatus(StatusEnum.COMPLETED.getName());
|
|
this.updateById(expenseInfo1);
|
|
this.updateById(expenseInfo1);
|
|
}
|
|
}
|
|
|
|
+ //备用金
|
|
|
|
+ else if("7".equals(expenseInfo1.getExpensesPurpose())){
|
|
|
|
+ //查询该账户是否有备用金
|
|
|
|
+ PettyCashInfo pettyCashInfo = pettyCashInfoService.selectOne(new EntityWrapper<PettyCashInfo>()
|
|
|
|
+ .eq("common_id",expenseInfo1.getCreateUserId())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ //为空新增
|
|
|
|
+ if (pettyCashInfo == null) {
|
|
|
|
+ PettyCashInfo pettyCashInfo1 = new PettyCashInfo();
|
|
|
|
+ pettyCashInfo1.setId(IdGenerator.generateUUID());
|
|
|
|
+ pettyCashInfo1.setCommonId(expenseInfo1.getCreateUserId());
|
|
|
|
+ pettyCashInfo1.setCompId(expenseInfo1.getCompId());
|
|
|
|
+ pettyCashInfo1.setPettyRelationId(IdGenerator.generateUUID());
|
|
|
|
+ expenseInfo1.setPettyRelationId(pettyCashInfo1.getPettyRelationId());
|
|
|
|
+ pettyCashInfo1.setAmountMoney(expenseInfo1.getAmountMoney());
|
|
|
|
+ //查询用户表
|
|
|
|
+ CommonStaff commonStaff = staffService.selectOne(new EntityWrapper<CommonStaff>()
|
|
|
|
+ .eq("staff_id",expenseInfo1.getCreateUserId())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(commonStaff != null){
|
|
|
|
+ pettyCashInfo1.setUserName(commonStaff.getStaffName());
|
|
|
|
+ pettyCashInfo1.setDeptId(commonStaff.getDeptId());
|
|
|
|
+ }
|
|
|
|
+ //查询部门表
|
|
|
|
+ CommonDepartment commonDepartment = commonDepartmentService.selectOne(new EntityWrapper<CommonDepartment>()
|
|
|
|
+ .eq("dept_id",commonStaff.getDeptId())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(commonDepartment != null){
|
|
|
|
+ pettyCashInfo1.setDeptName(commonDepartment.getDeptName());
|
|
|
|
+ }
|
|
|
|
+ pettyCashInfoService.insert(pettyCashInfo1);
|
|
|
|
+ }
|
|
|
|
+ //不为空,编辑
|
|
|
|
+ else{
|
|
|
|
+ //更新备用金帐户余额
|
|
|
|
+ pettyCashInfo.setAmountMoney(pettyCashInfo.getAmountMoney() + expenseInfo1.getAmountMoney());
|
|
|
|
+ pettyCashInfoService.updateById(pettyCashInfo);
|
|
|
|
+ expenseInfo1.setPettyRelationId(pettyCashInfo.getPettyRelationId());
|
|
|
|
+ }
|
|
|
|
+ this.updateById(expenseInfo1);
|
|
|
|
+ }
|
|
// 插入操作历史
|
|
// 插入操作历史
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
String staffName = this.billOperateHisService.getStaffAndName();
|
|
// 插入操作历史
|
|
// 插入操作历史
|
|
@@ -1599,31 +1747,51 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
|
-// * 备用金列表查询
|
|
|
|
-// * @param expenseInfo
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @Override
|
|
|
|
-// public Page<ExpenseInfo> selectPettyCashInfo(ExpenseInfo expenseInfo) {
|
|
|
|
-// Map<String, Object> pageView = new HashMap<>();
|
|
|
|
-// pageView.put("startRecord", (expenseInfo.getCurrentPage() - 1)
|
|
|
|
-// * expenseInfo.getPageSize());
|
|
|
|
-// pageView.put("searchKeyWord", expenseInfo.getSearchKeyWord());
|
|
|
|
-// pageView.put("searchType", expenseInfo.getSearchType());
|
|
|
|
-// pageView.put("pageSize", expenseInfo.getPageSize());
|
|
|
|
-// pageView.put("currentPage", expenseInfo.getCurrentPage());
|
|
|
|
-// pageView.put("contractNo", expenseInfo.getContractNo());
|
|
|
|
-// // 查询总数
|
|
|
|
-// Integer dataCount = baseMapper.getBondCountByCondition(pageView);
|
|
|
|
-// List<ExpenseInfo> dataList = baseMapper.getBondListByCondition(pageView);
|
|
|
|
-// Page<ExpenseInfo> page = new Page<>();
|
|
|
|
-// page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
|
-// page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
|
-// page.setCurrent(expenseInfo.getCurrentPage());
|
|
|
|
-// page.setSize(expenseInfo.getPageSize());
|
|
|
|
-// return page;
|
|
|
|
-// }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 备用金列表查询
|
|
|
|
+ * @param expenseInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Page<ExpenseInfo> selectPettyCashInfo(ExpenseInfo expenseInfo) {
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ pageView.put("startRecord", (expenseInfo.getCurrentPage() - 1)
|
|
|
|
+ * expenseInfo.getPageSize());
|
|
|
|
+ pageView.put("searchKeyWord", expenseInfo.getSearchKeyWord());
|
|
|
|
+ pageView.put("compId", expenseInfo.getCompId());
|
|
|
|
+ pageView.put("startDate", expenseInfo.getStartDate());
|
|
|
|
+ pageView.put("endDate", expenseInfo.getEndDate());
|
|
|
|
+ pageView.put("pageSize", expenseInfo.getPageSize());
|
|
|
|
+ pageView.put("currentPage", expenseInfo.getCurrentPage());
|
|
|
|
+ if (!StringUtils.isEmpty(expenseInfo.getAgent())) {
|
|
|
|
+ String str = expenseInfo.getAgent();
|
|
|
|
+ boolean str1 = str.contains(",");
|
|
|
|
+ if (str1) {
|
|
|
|
+ List<String> agentList = Arrays.asList(str.split(","));
|
|
|
|
+ pageView.put("agentList", agentList);
|
|
|
|
+ } else {
|
|
|
|
+ pageView.put("agent", expenseInfo.getAgent());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 查询总数
|
|
|
|
+ Integer dataCount = baseMapper.getPettyCashCountByCondition(pageView);
|
|
|
|
+ List<ExpenseInfo> dataList = baseMapper.getPettyCashListByCondition(pageView);
|
|
|
|
+ if (!CollectionUtils.isEmpty(dataList)) {
|
|
|
|
+ dataList.forEach(expenseInfo1 -> {
|
|
|
|
+ if (expenseInfo1.getCreateUserId() != null) {
|
|
|
|
+ CommonStaff commonStaff = staffService.getInfo(expenseInfo1.getCreateUserId());
|
|
|
|
+ expenseInfo1.setCreater(commonStaff.getStaffName());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ Page<ExpenseInfo> page = new Page<>();
|
|
|
|
+ page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
|
|
|
|
+ page.setTotal(dataCount == null ? 0 : dataCount);
|
|
|
|
+ page.setCurrent(expenseInfo.getCurrentPage());
|
|
|
|
+ page.setSize(expenseInfo.getPageSize());
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 燃料款列表请款记录列表
|
|
* 燃料款列表请款记录列表
|
|
* @param expenseInfo
|
|
* @param expenseInfo
|