| | |
| | | /** |
| | | * 修改预估应收账单 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:edit')") |
| | | @PreAuthorize("@ss.hasPermi('cwgl:estimatedReceivableBill:settlement')") |
| | | @Log(title = "预估应收账单", businessType = BusinessType.UPDATE) |
| | | @PostMapping("settlement") |
| | | public AjaxResult settlement(@RequestBody EstimatedReceivableBill estimatedReceivableBill) |
| | |
| | | int updatePendingSettlementBusinessIsCreate(@Param("list") List<String> list,@Param("id")Integer id,@Param("billName")String billName); |
| | | |
| | | List<String> selectCustomName(); |
| | | |
| | | List<String> selectPendingSettlementBusinessDispatchNos(Integer id); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.cwgl.domain.EstimatedReceivableBillLog; |
| | | import com.ruoyi.cwgl.domain.PendingSettlementBusiness; |
| | | import com.ruoyi.cwgl.mapper.EstimatedReceivableMapper; |
| | | import com.ruoyi.cwgl.mapper.PendingSettlementBusinessMapper; |
| | | import com.ruoyi.cwgl.service.IEstimatedReceivableBillLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private EstimatedReceivableBillMapper estimatedReceivableBillMapper; |
| | | @Autowired |
| | | private IEstimatedReceivableBillLogService logService; |
| | | @Resource |
| | | private PendingSettlementBusinessMapper pendingSettlementBusinessMapper; |
| | | @Resource |
| | | private EstimatedReceivableMapper estimatedReceivableMapper; |
| | | |
| | | |
| | | /** |
| | |
| | | estimatedReceivableBillLog.setOperation("本次提交金额"+ settlementAmount); |
| | | logService.insertEstimatedReceivableBillLog(estimatedReceivableBillLog); |
| | | settledAmount = settledAmount+settlementAmount; |
| | | List<String>dispatchNos =pendingSettlementBusinessMapper.selectPendingSettlementBusinessDispatchNos(estimatedReceivableBill.getId()); |
| | | if (settledAmount>totalAmount){ |
| | | //已结算大于应计算金额为已结算 |
| | | estimatedReceivableBill.setStatus(2); |
| | | estimatedReceivableMapper.updateEstimatedReceivableBillStatus(dispatchNos,3); |
| | | }else { |
| | | //否则部分结算 |
| | | estimatedReceivableBill.setStatus(1); |
| | | estimatedReceivableMapper.updateEstimatedReceivableBillStatus(dispatchNos,2); |
| | | } |
| | | return estimatedReceivableBillMapper.updateEstimatedReceivableBill(estimatedReceivableBill); |
| | | } |
| | |
| | | SELECT customer_name from pending_settlement_business group by customer_name |
| | | |
| | | </select> |
| | | <select id="selectPendingSettlementBusinessDispatchNos" resultType="java.lang.String"> |
| | | SELECT dispatch_no from pending_settlement_business where bill_id = #{id} |
| | | |
| | | </select> |
| | | |
| | | <!-- 新增 --> |
| | | <insert id="insertPendingSettlementBusiness" parameterType="com.ruoyi.cwgl.domain.PendingSettlementBusiness" useGeneratedKeys="true" keyProperty="id"> |