后台业务办理记录查询,app业务办理记录查询

This commit is contained in:
hayu 2025-02-19 20:29:20 +08:00
parent 85d9e0bacd
commit f4ca04f11b
25 changed files with 709 additions and 10 deletions

View File

@ -253,4 +253,6 @@ public class LeaseApplyInfo extends BaseEntity{
@ApiModelProperty(value = "采购申请编号") @ApiModelProperty(value = "采购申请编号")
private String applyCode; private String applyCode;
private Integer isApp;
} }

View File

@ -61,9 +61,17 @@ public class LeaseTaskController extends BaseController {
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
try { try {
List<LeaseApplyInfo> list = service.selectLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = service.selectLeaseApplyInfoList(leaseApplyInfo);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); if (leaseApplyInfo.getIsApp()==null){
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}else {
return AjaxResult.success(list);
}
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>())); if (leaseApplyInfo.getIsApp()==null){
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
}else {
return AjaxResult.success(new ArrayList<>());
}
} }
} }

View File

@ -103,6 +103,20 @@ public class DirectRotationController extends BaseController {
} }
} }
/**
* 直转记录查询列表--app
*/
@ApiOperation(value = "直转记录查询列表")
@GetMapping("/appList")
public AjaxResult appList(DirectApplyInfo directApplyInfo) {
try {
List<DirectApplyInfo> directApplyInfos = service.getList(directApplyInfo);
return AjaxResult.success(directApplyInfos);
} catch (Exception e) {
return AjaxResult.success(new ArrayList<>());
}
}
@ApiOperation(value = "查看详情") @ApiOperation(value = "查看详情")
@GetMapping("/getInfo") @GetMapping("/getInfo")
public AjaxResult getInfo(SltAgreementInfo sltAgreementInfo) { public AjaxResult getInfo(SltAgreementInfo sltAgreementInfo) {

View File

@ -150,4 +150,8 @@ public class DirectApplyInfo extends BaseEntity {
*/ */
private List<DirectApplyDetails> directApplyDetails; private List<DirectApplyDetails> directApplyDetails;
private Integer isApp;
private Integer taskStatus;
} }

View File

@ -0,0 +1,76 @@
package com.bonus.material.record.controller;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.record.service.IDerateReocrdQueryService;
import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* @description 减免记录查询
* @author hay
* @date 2025/2/19 10:43
*/
@Api(tags = "减免记录查询")
@RestController
@RequestMapping("/derateRecordQuery")
@Slf4j
public class DerateRecordQueryController extends BaseController {
@Autowired
private IDerateReocrdQueryService service;
/**
* 减免记录查询列表
*/
@ApiOperation(value = "减免记录查询列表")
@GetMapping("/getList")
public TableDataInfo getList(SltAgreementInfo bean) {
startPage();
try {
List<SltAgreementReduce> list = service.getList(bean);
return getDataTable(list);
} catch (Exception e) {
return getDataTable(new ArrayList<>());
}
}
/**
* 减免记录查询列表--app
*/
@ApiOperation(value = "减免记录查询列表")
@GetMapping("/getAppList")
public AjaxResult getAppList(SltAgreementInfo bean) {
try {
List<SltAgreementReduce> list = service.getList(bean);
return AjaxResult.success(list);
} catch (Exception e) {
return AjaxResult.success(new ArrayList<>());
}
}
/**
* 删除减免记录
*/
@ApiOperation(value = "删除减免记录")
@PreventRepeatSubmit
@SysLog(title = "直转记录查询", businessType = OperaType.DELETE, logType = 1,module = "减免申请记录查询->删除减免记录")
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(service.delData(id));
}
}

View File

@ -0,0 +1,62 @@
package com.bonus.material.record.controller;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.service.ISltAgreementInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* @description 结算记录查询
* @author hay
* @date 2025/2/19 10:43
*/
@Api(tags = "结算记录查询")
@RestController
@RequestMapping("/sltRecordQuery")
@Slf4j
public class SltRecordQueryController extends BaseController {
@Autowired
private ISltReocrdQueryService service;
/**
* 结算记录查询列表
*/
@ApiOperation(value = "结算记录查询列表")
@GetMapping("/getList")
public TableDataInfo getList(SltAgreementInfo bean) {
startPage();
try {
List<SltAgreementInfo> list = service.getList(bean);
return getDataTable(list);
} catch (Exception e) {
return getDataTable(new ArrayList<>());
}
}
/**
* 结算记录查询列表--app
*/
@ApiOperation(value = "结算记录查询列表")
@GetMapping("/getAppList")
public AjaxResult getAppList(SltAgreementInfo bean) {
try {
List<SltAgreementInfo> list = service.getList(bean);
return AjaxResult.success(list);
} catch (Exception e) {
return AjaxResult.success(new ArrayList<>());
}
}
}

