工程结算
This commit is contained in:
parent
70af70a8e8
commit
f85970d073
|
|
@ -90,6 +90,15 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
return AjaxResult.success(bean);
|
return AjaxResult.success(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算审核
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "结算审核")
|
||||||
|
@GetMapping("/settlementReview")
|
||||||
|
public AjaxResult settlementReview(SltAgreementApply apply) {
|
||||||
|
return toAjax(sltAgreementInfoService.settlementReview(apply));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出结算信息列表
|
* 导出结算信息列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -86,4 +86,10 @@ public interface SltAgreementInfoMapper {
|
||||||
List<SltAgreementInfo> getScrapDetailsList(@Param("taskList") List<TmTask> taskList);
|
List<SltAgreementInfo> getScrapDetailsList(@Param("taskList") List<TmTask> taskList);
|
||||||
|
|
||||||
List<SltAgreementInfo> getLoseList(SltAgreementInfo bean);
|
List<SltAgreementInfo> getLoseList(SltAgreementInfo bean);
|
||||||
|
|
||||||
|
int updateRelation(SltAgreementApply apply);
|
||||||
|
|
||||||
|
int updateApply(SltAgreementApply apply);
|
||||||
|
|
||||||
|
int updateMaStatus(SltAgreementInfo agreementInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ public interface ISltAgreementInfoService {
|
||||||
|
|
||||||
SltInfoVo getSltExamInfo(SltAgreementApply apply);
|
SltInfoVo getSltExamInfo(SltAgreementApply apply);
|
||||||
|
|
||||||
|
int settlementReview(SltAgreementApply apply);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增结算信息
|
* 新增结算信息
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementApply;
|
import com.bonus.material.settlement.domain.SltAgreementApply;
|
||||||
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;
|
||||||
|
|
@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
import com.bonus.material.settlement.service.ISltAgreementInfoService;
|
import com.bonus.material.settlement.service.ISltAgreementInfoService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
@ -110,6 +112,43 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
||||||
return sltInfoVo;
|
return sltInfoVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int settlementReview(SltAgreementApply apply) {
|
||||||
|
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
apply.setAuditor(String.valueOf(userid));
|
||||||
|
int j;
|
||||||
|
if ("2".equals(apply.getStatus())) {
|
||||||
|
// 驳回
|
||||||
|
int i = sltAgreementInfoMapper.updateRelation(apply);
|
||||||
|
j = sltAgreementInfoMapper.updateApply(apply);
|
||||||
|
} else {
|
||||||
|
// 通过
|
||||||
|
int i = sltAgreementInfoMapper.updateRelation(apply);
|
||||||
|
if (i > 0) {
|
||||||
|
List<SltAgreementRelation> relations = sltAgreementInfoMapper.getRelations(apply);
|
||||||
|
List<SltAgreementInfo> infos = new ArrayList<>();
|
||||||
|
for (SltAgreementRelation bean : relations) {
|
||||||
|
SltAgreementInfo info = new SltAgreementInfo();
|
||||||
|
info.setAgreementId(Long.valueOf(bean.getAgreementId()));
|
||||||
|
infos.add(info);
|
||||||
|
}
|
||||||
|
List<SltAgreementInfo> loseList = getLoseList(infos);
|
||||||
|
for (SltAgreementInfo agreementInfo : loseList) {
|
||||||
|
if (agreementInfo.getMaId() != null) {
|
||||||
|
agreementInfo.setStatus("103");
|
||||||
|
sltAgreementInfoMapper.updateMaStatus(agreementInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j = sltAgreementInfoMapper.updateApply(apply);
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("结算审核失败");
|
||||||
|
//throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增结算信息
|
* 新增结算信息
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -373,4 +373,25 @@ 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
|
||||||
where sar.apply_id = #{id}
|
where sar.apply_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateRelation">
|
||||||
|
update slt_agreement_relation
|
||||||
|
set status = #{status}
|
||||||
|
where apply_id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateApply">
|
||||||
|
update slt_agreement_apply
|
||||||
|
set status = #{status},
|
||||||
|
auditor = #{auditor},
|
||||||
|
audit_time = now(),
|
||||||
|
remark = #{remark}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateMaStatus">
|
||||||
|
update ma_machine
|
||||||
|
set ma_status =#{status}
|
||||||
|
where ma_id = #{maId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue