|
@@ -0,0 +1,870 @@
|
|
|
+package vip.xiaonuo.details.controller;
|
|
|
+
|
|
|
+
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import vip.xiaonuo.common.exception.CommonException;
|
|
|
+import vip.xiaonuo.common.pojo.CommonResult;
|
|
|
+import vip.xiaonuo.details.vo.DetailVo;
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.entity.HrBaseEmployeeInfo;
|
|
|
+import vip.xiaonuo.hr.modular.baseemployeeinfo.service.HrBaseEmployeeInfoService;
|
|
|
+import vip.xiaonuo.hr.modular.write.entity.HrPeopleWrite;
|
|
|
+import vip.xiaonuo.hr.modular.write.service.IHrPeopleWriteService;
|
|
|
+import vip.xiaonuo.money.entity.*;
|
|
|
+import vip.xiaonuo.money.param.*;
|
|
|
+import vip.xiaonuo.money.service.*;
|
|
|
+import vip.xiaonuo.production.entity.ProductionWorkstopPlan;
|
|
|
+import vip.xiaonuo.production.entity.ProductionWritePlan;
|
|
|
+import vip.xiaonuo.production.service.IProductionWorkstopPlanService;
|
|
|
+import vip.xiaonuo.production.service.IProductionWriteEnergyService;
|
|
|
+import vip.xiaonuo.production.service.IProductionWritePlanService;
|
|
|
+import vip.xiaonuo.purchase.entity.PurchaseOrder;
|
|
|
+import vip.xiaonuo.purchase.entity.PurchasePrice;
|
|
|
+import vip.xiaonuo.purchase.service.IPurchaseOrderService;
|
|
|
+import vip.xiaonuo.purchase.service.IPurchasePriceService;
|
|
|
+import vip.xiaonuo.quality.entity.QualityFenxibaogao;
|
|
|
+import vip.xiaonuo.quality.service.IQualityWriteService;
|
|
|
+import vip.xiaonuo.quality.service.QualityFenxibaogaoService;
|
|
|
+import vip.xiaonuo.sale.entity.*;
|
|
|
+import vip.xiaonuo.sale.mapper.SaleCustomerMapper;
|
|
|
+import vip.xiaonuo.sale.mapper.SaleOverdueMapper;
|
|
|
+import vip.xiaonuo.sale.mapper.SaleProduceMapper;
|
|
|
+import vip.xiaonuo.sale.mapper.SaleReceiveMapper;
|
|
|
+import vip.xiaonuo.sale.service.*;
|
|
|
+import vip.xiaonuo.sys.modular.org.entity.SysOrg;
|
|
|
+import vip.xiaonuo.sys.modular.org.mapper.SysOrgMapper;
|
|
|
+import vip.xiaonuo.warehouse.entity.WarehouseMaterialStock;
|
|
|
+import vip.xiaonuo.warehouse.entity.WarehouseStockDetail;
|
|
|
+import vip.xiaonuo.warehouse.service.IWarehouseMaterialStockService;
|
|
|
+import vip.xiaonuo.warehouse.service.IWarehouseStockDetailService;
|
|
|
+import vip.xiaonuo.write.entity.WriteProduct;
|
|
|
+import vip.xiaonuo.write.service.IWriteProductService;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.time.temporal.ValueRange;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 财务营业情况 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author author
|
|
|
+ * @since 2024-11-19
|
|
|
+ */
|
|
|
+@Api(tags = "详情控制器")
|
|
|
+@ApiSupport(author = "wang", order = 1)
|
|
|
+@RestController
|
|
|
+@Validated
|
|
|
+public class MoneyDetailsController {
|
|
|
+ @Autowired
|
|
|
+ private IMoneyBusinessService businessService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMoneyBorrowWarningService borrowWarningService;
|
|
|
+ @Autowired
|
|
|
+ private IMoneyCostService moneyCostService;
|
|
|
+ @Autowired
|
|
|
+ private SysOrgMapper sysOrgMapper;
|
|
|
+ @Autowired
|
|
|
+ private ISaleVisitService saleVisitService;
|
|
|
+ @Autowired
|
|
|
+ private ISalePlanService salePlanService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleDetailService saleDetailService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleOrderService saleOrderService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleDeliverService saleDeliverService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleCustomerService saleCustomerService;
|
|
|
+ @Autowired
|
|
|
+ private IMoneyProduceService moneyProduceService;
|
|
|
+ @Autowired
|
|
|
+ private IPurchaseOrderService purchaseOrderService;
|
|
|
+ @Autowired
|
|
|
+ private IWarehouseStockDetailService warehouseStockDetailService;
|
|
|
+ @Autowired
|
|
|
+ private IPurchasePriceService purchasePriceService;
|
|
|
+ @Autowired
|
|
|
+ private IProductionWorkstopPlanService planService;
|
|
|
+ @Autowired
|
|
|
+ private IProductionWritePlanService writePlanService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IProductionWriteEnergyService energyService;
|
|
|
+ @Autowired
|
|
|
+ private QualityFenxibaogaoService qualityFenxibaogaoService;
|
|
|
+ @Autowired
|
|
|
+ private IMoneyWriteOverdueService writeOverdueService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMoneyProduce0422Service produce0422Service;
|
|
|
+ @Autowired
|
|
|
+ private IWriteProductService writeProductService;
|
|
|
+ @Autowired
|
|
|
+ private IMoneyIncomeService incomeService;
|
|
|
+ @Autowired
|
|
|
+ private ISalePriceService priceService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleCostService saleCostService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleOverdueService saleOverdueService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleReceiveService receiveService;
|
|
|
+ @Autowired
|
|
|
+ private ISaleProduceService saleProduceService;
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation("营业收入,净利润,已交税金")
|
|
|
+ @PostMapping("/details/businessIncome")
|
|
|
+ public CommonResult<Page<MoneyBusiness> > businessIncome(@RequestBody DetailVo dsBusParam) {
|
|
|
+ Page<MoneyBusiness> page = businessService.page(new Page<MoneyBusiness>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ getWapper(dsBusParam, new QueryWrapper<MoneyBusiness>()));
|
|
|
+ for (MoneyBusiness record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompany(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation("当前资余额")
|
|
|
+ @PostMapping("/details/balance")
|
|
|
+ public CommonResult<Page<MoneyBusiness> > balance(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyBusiness> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyBusiness>());
|
|
|
+ Page<MoneyBusiness> page = businessService.page(new Page<MoneyBusiness>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wapper);
|
|
|
+ for (MoneyBusiness record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompany(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation("借款明细表")
|
|
|
+ @PostMapping("/details/listBorrowDetail")
|
|
|
+ public CommonResult<Page<MoneyBorrowWarning>> listBorrowDetail(@RequestBody MoneyBorrowDetailParam detailParam) {
|
|
|
+
|
|
|
+ String month = detailParam.getMonth();
|
|
|
+ String startDate = detailParam.getStartDate();
|
|
|
+ String endDate = detailParam.getEndDate();
|
|
|
+ Date now = new Date();
|
|
|
+
|
|
|
+ QueryWrapper<MoneyBorrowWarning> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(detailParam.getOrgId()), "org_id", detailParam.getOrgId());
|
|
|
+ if (StringUtils.isNotBlank(detailParam.getBankName())){
|
|
|
+ queryWrapper.and(i -> i.like("company",detailParam.getBankName())
|
|
|
+ .or().like("money_type",detailParam.getBankName())
|
|
|
+ .or().like("bank_name",detailParam.getBankName())
|
|
|
+ .or().like("bank_type",detailParam.getBankName())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ queryWrapper.ge(StringUtils.isNotBlank(startDate), "borrow_time", startDate);
|
|
|
+ queryWrapper.le(StringUtils.isNotBlank(endDate), "borrow_time", endDate);
|
|
|
+ queryWrapper.orderByDesc("borrow_time");
|
|
|
+ if (StringUtils.isNotBlank(month)){
|
|
|
+ queryWrapper.between("borrow_time",now, DateUtil.offsetMonth(now,Integer.parseInt(month)) );
|
|
|
+ }
|
|
|
+
|
|
|
+ queryWrapper.orderByDesc("borrow_time");
|
|
|
+ Page<MoneyBorrowWarning> page = borrowWarningService.page(new Page<MoneyBorrowWarning>(detailParam.getPageNum(), detailParam.getPageSize()), queryWrapper);
|
|
|
+ queryWrapper.select("sum(borrow_price) countMoney ");
|
|
|
+ MoneyBorrowWarning moneyBorrowWarning = borrowWarningService.getOne(queryWrapper);
|
|
|
+
|
|
|
+ for (MoneyBorrowWarning record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompany(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(moneyBorrowWarning)){
|
|
|
+ page.setCountId(moneyBorrowWarning.getCountMoney());
|
|
|
+ }else {
|
|
|
+ page.setCountId("0");
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation("期间费用")
|
|
|
+ @PostMapping("/details/getMoneyDetail")
|
|
|
+ public CommonResult<Page<MoneyCost> > getMoneyDetail(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyCost> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyCost>());
|
|
|
+ wapper.select("org_id,manage, sale,finance,(ifnull(manage,0) + ifnull(sale,0) + ifnull(finance,0)) as allMoney ,create_time ,company ,fname") ;
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("company",dsBusParam.getSearchWords())
|
|
|
+ .or().like("fname",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<MoneyCost> page = moneyCostService.page(new Page<MoneyCost>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wapper);
|
|
|
+ for (MoneyCost record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/details/visit")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation("拜访次数")
|
|
|
+ public CommonResult<Page<SaleVisit>> visit(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleVisit> wapper = new QueryWrapper();
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("kehu",dsBusParam.getSearchWords())
|
|
|
+ .or().like("sale_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleVisit> page = saleVisitService.page( new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()), getWapper(dsBusParam, wapper));
|
|
|
+ for (SaleVisit record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/plan")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation("销售计划")
|
|
|
+ public CommonResult<Page<SalePlan>> plan(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SalePlan> queryWrapper = new QueryWrapper();
|
|
|
+ Page<SalePlan> page = salePlanService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()), getWapper(dsBusParam, queryWrapper));
|
|
|
+ for (SalePlan record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/getContraceDetail")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation("合同金额")
|
|
|
+ public CommonResult<Page<SaleDetail>> getContraceDetail(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleDetail> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_contrace_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleDetail> page = saleDetailService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleDetail record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/getDeliverDetail")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation("发货金额")
|
|
|
+ public CommonResult<Page<SaleDeliver>> getDeliverDetail(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleDeliver> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleDeliver> page = saleDeliverService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper)) ;
|
|
|
+ for (SaleDeliver record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/customer")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation("客户销售金额")
|
|
|
+ public CommonResult<Page<SaleCustomer>> customer(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleCustomer> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("customer",dsBusParam.getSearchWords()) );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleCustomer> page = saleCustomerService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleCustomer record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ @ApiOperation("各部门收入趋势分析")
|
|
|
+ @PostMapping("/details/produce")
|
|
|
+ public CommonResult<Page<MoneyProduce>> produce(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyProduce> wrapper = getWapper(dsBusParam, new QueryWrapper<MoneyProduce>());
|
|
|
+ String types = dsBusParam.getTypes();
|
|
|
+ //国内
|
|
|
+ if (StringUtils.isNotBlank(types) && "6".equals(types) ){
|
|
|
+ wrapper.isNotNull("in_money").ne("in_money" ,0);
|
|
|
+ }else {
|
|
|
+ wrapper.isNotNull("out_money").ne("in_money" ,0);
|
|
|
+ }
|
|
|
+ Page<MoneyProduce> page = moneyProduceService.page(new Page<MoneyProduce>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+ for (MoneyProduce record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
+ @ApiOperation("采购金额")
|
|
|
+ @PostMapping("/details/puchaseOrder")
|
|
|
+ public CommonResult<Page<PurchaseOrder>> puchaseOrder(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<PurchaseOrder> wrapper = getWapper(dsBusParam, new QueryWrapper<PurchaseOrder>());
|
|
|
+ wrapper.isNotNull("order_number");
|
|
|
+ if(StringUtils.isNotBlank(dsBusParam.getMaterialTypes()) && "1".equals(dsBusParam.getMaterialTypes()) ){
|
|
|
+ wrapper.like("material","羊毛粗脂");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("order_number",dsBusParam.getSearchWords())
|
|
|
+ .or().like("material",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<PurchaseOrder> page = purchaseOrderService.page(new Page<PurchaseOrder>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (PurchaseOrder record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
+ @ApiOperation("库存数量")
|
|
|
+ @PostMapping("/details/materialNum")
|
|
|
+ public CommonResult<Page<WarehouseStockDetail>> materialNum(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<WarehouseStockDetail> wrapper = getWapper(dsBusParam, new QueryWrapper<WarehouseStockDetail>());
|
|
|
+ if(StringUtils.isNotBlank(dsBusParam.getMaterialTypes()) && "1".equals(dsBusParam.getMaterialTypes()) ){
|
|
|
+ wrapper.like("material_name","羊毛粗脂");
|
|
|
+ }
|
|
|
+ wrapper.isNotNull("income_number");
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("material_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("stock_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<WarehouseStockDetail> page = warehouseStockDetailService.page(new Page<WarehouseStockDetail>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (WarehouseStockDetail record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 13)
|
|
|
+ @ApiOperation("库存数量")
|
|
|
+ @PostMapping("/details/price")
|
|
|
+ public CommonResult<Page<PurchasePrice>> price(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<PurchasePrice> wrapper = getWapper(dsBusParam, new QueryWrapper<PurchasePrice>());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("material",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<PurchasePrice> page = purchasePriceService.page(new Page<PurchasePrice>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (PurchasePrice record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 14)
|
|
|
+ @ApiOperation("实际产量")
|
|
|
+ @PostMapping("/details/productionWorkPlan")
|
|
|
+ public CommonResult<Page<ProductionWorkstopPlan>> productionWorkPlan(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<ProductionWorkstopPlan> wrapper = getWapper(dsBusParam, new QueryWrapper<ProductionWorkstopPlan>());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("location_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<ProductionWorkstopPlan> page = planService.page(new Page<ProductionWorkstopPlan>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (ProductionWorkstopPlan record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiOperation("计划产量")
|
|
|
+ @PostMapping("/details/workPlan")
|
|
|
+ public CommonResult<Page<ProductionWritePlan>> workPlan(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<ProductionWritePlan> wrapper = getWapper(dsBusParam, new QueryWrapper<ProductionWritePlan>());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("production_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("location_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("org_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<ProductionWritePlan> page = writePlanService.page(new Page<ProductionWritePlan>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (ProductionWritePlan record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/enery")
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
+ @ApiOperation("能耗数据填报列表")
|
|
|
+ public CommonResult page(@RequestBody Map<String,String> paramsMap) {
|
|
|
+ return energyService.page(paramsMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/details/zhiliang")
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
+ @ApiOperation("质量分析报表")
|
|
|
+ public CommonResult<Page<QualityFenxibaogao>> zhiliang(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<QualityFenxibaogao> wrapper = getWapper(dsBusParam, new QueryWrapper<QualityFenxibaogao>());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("material_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("self_batch_num",dsBusParam.getSearchWords())
|
|
|
+ .or().like("inspec_num",dsBusParam.getSearchWords())
|
|
|
+ .or().like("inspec_items",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<QualityFenxibaogao> page = qualityFenxibaogaoService.page(new Page<QualityFenxibaogao>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/qualityWrite")
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiOperation("成品合格台账")
|
|
|
+ public CommonResult<Page<WriteProduct>> qualityWrite(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<WriteProduct> wrapper = new QueryWrapper<WriteProduct>();
|
|
|
+ wrapper.eq(StringUtils.isNotBlank(dsBusParam.getOrgId()),"org_id",dsBusParam.getOrgId());
|
|
|
+ wrapper.ge(StringUtils.isNotBlank(dsBusParam.getStartDate()),"report_date",dsBusParam.getStartDate());
|
|
|
+ wrapper.le(StringUtils.isNotBlank(dsBusParam.getEndDate()),"report_date",dsBusParam.getEndDate());
|
|
|
+ wrapper.orderByDesc("report_date");
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wrapper.and(i -> i.like("production_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("self_batch",dsBusParam.getSearchWords())
|
|
|
+ .or().like("factory_batch",dsBusParam.getSearchWords())
|
|
|
+ .or().like("production_unit",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<WriteProduct> page = writeProductService.page(new Page<WriteProduct>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+
|
|
|
+ for (WriteProduct record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IHrPeopleWriteService peopleWriteService;
|
|
|
+
|
|
|
+ @PostMapping("/details/listBalance")
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiOperation("员工人数")
|
|
|
+ public CommonResult<Page<HrPeopleWrite>> listBalance(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<HrPeopleWrite> wrapper = getWapper(dsBusParam, new QueryWrapper<HrPeopleWrite>());
|
|
|
+ Page<HrPeopleWrite> page = peopleWriteService.page(new Page<HrPeopleWrite>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wrapper);
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 17)
|
|
|
+ @ApiOperation("已交税金,产值")
|
|
|
+ @PostMapping("/details/busines")
|
|
|
+ public CommonResult<Page<MoneyBusiness> > busines(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyBusiness> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyBusiness>());
|
|
|
+ wapper.isNotNull("people_money");
|
|
|
+ Page<MoneyBusiness> page = businessService.page(new Page<MoneyBusiness>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ wapper);
|
|
|
+ for (MoneyBusiness record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompany(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private HrBaseEmployeeInfoService hrBaseEmployeeInfoService;
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 18)
|
|
|
+ @ApiOperation("人员列表")
|
|
|
+ @PostMapping("/details/list")
|
|
|
+ public CommonResult<Page<HrBaseEmployeeInfo> > list(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<HrBaseEmployeeInfo> wapper = getWapper(dsBusParam, new QueryWrapper<HrBaseEmployeeInfo>());
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("NAME",dsBusParam.getSearchWords())
|
|
|
+ .or().like("NATION",dsBusParam.getSearchWords())
|
|
|
+ .or().like("HOME_ADDRESS",dsBusParam.getSearchWords())
|
|
|
+ .or().like("NATIVE_PLACE",dsBusParam.getSearchWords())
|
|
|
+ .or().like("ID_CARD_NUMBER",dsBusParam.getSearchWords())
|
|
|
+ .or().like("PHONE",dsBusParam.getSearchWords())
|
|
|
+ .or().like("alma_mater",dsBusParam.getSearchWords())
|
|
|
+ .or().like("post",dsBusParam.getSearchWords())
|
|
|
+ .or().like("department_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<HrBaseEmployeeInfo> page = hrBaseEmployeeInfoService.page(new Page<HrBaseEmployeeInfo>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ wapper);
|
|
|
+
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @ApiOperation("收入占比分析 -- 产品销售趋势")
|
|
|
+ @PostMapping("/details/analysisIncome")
|
|
|
+ public CommonResult<Page<MoneyProduce0422> > analysisIncome(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyProduce0422> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyProduce0422>());
|
|
|
+ if(StringUtils.isNotBlank(dsBusParam.getTypes()) && "9".equals(dsBusParam.getTypes())){
|
|
|
+ wapper.isNotNull("material_qty");
|
|
|
+ }else {
|
|
|
+ wapper.isNotNull("material_amount");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("material_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<MoneyProduce0422> page = produce0422Service.page(new Page<MoneyProduce0422>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ wapper);
|
|
|
+ for (MoneyProduce0422 record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @ApiOperation("应收分析")
|
|
|
+ @PostMapping("/details/getOverdue")
|
|
|
+ public CommonResult<Page<MoneyWriteOverdue> > getOverdue(@RequestBody DetailVo dsBusParam) {
|
|
|
+// QueryWrapper<MoneyWriteOverdue> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyWriteOverdue>());
|
|
|
+// wapper.eq("document_type",1);
|
|
|
+ QueryWrapper<MoneyWriteOverdue> wapper = new QueryWrapper<>();
|
|
|
+ wapper.eq(StringUtils.isNotBlank(dsBusParam.getOrgId()),"org_id",dsBusParam.getOrgId());
|
|
|
+ wapper.ge(StringUtils.isNotBlank(dsBusParam.getStartDate()),"xsrq",dsBusParam.getStartDate());
|
|
|
+ wapper.le(StringUtils.isNotBlank(dsBusParam.getEndDate()),"xsrq",dsBusParam.getEndDate());
|
|
|
+ wapper.orderByDesc("xsrq");
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("user_name",dsBusParam.getSearchWords())
|
|
|
+ .or().like("document_number",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<MoneyWriteOverdue> page = writeOverdueService.page(new Page<MoneyWriteOverdue>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ wapper);
|
|
|
+ for (MoneyWriteOverdue record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @ApiOperation("目标收入")
|
|
|
+ @PostMapping("/details/getMoneyIncome")
|
|
|
+ public CommonResult<Page<MoneyIncome> > getMoneyIncome(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyIncome> wapper = new QueryWrapper<>();
|
|
|
+ wapper.eq(StringUtils.isNotBlank(dsBusParam.getOrgId()), "org_id", dsBusParam.getOrgId());
|
|
|
+ wapper.ge(StringUtils.isNotBlank(dsBusParam.getStartDate()), "year", dsBusParam.getStartDate());
|
|
|
+ wapper.le(StringUtils.isNotBlank(dsBusParam.getEndDate()), "year", dsBusParam.getEndDate());
|
|
|
+ wapper.orderByDesc("year");
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())) {
|
|
|
+ wapper.and(i -> i.like("company_name", dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<MoneyIncome> page = incomeService.page(new Page<MoneyIncome>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ wapper);
|
|
|
+ for (MoneyIncome record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompanyName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 20)
|
|
|
+ @ApiOperation("实际收入")
|
|
|
+ @PostMapping("/details/MoneyIncomeList")
|
|
|
+ public CommonResult<Page<MoneyBusiness> > MoneyIncomeList(@RequestBody DetailVo dsBusParam) {
|
|
|
+ dsBusParam.setTypes("1");
|
|
|
+ Page<MoneyBusiness> page = businessService.page(new Page<MoneyBusiness>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),
|
|
|
+ getWapper(dsBusParam, new QueryWrapper<MoneyBusiness>()));
|
|
|
+ for (MoneyBusiness record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setCompany(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/listProduceProfit")
|
|
|
+ @ApiOperationSupport(order = 21)
|
|
|
+ @ApiOperation("主要产品销售")
|
|
|
+ public CommonResult<Page<SaleDetail>> listProduceProfit(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleDetail> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_contrace_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleDetail> page = saleDetailService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleDetail record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @ApiOperationSupport(order = 22)
|
|
|
+ @ApiOperation("销售成本")
|
|
|
+ @PostMapping("/details/listForecast")
|
|
|
+ public CommonResult<Page<MoneyCost> > listForecast(@RequestBody DetailVo dsBusParam) {
|
|
|
+ QueryWrapper<MoneyCost> wapper = getWapper(dsBusParam, new QueryWrapper<MoneyCost>());
|
|
|
+ wapper.select("org_id,manage, sale,finance,(ifnull(manage,0) + ifnull(sale,0) + ifnull(finance,0)) as allMoney ,create_time ,company ,fname") ;
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ wapper.and(i -> i.like("company",dsBusParam.getSearchWords())
|
|
|
+ .or().like("fname",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<MoneyCost> page = moneyCostService.page(new Page<MoneyCost>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),wapper);
|
|
|
+ for (MoneyCost record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/saleOrder")
|
|
|
+ @ApiOperationSupport(order = 23)
|
|
|
+ @ApiOperation("订单金额-已签未发")
|
|
|
+ public CommonResult<Page<SaleOrder>> saleOrder(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleOrder> page = saleOrderService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleOrder record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/saleOrderWeiFa")
|
|
|
+ @ApiOperationSupport(order = 23)
|
|
|
+ @ApiOperation("已签未发")
|
|
|
+ public CommonResult<Page<SaleOrder>> saleOrderWeiFa(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleOrder> page = saleOrderService.saleOrderWeiFa(new Page<SaleOrder>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleOrder record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/details/salPrice")
|
|
|
+ @ApiOperationSupport(order = 24)
|
|
|
+ @ApiOperation("总要产品单价")
|
|
|
+ public CommonResult<Page<SalePrice>> salPrice(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SalePrice> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SalePrice> page = priceService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SalePrice record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/salesman")
|
|
|
+ @ApiOperationSupport(order = 25)
|
|
|
+ @ApiOperation("主要产品销售")
|
|
|
+ public CommonResult<Page<SaleDetail>> salesman(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleDetail> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_contrace_order",dsBusParam.getSearchWords())
|
|
|
+ .or().like("customer",dsBusParam.getSearchWords())
|
|
|
+ .or().like("salesman",dsBusParam.getSearchWords())
|
|
|
+ .or().like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<SaleDetail> page = saleDetailService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleDetail record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgName(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/saleCost")
|
|
|
+ @ApiOperationSupport(order = 25)
|
|
|
+ @ApiOperation("销售费用")
|
|
|
+ public CommonResult<Page<SaleCost>> saleCost(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleCost> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("sale_cost_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleCost> page = saleCostService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleCost record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/saleOverdue")
|
|
|
+ @ApiOperationSupport(order = 26)
|
|
|
+ @ApiOperation("逾期合同明细")
|
|
|
+ public CommonResult<Page<SaleOverdue>> saleOverdue(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleOverdue> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("overdue_order",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleOverdue> page = saleOverdueService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleOverdue record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/saleReceive")
|
|
|
+ @ApiOperationSupport(order = 27)
|
|
|
+ @ApiOperation("应收账款明细")
|
|
|
+ public CommonResult<Page<SaleReceive>> saleReceive(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleReceive> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("receive_order",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleReceive> page = receiveService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleReceive record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+ @PostMapping("/details/saleProduce")
|
|
|
+ @ApiOperationSupport(order = 27)
|
|
|
+ @ApiOperation("销售趋势")
|
|
|
+ public CommonResult<Page<SaleProduce>> saleProduce(@RequestBody DetailVo dsBusParam) {
|
|
|
+
|
|
|
+ QueryWrapper<SaleProduce> queryWrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getSearchWords())){
|
|
|
+ queryWrapper.and(i -> i.like("produce_name",dsBusParam.getSearchWords())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ Page<SaleProduce> page = saleProduceService.page(new Page<>(dsBusParam.getPageNum(), dsBusParam.getPageSize()),getWapper(dsBusParam,queryWrapper));
|
|
|
+ for (SaleProduce record : page.getRecords()) {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(record.getOrgId());
|
|
|
+ record.setOrgId(sysOrg.getFdesc());
|
|
|
+ }
|
|
|
+ return CommonResult.data(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private <T> QueryWrapper<T> getWapper(DetailVo dsBusParam,QueryWrapper<T> queryWrapper) {
|
|
|
+
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(dsBusParam.getOrgId()),"org_id",dsBusParam.getOrgId());
|
|
|
+ queryWrapper.ge(StringUtils.isNotBlank(dsBusParam.getStartDate()),"create_time",dsBusParam.getStartDate());
|
|
|
+ queryWrapper.le(StringUtils.isNotBlank(dsBusParam.getEndDate()),"create_time",dsBusParam.getEndDate());
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(dsBusParam.getTypes())){
|
|
|
+ for (String s : dsBusParam.getTypes().split(",")) {
|
|
|
+ if ("1".equals(s)) {
|
|
|
+ queryWrapper.ne("business_income", 0);
|
|
|
+ } else if ("2".equals(s)) {
|
|
|
+ queryWrapper.ne("profit", 0);
|
|
|
+ } else if ("3".equals(s)) {
|
|
|
+ queryWrapper.ne("taxes", 0);
|
|
|
+ } else if ("4".equals(s)) {
|
|
|
+ queryWrapper.ne("balance", 0);
|
|
|
+ } else if ("5".equals(s)) {
|
|
|
+ queryWrapper.ne("business_cost", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return queryWrapper;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|