View File

@ -0,0 +1,29 @@
package com.bonus.material.record.mapper;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import java.util.List;
/**
* @description 减免记录查询
* @author hay
* @date 2025/2/19 10:50
*/
public interface DerateRecordQueryMapper {
/**
* 减免记录查询列表
* @param bean
* @return
*/
List<SltAgreementReduce> getList(SltAgreementInfo bean);
/**
* 删除减免记录
* @param id
* @return
*/
int delData(Long id);
}

View File

@ -0,0 +1,21 @@
package com.bonus.material.record.mapper;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import java.util.List;
/**
* @description 结算记录查询
* @author hay
* @date 2025/2/19 10:50
*/
public interface SltRecordQueryMapper {
/**
* 结算记录查询列表
* @param bean
* @return
*/
List<SltAgreementInfo> getList(SltAgreementInfo bean);
}

View File

@ -0,0 +1,29 @@
package com.bonus.material.record.service;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import java.util.List;
/**
* @description 减免记录查询
* @author hay
* @date 2025/2/19 10:46
*/
public interface IDerateReocrdQueryService {
/**
* 根据条件获取减免记录
* @param bean
* @return
*/
List<SltAgreementReduce> getList(SltAgreementInfo bean);
/**
* 删除减免记录
* @param id
* @return
*/
int delData(Long id);
}

View File

@ -0,0 +1,21 @@
package com.bonus.material.record.service;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import java.util.List;
/**
* @description 结算记录查询
* @author hay
* @date 2025/2/19 10:46
*/
public interface ISltReocrdQueryService {
/**
* 根据条件获取结算记录
* @param bean
* @return
*/
List<SltAgreementInfo> getList(SltAgreementInfo bean);
}

View File

@ -0,0 +1,38 @@
package com.bonus.material.record.service.impl;
import com.bonus.material.record.mapper.DerateRecordQueryMapper;
import com.bonus.material.record.mapper.SltRecordQueryMapper;
import com.bonus.material.record.service.IDerateReocrdQueryService;
import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @description 减免记录查询
* @author hay
* @date 2025/2/19 10:47
*/
@Service
public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService {
@Resource
private DerateRecordQueryMapper mapper;
@Override
public List<SltAgreementReduce> getList(SltAgreementInfo bean) {
return mapper.getList(bean);
}
@Override
public int delData(Long id) {
try {
mapper.delData(id);
return 1;
} catch (Exception e) {
return 0;
}
}
}

View File

@ -0,0 +1,34 @@
package com.bonus.material.record.service.impl;
import com.bonus.material.record.mapper.SltRecordQueryMapper;
import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @description 结算记录查询
* @author hay
* @date 2025/2/19 10:47
*/
@Service
public class SltRecordQueryServiceImpl implements ISltReocrdQueryService {
@Resource
private SltRecordQueryMapper mapper;
@Override
public List<SltAgreementInfo> getList(SltAgreementInfo bean) {
List<SltAgreementInfo> list = mapper.getList(bean);
if (list.size()>0){
for (SltAgreementInfo sltAgreementInfo : list) {
if (sltAgreementInfo.getAgreementId()!=null){
}
}
}
return list;
}
}

View File

@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
@ -19,9 +20,11 @@ import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.countersign.domain.SignConfigVo; import com.bonus.material.countersign.domain.SignConfigVo;
import com.bonus.material.lease.domain.vo.LeaseOutVo; import com.bonus.material.lease.domain.vo.LeaseOutVo;
import com.bonus.material.settlement.domain.SltAgreementApply; import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import com.bonus.material.settlement.domain.vo.SltInfoVo; import com.bonus.material.settlement.domain.vo.SltInfoVo;
import com.bonus.material.settlement.domain.vo.SltLeaseInfo; import com.bonus.material.settlement.domain.vo.SltLeaseInfo;
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper; import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
import com.bonus.material.settlement.mapper.SltAgreementReduceMapper;
import com.bonus.material.task.domain.TmTask; import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.task.mapper.TmTaskMapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -67,6 +70,9 @@ public class SltAgreementInfoController extends BaseController {
@Autowired @Autowired
private TmTaskMapper taskMapper; private TmTaskMapper taskMapper;
@Resource
private SltAgreementReduceMapper sltAgreementRecudceMapper;
/** /**
* 查询结算信息列表 * 查询结算信息列表
*/ */
@ -97,6 +103,18 @@ public class SltAgreementInfoController extends BaseController {
return AjaxResult.success(bean); return AjaxResult.success(bean);
} }
@ApiOperation(value = "结算记录查询明细")
@PostMapping("/getSltRecordDetailsList")
public AjaxResult getSltRecordDetailsList(@RequestBody SltAgreementInfo info) {
try {
SltInfoVo bean = sltAgreementInfoService.getSltRecordDetailsList(info);
return AjaxResult.success(bean);
} catch (Exception e) {
return AjaxResult.success(new SltInfoVo());
}
}
/** /**
* 获取结算审核列表 * 获取结算审核列表
*/ */
@ -189,13 +207,14 @@ public class SltAgreementInfoController extends BaseController {
* 导出结算单--all * 导出结算单--all
* @throws Exception * @throws Exception
*/ */
private void expOutExcelAll(HttpServletResponse response, List<SltLeaseInfo> lease,List<SltLeaseInfo> lose,List<SltLeaseInfo> repair,List<SltLeaseInfo> scrap, private void expOutExcelAll(HttpServletResponse response, List<SltLeaseInfo> lease,List<SltLeaseInfo> lose,List<SltLeaseInfo> repair,List<SltLeaseInfo> scrap,List<SltLeaseInfo> reduction,
String filename,String projectName,String unitName,BigDecimal totalCostLease,BigDecimal totalCostLose,BigDecimal totalCostRepair,BigDecimal totalCostScrap) String filename,String projectName,String unitName,BigDecimal totalCostLease,BigDecimal totalCostLose,BigDecimal totalCostRepair,BigDecimal totalCostScrap,BigDecimal totalCostReduction)
throws Exception { throws Exception {
List<Map<String, Object>> resultsLease = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> resultsLease = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> resultsLose = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> resultsLose = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> resultsRepair = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> resultsRepair = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> resultsScrap = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> resultsScrap = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> resultsReduction = new ArrayList<Map<String, Object>>();
if (lease!= null) { if (lease!= null) {
int sizeLease = lease.size(); int sizeLease = lease.size();
@ -230,6 +249,15 @@ public class SltAgreementInfoController extends BaseController {
} }
} }
if (reduction!= null) {
int sizeReduction = reduction.size();
for (int i = 0; i < sizeReduction; i++) {
SltLeaseInfo bean = reduction.get(i);
Map<String, Object> maps = outReceiveDetailsBeanToMap(bean,5,1);
resultsReduction.add(maps);
}
}
List<String> headersLease = receiveDetailsHeader(1,1); List<String> headersLease = receiveDetailsHeader(1,1);
List<String> headersLose = receiveDetailsHeader(2,1); List<String> headersLose = receiveDetailsHeader(2,1);
List<String> headersRepair = receiveDetailsHeader(3,1); List<String> headersRepair = receiveDetailsHeader(3,1);
@ -325,7 +353,18 @@ public class SltAgreementInfoController extends BaseController {
maps.put("t3", ""); maps.put("t3", "");
maps.put("t4", ""); maps.put("t4", "");
} }
} } else if(type==5){
maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName());
maps.put("leasePrice", bean.getLeasePrice());
maps.put("num", bean.getNum());
maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime()));
maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime()));
maps.put("leaseDays", bean.getLeaseDays());
maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP));
maps.put("remark", bean.getRemark());
}
return maps; return maps;
} }
@ -532,6 +571,38 @@ public class SltAgreementInfoController extends BaseController {
} }
} }
/**
* 导出减免费用明细
*/
@ApiOperation(value = "导出减免费用明细")
@PreventRepeatSubmit
// @RequiresPermissions("settlement:info:export")
@SysLog(title = "结算信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出减免费用明细")
@PostMapping("/exportReduction")
public void exportReduction(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) {
try {
String fileName = "减免费用明细表";
String projectName = sltAgreementInfo.getProjectName();
String unitName = sltAgreementInfo.getUnitName();
BigDecimal reductionCost = BigDecimal.valueOf(0.00);
List<SltAgreementReduce> reductionList = new ArrayList<>();
if (sltAgreementInfo.getAgreementId() != null){
SltAgreementReduce bean =new SltAgreementReduce();
bean.setAgreementId(sltAgreementInfo.getAgreementId());
reductionList = sltAgreementRecudceMapper.getReductionList(bean);
}
for (SltAgreementReduce reduction : reductionList) {
if(reduction.getLeaseMoney()!=null){
reductionCost = reductionCost.add(reduction.getLeaseMoney());
}
}
List<SltLeaseInfo> repair = Convert.toList(SltLeaseInfo.class, reductionList);
expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,3);
} catch (Exception e) {
log.error(e.toString(), e);
}
}
/** /**
* 导出报废费用明细 * 导出报废费用明细
*/ */
@ -686,7 +757,22 @@ public class SltAgreementInfoController extends BaseController {
} }
List<SltLeaseInfo> scrap = Convert.toList(SltLeaseInfo.class, scrapList); List<SltLeaseInfo> scrap = Convert.toList(SltLeaseInfo.class, scrapList);
expOutExcelAll(response,lease,lose,repair,scrap,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap); //减免费用明细
BigDecimal totalCostReduction = BigDecimal.valueOf(0.00);
List<SltAgreementReduce> reductionList = new ArrayList<>();
if (sltAgreementInfo.getAgreementId()!=null){
SltAgreementReduce bean =new SltAgreementReduce();
bean.setAgreementId(sltAgreementInfo.getAgreementId());
reductionList = sltAgreementRecudceMapper.getReductionList(bean);
for (SltAgreementReduce reduction : reductionList){
if(reduction.getLeaseMoney()!=null){
totalCostReduction = totalCostReduction.add(reduction.getLeaseMoney());
}
}
}
List<SltLeaseInfo> reduction = Convert.toList(SltLeaseInfo.class, reductionList);
expOutExcelAll(response,lease,lose,repair,scrap,reduction,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction);
} catch (Exception e) { } catch (Exception e) {
log.error(e.toString(), e); log.error(e.toString(), e);
} }

