|
@@ -687,6 +687,18 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
|
expenseInfo.setStatusFlag(StatusEnum.REJECTED.getFlag());
|
|
|
expenseInfo.setStatus(StatusEnum.REJECTED.getName());
|
|
|
}
|
|
|
+ //确认保证金抵粮款
|
|
|
+ else if ("7".equals(expenseInfo.getFlag())) {
|
|
|
+ List<ExpenseInfo> expenseInfoList=this.selectList(new EntityWrapper<ExpenseInfo>()
|
|
|
+ .eq("relation_id",expenseInfo1.getRelationId()));
|
|
|
+ if (!CollectionUtils.isEmpty(expenseInfoList)){
|
|
|
+ for (ExpenseInfo expenseInfo2:expenseInfoList){
|
|
|
+ expenseInfo2.setStatusFlag(StatusEnum.COMPLETED.getFlag());
|
|
|
+ expenseInfo2.setStatus(StatusEnum.COMPLETED.getName());
|
|
|
+ this.updateById(expenseInfo2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 主表信息编辑
|
|
|
this.updateById(expenseInfo);
|
|
|
if (flag == 1) {
|
|
@@ -1188,6 +1200,112 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Page<ExpenseInfo> selectBondInfo(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("contractType", expenseInfo.getContractType());
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String foodAllowance(ExpenseInfo expenseInfo) {
|
|
|
+ String relationId=IdGenerator.generateUUID();
|
|
|
+ //生成抵粮款的费用信息
|
|
|
+ ExpenseInfo expenseInfo1=new ExpenseInfo();
|
|
|
+ expenseInfo1.setId(IdGenerator.generateUUID());
|
|
|
+ expenseInfo1.setRelationId(relationId);
|
|
|
+ expenseInfo1.setCompId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+ expenseInfo1.setAmountMoney(expenseInfo.getAmountMoney());
|
|
|
+ expenseInfo1.setExpensesType("2");
|
|
|
+ expenseInfo1.setExpenseName("保证金抵粮款");
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ Integer num=this.expenseCount(expenseInfo1)+1;
|
|
|
+ String newNo="";
|
|
|
+ //一位数
|
|
|
+ if (num < 10) {
|
|
|
+ newNo="000" + num;
|
|
|
+ }
|
|
|
+ //两位数
|
|
|
+ else if (num < 100) {
|
|
|
+ newNo="00" + num;
|
|
|
+ }
|
|
|
+ //三位数
|
|
|
+ else if (num < 1000) {
|
|
|
+ newNo="0" + num;
|
|
|
+ }
|
|
|
+ //四位数
|
|
|
+ else if (num < 10000) {
|
|
|
+ newNo=String.valueOf(num);
|
|
|
+ }
|
|
|
+ String no = "HTF"+df.format(new Date())+newNo;
|
|
|
+ expenseInfo1.setCostNo(no);
|
|
|
+ expenseInfo1.setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
|
+ expenseInfo1.setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
|
+ expenseInfo1.setExpensesPurpose("1");
|
|
|
+ expenseInfo1.setCostType("5");
|
|
|
+ expenseInfo1.setContractNo(expenseInfo.getContractNo());
|
|
|
+ expenseInfo1.setAgent(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffName());
|
|
|
+ expenseInfo1.setUnallocatedAmount(0d);
|
|
|
+ boolean one =this.insert(expenseInfo1);
|
|
|
+ ExpenseInfo expenseInfo2=new ExpenseInfo();
|
|
|
+ expenseInfo2.setId(IdGenerator.generateUUID());
|
|
|
+ expenseInfo2.setRelationId(relationId);
|
|
|
+ expenseInfo2.setCompId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+ expenseInfo2.setAmountMoney(expenseInfo.getAmountMoney());
|
|
|
+ expenseInfo2.setExpensesType("1");
|
|
|
+ expenseInfo2.setExpenseName("保证金抵粮款");
|
|
|
+ SimpleDateFormat df1 = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ Integer num1=this.expenseCount(expenseInfo2)+1;
|
|
|
+ String newNo1="";
|
|
|
+ //一位数
|
|
|
+ if (num < 10) {
|
|
|
+ newNo1="000" + num1;
|
|
|
+ }
|
|
|
+ //两位数
|
|
|
+ else if (num < 100) {
|
|
|
+ newNo1="00" + num1;
|
|
|
+ }
|
|
|
+ //三位数
|
|
|
+ else if (num < 1000) {
|
|
|
+ newNo1="0" + num1;
|
|
|
+ }
|
|
|
+ //四位数
|
|
|
+ else if (num < 10000) {
|
|
|
+ newNo1=String.valueOf(num1);
|
|
|
+ }
|
|
|
+ String no1 = "HTF"+df1.format(new Date())+newNo1;
|
|
|
+ expenseInfo2.setCostNo(no1);
|
|
|
+ expenseInfo2.setStatusFlag(StatusEnum.TO_BE_CONFIRMED.getFlag());
|
|
|
+ expenseInfo2.setStatus(StatusEnum.TO_BE_CONFIRMED.getName());
|
|
|
+ expenseInfo2.setExpensesPurpose("1");
|
|
|
+ expenseInfo2.setCostType("1");
|
|
|
+ expenseInfo2.setContractNo(expenseInfo.getContractNo());
|
|
|
+ expenseInfo2.setAgent(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffName());
|
|
|
+ expenseInfo2.setUnallocatedAmount(0d);
|
|
|
+ boolean two =this.insert(expenseInfo2);
|
|
|
+ // 假如 都成功返回ok
|
|
|
+ if (one && two) {
|
|
|
+ return "OK";
|
|
|
+ } else {
|
|
|
+ return "NG";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private String addDateOneDay(Date date) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|