协议书编号
This commit is contained in:
parent
f917407328
commit
1f3c3bc460
|
|
@ -89,6 +89,11 @@ public interface SltAgreementInfoMapper {
|
|||
*/
|
||||
int updateSltBookCodeById(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
/**
|
||||
* 查询协议书编号是否存在
|
||||
*/
|
||||
int countSltBookCodeByCode(String bookCode);
|
||||
|
||||
/**
|
||||
* 修改结算信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.stream.Collectors;
|
|||
import com.bonus.common.biz.constant.GlobalConstants;
|
||||
import com.bonus.common.biz.domain.ProjectTreeBuild;
|
||||
import com.bonus.common.biz.domain.ProjectTreeNode;
|
||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||
import com.bonus.common.biz.utils.RequestContext;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
|
|
@ -949,9 +950,21 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getSltList(SltAgreementInfo bean) {
|
||||
if (Objects.isNull(bean)) {
|
||||
bean = new SltAgreementInfo();
|
||||
}
|
||||
|
||||
Integer settlementType = bean.getSettlementType();
|
||||
Boolean enableQuerySltData = bean.getEnableQuerySltData();
|
||||
List<SltAgreementInfo> list = sltAgreementInfoMapper.getSltList(bean);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
if (settlementType != null) {
|
||||
list = list.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> settlementType.equals(item.getSettlementType()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
for (SltAgreementInfo row : list) {
|
||||
SltInfoVo sltInfoVo;
|
||||
row.setEnableQuerySltData(enableQuerySltData);
|
||||
|
|
@ -972,9 +985,20 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getSltReportedList(SltAgreementInfo bean) {
|
||||
if (bean == null) {
|
||||
bean = new SltAgreementInfo();
|
||||
}
|
||||
List<SltAgreementInfo> sltReportedList = sltAgreementInfoMapper.getSltReportedList(bean);
|
||||
if (sltReportedList != null) {
|
||||
sltReportedList.removeIf(Objects::isNull);
|
||||
|
||||
if (bean.getSettlementType() != null) {
|
||||
Integer querySltType = bean.getSettlementType();
|
||||
sltReportedList = sltReportedList.stream()
|
||||
.filter(item -> querySltType.equals(item.getSettlementType()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 去掉没有审核的or审核不通过的
|
||||
sltReportedList.removeIf(obj -> Objects.isNull(obj.getSltStatus()) || !Objects.equals("2", obj.getSltStatus()));
|
||||
sltReportedList.forEach(sltAgreementInfo -> sltAgreementInfo.setCosts(
|
||||
|
|
@ -1152,12 +1176,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult costExamine(SltAgreementApply sltAgreementApply) {
|
||||
Long deptId = typeService.getUserDeptId();
|
||||
sltAgreementApply.setCompanyId(deptId);
|
||||
|
||||
if (Objects.isNull(sltAgreementApply) || Objects.isNull(sltAgreementApply.getStatus())) {
|
||||
return AjaxResult.error("结算信息为空,请刷新后重试!");
|
||||
}
|
||||
|
||||
Long deptId = typeService.getUserDeptId();
|
||||
sltAgreementApply.setCompanyId(deptId);
|
||||
|
||||
Integer settlementType = sltAgreementApply.getSettlementType();
|
||||
String sltTask = sltAgreementApply.getSltTask();
|
||||
try {
|
||||
|
|
@ -1174,7 +1199,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
|
||||
Integer checkSettlementType = checkSltPer.getSettlementType();
|
||||
|
||||
if(GlobalConstants.LONG_JJ == deptId){
|
||||
if(GlobalConstants.LONG_JJ.equals(deptId)){
|
||||
if(checkSettlementType == 1 && "73".equals(userId)){
|
||||
sltSwitch = true;
|
||||
}
|
||||
|
|
@ -1182,7 +1207,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
if(checkSettlementType == 2 && "1549".equals(userId)){
|
||||
sltSwitch = true;
|
||||
}
|
||||
}else if(GlobalConstants.LONG_HY == deptId){
|
||||
}else if(GlobalConstants.LONG_HY.equals(deptId)){
|
||||
//顾国强
|
||||
if("193".equals(userId)){
|
||||
sltSwitch = true;
|
||||
|
|
@ -1887,10 +1912,22 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
|||
/**
|
||||
* 修改结算协议书编号
|
||||
*
|
||||
* @param sltAgreementInfo ID及协议书编号
|
||||
* @param sltAgreementInfo 主键id及协议书编号
|
||||
*/
|
||||
@Override
|
||||
public int updateSltBookCodeById(SltAgreementInfo sltAgreementInfo) {
|
||||
if (sltAgreementInfo == null) {
|
||||
throw new ServiceException("非法参数,请检查后重试!");
|
||||
}
|
||||
if (sltAgreementInfo.getBookCode() == null || sltAgreementInfo.getBookCode().trim().isEmpty()) {
|
||||
throw new ServiceException("协议书编号为空,请检查后重试!");
|
||||
}
|
||||
if (sltAgreementInfo.getId() == null) {
|
||||
throw new ServiceException("参数缺失,请刷新页面后重试!");
|
||||
}
|
||||
if (sltAgreementInfoMapper.countSltBookCodeByCode(sltAgreementInfo.getBookCode()) > 0) {
|
||||
throw new ServiceException("此编码已存在,请修改后重新录入!", HttpCodeEnum.NICKNAME_EXIST.getCode());
|
||||
}
|
||||
return sltAgreementInfoMapper.updateSltBookCodeById(sltAgreementInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -680,11 +680,13 @@
|
|||
WHERE
|
||||
bai.STATUS = '1'
|
||||
AND sas.slt_status IN ( '1', '2', '3' )
|
||||
|
||||
<if test="startTime != null and endTime != null ">
|
||||
and saa.audit_time >= #{startTime}
|
||||
and saa.audit_time <![CDATA[ < ]]> DATE_ADD(#{endTime}, INTERVAL 1 DAY)
|
||||
</if>
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bui.unit_id = #{unitId}
|
||||
</if>
|
||||
|
||||
<if test="agreementCode != null and agreementCode != ''">
|
||||
and bai.agreement_code = #{agreementCode}
|
||||
</if>
|
||||
|
|
@ -909,7 +911,7 @@
|
|||
saa.id as id, bai.agreement_id as agreementId, bai.agreement_code as agreementCode, saa.settlement_type as settlementType,
|
||||
bui.unit_id as unitId,bui.unit_name as unitName, bp.pro_id as projectId , bp.pro_name as projectName,
|
||||
saa.remark,saa.cost as costs,su.nick_name as auditor,saa.audit_time as auditTime,
|
||||
saa.create_time as createTime,
|
||||
saa.create_time as createTime, saa.book_code,
|
||||
SUM(IF(sad.slt_type = '1',sad.money,0)) AS leaseCost,
|
||||
SUM(IF(sad.slt_type = '2',sad.money,0)) AS loseCost,
|
||||
SUM(IF(sad.slt_type = '3' AND sad.is_charge = '1',sad.money,0)) AS repairCost,
|
||||
|
|
@ -2613,4 +2615,8 @@
|
|||
id = #{id}
|
||||
and book_code is null
|
||||
</update>
|
||||
|
||||
<select id="countSltBookCodeByCode" resultType="int">
|
||||
select count(*) from slt_agreement_apply where book_code = #{bookCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue