结算页面优化

This commit is contained in:
mashuai 2025-12-11 13:17:21 +08:00
parent 16f385fb5b
commit aa9fbe8759
8 changed files with 264 additions and 47 deletions

View File

@ -28,6 +28,7 @@ import com.bonus.common.biz.constant.GlobalConstants;
import com.bonus.common.biz.utils.RequestContext;
import com.bonus.common.biz.utils.StringHelper;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.log.enums.OperatorType;
@ -1608,11 +1609,15 @@ public class SltAgreementInfoController extends BaseController {
*/
@ApiOperation(value = "丢失报表list查询")
@GetMapping("/getLostReportList")
public TableDataInfo getLostReportList(SltAgreementInfo bean) {
startPage();
public AjaxResult getLostReportList(SltAgreementInfo bean) {
/*startPage();
List<SltAgreementInfo> list = sltAgreementInfoService.getLostReportList(bean);
return getDataTable(list);
return getDataTable(list);*/
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List<SltAgreementInfo> list = sltAgreementInfoService.getLostReportList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**
@ -1624,9 +1629,16 @@ public class SltAgreementInfoController extends BaseController {
@PostMapping("/exportLostList")
public void exportLostList(HttpServletResponse response, SltAgreementInfoLose bean)
{
String fileName = "丢失费用报表";
List<SltAgreementInfoLose> list = sltAgreementInfoService.getLostReportListExport(bean);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
list.get(i).setSeq(i + 1);
}
ExcelUtil<SltAgreementInfoLose> util = new ExcelUtil<>(SltAgreementInfoLose.class);
util.exportExcel(response, list, "导出丢失费用报表");
// 获取当前年月日时分秒导出时间用括号拼接在后面
String title = "丢失费用报表" + "" + "导出时间:" + DateUtils.getTime() + "";
util.exportExcel(response, list, fileName, title);
}
/**
@ -1649,9 +1661,16 @@ public class SltAgreementInfoController extends BaseController {
@PostMapping("/exportRepairList")
public void exportRepairList(HttpServletResponse response, SltAgreementInfoRepair bean)
{
String fileName = "维修费用报表";
List<SltAgreementInfoRepair> list = sltAgreementInfoService.getRepairReportListExport(bean);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
list.get(i).setSeq(i + 1);
}
ExcelUtil<SltAgreementInfoRepair> util = new ExcelUtil<>(SltAgreementInfoRepair.class);
util.exportExcel(response, list, "导出维修费用报表");
// 获取当前年月日时分秒导出时间用括号拼接在后面
String title = "维修费用报表" + "" + "导出时间:" + DateUtils.getTime() + "";
util.exportExcel(response, list, fileName, title);
}
/**
@ -1674,9 +1693,16 @@ public class SltAgreementInfoController extends BaseController {
@PostMapping("/exportScrapList")
public void exportScrapList(HttpServletResponse response, SltAgreementInfoScrap bean)
{
String fileName = "报废费用报表";
List<SltAgreementInfoScrap> list = sltAgreementInfoService.getScrapReportListExport(bean);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
list.get(i).setSeq(i + 1);
}
ExcelUtil<SltAgreementInfoScrap> util = new ExcelUtil<>(SltAgreementInfoScrap.class);
util.exportExcel(response, list, "导出报废费用报表");
// 获取当前年月日时分秒导出时间用括号拼接在后面
String title = "报废费用报表" + "" + "导出时间:" + DateUtils.getTime() + "";
util.exportExcel(response, list, fileName, title);
}
/**

View File

@ -63,4 +63,7 @@ public class PeriodCostQueryDto {
@ApiModelProperty(value = "数据所属组织ID")
private Long companyId;
@ApiModelProperty(value = "竣工状态 0=未竣工,1=已竣工")
private String isFinish;
}

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -116,4 +117,15 @@ public class PeriodCostResultVo {
private Integer comsumable;
private String settlementStatus;
@ApiModelProperty(value = "竣工状态 0=未竣工,1=已竣工")
private String isFinish;
@ApiModelProperty(value = "竣工状态 汉字")
private String proStatus;
@ApiModelProperty(value = "竣工日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date actualEndDate;
}

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.bonus.common.core.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -104,4 +105,15 @@ public class PeriodCostSummaryVo {
@ApiModelProperty(value = "备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(value = "竣工状态 0=未竣工,1=已竣工")
private String isFinish;
@ApiModelProperty(value = "竣工状态 汉字")
private String proStatus;
@ApiModelProperty(value = "竣工日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date actualEndDate;
}

View File

@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -36,13 +38,21 @@ public class SltAgreementInfoLose extends BaseEntity {
*/
private List<Long> agreementIds;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", cellType = Excel.ColumnType.NUMERIC, width = 5, sort = 0)
private Integer seq;
/**
* 协议编号
*/
@Excel(name = "协议编号",sort = 1)
@Excel(name = "协议",sort = 1)
@ApiModelProperty(value = "协议编号")
private String agreementCode;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司", sort = 2)
private String impUnitName;
@ApiModelProperty("结算申请单号")
private String sltApplyCode;
@ -52,20 +62,20 @@ public class SltAgreementInfoLose extends BaseEntity {
/**
* 设备名称
*/
@Excel(name = "机具名称",sort = 4)
@Excel(name = "机具名称",sort = 5)
@ApiModelProperty(value = "机具名称")
private String typeName;
/**
* 规格型号
*/
@Excel(name = "规格型号",sort = 5)
@Excel(name = "规格型号",sort = 6)
@ApiModelProperty(value = "规格型号")
private String modelName;
/**
* 计量单位
*/
@Excel(name = "单位",sort = 6)
@Excel(name = "单位",sort = 7)
@ApiModelProperty(value = "计量单位")
private String mtUnitName;
/**
@ -78,7 +88,7 @@ public class SltAgreementInfoLose extends BaseEntity {
private Long maId;
/** 领料数量 */
@Excel(name = "丢失数量",sort = 7, cellType = Excel.ColumnType.NUMERIC)
@Excel(name = "丢失数量",sort = 8, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "丢失数量")
private BigDecimal num;
@ -113,7 +123,7 @@ public class SltAgreementInfoLose extends BaseEntity {
private BigDecimal leasePrice;
/** 原值 */
@Excel(name = "单价(元)",sort = 8, cellType = Excel.ColumnType.NUMERIC)
@Excel(name = "单价(元)",sort = 9, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "原值")
private BigDecimal buyPrice;
@ -156,12 +166,12 @@ public class SltAgreementInfoLose extends BaseEntity {
/**
* 项目名称
*/
@Excel(name = "结算单位",sort = 2)
@Excel(name = "结算单位",sort = 3, width = 30)
private String unitName;
/**
* 工程名称
*/
@Excel(name = "结算工程",sort = 3)
@Excel(name = "结算工程",sort = 4, width = 40)
private String projectName;
@ApiModelProperty(value = "往来单位id")
@ -234,7 +244,7 @@ public class SltAgreementInfoLose extends BaseEntity {
private BigDecimal repairCost;
private BigDecimal scrapCost;
@Excel(name = "丢失费用(元)",sort = 9, cellType = Excel.ColumnType.NUMERIC)
@Excel(name = "丢失费用(元)",sort = 10, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal loseCost;
private BigDecimal reductionCost;
@ -265,5 +275,13 @@ public class SltAgreementInfoLose extends BaseEntity {
@ApiModelProperty("年月")
private String yearMonth;
@ApiModelProperty(value = "竣工状态")
@Excel(name = "竣工状态", readConverterExp = "0=未竣工,1=已竣工")
private String isFinish;
@ApiModelProperty(value = "竣工日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "竣工日期", dateFormat = "yyyy-MM-dd")
private Date actualEndDate;
}

View File

@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -27,6 +29,10 @@ public class SltAgreementInfoRepair extends BaseEntity {
/** ID */
private Long id;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", cellType = Excel.ColumnType.NUMERIC, width = 5, sort = 0)
private Integer seq;
/** 协议id */
@ApiModelProperty(value = "协议id")
private Long agreementId;
@ -39,10 +45,14 @@ public class SltAgreementInfoRepair extends BaseEntity {
/**
* 协议编号
*/
@Excel(name = "协议",sort = 1)
@Excel(name = "协议",sort = 1)
@ApiModelProperty(value = "协议编号")
private String agreementCode;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司", sort = 2)
private String impUnitName;
@ApiModelProperty("结算申请单号")
private String sltApplyCode;
@ -52,20 +62,20 @@ public class SltAgreementInfoRepair extends BaseEntity {
/**
* 设备名称
*/
@Excel(name = "机具名称",sort = 4)
@Excel(name = "机具名称",sort = 5)
@ApiModelProperty(value = "机具名称")
private String typeName;
/**
* 规格型号
*/
@Excel(name = "规格型号",sort = 5)
@Excel(name = "规格型号",sort = 6)
@ApiModelProperty(value = "规格型号")
private String modelName;
/**
* 计量单位
*/
@Excel(name = "单位",sort = 6)
@Excel(name = "单位",sort = 7)
@ApiModelProperty(value = "计量单位")
private String mtUnitName;
/**
@ -78,8 +88,8 @@ public class SltAgreementInfoRepair extends BaseEntity {
private Long maId;
/** 领料数量 */
@Excel(name = "报废数量",sort = 7, cellType = Excel.ColumnType.NUMERIC)
@ApiModelProperty(value = "报废数量")
@Excel(name = "维修数量",sort = 8, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "维修数量")
private BigDecimal num;
private Long userId;
@ -147,21 +157,21 @@ public class SltAgreementInfoRepair extends BaseEntity {
private Long leaseDay;
/**
* 租赁费用
* 维修费用
*/
@ApiModelProperty(value = "租赁费用")
@Excel(name = "报废费用(元)",sort = 8)
@ApiModelProperty(value = "维修费用")
@Excel(name = "维修费用(元)",sort = 9, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal costs;
/**
* 项目名称
*/
@Excel(name = "结算单位",sort = 2)
@Excel(name = "结算单位",sort = 3, width = 30)
private String unitName;
/**
* 工程名称
*/
@Excel(name = "结算工程",sort = 3)
@Excel(name = "结算工程",sort = 4, width = 40)
private String projectName;
@ApiModelProperty(value = "往来单位id")
@ -180,14 +190,14 @@ public class SltAgreementInfoRepair extends BaseEntity {
/**
* 维修类型
*/
@Excel(name = "维修方式",sort = 9)
@Excel(name = "维修方式",sort = 10)
@ApiModelProperty(value = "维修类型")
private String repairType;
/**
* 是否收费
*/
@Excel(name = "费用类型",sort = 10)
@Excel(name = "费用类型",sort = 11)
@ApiModelProperty(value = "是否收费")
private String partType;
@ -268,5 +278,13 @@ public class SltAgreementInfoRepair extends BaseEntity {
@ApiModelProperty("年月")
private String yearMonth;
@ApiModelProperty(value = "竣工状态")
@Excel(name = "竣工状态", readConverterExp = "0=未竣工,1=已竣工")
private String isFinish;
@ApiModelProperty(value = "竣工日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "竣工日期", dateFormat = "yyyy-MM-dd")
private Date actualEndDate;
}

View File

@ -8,6 +8,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@ -27,6 +29,10 @@ public class SltAgreementInfoScrap extends BaseEntity {
/** ID */
private Long id;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", cellType = Excel.ColumnType.NUMERIC, width = 5, sort = 0)
private Integer seq;
/** 协议id */
@ApiModelProperty(value = "协议id")
private Long agreementId;
@ -39,10 +45,14 @@ public class SltAgreementInfoScrap extends BaseEntity {
/**
* 协议编号
*/
@Excel(name = "协议",sort = 1)
@Excel(name = "协议",sort = 1)
@ApiModelProperty(value = "协议编号")
private String agreementCode;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司", sort = 2)
private String impUnitName;
@ApiModelProperty("结算申请单号")
private String sltApplyCode;
@ -52,20 +62,20 @@ public class SltAgreementInfoScrap extends BaseEntity {
/**
* 设备名称
*/
@Excel(name = "机具名称",sort = 4)
@Excel(name = "机具名称",sort = 5)
@ApiModelProperty(value = "机具名称")
private String typeName;
/**
* 规格型号
*/
@Excel(name = "规格型号",sort = 5)
@Excel(name = "规格型号",sort = 6)
@ApiModelProperty(value = "规格型号")
private String modelName;
/**
* 计量单位
*/
@Excel(name = "单位",sort = 6)
@Excel(name = "单位",sort = 7)
@ApiModelProperty(value = "计量单位")
private String mtUnitName;
/**
@ -78,7 +88,7 @@ public class SltAgreementInfoScrap extends BaseEntity {
private Long maId;
/** 领料数量 */
@Excel(name = "报废数量",sort = 7, cellType = Excel.ColumnType.NUMERIC)
@Excel(name = "报废数量",sort = 8, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "报废数量")
private BigDecimal num;
@ -150,18 +160,18 @@ public class SltAgreementInfoScrap extends BaseEntity {
* 租赁费用
*/
@ApiModelProperty(value = "租赁费用")
@Excel(name = "报废费用(元)",sort = 9, cellType = Excel.ColumnType.NUMERIC)
@Excel(name = "报废费用(元)",sort = 9, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal costs;
/**
* 项目名称
*/
@Excel(name = "结算单位",sort = 2)
@Excel(name = "结算单位",sort = 3)
private String unitName;
/**
* 工程名称
*/
@Excel(name = "结算工程",sort = 3)
@Excel(name = "结算工程",sort = 4)
private String projectName;
@ApiModelProperty(value = "往来单位id")
@ -265,5 +275,13 @@ public class SltAgreementInfoScrap extends BaseEntity {
@ApiModelProperty("年月")
private String yearMonth;
@ApiModelProperty(value = "竣工状态")
@Excel(name = "竣工状态", readConverterExp = "0=未竣工,1=已竣工")
private String isFinish;
@ApiModelProperty(value = "竣工日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "竣工日期", dateFormat = "yyyy-MM-dd")
private Date actualEndDate;
}

View File

@ -1126,7 +1126,12 @@
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus,
sd.dept_name AS impUnitName
sd.dept_name AS impUnitName,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate
from repair_cost rc
left join tm_task_agreement tta on rc.task_id = tta.task_id
left join tm_task tt on rc.task_id = tt.task_id
@ -1156,7 +1161,13 @@
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
<if test="info.impUnitName != null and info.impUnitName != ''">
AND sd.dept_name = #{info.impUnitName}
and sd.dept_name = #{info.impUnitName}
</if>
<if test="info.isFinish != null and info.isFinish == 1">
and bp.actual_end_date is not null
</if>
<if test="info.isFinish != null and info.isFinish == 0">
and bp.actual_end_date is null
</if>
</select>
@ -1177,7 +1188,13 @@
case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType,
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate,
sd.dept_name AS impUnitName
from repair_cost rc
left join tm_task_agreement tta on rc.task_id = tta.task_id
left join tm_task tt on rc.task_id = tt.task_id
@ -1186,6 +1203,7 @@
left join bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on rc.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
where rc.status in ('0','1')
and rc.repair_type in ('1','2')
<if test="info.settlementType != null and info.settlementType != 0">
@ -1197,9 +1215,18 @@
#{aid}
</foreach>
</if>
<if test="info.endTime != null and info.startTime != null">
and tt.create_time between #{info.startTime} and #{info.endTime}
</if>
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
<if test="info.isFinish != null and info.isFinish == 1">
and bp.actual_end_date is not null
</if>
<if test="info.isFinish != null and info.isFinish == 0">
and bp.actual_end_date is null
</if>
</select>
<select id="getScrapDetailsListBatch" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -1220,7 +1247,12 @@
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' when '3' then '其他维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus,
sd.dept_name AS impUnitName
sd.dept_name AS impUnitName,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate
from repair_cost rc
LEFT JOIN tm_task_agreement tta on rc.task_id = tta.task_id
LEFT JOIN tm_task tt on rc.task_id = tt.task_id
@ -1252,6 +1284,12 @@
<if test="info.impUnitName != null and info.impUnitName != ''">
AND sd.dept_name = #{info.impUnitName}
</if>
<if test="info.isFinish != null and info.isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="info.isFinish != null and info.isFinish == 0">
AND bp.actual_end_date is null
</if>
</select>
<select id="getScrapDetailsListBatchExport" resultType="com.bonus.material.settlement.domain.vo.SltAgreementInfoScrap">
@ -1271,7 +1309,13 @@
case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType,
case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' when '3' then '其他维修' else '' end as repairType,
rc.company_id as companyId,
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus
case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus,
sd.dept_name AS impUnitName,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate
from repair_cost rc
LEFT JOIN tm_task_agreement tta on rc.task_id = tta.task_id
LEFT JOIN tm_task tt on rc.task_id = tt.task_id
@ -1280,6 +1324,7 @@
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt on rc.type_id = mt.type_id
LEFT JOIN ma_type mt1 on mt.parent_id = mt1.type_id
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
where rc.status in ('0','1')
and rc.repair_type = '3'
<if test="info.settlementType != null and info.settlementType != 0">
@ -1297,6 +1342,12 @@
<if test="info.agreementCode != null and info.agreementCode != ''">
and bai.agreement_code like concat('%',#{info.agreementCode},'%')
</if>
<if test="info.isFinish != null and info.isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="info.isFinish != null and info.isFinish == 0">
AND bp.actual_end_date is null
</if>
</select>
<select id="getLostReportList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -1352,7 +1403,9 @@
res.endTime,
res.leaseDays,
res. loseCost,
res.impUnitName
res.impUnitName,
res.isFinish,
res.actualEndDate
FROM (SELECT bai.agreement_id AS agreementId,
bai.agreement_code as agreementCode,
ifnull(sad.unit_name ,bui.unit_name) as unitName,
@ -1369,7 +1422,12 @@
DATE(ifnull(saa.create_time, sad.end_time)) as endTime,
DATEDIFF(
IF(sad.end_time is null, saa.create_time,sad.end_time), sad.start_time) + 1 as leaseDays,
sd.dept_name AS impUnitName
sd.dept_name AS impUnitName,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate
FROM
bm_agreement_info bai
LEFT JOIN slt_agreement_apply saa
@ -1411,6 +1469,12 @@
OR sd.dept_name like concat('%',#{keyWord},'%')
)
</if>
<if test="isFinish != null and isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="isFinish != null and isFinish == 0">
AND bp.actual_end_date is null
</if>
</where>
) res
@ -1466,7 +1530,10 @@
res.startTime,
res.endTime,
res.leaseDays,
res. loseCost
res. loseCost,
res.isFinish,
res.actualEndDate,
res.impUnitName
FROM (SELECT bai.agreement_id AS agreementId,
bai.agreement_code as agreementCode,
ifnull(sad.unit_name ,bui.unit_name) as unitName,
@ -1482,7 +1549,13 @@
DATE (sad.start_time) as startTime,
DATE(ifnull(saa.create_time, sad.end_time)) as endTime,
DATEDIFF(
IF(sad.end_time is null, saa.create_time,sad.end_time), sad.start_time) + 1 as leaseDays
IF(sad.end_time is null, saa.create_time,sad.end_time), sad.start_time) + 1 as leaseDays,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate,
sd.dept_name as impUnitName
FROM
bm_agreement_info bai
LEFT JOIN slt_agreement_apply saa
@ -1492,6 +1565,7 @@
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on sad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
<where>
<if test="settlementType != null and settlementType != 0">
@ -1503,6 +1577,12 @@
<if test="agreementCode != null and agreementCode != ''">
and bai.agreement_code like concat('%',#{agreementCode},'%')
</if>
<if test="isFinish != null and isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="isFinish != null and isFinish == 0">
AND bp.actual_end_date is null
</if>
</where>
) res
@ -1523,7 +1603,16 @@
sai.slt_time AS settlement_time, sai.status,
mt.unit_name as mt_unit_name, mt.comsumable,
bai.remark,
sd.dept_name AS impUnit_name
sd.dept_name AS impUnit_name,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate,
CASE
WHEN bp.actual_end_date is not null THEN '已竣工'
ELSE '未竣工'
END as proStatus
FROM bm_agreement_info bai
INNER JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
@ -1541,6 +1630,12 @@
<if test="agreementId != null and agreementId > 0">
AND bai.agreement_id = #{agreementId}
</if>
<if test="isFinish != null and isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="isFinish != null and isFinish == 0">
AND bp.actual_end_date is null
</if>
<if test="agreementIds != null and agreementIds.size() > 0">
AND bai.agreement_id IN
<foreach collection="agreementIds" item="agreementId" open="(" separator="," close=")">
@ -1676,7 +1771,16 @@
sai.ma_id, sai.num, sai.price as lease_price, sai.start_time, IFNULL(sai.end_time,saa.create_time) as end_time,
mt.unit_name as mt_unit_name, mt.comsumable,
bai.remark,
sd.dept_name AS impUnit_name
sd.dept_name AS impUnit_name,
CASE
WHEN bp.actual_end_date is not null THEN '1'
ELSE '0'
END as isFinish,
bp.actual_end_date as actualEndDate,
CASE
WHEN bp.actual_end_date is not null THEN '已竣工'
ELSE '未竣工'
END as proStatus
FROM bm_agreement_info bai
LEFT JOIN slt_agreement_apply saa on bai.agreement_id = saa.agreement_id
LEFT JOIN slt_agreement_details sai ON saa.ID = sai.apply_id
@ -1695,6 +1799,12 @@
<if test="agreementId != null and agreementId > 0">
AND bai.agreement_id = #{agreementId}
</if>
<if test="isFinish != null and isFinish == 1">
AND bp.actual_end_date is not null
</if>
<if test="isFinish != null and isFinish == 0">
AND bp.actual_end_date is null
</if>
<if test="agreementIds != null and agreementIds.size() > 0">
AND bai.agreement_id IN
<foreach collection="agreementIds" item="agreementId" open="(" separator="," close=")">