|
|
@ -74,6 +74,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -160,13 +161,16 @@ public class FinPaymentapplyService extends MybatisBaseService<FinPaymentapplyMa |
|
|
|
BeanUtil.copyProperties(dto, finPaymentapply, "sid"); |
|
|
|
String billNo = getApplyCode(dto); |
|
|
|
finPaymentapply.setBillNo(billNo); |
|
|
|
baseMapper.insert(finPaymentapply); |
|
|
|
|
|
|
|
List<FinPaymentapplyDetailDto> detailsList = dto.getDetailsList(); |
|
|
|
finPaymentapplyDetailsService.saveDetailsList(detailsList, finPaymentapply.getSid()); |
|
|
|
String i = finPaymentapplyDetailsService.saveDetailsList(detailsList, finPaymentapply.getSid()); |
|
|
|
if ("1".equals(dto.getIsVeh())) { |
|
|
|
List<FinPaymentapplyVehicleDto> vehicleDtoList = dto.getVehicleList(); |
|
|
|
finPaymentapplyVehicleService.saveVehicleList(vehicleDtoList, finPaymentapply.getSid()); |
|
|
|
String j = finPaymentapplyVehicleService.saveVehicleList(vehicleDtoList, finPaymentapply.getSid()); |
|
|
|
finPaymentapply.setCarTotal(new BigDecimal(j)); |
|
|
|
} |
|
|
|
finPaymentapply.setPaymentTotal(new BigDecimal(i)); |
|
|
|
baseMapper.insert(finPaymentapply); |
|
|
|
dtoSid = finPaymentapply.getSid(); |
|
|
|
} else { |
|
|
|
FinPaymentapply finPaymentapply = fetchBySid(dtoSid); |
|
|
@ -174,15 +178,18 @@ public class FinPaymentapplyService extends MybatisBaseService<FinPaymentapplyMa |
|
|
|
return rb.setMsg("该付款申请不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, finPaymentapply); |
|
|
|
baseMapper.updateById(finPaymentapply); |
|
|
|
|
|
|
|
List<FinPaymentapplyDetailDto> detailsList = dto.getDetailsList(); |
|
|
|
finPaymentapplyDetailsService.saveDetailsList(detailsList, finPaymentapply.getSid()); |
|
|
|
String i = finPaymentapplyDetailsService.saveDetailsList(detailsList, finPaymentapply.getSid()); |
|
|
|
if ("1".equals(dto.getIsVeh())) { |
|
|
|
List<FinPaymentapplyVehicleDto> vehicleDtoList = dto.getVehicleList(); |
|
|
|
finPaymentapplyVehicleService.saveVehicleList(vehicleDtoList, finPaymentapply.getSid()); |
|
|
|
String j = finPaymentapplyVehicleService.saveVehicleList(vehicleDtoList, finPaymentapply.getSid()); |
|
|
|
finPaymentapply.setCarTotal(new BigDecimal(j)); |
|
|
|
} else { |
|
|
|
finPaymentapplyVehicleService.deleteVehicle(dtoSid); |
|
|
|
} |
|
|
|
finPaymentapply.setPaymentTotal(new BigDecimal(i)); |
|
|
|
baseMapper.updateById(finPaymentapply); |
|
|
|
} |
|
|
|
return rb.success().setData(dtoSid); |
|
|
|
} |
|
|
|