|
@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiOperation;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.dto.invoice.PurchaseAddReqDTO;
|
|
import org.jeecg.common.dto.invoice.PurchaseAddReqDTO;
|
|
|
|
+import org.jeecg.common.dto.invoice.PurchaseDetailReqDTO;
|
|
|
|
+import org.jeecg.common.dto.invoice.PurchaseDetailRespDTO;
|
|
import org.jeecg.common.dto.invoice.PurchaseReqDTO;
|
|
import org.jeecg.common.dto.invoice.PurchaseReqDTO;
|
|
import org.jeecg.common.dto.invoice.PurchaseRespDTO;
|
|
import org.jeecg.common.dto.invoice.PurchaseRespDTO;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
@@ -17,9 +19,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.jeecg.modules.invoice.entity.InvoiceManagePurchaseDetail;
|
|
|
|
+import org.jeecg.modules.invoice.service.InvoiceManagePurchaseDetailService;
|
|
import org.jeecg.modules.invoice.service.InvoiceManagePurchaseService;
|
|
import org.jeecg.modules.invoice.service.InvoiceManagePurchaseService;
|
|
import org.jeecg.modules.system.service.ISysSerialPatternService;
|
|
import org.jeecg.modules.system.service.ISysSerialPatternService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -30,6 +35,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Author jihaosen
|
|
* @Author jihaosen
|
|
* @date 2021/2/26
|
|
* @date 2021/2/26
|
|
@@ -43,7 +50,8 @@ public class InvoiceManagePurchaseController {
|
|
private InvoiceManagePurchaseService invoiceManagePurchaseService;
|
|
private InvoiceManagePurchaseService invoiceManagePurchaseService;
|
|
@Autowired
|
|
@Autowired
|
|
private ISysSerialPatternService sysSerialPatternService;
|
|
private ISysSerialPatternService sysSerialPatternService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private InvoiceManagePurchaseDetailService invoiceManagePurchaseDetailService;
|
|
|
|
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
@ApiOperation(value = "分页查询接口", notes = "采购发票和销售发票分页查询")
|
|
@ApiOperation(value = "分页查询接口", notes = "采购发票和销售发票分页查询")
|
|
@@ -176,4 +184,31 @@ public class InvoiceManagePurchaseController {
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询未收票金额", notes = "查询未收票金额")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "组织", required = true, dataType = "String")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping(value = "/getChildrenList")
|
|
|
|
+ public Result<PurchaseDetailRespDTO> getChildrenList(PurchaseDetailReqDTO reqDTO) {
|
|
|
|
+ Result<PurchaseDetailRespDTO> result = new Result<PurchaseDetailRespDTO>();
|
|
|
|
+ QueryWrapper<InvoiceManagePurchaseDetail> queryWrapper = new QueryWrapper();
|
|
|
|
+ queryWrapper.eq("del_flag", "0");
|
|
|
|
+ queryWrapper.lambda().eq(InvoiceManagePurchaseDetail :: getCoArchivesId, reqDTO.getCoArchivesId());
|
|
|
|
+ queryWrapper.lambda().eq(InvoiceManagePurchaseDetail::getProBusinessId, reqDTO.getProBusinessId());
|
|
|
|
+ List<InvoiceManagePurchaseDetail> details = invoiceManagePurchaseDetailService.list(queryWrapper);
|
|
|
|
+ PurchaseDetailRespDTO respDTO = new PurchaseDetailRespDTO();
|
|
|
|
+ if(!CollectionUtils.isEmpty(details)){
|
|
|
|
+ respDTO.setUncoPrice(details.get(0).getUncoPrice());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(respDTO==null) {
|
|
|
|
+ result.error500("未找到对应实体");
|
|
|
|
+ }else {
|
|
|
|
+ result.setResult(respDTO);
|
|
|
|
+ result.setSuccess(true);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|