结算管理代码提交

This commit is contained in:
liang.chao 2024-07-30 17:22:25 +08:00
parent ea13b5f59e
commit 98f6d42010
10 changed files with 132 additions and 34 deletions

View File

@ -136,6 +136,9 @@ public class SltAgreementInfo {
* 实际结算天数 * 实际结算天数
*/ */
private BigDecimal realDays; private BigDecimal realDays;
/**
* 是否结算0 未结算 1已结算
*/
private String isSlt;
} }

View File

@ -43,11 +43,13 @@ public class SltAgreementRelation {
*/ */
private String status; private String status;
String loseCost; private String loseCost;
String leaseCostOne; private String leaseCostOne;
String leaseCostThree; private String leaseCostThree;
String scrapCost; private String scrapCost;
String repairCost; private String repairCost;
private String isSltOne;
private String isSltThree;
/** /**
* 项目名称 * 项目名称
*/ */

View File

@ -56,14 +56,24 @@ public class SltAgreementInfoController extends BaseController {
return AjaxResult.success(bean); return AjaxResult.success(bean);
} }
/**
* 根据协议获取完工结算清单
*/
@ApiOperation(value = "根据协议获取结算清单")
@PostMapping("/getSltInfoMonth")
public AjaxResult getSltInfoMonth(@RequestBody List<AgreementInfo> list) {
SltInfoVo bean = sltAgreementInfoService.getSltInfo(list);
return AjaxResult.success(bean);
}
/** /**
* 调整天数 * 调整天数
*/ */
@ApiOperation(value = "调整天数") @ApiOperation(value = "调整天数和日期")
@PostMapping("/updateTrimDay") @PostMapping("/updateTrimDay")
public AjaxResult updateTrimDay(@RequestBody List<SltAgreementInfo> sltAgreementInfo) { public AjaxResult updateTrimDay(@RequestBody List<SltAgreementInfo> sltAgreementInfo) {
int bean = sltAgreementInfoService.updateTrimDay(sltAgreementInfo); int bean = sltAgreementInfoService.updateTrimDay(sltAgreementInfo);
if (bean == 0){ if (bean == 0) {
return AjaxResult.error("修改失败"); return AjaxResult.error("修改失败");
} }
return AjaxResult.success("修改成功"); return AjaxResult.success("修改成功");
@ -73,9 +83,21 @@ public class SltAgreementInfoController extends BaseController {
* 租赁明细导出 * 租赁明细导出
*/ */
@Log(title = "租赁明细导出", businessType = BusinessType.EXPORT) @Log(title = "租赁明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportLease") @PostMapping("/exportLeaseOne")
public void exportLease(HttpServletResponse response, @RequestBody List<AgreementInfo> list) { public void exportLeaseOne(HttpServletResponse response, @RequestBody List<AgreementInfo> list) {
List<SltAgreementInfo> explist = sltAgreementInfoService.getLeaseList(list); List<SltAgreementInfo> explist = sltAgreementInfoService.getLeaseListOne(list);
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist);
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
util.exportExcel(response, leaseInfoList, "租赁明细导出");
}
/**
* 租赁明细导出
*/
@Log(title = "租赁明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportLeaseThree")
public void exportLeaseThree(HttpServletResponse response, @RequestBody List<AgreementInfo> list) {
List<SltAgreementInfo> explist = sltAgreementInfoService.getLeaseListThree(list);
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist); List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist);
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class); ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
util.exportExcel(response, leaseInfoList, "租赁明细导出"); util.exportExcel(response, leaseInfoList, "租赁明细导出");
@ -98,7 +120,7 @@ public class SltAgreementInfoController extends BaseController {
*/ */
@Log(title = "维修明细导出", businessType = BusinessType.EXPORT) @Log(title = "维修明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportRepair") @PostMapping("/exportRepair")
public void exportRepair(HttpServletResponse response, @RequestBody List<AgreementInfo> list) { public void exportRepair(HttpServletResponse response, List<AgreementInfo> list) {
List<SltAgreementInfo> explist = sltAgreementInfoService.getRepairList(list); List<SltAgreementInfo> explist = sltAgreementInfoService.getRepairList(list);
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist); List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist);
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class); ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
@ -110,7 +132,7 @@ public class SltAgreementInfoController extends BaseController {
*/ */
@Log(title = "报废明细导出", businessType = BusinessType.EXPORT) @Log(title = "报废明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportScrap") @PostMapping("/exportScrap")
public void exportScrap(HttpServletResponse response, @RequestBody List<AgreementInfo> list) { public void exportScrap(HttpServletResponse response, List<AgreementInfo> list) {
List<SltAgreementInfo> explist = sltAgreementInfoService.getScrapList(list); List<SltAgreementInfo> explist = sltAgreementInfoService.getScrapList(list);
List<ScrapInfo> leaseInfoList = Convert.toList(ScrapInfo.class, explist); List<ScrapInfo> leaseInfoList = Convert.toList(ScrapInfo.class, explist);
ExcelUtil<ScrapInfo> util = new ExcelUtil<ScrapInfo>(ScrapInfo.class); ExcelUtil<ScrapInfo> util = new ExcelUtil<ScrapInfo>(ScrapInfo.class);
@ -126,6 +148,15 @@ public class SltAgreementInfoController extends BaseController {
return sltAgreementInfoService.submitFee(apply); return sltAgreementInfoService.submitFee(apply);
} }
/**
* 费用结算提交
*/
@ApiOperation(value = "费用结算提交-承担方")
@PostMapping("/submitFeeBear")
public AjaxResult submitFeeBear(@RequestBody SltAgreementInfo apply) {
return sltAgreementInfoService.submitFeeOne(apply);
}
/** /**
* 获取结算审核列表 * 获取结算审核列表
*/ */

View File

@ -75,22 +75,22 @@ public class LeaseInfo {
/** /**
*租赁单价 *租赁单价
*/ */
@Excel(name = "租赁单价") @Excel(name = "台班费单价(元/天)")
private String leasePrice; private String leasePrice;
/** /**
*领料数量 *领料数量
*/ */
@Excel(name = "租赁数量") @Excel(name = "数量")
private String num; private String num;
/** /**
*领料时间 *领料时间
*/ */
@Excel(name = "日期") @Excel(name = "租日期")
private String startTime; private String startTime;
/** /**
*退料时间 *退料时间
*/ */
@Excel(name = "归还日期") @Excel(name = "终止日期")
private String endTime; private String endTime;
/** /**
* 租赁天数 * 租赁天数
@ -98,10 +98,25 @@ public class LeaseInfo {
@Excel(name = "租赁天数") @Excel(name = "租赁天数")
private String leaseDays; private String leaseDays;
/** /**
* 租赁费用 * 实际结算天数
*/ */
@Excel(name = "外部租赁费用") @Excel(name = "实际结算天数")
private String realDays;
/**
* 应结算金额
*/
@Excel(name = "应结算金额(元)")
private String costs; private String costs;
/**
* 实际结算金额
*/
@Excel(name = "实际结算金额(元)")
private String realCosts;
/**
* 实际结算金额
*/
@Excel(name = "调整天数")
private String trimDay;
/** /**
* 类型0不收费1收费 * 类型0不收费1收费
*/ */

View File

@ -41,6 +41,7 @@ public class LoseInfo {
/** /**
*原值 *原值
*/ */
@Excel(name = "赔偿单价")
private String buyPrice; private String buyPrice;
/** /**
* *
@ -49,12 +50,10 @@ public class LoseInfo {
/** /**
* 项目名称 * 项目名称
*/ */
@Excel(name = "结算单位名称")
private String unitName; private String unitName;
/** /**
* 工程名称 * 工程名称
*/ */
@Excel(name = "结算工程名称")
private String projectName; private String projectName;
/** /**
* 设备名称 * 设备名称
@ -66,10 +65,15 @@ public class LoseInfo {
*/ */
@Excel(name = "规格型号") @Excel(name = "规格型号")
private String modelName; private String modelName;
/**
* 设备编码
*/
@Excel(name = "设备编码")
private String maCode;
/** /**
* 计量单位 * 计量单位
*/ */
@Excel(name = "计量单位") @Excel(name = "单位")
private String nuitName; private String nuitName;
/** /**
*租赁单价 *租赁单价
@ -78,7 +82,7 @@ public class LoseInfo {
/** /**
*领料数量 *领料数量
*/ */
@Excel(name = "丢失数量") @Excel(name = "未还数量")
private String num; private String num;
/** /**
*领料时间 *领料时间
@ -95,7 +99,7 @@ public class LoseInfo {
/** /**
* 租赁费用 * 租赁费用
*/ */
@Excel(name = "丢失费用") @Excel(name = "赔偿金额")
private String costs; private String costs;
/** /**
* 类型0不收费1收费 * 类型0不收费1收费

View File

@ -54,4 +54,6 @@ public interface SltAgreementInfoMapper {
int updateMaStatus(SltAgreementInfo agreementInfo); int updateMaStatus(SltAgreementInfo agreementInfo);
int updateTrimDay(SltAgreementInfo sltAgreementInfo); int updateTrimDay(SltAgreementInfo sltAgreementInfo);
int updateInfoOneStatus(SltAgreementInfo apply);
} }

View File

@ -19,6 +19,7 @@ public interface SltAgreementInfoService {
SltInfoVo getSltInfo(List<AgreementInfo> list); SltInfoVo getSltInfo(List<AgreementInfo> list);
AjaxResult submitFee(SltAgreementApply apply); AjaxResult submitFee(SltAgreementApply apply);
AjaxResult submitFeeOne(SltAgreementInfo apply);
List<SltAgreementApply> getSltExam(AgreementInfo bean); List<SltAgreementApply> getSltExam(AgreementInfo bean);

View File

@ -192,10 +192,6 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List<SltAgreementRelation> relations = new ArrayList<>(); List<SltAgreementRelation> relations = new ArrayList<>();
for (AgreementInfo info : list) { for (AgreementInfo info : list) {
SltAgreementRelation relation = new SltAgreementRelation(); SltAgreementRelation relation = new SltAgreementRelation();
/*BigDecimal loseCost = new BigDecimal("0");
BigDecimal leaseCost = new BigDecimal("0");
BigDecimal scrapCost = new BigDecimal("0");
BigDecimal repairCost = new BigDecimal("0");*/
BigDecimal loseCost = BigDecimal.ZERO; BigDecimal loseCost = BigDecimal.ZERO;
BigDecimal leaseCostOne = BigDecimal.ZERO; BigDecimal leaseCostOne = BigDecimal.ZERO;
BigDecimal leaseCostThree = BigDecimal.ZERO; BigDecimal leaseCostThree = BigDecimal.ZERO;
@ -207,7 +203,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
relation.setProjectName(lease.getProjectName()); relation.setProjectName(lease.getProjectName());
relation.setUnitName(lease.getUnitName()); relation.setUnitName(lease.getUnitName());
relation.setCompanyId(lease.getCompanyId()); relation.setCompanyId(lease.getCompanyId());
BigDecimal cost = new BigDecimal(lease.getCosts()); BigDecimal cost = new BigDecimal(lease.getRealCosts());
leaseCostOne = leaseCostOne.add(cost); leaseCostOne = leaseCostOne.add(cost);
} }
} }
@ -217,7 +213,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
relation.setProjectName(lease.getProjectName()); relation.setProjectName(lease.getProjectName());
relation.setUnitName(lease.getUnitName()); relation.setUnitName(lease.getUnitName());
relation.setCompanyId(lease.getCompanyId()); relation.setCompanyId(lease.getCompanyId());
BigDecimal cost = new BigDecimal(lease.getCosts()); BigDecimal cost = new BigDecimal(lease.getRealCosts());
leaseCostThree = leaseCostThree.add(cost); leaseCostThree = leaseCostThree.add(cost);
} }
} }
@ -244,6 +240,20 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
loseCost = loseCost.add(cost); loseCost = loseCost.add(cost);
} }
} }
// 判断是否已经结算(01承担方)
boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt()));
if (b) {
relation.setIsSltOne("1");
} else {
relation.setIsSltOne("0");
}
// 判断是否已经结算(03承担方)
boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt()));
if (f) {
relation.setIsSltThree("1");
} else {
relation.setIsSltThree("0");
}
relation.setLeaseCostOne(leaseCostOne.toString()); relation.setLeaseCostOne(leaseCostOne.toString());
relation.setLeaseCostThree(leaseCostThree.toString()); relation.setLeaseCostThree(leaseCostThree.toString());
relation.setRepairCost(repairCost.toString()); relation.setRepairCost(repairCost.toString());
@ -333,6 +343,16 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
return AjaxResult.success(); return AjaxResult.success();
} }
@Override
public AjaxResult submitFeeOne(SltAgreementInfo apply) {
int i = sltAgreementInfoMapper.updateInfoOneStatus(apply);
if (i > 0) {
return AjaxResult.success("结算成功");
} else {
return AjaxResult.error("结算失败");
}
}
@Override @Override
public List<SltAgreementApply> getSltExam(AgreementInfo bean) { public List<SltAgreementApply> getSltExam(AgreementInfo bean) {
return sltAgreementInfoMapper.getSltExam(bean); return sltAgreementInfoMapper.getSltExam(bean);

View File

@ -87,12 +87,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<update id="updateTrimDay"> <update id="updateTrimDay">
update slt_agreement_info update slt_agreement_info
set trim_day = #{trimDay} <set>
<if test="trimDay != null and trimDay != ''">
trim_day = #{trimDay},
</if>
<if test="endTime != null and endTime != ''">
end_time = #{endTime},
</if>
</set>
where agreement_id = #{agreementId} and type_id = #{typeId} where agreement_id = #{agreementId} and type_id = #{typeId}
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
and ma_id = #{maId} and ma_id = #{maId}
</if> </if>
</update> </update>
<update id="updateInfoOneStatus">
UPDATE slt_agreement_info sai
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
SET sai.is_slt = '1'
WHERE
sai.agreement_id = #{agreementId}
AND sai.lease_type = 0
AND lai.cost_bearing_party = #{costBearingParty}
</update>
<select id="getSltAgreementInfo" resultType="com.bonus.sgzb.material.domain.AgreementInfo"> <select id="getSltAgreementInfo" resultType="com.bonus.sgzb.material.domain.AgreementInfo">
SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time, SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time,
bui.unit_id,bui.unit_name , bp.lot_id as projectId , bp.lot_name as projectName, bui.unit_id,bui.unit_name , bp.lot_id as projectId , bp.lot_name as projectName,
@ -161,6 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.unit_name as nuitName, mt.unit_name as nuitName,
sai.buy_price as buyPrice, sai.buy_price as buyPrice,
sai.num as num, sai.num as num,
mm.ma_code as maCode,
sai.start_time as startTime, sai.start_time as startTime,
sai.end_time as endTime, sai.end_time as endTime,
DATEDIFF(sai.end_time, sai.start_time) + 1 as leaseDays DATEDIFF(sai.end_time, sai.start_time) + 1 as leaseDays
@ -170,7 +187,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
left join ma_type mt on sai.type_id = mt.type_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 left join ma_type mt1 on mt.parent_id = mt1.type_id
where sai.agreement_id = #{agreementId} and sai.end_time is null left join ma_machine mm on mm.ma_id = sai.ma_id
where sai.agreement_id = #{agreementId} and sai.lease_type = 0 and sai.end_time is null
</select> </select>
<select id="getTaskList" resultType="com.bonus.sgzb.material.domain.TmTask"> <select id="getTaskList" resultType="com.bonus.sgzb.material.domain.TmTask">
select tt.task_id as taskId select tt.task_id as taskId
@ -303,6 +321,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.unit_name as nuitName, mt.unit_name as nuitName,
sai.lease_price as leasePrice, sai.lease_price as leasePrice,
sai.num as num, sai.num as num,
sai.is_slt as isSlt,
sai.trim_day as trimDay, sai.trim_day as trimDay,
DATE(sai.start_time) as startTime, DATE(sai.start_time) as startTime,
DATE(sai.end_time) as endTime, DATE(sai.end_time) as endTime,
@ -330,6 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.trim_day as trimDay, sai.trim_day as trimDay,
sai.lease_price as leasePrice, sai.lease_price as leasePrice,
sai.num as num, sai.num as num,
sai.is_slt as isSlt,
DATE(sai.start_time) as startTime, DATE(sai.start_time) as startTime,
DATE(sai.end_time) as endTime, DATE(sai.end_time) as endTime,
DATEDIFF(IF(sai.end_time is null,CURDATE(),sai.end_time), sai.start_time) + 1 as leaseDays DATEDIFF(IF(sai.end_time is null,CURDATE(),sai.end_time), sai.start_time) + 1 as leaseDays

View File

@ -135,7 +135,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="info" type="info"
plain plain
@ -145,7 +145,7 @@
v-hasPermi="['system:user:import']" v-hasPermi="['system:user:import']"
>导入</el-button >导入</el-button
> >
</el-col> </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"