View File

@ -213,4 +213,12 @@ public class SltAgreementInfo extends BaseEntity {
private Integer type; private Integer type;
private Integer taskStatus;
private String startDate;
private String endDate;
private Integer isApp;
} }

View File

@ -92,6 +92,9 @@ public class SltAgreementReduce extends BaseEntity {
@ApiModelProperty(value = "租赁金额") @ApiModelProperty(value = "租赁金额")
private BigDecimal leaseMoney; private BigDecimal leaseMoney;
@ApiModelProperty(value = "累计减免费用")
private BigDecimal leaseMoneyAll;
@ApiModelProperty(value = "减免数量") @ApiModelProperty(value = "减免数量")
private BigDecimal reduceNum; private BigDecimal reduceNum;
@ -117,4 +120,9 @@ public class SltAgreementReduce extends BaseEntity {
private BmFileInfo file; private BmFileInfo file;
private List<SltAgreementReduce> detailList; private List<SltAgreementReduce> detailList;
private String typeName;
private String modeName;
private String unitName;
private String projectName;
} }

View File

@ -2,6 +2,7 @@ package com.bonus.material.settlement.domain.vo;
import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.annotation.Excel;
import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import com.bonus.material.settlement.domain.SltAgreementRelation; import com.bonus.material.settlement.domain.SltAgreementRelation;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -43,6 +44,11 @@ public class SltInfoVo {
*/ */
List<SltAgreementInfo> loseList; List<SltAgreementInfo> loseList;
/**
* 减免费用列表
*/
List<SltAgreementReduce> reductionList;
List<SltAgreementRelation> relations; List<SltAgreementRelation> relations;
/** /**
@ -69,6 +75,12 @@ public class SltInfoVo {
@ApiModelProperty(value = "丢失费用小计") @ApiModelProperty(value = "丢失费用小计")
private BigDecimal loseCost; private BigDecimal loseCost;
/**
* 减免费用小计
*/
@ApiModelProperty(value = "减免费用小计")
private BigDecimal reductionCost;
/** /**
* 合计 * 合计
*/ */

View File

@ -206,4 +206,6 @@ public class SltLeaseInfo extends BaseEntity {
private String keyWord; private String keyWord;
private String remark;
} }

View File

@ -31,4 +31,11 @@ public interface SltAgreementReduceMapper {
List<SltAgreementReduce> selectByMatype(SltAgreementReduce sltAgreement); List<SltAgreementReduce> selectByMatype(SltAgreementReduce sltAgreement);
List<SltAgreementReduce> selectByMaModel(SltAgreementReduce sltAgreement); List<SltAgreementReduce> selectByMaModel(SltAgreementReduce sltAgreement);
/**
* 根据协议Id查询减免明细
* @param bean
* @return
*/
List<SltAgreementReduce> getReductionList(SltAgreementReduce bean);
} }

View File

@ -97,4 +97,12 @@ public interface ISltAgreementInfoService {
* @return 结果 * @return 结果
*/ */
AjaxResult costExamine(SltAgreementApply sltAgreementApply); AjaxResult costExamine(SltAgreementApply sltAgreementApply);
/**
* 结算记录查询明细
*
* @param info 结算信息
* @return 结果
*/
SltInfoVo getSltRecordDetailsList(SltAgreementInfo info);
} }

View File

@ -11,8 +11,10 @@ import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils; import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.countersign.domain.SignConfigVo; import com.bonus.material.countersign.domain.SignConfigVo;
import com.bonus.material.settlement.domain.SltAgreementApply; import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.SltAgreementReduce;
import com.bonus.material.settlement.domain.SltAgreementRelation; import com.bonus.material.settlement.domain.SltAgreementRelation;
import com.bonus.material.settlement.domain.vo.SltInfoVo; import com.bonus.material.settlement.domain.vo.SltInfoVo;
import com.bonus.material.settlement.mapper.SltAgreementReduceMapper;
import com.bonus.material.task.domain.TmTask; import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.task.mapper.TmTaskMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -38,6 +40,9 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
@Autowired @Autowired
private TmTaskMapper taskMapper; private TmTaskMapper taskMapper;
@Resource
private SltAgreementReduceMapper sltAgreementRecudceMapper;
/** /**
* 查询结算信息 * 查询结算信息
* *
@ -320,6 +325,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
return loseList; return loseList;
} }
private List<SltAgreementReduce> getReductionList(SltAgreementInfo info) {
SltAgreementReduce bean =new SltAgreementReduce();
bean.setAgreementId(info.getAgreementId());
List<SltAgreementReduce> reductionList = sltAgreementRecudceMapper.getReductionList(bean);
return reductionList;
}
private List<SltAgreementRelation> getRelations(List<SltAgreementInfo> leaseList, List<SltAgreementInfo> repairList, private List<SltAgreementRelation> getRelations(List<SltAgreementInfo> leaseList, List<SltAgreementInfo> repairList,
List<SltAgreementInfo> scrapList, List<SltAgreementInfo> loseList, List<SltAgreementInfo> scrapList, List<SltAgreementInfo> loseList,
SltAgreementInfo sltInfo) { SltAgreementInfo sltInfo) {
@ -497,4 +509,72 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
return AjaxResult.error(); return AjaxResult.error();
} }
} }
@Override
public SltInfoVo getSltRecordDetailsList(SltAgreementInfo info) {
SltInfoVo sltInfoVo = new SltInfoVo();
sltInfoVo.setUnitName(info.getUnitName());
sltInfoVo.setProjectName(info.getProjectName());
BigDecimal leaseCost = BigDecimal.valueOf(0.00);
BigDecimal repairCost = BigDecimal.valueOf(0.00);
BigDecimal scrapCost = BigDecimal.valueOf(0.00);
BigDecimal loseCost = BigDecimal.valueOf(0.00);
BigDecimal reductionCost = BigDecimal.valueOf(0.00);
//租赁费用列表
List<SltAgreementInfo> leaseList = getLeaseList(info);
//维修费用列表
List<SltAgreementInfo> repairList = getRepairList(info);
//报废费用列表
List<SltAgreementInfo> scrapList = getScrapList(info);
//丢失费用列表
List<SltAgreementInfo> loseList = getLoseList(info);
//减免费用列表
List<SltAgreementReduce> reductionList = getReductionList(info);
sltInfoVo.setLeaseList(leaseList);
sltInfoVo.setRepairList(repairList);
sltInfoVo.setScrapList(scrapList);
sltInfoVo.setLoseList(loseList);
sltInfoVo.setReductionList(reductionList);
for (SltAgreementInfo lease : leaseList) {
if(lease.getCosts()!=null){
leaseCost = leaseCost.add(lease.getCosts());
}
}
for (SltAgreementInfo repair : repairList) {
if(repair.getCosts()!=null && (repair.getPartType().equals("收费"))){
repairCost = repairCost.add(repair.getCosts());
}
}
for (SltAgreementInfo scrap : scrapList) {
if(scrap.getCosts()!=null && (scrap.getPartType().equals("收费"))){
scrapCost = scrapCost.add(scrap.getCosts());
}
}
for (SltAgreementInfo lose : loseList) {
if(lose.getCosts()!=null){
loseCost = loseCost.add(lose.getCosts());
}
}
for (SltAgreementReduce reduction : reductionList){
if(reduction.getLeaseMoney()!=null){
reductionCost = reductionCost.add(reduction.getLeaseMoney());
}
}
sltInfoVo.setLeaseCost(leaseCost);
sltInfoVo.setRepairCost(repairCost);
sltInfoVo.setScrapCost(scrapCost);
sltInfoVo.setLoseCost(loseCost);
sltInfoVo.setReductionCost(reductionCost);
List<SltAgreementRelation> relations = getRelations(leaseList, repairList, scrapList, loseList, info);
//加上减免
if (relations.size()>0){
relations.get(0).setSubCost(reductionCost);
}
sltInfoVo.setRelations(relations);
return sltInfoVo;
}
} }

View File

@ -110,7 +110,13 @@
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url,
lai.lease_sign_type, lai.lease_sign_type,
bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus, bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus,
sda.dict_label as taskStatusName, case tt.task_status
when 0 then '待审核'
when 1 then '待审核'
when 2 then '审核中'
when 3 then '已完成'
when 4 then '已完成'
end as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum, IFNULL(sum(lad.al_num),0) as alNum,
GROUP_CONCAT(DISTINCT mt1.type_name) AS maTypeNames, GROUP_CONCAT(DISTINCT mt1.type_name) AS maTypeNames,
@ -276,7 +282,7 @@
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" <select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo"
resultMap="LeaseApplyInfoResult"> resultMap="LeaseApplyInfoResult">
<include refid="selectLeaseApplyInfoVo"/> <include refid="selectLeaseApplyInfoVo"/>
<where> where 1=1
<if test="code != null and code != ''">and lai.code = #{code}</if> <if test="code != null and code != ''">and lai.code = #{code}</if>
<if test="taskId != null ">and lai.task_id = #{taskId}</if> <if test="taskId != null ">and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if> <if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if>
@ -316,7 +322,7 @@
) )
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[ AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]> AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if> </if>
<if test="directId != null ">and lai.direct_id = #{directId}</if> <if test="directId != null ">and lai.direct_id = #{directId}</if>
<if test="leaseType != null and leaseType != ''">and lai.lease_type = #{leaseType}</if> <if test="leaseType != null and leaseType != ''">and lai.lease_type = #{leaseType}</if>
@ -325,7 +331,8 @@
#{costBearingParty} #{costBearingParty}
</if> </if>
and lai.apply_code is not null and lai.apply_code is not null
</where> <if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
GROUP BY lai.id GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc ORDER BY tt.task_status,tt.create_time desc
</select> </select>

View File

@ -128,6 +128,8 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and dai.status = #{status} and dai.status = #{status}
</if> </if>
<if test="isApp != null and taskStatus==0">and dai.status = 0 </if>
<if test="isApp != null and taskStatus==1">and (dai.status = 1 or dai.status = 2)</if>
</where> </where>
GROUP BY dai.id GROUP BY dai.id
order by dai.create_time desc order by dai.create_time desc

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.record.mapper.DerateRecordQueryMapper">
<select id="getList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce">
SELECT
sra.id as id,
sra.create_time as createTime,
su.user_name as createBy,
bu.unit_name as unitName,
bp.pro_name as projectName,
SUM(srd.lease_price * srd.num) as leasePrice,
SUM(srd.lease_money) as leaseMoney,
sra.`status`,
a.leaseMoneyAll as leaseMoneyAll
FROM
slt_reduce_apply sra
LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id
LEFT JOIN sys_user su on su.user_id=sra.creator
LEFT JOIN bm_agreement_info bai on bai.agreement_id=sra.agreement_id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
LEFT JOIN
(
SELECT
sra.agreement_id as agreementId,
SUM(srd.lease_money) as leaseMoneyAll
FROM
slt_reduce_apply sra
LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id
GROUP BY sra.agreement_id
) a on a.agreementId=sra.agreement_id
where 1=1
<if test="startTime != null and endTime != ''">
AND sra.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="startDate != null and endDate != ''">
AND sra.create_time BETWEEN #{startDate} AND #{endDate}
</if>
<if test="keyWord != null and keyWord != ''">
AND (
su.user_name LIKE concat('%', #{keyWord}, '%') or
bu.unit_name LIKE concat('%', #{keyWord}, '%') or
bp.pro_name LIKE concat('%', #{keyWord}, '%')
)
</if>
<if test="status != null and status!=''">
AND sra.status = #{status}
</if>
<if test="taskStatus !=null">
AND sra.status = #{taskStatus}
</if>
GROUP BY sra.id
ORDER BY sra.create_time DESC
</select>
<delete id="delData">
delete
from slt_reduce_apply
where id = #{id};
delete
from slt_reduce_details
where apply_id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.record.mapper.SltRecordQueryMapper">
<select id="getList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT saa.create_time as createTime,
su.user_name as createBy,
bui.unit_id AS unitId,
bui.unit_name AS unitName,
bp.pro_id AS projectId,
bp.pro_name AS projectName,
bai.agreement_id AS agreementId,
bai.agreement_code AS agreementCode,
saa.cost AS costs,
saa.`status`,
saa.remark
FROM slt_agreement_apply saa
LEFT JOIN sys_user su on su.user_id = saa.creator and su.del_flag = 0
LEFT JOIN bm_agreement_info bai on bai.agreement_id = saa.agreement_id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
WHERE saa.status in ('1', '2', '3')
<if test="keyWord != null and keyWord != ''">
AND (
su.user_name LIKE concat('%', #{keyWord}, '%') or
bui.unit_name LIKE concat('%', #{keyWord}, '%') or
bp.pro_name LIKE concat('%', #{keyWord}, '%') or
bai.agreement_code LIKE concat('%', #{keyWord}, '%') or
saa.remark LIKE concat('%', #{keyWord}, '%')
)
</if>
<if test="startTime != null and endTime != ''">
AND DATE_FORMAT( saa.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="startDate != null and endDate != ''">
AND DATE_FORMAT( saa.create_time, '%Y-%m-%d' ) BETWEEN #{startDate} AND #{endDate}
</if>
<if test="status != null">
AND saa.status = #{status}
</if>
<if test="taskStatus != null">
AND saa.status = #{taskStatus}
</if>
<if test="unitId != null and unitId != ''">
AND bui.unit_id = #{unitId}
</if>
<if test="projectId != null and projectId != ''">
AND bp.pro_id = #{projectId}
</if>
ORDER BY saa.update_time DESC
</select>
</mapper>

View File

@ -228,4 +228,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.agreement_id = #{agreementId} and mt2.type_id = #{typeId} sai.agreement_id = #{agreementId} and mt2.type_id = #{typeId}
group by mt.type_id group by mt.type_id
</select> </select>
<select id="getReductionList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce">
SELECT mt2.type_name as typeName,
mt.type_name as modeName,
mt.unit_name as unitName,
srd.lease_price as leasePrice,
srd.reduce_num as reduceNum,
srd.start_time as startTime,
srd.end_time as endTime,
srd.days as days,
srd.lease_money as leaseMoney,
sra.remark
FROM slt_reduce_apply sra
LEFT JOIN slt_reduce_details srd on sra.id = srd.apply_id
LEFT JOIN ma_type mt on mt.type_id = srd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
WHERE sra.agreement_id = #{agreementId}
</select>
</mapper> </mapper>