Commit 80032e4c by huluobin

审批流涉及到的人要展示出来,比如待部门审核,需要审批人

parent e81c22f5
...@@ -14,88 +14,159 @@ import java.util.List; ...@@ -14,88 +14,159 @@ import java.util.List;
@Data @Data
public class CostDto { public class CostDto {
private Integer id; // 费用单表 id
private String costNo; // 费用单编号
private String costPlanNo; // 费用计划编号
private String companyNo; // 主体编号
private String companyName; // 主体名称
private String typeNo; // 大类编号
private String typeName; // 大类标题
private String kindNo; // 小类编号
private String kindName; // 小类标题
private Integer createUserid; // 创建人 id
private String createUsercode; // 创建人编号
private String createUsername; // 创建人名称
private String costRemark; // 费用单备注
// 费用单编号
private Integer id;
@ApiModelProperty("费用单编号")
private String costNo;
@ApiModelProperty("费用计划编号")
private String costPlanNo;
@ApiModelProperty("主体编号")
private String companyNo;
@ApiModelProperty("主体名称")
private String companyName;
@ApiModelProperty("类型编号")
private String typeNo;
@ApiModelProperty("类型标题")
private String typeName;
@ApiModelProperty("科目编号")
private String subjectCode;
@ApiModelProperty("小类编号")
private String kindNo;
@ApiModelProperty("小类标题")
private String kindName;
@ApiModelProperty("创建人id")
private Integer createUserid;
@ApiModelProperty("创建人编号")
private String createUsercode;
@ApiModelProperty("创建人名称")
private String createUsername;
@ApiModelProperty("费用单备注")
private String costRemark;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; // 创建时间 private Date createTime;
private String sonCostNo; // 关联子单
private String supCostNo; // 关联父单 // @ApiModelProperty("关联子单")puh
private Integer costStatus; // 费用单状态 0 未提交 1待审核 2待出纳付款 3已支付 // @Deprecated
private String costStatusDto; // 费用单状态 0 未提交 1待审核 2待出纳付款 3已支付 // private String sonCostNo;
private String filePath; // 文件地址 @ApiModelProperty("关联父单")
private String fileName; // 文件名 private String supCostNo;
private String morFilePath; // 补充材料地址
private String morFileName; // 补充材料文件名 @ApiModelProperty("费用单状态 0 待提交 1- 待财务审核 2待出纳付款 3被驳回 4已支付 5已作废 6-待部门审核 7-待财务审核 8-待最终审核人审核")
private BigDecimal amount; // 费用总金额 private Integer costStatus;
private String amountDto;
private Integer subLogisticsSupplierId; // 二级物流供应商ID @ApiModelProperty("文件地址")
private Integer logisticsSupplierId; // 一级物流供应商ID private String filePath;
private String bankName; // 收款银行(平台) @ApiModelProperty("补充材料地址")
private String bankCard; // 收款账户 private String morFilePath;
private String bankCardUser; // 收款用户名 @ApiModelProperty("补充信息")
private String bankCompany; // 收款/付款单位 private String morRemark;
private String morRemark; // 补充信息
private Integer isLend; // 0 普通费用 1 借支 2 借还 @ApiModelProperty("费用总金额")
private String isLendDto;// 0 普通费用 1 借支 2 借还 private BigDecimal amount;
private Integer costForm; // 费用类型
private String costFormDto; // 费用类型 @ApiModelProperty("二级物流供应商ID")
private String costReason; // 付款理由 private Integer subLogisticsSupplierId;
private BigDecimal hadPay; // 借支单已还金额 @ApiModelProperty("一级物流供应商ID")
private Integer lendStatus; // 借支单状态 1 未还 2 部分还款 3 结清 private Integer logisticsSupplierId;
private String lendStatusDto;
private BigDecimal compensate; // 借支单补偿金额 @ApiModelProperty("收款银行(平台)")
private BigDecimal counteract; // 冲销金额 private String bankName;
private BigDecimal lendBalance; // 借还单余额 @ApiModelProperty("收款账户")
private String rejectReason; // 驳回原因 private String bankCard;
private String dic; // 币种 @ApiModelProperty("收款用户名")
private String dicDto; // 币种 private String bankCardUser;
private BigDecimal payCounteract; // 借还单冲销金额 ( 支付币种 ) @ApiModelProperty("收款/付款单位")
private BigDecimal payLendBalance; // 借还单余额 ( 支付币种 ) private String bankCompany;
private BigDecimal payPlanAmount; // 计划金额 ( 支付币种 )
private String payPlanAmountDto;
private String payDic; // 支付币种 @ApiModelProperty("1 付款费用 2 收款费用 3 借支/借还")
private String payDicDto; // 支付币种 private Integer costForm;
private BigDecimal payCur; // 汇率 @ApiModelProperty("1 借支 2 借还")
private Integer isTax; // 0 不抵扣个税 1 抵扣个税 private Integer isLend;
private String isTaxStr; // 0 不抵扣个税 1 抵扣个税 @ApiModelProperty("1 未还 2 部分还款 3 待补差额 4 结清")
private String detailKey; // 出纳系统 detailKey private Integer lendStatus;
@ApiModelProperty("付款理由")
private String costReason;
@ApiModelProperty("驳回原因")
private String rejectReason;
@ApiModelProperty("借支单已还金额")
private BigDecimal hadPay;
@ApiModelProperty("借支单补偿金额")
private BigDecimal compensate;
@ApiModelProperty("冲销金额 (借支单币种)")
private BigDecimal counteract;
@ApiModelProperty("借还单余额 (借支单币种)")
private BigDecimal lendBalance;
@ApiModelProperty("对应借支单币种)")
private String dic;
@ApiModelProperty("借还单冲销金额 ( 支付币种 )")
private BigDecimal payCounteract;
@ApiModelProperty("借还单余额 ( 支付币种 )")
private BigDecimal payLendBalance;
@ApiModelProperty("计划金额 ( 支付币种 )")
private BigDecimal payPlanAmount;
@ApiModelProperty("支付币种")
private String payDic;
@ApiModelProperty("借还单 借还支付币种 -> 借支币种汇率")
private BigDecimal payCur;
@ApiModelProperty("0 不抵扣个税 1 抵扣个税")
private Integer isTax;
@ApiModelProperty("出纳系统 detailKey")
private String detailKey;
@ApiModelProperty("支付者用户ID")
private Integer payUserId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date payTime; // 付款时间 @ApiModelProperty("支付时间")
private Date payTime;
@ApiModelProperty("转人民币汇率")
private BigDecimal toRmbRate;
@ApiModelProperty("费用单人民币总金额")
private BigDecimal amountRmb;
@ApiModelProperty("公司主体value")
private Integer companyValue;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("财务审核时间")
private Date auditTime;
@ApiModelProperty("费用单发票状态编号")
private Integer hasInvoice; private Integer hasInvoice;
@ApiModelProperty("驳回类型")
private Integer rejectType; private Integer rejectType;
private Integer rejectTime;
@ApiModelProperty("财务驳回时间")
private Date rejectTime;
@ApiModelProperty("")
private String cashierFilePath; private String cashierFilePath;
@ApiModelProperty("")
private String cashierDownloadPath; private String cashierDownloadPath;
//费用来源 1-默认 2-WMS 3-调拨系统 @ApiModelProperty("费用来源 1-默认 2-WMS 3-调拨系统")
private String sourceFrom; private String sourceFrom;
//项目
@ApiModelProperty("项目")
private String projectType; private String projectType;
//客户编号
private String customerNum;
@TableField(exist = false)
private Integer primaryDepartmentId;
@TableField(exist = false)
private String primaryDepartmentName;
@ApiModelProperty("能否审核") @ApiModelProperty("客户编号")
@TableField(exist = false) private String customerNum;
private Boolean canAudit;
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
@ApiModelProperty("附加字段") @ApiModelProperty("附加字段")
...@@ -104,35 +175,43 @@ public class CostDto { ...@@ -104,35 +175,43 @@ public class CostDto {
@ApiModelProperty("费用模版id") @ApiModelProperty("费用模版id")
private Integer costTemplateId; private Integer costTemplateId;
@TableField(exist = false)
private CostTemplateDto costTemplate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime lastModifyDate; private LocalDateTime lastModifyDate;
///------------- @ApiModelProperty("能否审核")
@TableField(exist = false)
@ApiModelProperty("科目编号") private Boolean canAudit;
private String subjectCode;
@ApiModelProperty("支付者用户ID")
private Integer payUserId;
@ApiModelProperty("转人民币汇率") @ApiModelProperty("借支单,还款申请金额,包括已还的和申请中 ,借支单币种。")
private BigDecimal toRmbRate; private BigDecimal repaymentAppliedAmount;
@ApiModelProperty("费用单人民币总金额") @TableField(exist = false)
private BigDecimal amountRmb; private Integer primaryDepartmentId;
@TableField(exist = false)
private String primaryDepartmentName;
@ApiModelProperty("公司主体value") @ApiModelProperty("最终审核人")
private Integer companyValue; private String finalReviewerUserName;
@ApiModelProperty("财务审核人")
private String financialFinalReviewerUserName;
@ApiModelProperty("部门审核人")
private String departmentReviewerUserName;
@ApiModelProperty("行政审核人")
private String hrReviewerUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String costStatusDto; // 费用单状态 0 未提交 1待审核 2待出纳付款 3已支付
@ApiModelProperty("财务审核时间") private String fileName; // 文件名
private Date auditTime; private String morFileName; // 补充材料文件名
private String amountDto;
private String isLendDto;// 0 普通费用 1 借支 2 借还
private String costFormDto; // 费用类型
private String lendStatusDto;
private String dicDto; // 币种
private String payPlanAmountDto;
private String payDicDto; // 支付币种
private String isTaxStr; // 0 不抵扣个税 1 抵扣个税
@ApiModelProperty("借支单,还款申请金额,包括已还的和申请中 ,借支单币种。")
private BigDecimal repaymentAppliedAmount;
@TableField(exist = false)
private CostTemplateDto costTemplate;
} }
...@@ -13,4 +13,7 @@ public interface CostLogDao { ...@@ -13,4 +13,7 @@ public interface CostLogDao {
Integer insert(CostLogDomain log); Integer insert(CostLogDomain log);
List<CostLogDomain> selectByCostNo(String costNo); List<CostLogDomain> selectByCostNo(String costNo);
//查询部门审核日志
CostLogDomain selectDepartmentCheckLog(String costNo);
} }
...@@ -10,9 +10,10 @@ public interface CostLogService { ...@@ -10,9 +10,10 @@ public interface CostLogService {
Integer save(String costNo, Integer updateUserid, String updateMainNote, Integer type); Integer save(String costNo, Integer updateUserid, String updateMainNote, Integer type);
Integer saveByManage(String costNo, String updateMainNote, Integer type); void saveByManage(String costNo, String updateMainNote, Integer type);
List<CostLogDomain> getListByCostNo(String costNo); List<CostLogDomain> getListByCostNo(String costNo);
List<String> getListLogs(List<CostLogDomain> logs); List<String> getListLogs(List<CostLogDomain> logs);
} }
...@@ -67,7 +67,7 @@ public class CostLogServiceImpl implements CostLogService { ...@@ -67,7 +67,7 @@ public class CostLogServiceImpl implements CostLogService {
CostCompanyDao costCompanyDao; CostCompanyDao costCompanyDao;
@Override @Override
public Integer saveByManage(String costNo, String updateMainNote, Integer type) { public void saveByManage(String costNo, String updateMainNote, Integer type) {
CostLogDomain costLog = new CostLogDomain(); CostLogDomain costLog = new CostLogDomain();
costLog.setCostNo(costNo); costLog.setCostNo(costNo);
costLog.setUpdateTime(new Date()); costLog.setUpdateTime(new Date());
...@@ -115,7 +115,7 @@ public class CostLogServiceImpl implements CostLogService { ...@@ -115,7 +115,7 @@ public class CostLogServiceImpl implements CostLogService {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
costLog.setUpdateNote(sdf.format(costLog.getUpdateTime()) + " " + updateMainNote + " 更新人:" + reviewer.getUserName()); costLog.setUpdateNote(sdf.format(costLog.getUpdateTime()) + " " + updateMainNote + " 更新人:" + reviewer.getUserName());
costLog.setType(type); costLog.setType(type);
return costLogDao.insert(costLog); costLogDao.insert(costLog);
} }
@Override @Override
......
...@@ -12,13 +12,11 @@ import com.blt.other.module.database.model.*; ...@@ -12,13 +12,11 @@ import com.blt.other.module.database.model.*;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,7 +29,6 @@ import java.util.*; ...@@ -31,7 +29,6 @@ import java.util.*;
@Service @Service
public class CostTypeKindServiceImpl implements CostTypeKindService { public class CostTypeKindServiceImpl implements CostTypeKindService {
private static Logger logger = LoggerFactory.getLogger(CostTypeKindServiceImpl.class);
@Autowired @Autowired
private CostTypeKindDao costTypeKindDao; private CostTypeKindDao costTypeKindDao;
@Autowired @Autowired
...@@ -52,13 +49,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -52,13 +49,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
return getDtoList(costTypeKindDomains); return getDtoList(costTypeKindDomains);
} }
/**
* 分页获取所有费用小类
*
* @param pageSize
* @param pageNum
* @return
*/
@Override @Override
public Map<String, Object> getAllKindWithPage(Integer pageNum, Integer pageSize) { public Map<String, Object> getAllKindWithPage(Integer pageNum, Integer pageSize) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
...@@ -76,8 +66,7 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -76,8 +66,7 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
@Override @Override
public List<CostTypeKindDto> getListByTypeNo(String typeNo) { public List<CostTypeKindDto> getListByTypeNo(String typeNo) {
List<CostTypeKindDomain> costTypeKindDomains = costTypeKindDao.selectByTypeNo(typeNo); List<CostTypeKindDomain> costTypeKindDomains = costTypeKindDao.selectByTypeNo(typeNo);
List<CostTypeKindDto> dtoList = getDtoList(costTypeKindDomains); return getDtoList(costTypeKindDomains);
return dtoList;
} }
@Override @Override
...@@ -86,11 +75,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -86,11 +75,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
return getDtoList(costTypeKindDomains); return getDtoList(costTypeKindDomains);
} }
/**
* 保存费用种类记录
*
* @return
*/
@Override @Override
public Integer saveNewKind(CostTypeKindDomain costTypeKindDomain) { public Integer saveNewKind(CostTypeKindDomain costTypeKindDomain) {
// 是否已经存在相同 typeNo 、kindName 的记录 // 是否已经存在相同 typeNo 、kindName 的记录
...@@ -99,46 +83,32 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -99,46 +83,32 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
return null; return null;
} }
// 执行 doInsert() // 执行 doInsert()
Integer integer = doInsert(costTypeKindDomain); return doInsert(costTypeKindDomain);
return integer;
} }
/**
* 根据 kindNo 获取费用单详情
*
* @param kindNo
* @return
*/
@Override @Override
public CostTypeKindDomain getKindByKindNo(String kindNo) { public CostTypeKindDomain getKindByKindNo(String kindNo) {
return costTypeKindDao.selectByKindNo(kindNo); return costTypeKindDao.selectByKindNo(kindNo);
} }
/**
* Excel 导入费用小类
*
* @param file
* @return
* @throws Exception
*/
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Boolean importByExcel(MultipartFile file, String createUsercode) throws Exception { public Boolean importByExcel(MultipartFile file, String createUsercode) throws Exception {
boolean notNull = false; boolean notNull = false;
boolean isExcel2003 = true; boolean isExcel2003 = true;
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
assert fileName != null;
if (fileName.matches("^.+\\.(?i)(xlsx)$")) { if (fileName.matches("^.+\\.(?i)(xlsx)$")) {
isExcel2003 = false; isExcel2003 = false;
} }
InputStream is = file.getInputStream(); InputStream is = file.getInputStream();
Workbook wb = null; Workbook wb;
if (isExcel2003) { if (isExcel2003) {
wb = new HSSFWorkbook(is); wb = new HSSFWorkbook(is);
} else { } else {
wb = new XSSFWorkbook(is); wb = new XSSFWorkbook(is);
} }
if (null != wb) {
List<CostTypeKindDomain> list = new ArrayList<>(); List<CostTypeKindDomain> list = new ArrayList<>();
for (int s = 0; s < wb.getNumberOfSheets(); s++) { for (int s = 0; s < wb.getNumberOfSheets(); s++) {
Sheet sheet = wb.getSheetAt(s); Sheet sheet = wb.getSheetAt(s);
...@@ -159,11 +129,10 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -159,11 +129,10 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
// System.out.print("序号2 "); // System.out.print("序号2 ");
// 超出的多余行数,跳过 // 超出的多余行数,跳过
continue; continue;
} else {
} }
costTypeKindDomain = new CostTypeKindDomain(); costTypeKindDomain = new CostTypeKindDomain();
CostCompanyDomain companyDomain = null; CostCompanyDomain companyDomain;
if (null == row.getCell(1) || row.getCell(1).getStringCellValue().isEmpty()) { if (null == row.getCell(1) || row.getCell(1).getStringCellValue().isEmpty()) {
throw new RuntimeException("sheet" + (s + 1) + " " + "第 " + (r) + " 行公司主体不能为空"); throw new RuntimeException("sheet" + (s + 1) + " " + "第 " + (r) + " 行公司主体不能为空");
} else { } else {
...@@ -179,7 +148,8 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -179,7 +148,8 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
// 科目编码 第 2 列 // 科目编码 第 2 列
if (null != row.getCell(2)) { if (null != row.getCell(2)) {
row.getCell(2).setCellType(Cell.CELL_TYPE_STRING); // row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
row.getCell(2).setCellType(CellType.STRING);
if (!row.getCell(2).getStringCellValue().isEmpty()) { if (!row.getCell(2).getStringCellValue().isEmpty()) {
costTypeKindDomain.setSubjectCode(row.getCell(2).getStringCellValue()); costTypeKindDomain.setSubjectCode(row.getCell(2).getStringCellValue());
} else { } else {
...@@ -233,7 +203,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -233,7 +203,6 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
costTypeKindDao.insert(costTypeKindDomain); costTypeKindDao.insert(costTypeKindDomain);
} }
} }
}
return notNull; return notNull;
} }
...@@ -252,8 +221,7 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -252,8 +221,7 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
costTypeKindDomain.setCompanyNo(costTypeDomain.getCompanyNo()); costTypeKindDomain.setCompanyNo(costTypeDomain.getCompanyNo());
costTypeKindDomain.setCompanyName(costTypeDomain.getCompanyName()); costTypeKindDomain.setCompanyName(costTypeDomain.getCompanyName());
} }
Integer i = costTypeKindDao.update(costTypeKindDomain); return costTypeKindDao.update(costTypeKindDomain);
return i;
} }
@Override @Override
...@@ -275,9 +243,9 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -275,9 +243,9 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
typeDomain.setCompanyName(companyDomain.getCompanyName()); typeDomain.setCompanyName(companyDomain.getCompanyName());
typeDomain.setCompanyNo(companyDomain.getCompanyNo()); typeDomain.setCompanyNo(companyDomain.getCompanyNo());
typeDomain = setCostForm(typeDomain, row, s, r); setCostForm(typeDomain, row, s, r);
// TODO try 重复的 typeNo // TODO try 重复的 typeNo
Integer insert = costTypeDao.insert(typeDomain); costTypeDao.insert(typeDomain);
} }
return typeDomain; return typeDomain;
} }
...@@ -328,14 +296,13 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -328,14 +296,13 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
costTypeKindDomain.setKindNo(createKindNo()); costTypeKindDomain.setKindNo(createKindNo());
costTypeKindDomain.setCostTypeStatus(1); costTypeKindDomain.setCostTypeStatus(1);
costTypeKindDomain.setSubjectCode(costTypeDomain.getSubjectCode()); costTypeKindDomain.setSubjectCode(costTypeDomain.getSubjectCode());
Integer result = costTypeKindDao.insert(costTypeKindDomain); return costTypeKindDao.insert(costTypeKindDomain);
return result;
} }
/** /**
* 生成唯一的费用种类编号 * 生成唯一的费用种类编号
* *
* @return * @return 唯一的费用种类编号
*/ */
private String createKindNo() { private String createKindNo() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss"); SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
...@@ -356,15 +323,15 @@ public class CostTypeKindServiceImpl implements CostTypeKindService { ...@@ -356,15 +323,15 @@ public class CostTypeKindServiceImpl implements CostTypeKindService {
for (CostTypeKindDomain costTypeKindDomain : list) { for (CostTypeKindDomain costTypeKindDomain : list) {
costTypeKindDto = new CostTypeKindDto(); costTypeKindDto = new CostTypeKindDto();
BeanUtils.copyProperties(costTypeKindDomain, costTypeKindDto); BeanUtils.copyProperties(costTypeKindDomain, costTypeKindDto);
costTypeKindDto.setCostTypeStatusDto(getCostTypeStatus("cost_type_status", costTypeKindDto.getCostTypeStatus())); costTypeKindDto.setCostTypeStatusDto(getCostTypeStatus(costTypeKindDto.getCostTypeStatus()));
costTypeKindDtoList.add(costTypeKindDto); costTypeKindDtoList.add(costTypeKindDto);
} }
} }
return costTypeKindDtoList; return costTypeKindDtoList;
} }
private String getCostTypeStatus(String statusname, Integer statuskey) { private String getCostTypeStatus(Integer statusKey) {
return statusMapper.getStatusValue(statusname, statuskey); return statusMapper.getStatusValue("cost_type_status", statusKey);
} }
@Override @Override
......
...@@ -3,10 +3,12 @@ package com.blt.other.module.cost.service.impl.costcheck; ...@@ -3,10 +3,12 @@ package com.blt.other.module.cost.service.impl.costcheck;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.module.auth.model.CostReviewer; import com.blt.other.module.auth.model.CostReviewer;
import com.blt.other.module.cost.dao.CostCompanyDao; import com.blt.other.module.cost.dao.CostCompanyDao;
import com.blt.other.module.cost.dao.CostLogDao;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplate; import com.blt.other.module.cost.model.CostTemplate;
import com.blt.other.module.database.model.CostCompanyDomain; import com.blt.other.module.database.model.CostCompanyDomain;
import com.blt.other.module.database.model.CostLogDomain; import com.blt.other.module.database.model.CostLogDomain;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -21,6 +23,7 @@ import java.time.LocalDateTime; ...@@ -21,6 +23,7 @@ import java.time.LocalDateTime;
* @author robbendev * @author robbendev
* @since 2020/10/30 2:57 下午 * @since 2020/10/30 2:57 下午
*/ */
@Slf4j
@Component @Component
public class FinalCheckState extends CostState { public class FinalCheckState extends CostState {
...@@ -28,7 +31,22 @@ public class FinalCheckState extends CostState { ...@@ -28,7 +31,22 @@ public class FinalCheckState extends CostState {
UnPayState unPayState; UnPayState unPayState;
@Resource @Resource
CostCompanyDao costCompanyDao; CostCompanyDao costCompanyDao;
@Resource
CostLogDao costLogDao;
private void autoPass() {
CostDomain costDomain = costContext.costDomain;
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过", CostLogDomain.FINAL_AUTO_PASS);
//流转状态
nextState(unPayState);
//通知财务系统
costContext.costService.toFinancial(costDomain);
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
...@@ -44,15 +62,18 @@ public class FinalCheckState extends CostState { ...@@ -44,15 +62,18 @@ public class FinalCheckState extends CostState {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
//部门审核人和最终审核人是同一个人,最终审核人自动通过。
CostLogDomain costLogDomain = costLogDao.selectDepartmentCheckLog(costDomain.getCostNo());
if (costLogDomain != null && costLogDomain.getUpdateUserid().equals(currentUserId)) {
log.info("费用单:{}部门审核人和最终审核人是同一个人,最终审核人自动通过。", costDomain.getCostNo());
this.autoPass();
return;
}
//如果不需要审核 并且主体不是工会 直接通过 //如果不需要审核 并且主体不是工会 直接通过
if (!costTemplate.shouldFinalCheck(costDomain)) { if (!costTemplate.shouldFinalCheck(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); log.info("费用单:{}不需要最终审核审核,并且主体不是工会。最终审核人自动通过", costDomain.getCostNo());
costDomain.setLastModifyDate(LocalDateTime.now()); this.autoPass();
costDao.updateById(costDomain);
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过", CostLogDomain.FINAL_AUTO_PASS);
//通知财务系统
costContext.costService.toFinancial(costDomain);
return; return;
} }
...@@ -60,15 +81,8 @@ public class FinalCheckState extends CostState { ...@@ -60,15 +81,8 @@ public class FinalCheckState extends CostState {
if (costTemplate.shouldFinalAutoCheck(costDomain)) { if (costTemplate.shouldFinalAutoCheck(costDomain)) {
//自动审核通过 //自动审核通过
if (this.autoCheck(costDomain)) { if (this.autoCheck(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); log.info("费用单:{}需要自动审核并且自动审核规则校验通过.最终审核人自动通过", costDomain.getCostNo());
costDomain.setLastModifyDate(LocalDateTime.now()); this.autoPass();
costDao.updateById(costDomain);
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过", CostLogDomain.FINAL_AUTO_PASS);
//流转状态
nextState(unPayState);
//通知财务系统
costContext.costService.toFinancial(costDomain);
return; return;
} }
} }
...@@ -80,6 +94,7 @@ public class FinalCheckState extends CostState { ...@@ -80,6 +94,7 @@ public class FinalCheckState extends CostState {
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
log.info("费用单:{}最终审核人工审核通过", costDomain.getCostNo());
costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核通过", CostLogDomain.FINAL_MANUAL_PASS); costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核通过", CostLogDomain.FINAL_MANUAL_PASS);
//流转状态 //流转状态
...@@ -114,6 +129,7 @@ public class FinalCheckState extends CostState { ...@@ -114,6 +129,7 @@ public class FinalCheckState extends CostState {
costContext.costService.reject(costDomain.getCostNo()); costContext.costService.reject(costDomain.getCostNo());
log.info("费用单:{}最终审核拒绝,理由:{}", costDomain.getCostNo(), rejectReason);
costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE); costLogService.save(costDomain.getCostNo(), currentUserId, "最终审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE);
} }
......
...@@ -6,9 +6,9 @@ import com.bailuntec.common.exception.BizException; ...@@ -6,9 +6,9 @@ import com.bailuntec.common.exception.BizException;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.qiniu.common.QiniuException; import com.qiniu.common.QiniuException;
import com.qiniu.common.Zone;
import com.qiniu.http.Response; import com.qiniu.http.Response;
import com.qiniu.storage.Configuration; import com.qiniu.storage.Configuration;
import com.qiniu.storage.Region;
import com.qiniu.storage.UploadManager; import com.qiniu.storage.UploadManager;
import com.qiniu.storage.model.DefaultPutRet; import com.qiniu.storage.model.DefaultPutRet;
import com.qiniu.util.Auth; import com.qiniu.util.Auth;
...@@ -98,10 +98,10 @@ public class CostFileUtil { ...@@ -98,10 +98,10 @@ public class CostFileUtil {
return qiniuUpload(localFile); return qiniuUpload(localFile);
} }
@SuppressWarnings("all")
public String qiniuUpload(File localFilePath) { public String qiniuUpload(File localFilePath) {
//1、构造一个带指定Zone对象的配置类 //1、构造一个带指定Zone对象的配置类
Configuration cfg = new Configuration(Zone.zone2()); // Configuration cfg = new Configuration(Zone.zone2());
Configuration cfg = new Configuration(Region.region2());
//2、其他参数参考类注释 //2、其他参数参考类注释
UploadManager uploadManager = new UploadManager(cfg); UploadManager uploadManager = new UploadManager(cfg);
//3、生成上传凭证,然后准备上传 //3、生成上传凭证,然后准备上传
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<AsyncLogger name="io.lettuce" level="ERROR" includeLocation="true"/> <AsyncLogger name="io.lettuce" level="ERROR" includeLocation="true"/>
<AsyncRoot level="INFO" includeLocation="true"> <AsyncRoot level="INFO" includeLocation="true">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- <appender-ref ref="CONSOLE"/>-->
</AsyncRoot> </AsyncRoot>
</Loggers> </Loggers>
......
...@@ -419,24 +419,14 @@ ...@@ -419,24 +419,14 @@
group_concat(distinct t8.reviewer_user_name) as hr_reviewer_user_name group_concat(distinct t8.reviewer_user_name) as hr_reviewer_user_name
from cost t1 from cost t1
left join cost_log t2 on t1.cost_no = t2.cost_no left join cost_log t2 on t1.cost_no = t2.cost_no
<!--# <if test="req.type == 1">-->
left join cost_company t3 on t1.company_no = t3.company_no left join cost_company t3 on t1.company_no = t3.company_no
-- 最终审核人
left join cost_reviewer t4 on t3.id = t4.refer_id and t4.type = 3 left join cost_reviewer t4 on t3.id = t4.refer_id and t4.type = 3
-- 财务审核人
left join cost_reviewer t5 on t3.id = t5.refer_id and t5.type = 2 left join cost_reviewer t5 on t3.id = t5.refer_id and t5.type = 2
<!--# </if>-->
-- 部门审核人
<!--# <if test="req.type == 2">-->
left join oa_user t6 on t1.create_userid = t6.oa_user_id left join oa_user t6 on t1.create_userid = t6.oa_user_id
left join cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1 left join cost_reviewer t7 on t6.primary_department_id = t7.refer_id and t7.type = 1
<!--# </if>-->
-- 行政审核
<!--# <if test="req.type == 3">-->
left join cost_company t3 on t1.company_no = t3.company_no
left join cost_reviewer t8 on t3.id = t8.refer_id and t5.type = 4 left join cost_reviewer t8 on t3.id = t8.refer_id and t5.type = 4
<!--# </if>-->
where true where true
/*财务 或者 最终审核 只显示待审核的*/ /*财务 或者 最终审核 只显示待审核的*/
<if test="req.type == 1"> <if test="req.type == 1">
and (t1.cost_status = 7 or t1.cost_status = 8) and (t1.cost_status = 7 or t1.cost_status = 8)
...@@ -486,7 +476,6 @@ ...@@ -486,7 +476,6 @@
order by t1.create_time desc order by t1.create_time desc
</select> </select>
<select id="appCheckCostList" resultType="com.blt.other.module.cost.model.CostDomain"> <select id="appCheckCostList" resultType="com.blt.other.module.cost.model.CostDomain">
select t1.* select t1.*
from cost t1 from cost t1
......
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
or company_name LIKE CONCAT('%',#{key},'%') or company_name LIKE CONCAT('%',#{key},'%')
</if> </if>
</foreach> </foreach>
<foreach collection="keys" item="key" index="index">
<if test="key != null and key != '' ">
or bank_card_user LIKE CONCAT('%',#{key},'%')
</if>
</foreach>
</select> </select>
<select id="selectByKeys" resultType="com.blt.other.module.cost.model.CostDomain"> <select id="selectByKeys" resultType="com.blt.other.module.cost.model.CostDomain">
......
...@@ -4,24 +4,25 @@ ...@@ -4,24 +4,25 @@
<mapper namespace="com.blt.other.module.cost.dao.CostLogDao"> <mapper namespace="com.blt.other.module.cost.dao.CostLogDao">
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO INSERT INTO cost_log(cost_no, update_usercode, update_username, update_time, update_note, update_userid)
cost_log(
cost_no,update_usercode,update_username,update_time,update_note,update_userid
)
VALUE VALUE
( (
#{costNo},#{updateUsercode},#{updateUsername},#{updateTime},#{updateNote},#{updateUserid} #{costNo}, #{updateUsercode}, #{updateUsername}, #{updateTime}, #{updateNote}, #{updateUserid}
) )
</insert> </insert>
<select id="selectByCostNo" resultType="com.blt.other.module.database.model.CostLogDomain"> <select id="selectByCostNo" resultType="com.blt.other.module.database.model.CostLogDomain">
SELECT SELECT *
* FROM cost_log
FROM WHERE cost_no = #{costNo}
cost_log ORDER BY id DESC
WHERE </select>
cost_no = #{costNo} <select id="selectDepartmentCheckLog" resultType="com.blt.other.module.database.model.CostLogDomain">
ORDER BY select *
id DESC from cost_log
where cost_no = #{costNo}
and type in (2, 3)
order by update_time desc
limit 1;
</select> </select>
</mapper> </mapper>
...@@ -64,7 +64,7 @@ public class CodeGenerator { ...@@ -64,7 +64,7 @@ public class CodeGenerator {
PackageConfig pc = new PackageConfig(); PackageConfig pc = new PackageConfig();
String s = scanner("模块名"); String s = scanner("模块名");
String ss = "." + s; String ss = "." + s;
pc.setParent("com.blt.other" + ss); pc.setParent("com.blt.other.module" + ss);
pc.setEntity("model"); pc.setEntity("model");
pc.setService("service"); pc.setService("service");
pc.setServiceImpl("service" + ".impl"); pc.setServiceImpl("service" + ".impl");
......
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