丢失、报废、维修费用报表
This commit is contained in:
parent
de498f3e58
commit
c997c888be
|
|
@ -1428,6 +1428,39 @@ public class SltAgreementInfoController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 丢失报表--列表
|
||||
*/
|
||||
@ApiOperation(value = "丢失报表list查询")
|
||||
@GetMapping("/getLostReportList")
|
||||
public TableDataInfo getLostReportList(SltAgreementInfo bean) {
|
||||
startPage();
|
||||
List<SltAgreementInfo> list = sltAgreementInfoService.getLostReportList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 维修报表--列表
|
||||
*/
|
||||
@ApiOperation(value = "维修报表list查询")
|
||||
@GetMapping("/getRepairReportList")
|
||||
public TableDataInfo getRepairReportList(SltAgreementInfo bean) {
|
||||
startPage();
|
||||
List<SltAgreementInfo> list = sltAgreementInfoService.getRepairReportList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报废报表--列表
|
||||
*/
|
||||
@ApiOperation(value = "报废报表list查询")
|
||||
@GetMapping("/getScrapReportList")
|
||||
public TableDataInfo getScrapReportList(SltAgreementInfo bean) {
|
||||
startPage();
|
||||
List<SltAgreementInfo> list = sltAgreementInfoService.getScrapReportList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已结算报表--列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ public interface SltAgreementInfoMapper {
|
|||
// 获取多个协议号的丢失详情
|
||||
List<SltAgreementInfo> getLoseListBatch(SltAgreementInfo bean);
|
||||
|
||||
// 获取丢失报表
|
||||
List<SltAgreementInfo> getLostReportList(SltAgreementInfo bean);
|
||||
|
||||
int updateRelation(SltAgreementApply apply);
|
||||
|
||||
int updateApply(SltAgreementApply apply);
|
||||
|
|
|
|||
|
|
@ -114,6 +114,21 @@ public interface ISltAgreementInfoService {
|
|||
*/
|
||||
List<SltAgreementInfo> getSltReportList(SltAgreementInfo bean);
|
||||
|
||||
/**
|
||||
* 查询丢失报表
|
||||
*/
|
||||
List<SltAgreementInfo> getLostReportList(SltAgreementInfo info);
|
||||
|
||||
/**
|
||||
* 维修报表list
|
||||
*/
|
||||
List<SltAgreementInfo> getRepairReportList(SltAgreementInfo bean);
|
||||
|
||||
/**
|
||||
* 报废报表list
|
||||
*/
|
||||
List<SltAgreementInfo> getScrapReportList(SltAgreementInfo bean);
|
||||
|
||||
|
||||
/**
|
||||
* 进行结算审批
|
||||
|
|
|
|||
|
|
@ -774,7 +774,21 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getSltReportedList(SltAgreementInfo bean) {
|
||||
return sltAgreementInfoMapper.getSltReportedList(bean);
|
||||
List<SltAgreementInfo> sltReportedList = sltAgreementInfoMapper.getSltReportedList(bean);
|
||||
if (sltReportedList != null) {
|
||||
sltReportedList.removeIf(Objects::isNull);
|
||||
sltReportedList.forEach(sltAgreementInfo -> {
|
||||
if (sltAgreementInfo.getCosts() == null || sltAgreementInfo.getCosts().equals(BigDecimal.ZERO)) {
|
||||
sltAgreementInfo.setCosts(
|
||||
sltAgreementInfo.getLeaseCost()
|
||||
.add(sltAgreementInfo.getRepairCost())
|
||||
.add(sltAgreementInfo.getScrapCost())
|
||||
.add(sltAgreementInfo.getLoseCost())
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
return sltReportedList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -797,6 +811,47 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询丢失报表
|
||||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getLostReportList(SltAgreementInfo info) {
|
||||
List<SltAgreementInfo> loseList = sltAgreementInfoMapper.getLostReportList(info);
|
||||
|
||||
loseList.removeIf(Objects::isNull);
|
||||
|
||||
for (SltAgreementInfo bean : loseList) {
|
||||
if (null == bean.getBuyPrice()) {
|
||||
bean.setBuyPrice(BigDecimal.ZERO);
|
||||
}
|
||||
if (null == bean.getNum()) {
|
||||
bean.setNum(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
return loseList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 维修报表list
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getRepairReportList(SltAgreementInfo bean) {
|
||||
return sltAgreementInfoMapper.getRepairDetailsListBatch(bean, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报废报表list
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getScrapReportList(SltAgreementInfo bean) {
|
||||
List<SltAgreementInfo> scrapList = sltAgreementInfoMapper.getScrapDetailsListBatch(bean);
|
||||
return scrapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断以逗号分隔的字符串是否包含指定的值(严格判断)
|
||||
* @param strings 以逗号分隔的字符串
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id
|
||||
where bai.status = '1' AND bui.type_id != '1731' AND bai.is_slt = '0'
|
||||
where bai.status = '1' AND bui.type_id != '1731' AND (bai.is_slt = '0' OR bai.is_slt is null)
|
||||
<if test="unitIds != null">
|
||||
and bui.unit_id in
|
||||
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||
|
|
@ -973,6 +973,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getRepairDetailsListBatch" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
select
|
||||
tta.agreement_id as agreementId,
|
||||
bai.agreement_code as agreementCode,
|
||||
bui.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
rc.id as costId,
|
||||
|
|
@ -1011,6 +1012,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getScrapDetailsListBatch" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
select
|
||||
tta.agreement_id as agreementId,
|
||||
bai.agreement_code as agreementCode,
|
||||
bui.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
rc.id as costId,
|
||||
|
|
@ -1045,4 +1047,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getLostReportList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
select sai.id,
|
||||
sai.agreement_id as agreementId,
|
||||
bai.agreement_code as agreementCode,
|
||||
bui.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
sai.type_id as typeId,
|
||||
sai.ma_id as maId,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as modelName,
|
||||
mt.unit_name as mtUnitName,
|
||||
mt.buy_price as buyPrice,
|
||||
sum(sai.num) as num
|
||||
from
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.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
|
||||
left join ma_type mt on sai.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
<where>
|
||||
<if test="settlementType != null and settlementType != 0">
|
||||
and mt.jiju_type = #{settlementType}
|
||||
</if>
|
||||
<if test="startTime != null and endTime != null">
|
||||
and sai.create_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
<if test="agreementCode != null and agreementCode != ''">
|
||||
and bai.agreement_code like concat('%',#{agreementCode},'%')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
sai.agreement_id,mt.type_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue