Browse Source

销售统计

master
liupopo 2 years ago
parent
commit
6198f5369a
  1. 3
      supervise-customer-ui/src/views/kucun/xssjgl/index.vue
  2. 6
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java
  3. 40
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java
  4. 28
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java
  5. 5
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java
  6. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java

3
supervise-customer-ui/src/views/kucun/xssjgl/index.vue

@ -82,7 +82,8 @@
</el-card>
</div>
<div><el-button :disabled="filecandown" size="small" type="primary" @click="doDownloadHz">下载销售报表文件</el-button>
<el-button :disabled="filecandown" size="small" type="primary" @click="doDownloadHzYc">下载烟草分销数据文件</el-button></div>
<!-- <el-button :disabled="filecandown" size="small" type="primary" @click="doDownloadHzYc">下载烟草分销数据文件</el-button> -->
</div>
</el-card>
<span slot="footer" class="dialog-footer"><el-button @click="dialogClose"> </el-button></span>
</el-dialog>

6
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java

@ -70,7 +70,7 @@ public interface GdInstorageCountMapper extends BaseMapper<GdInstorageCount> {
@Select("SELECT t.*, " +
" CONVERT(IF((t.billTotalPrice-t.prodValue)>0,t.billTotalPrice-t.prodValue,0),DECIMAL(12,2)) wdhjz, " +
" CONVERT(IF((t.prodValue-t.billTotalPrice)>0,t.prodValue-t.billTotalPrice,0),DECIMAL(12,2)) cchjz, " +
" IF((t.billTotalPrice-t.prodValue)>0,'是','否') sfyq " +
" IF((t.billTotalPrice-t.prodValue)>0 and DATEDIFF(arrivaldate, CURDATE())<0 ,'是','否') sfyq " +
"FROM( " +
" SELECT " +
" MAX(sbi.codeUnified) codeUnified, " +
@ -80,8 +80,8 @@ public interface GdInstorageCountMapper extends BaseMapper<GdInstorageCount> {
" ( " +
" SELECT CONVERT(IFNULL(SUM(colq16),0),DECIMAL(12,2)) FROM gd_instorage gic LEFT JOIN `product_information` PI ON pi.code=gic.colh7 " +
" WHERE gic.supplierCodeUnified=pr.supplierOnlyCode " +
" AND pi.categoryKey IN(SELECT categoryKey FROM `restricted_category`) " +
" AND pi.brandsid IN(SELECT CODE FROM `restricted_brand`) " +
// " AND pi.categoryKey IN(SELECT categoryKey FROM `restricted_category`) " +
// " AND pi.brandsid IN(SELECT CODE FROM `restricted_brand`) " +
" ) prodvalue, " +
" MAX(pr.`arrivalDate`) arrivaldate " +
" FROM `supplier_bank_info` sbi " +

40
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java

@ -270,38 +270,38 @@ public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper,
for (int y = 3; y < countRow; y++) {
Map<String, Object> map = list1.get(y - 3);
writer.writeCellValue(0, y, map.get("name"));
writer.writeCellValue(1, y, "");
writer.writeCellValue(2, y, map.get("billtotalprice"));
// writer.writeCellValue(1, y, "");
writer.writeCellValue(1, y, map.get("billtotalprice"));
cbilltotalprice = cbilltotalprice + ExcelTool.toDouble(map.get("billtotalprice"));
writer.writeCellValue(3, y, map.get("prodvalue"));
writer.writeCellValue(2, y, map.get("prodvalue"));
cprodvalue = cprodvalue + ExcelTool.toDouble(map.get("prodvalue"));
writer.writeCellValue(4, y, map.get("wdhjz"));
writer.writeCellValue(3, y, map.get("wdhjz"));
cwdhjz = cwdhjz + ExcelTool.toDouble(map.get("wdhjz"));
writer.writeCellValue(5, y, map.get("cchjz"));
writer.writeCellValue(4, y, map.get("cchjz"));
ccchjz = ccchjz + ExcelTool.toDouble(map.get("cchjz"));
writer.writeCellValue(6, y, map.get("arrivaldate"));
writer.writeCellValue(7, y, map.get("sfyq"));
writer.writeCellValue(5, y, map.get("arrivaldate"));
writer.writeCellValue(6, y, map.get("sfyq"));
}
writer.writeCellValue(0, countRow, "市烟草");
writer.writeCellValue(1, countRow, "");
writer.writeCellValue(2, countRow, cPrice);
// writer.writeCellValue(1, countRow, "");
writer.writeCellValue(1, countRow, cPrice);
cbilltotalprice = cbilltotalprice + cPrice;
writer.writeCellValue(3, countRow, cghje);
writer.writeCellValue(2, countRow, cghje);
cprodvalue = cprodvalue + cghje;
writer.writeCellValue(4, countRow, cztje);
writer.writeCellValue(3, countRow, cztje);
cwdhjz = cwdhjz + cztje;
writer.writeCellValue(5, countRow, "0.0");
writer.writeCellValue(6, countRow, maxDate);
writer.writeCellValue(7, countRow, "否");
writer.writeCellValue(4, countRow, "0.0");
writer.writeCellValue(5, countRow, maxDate);
writer.writeCellValue(6, countRow, "否");
writer.writeCellValue(0, countRow + 1, "合计");
writer.writeCellValue(1, countRow + 1, "");
writer.writeCellValue(2, countRow + 1, cbilltotalprice);
writer.writeCellValue(3, countRow + 1, cprodvalue);
writer.writeCellValue(4, countRow + 1, cwdhjz);
writer.writeCellValue(5, countRow + 1, ccchjz);
// writer.writeCellValue(1, countRow + 1, "");
writer.writeCellValue(1, countRow + 1, cbilltotalprice);
writer.writeCellValue(2, countRow + 1, cprodvalue);
writer.writeCellValue(3, countRow + 1, cwdhjz);
writer.writeCellValue(4, countRow + 1, ccchjz);
writer.writeCellValue(5, countRow + 1, "");
writer.writeCellValue(6, countRow + 1, "");
writer.writeCellValue(7, countRow + 1, "");
writer.flush();
writer.close();

28
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesService.java

@ -367,6 +367,34 @@ public class GdSalesService extends ServiceImpl<GdSalesMapper, GdSales> {
String url = urlPrefix + "kchzb/" + newFileName;
gdLog.setFileUrl(url);
gdLog.setOutFilePath(uploadPath + "kchzb/" + newFileName);
// String newFileNameyc = "kchzb/烟草分销数据" + orderDate + "-" + System.currentTimeMillis() + ".xlsx";
// ExcelWriter writerYcfx = ExcelUtil.getWriter(uploadPath + newFileNameyc);
// List<GdSalesYc> gdSalesYcs = gdSalesYcService.listFxOfDay(orderDate);
// writerYcfx.addHeaderAlias("orderType", "订单类型");
// writerYcfx.addHeaderAlias("orderNo", "销售订单号");
// writerYcfx.addHeaderAlias("prodCode", "商品编码");
// writerYcfx.addHeaderAlias("prodBarCode", "商品条码");
// writerYcfx.addHeaderAlias("prodName", "商品名称");
// writerYcfx.addHeaderAlias("brandCode", "品牌代码");
// writerYcfx.addHeaderAlias("brandName", "品牌名称");
// writerYcfx.addHeaderAlias("categoryb", "商品大类");
// writerYcfx.addHeaderAlias("categorym", "商品中类");
// writerYcfx.addHeaderAlias("categorys", "商品小类");
// writerYcfx.addHeaderAlias("customerCode", "客户代码");
// writerYcfx.addHeaderAlias("customerName", "客户名称");
// writerYcfx.addHeaderAlias("saleNum", "销售数量");
// writerYcfx.addHeaderAlias("storeCode", "销售渠道");
// writerYcfx.addHeaderAlias("salePrice", "销售价格");
// writerYcfx.addHeaderAlias("saleCost", "销售成本");
// writerYcfx.addHeaderAlias("profit", "利润");
// writerYcfx.addHeaderAlias("dataDate", "数据日期");
// writerYcfx.setOnlyAlias(true);
// writerYcfx.write(gdSalesYcs, true);
// writerYcfx.close();
// String urlyc = urlPrefix + newFileNameyc;
// gdLog.setRemarks(urlyc);
gdSalesLogService.updateById(gdLog);
return rb.success().setData(gdLog);

5
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcMapper.java

@ -79,5 +79,8 @@ public interface GdSalesYcMapper extends BaseMapper<GdSalesYc> {
@Select("SELECT CONVERT(IFNULL(sum(saleNum*salePrice),0),DECIMAL(12,2)) as amount FROM gd_sales_yc where dataDate=#{dataDate} " +
" and storeCode in (select code from store_index si where si.`type`='连锁内加盟') ")
double amountOfLsnjmDay(String orderDate);
double amountOfLsnjmDay(@Param("dataDate") String orderDate);
@Select("SELECT * FROM gd_sales_gd where orderType='批发' and (customerName='客户' or customerName='客户1') and dataDate=#{dataDate} " )
List<GdSalesYc> listFxOfDay(@Param("dataDate") String orderDate);
}

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdsales/GdSalesYcService.java

@ -78,4 +78,8 @@ public class GdSalesYcService extends ServiceImpl<GdSalesYcMapper, GdSalesYc> {
public double amountOfLsnjmDay(String orderDate) {
return baseMapper.amountOfLsnjmDay(orderDate);
}
public List<GdSalesYc> listFxOfDay(String orderDate) {
return baseMapper.listFxOfDay(orderDate);
}
}

Loading…
Cancel
Save