yxt_djz 3 years ago
parent
commit
afc42a2254
  1. 4
      yxt_supervise/pom.xml
  2. 2
      yxt_supervise/supervise-portal/pom.xml
  3. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/brandinfo/BrandInfoMapper.java
  4. 5
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/brandinfo/BrandInfoService.java
  5. 2
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/dictcommon/DictCommonMapper.java
  6. 5
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/dictcommon/DictCommonService.java
  7. 52
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/inventoryinformation/InventoryInformationService.java
  8. 3
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/productinformation/ProductInformationMapper.java
  9. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/productinformation/ProductInformationService.java
  10. 4
      yxt_supervise/supervise-supplychain/pom.xml

4
yxt_supervise/pom.xml

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.yxt.anrui</groupId> <groupId>com.yxt.supervise</groupId>
<artifactId>anrui</artifactId> <artifactId>yxt_supervise</artifactId>
<version>0.0.1</version> <version>0.0.1</version>

2
yxt_supervise/supervise-portal/pom.xml

@ -10,7 +10,7 @@
<module>supervise-portal-api</module> <module>supervise-portal-api</module>
<module>supervise-portal-biz</module> <module>supervise-portal-biz</module>
</modules> </modules>
<groupId>com.yxt.anrui</groupId> <groupId>com.yxt.supervise</groupId>
<version>0.0.1</version> <version>0.0.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>

2
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/brandinfo/BrandInfoMapper.java

@ -64,4 +64,6 @@ public interface BrandInfoMapper extends BaseMapper<BrandInfo> {
List<BrandInfoVo> selectListVo(); List<BrandInfoVo> selectListVo();
@Select("select * from brand_info where code=#{code}") @Select("select * from brand_info where code=#{code}")
BrandInfoVo selectByCode(String code); BrandInfoVo selectByCode(String code);
@Select("select name,code from restricted_brand where code=#{code} group by name")
BrandInfo fetchByCodeForLimit(String brandSid);
} }

5
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/brandinfo/BrandInfoService.java

@ -105,4 +105,9 @@ public class BrandInfoService extends MybatisBaseService<BrandInfoMapper, BrandI
BrandInfoVo vo = baseMapper.selectByCode(key); BrandInfoVo vo = baseMapper.selectByCode(key);
return vo; return vo;
} }
public BrandInfo fetchByCodeForLimit(String brandSid) {
BrandInfo vo = baseMapper.fetchByCodeForLimit(brandSid);
return vo;
}
} }

2
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/dictcommon/DictCommonMapper.java

@ -68,4 +68,6 @@ public interface DictCommonMapper extends BaseMapper<DictCommon> {
DictCommonDetailsVo fetchByKey(@Param("key")String key); DictCommonDetailsVo fetchByKey(@Param("key")String key);
@Select("select * from dict_common where dictkey=#{key} and dictType=#{type}") @Select("select * from dict_common where dictkey=#{key} and dictType=#{type}")
DictCommonDetailsVo fetchByKeyAndType(@Param("key")String key, @Param("type")String type); DictCommonDetailsVo fetchByKeyAndType(@Param("key")String key, @Param("type")String type);
@Select("select * from restricted_category where dictkey=#{key} and dictType=#{type}")
DictCommonDetailsVo fetchByKeyAndTypeForLimit(@Param("type")String category, @Param("key")String categoryKey);
} }

5
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/dictcommon/DictCommonService.java

@ -112,4 +112,9 @@ public class DictCommonService extends MybatisBaseService<DictCommonMapper, Dict
DictCommonDetailsVo vo = baseMapper.fetchByKeyAndType(value,type); DictCommonDetailsVo vo = baseMapper.fetchByKeyAndType(value,type);
return vo; return vo;
} }
public DictCommonDetailsVo fetchByKeyAndTypeForLimit(String category, String categoryKey) {
DictCommonDetailsVo vo = baseMapper.fetchByKeyAndTypeForLimit(category,categoryKey);
return vo;
}
} }

52
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/inventoryinformation/InventoryInformationService.java

@ -33,8 +33,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.supervise.portal.api.dictcommon.DictCommon; import com.yxt.supervise.portal.api.dictcommon.DictCommon;
import com.yxt.supervise.portal.api.dictcommon.DictCommonDetailsVo; import com.yxt.supervise.portal.api.dictcommon.DictCommonDetailsVo;
import com.yxt.supervise.portal.api.inventoryinformation.*; import com.yxt.supervise.portal.api.inventoryinformation.*;
import com.yxt.supervise.portal.api.productnum.ProductNum;
import com.yxt.supervise.portal.api.purchaserequisitionpro.PurchaseRequisitionPro; import com.yxt.supervise.portal.api.purchaserequisitionpro.PurchaseRequisitionPro;
import com.yxt.supervise.portal.biz.dictcommon.DictCommonService; import com.yxt.supervise.portal.biz.dictcommon.DictCommonService;
import com.yxt.supervise.portal.biz.productnum.ProductNumService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
@ -301,15 +303,18 @@ public class InventoryInformationService extends MybatisBaseService<InventoryInf
System.out.println(x1); System.out.println(x1);
//return message; //return message;
} }
@Resource
private ProductNumService productNumService;
public HSSFWorkbook exportExcel( HSSFWorkbook wb) { public HSSFWorkbook exportExcel( HSSFWorkbook wb) {
String title = "采购订单商品明细表"; String title = "重点品类商品订货明细";
String[] col = {"审核单号","状态","合计金额"}; String[] col = {"审核单号","状态","合计金额"};
String[] col1 = {"序号","商品代码","商名称","规格型号","数量","单位","单价(元)","含税单价(元)","合计(元)", String[] col1 = {"序号","厂商编码","商名称","商品代码","商品条码","商品名称","单位","进价","配价","售价","箱规",
"包内数量","包装规格","包代码","包数量","包单价","包合计","商品品类","品牌名称","发货日期"}; "订货数量","订货金额(元)","合计","税票","降价折扣%","判定结果","备注"};
//sheet名 //sheet名
String sheetName = "采购订单商品明细表"; String sheetName = "重点品类商品订货明细";
//创建HSSFWorkbook //创建HSSFWorkbook
String [][]content={{"张三","男","12","清华大学","大一"},{"李四","女","14","北京大学","大二"}}; //String [][]content={{"张三","男","12","清华大学","大一"},{"李四","女","14","北京大学","大二"}};
List<ProductNum> productNums=productNumService.getAll();
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件 // 第一步,创建一个HSSFWorkbook,对应一个Excel文件
if(wb == null){ if(wb == null){
wb = new HSSFWorkbook(); wb = new HSSFWorkbook();
@ -329,29 +334,48 @@ public class InventoryInformationService extends MybatisBaseService<InventoryInf
titleRow.setCellValue(title); titleRow.setCellValue(title);
titleRow.setCellStyle(style); titleRow.setCellStyle(style);
HSSFCell titleRow1 = row.createCell(1); /*HSSFCell titleRow1 = row.createCell(1);
titleRow1.setCellValue("审核单号:123456789 状态:已通过审核 合计金额:12345678"); titleRow1.setCellValue("审核单号:123456789 状态:已通过审核 合计金额:12345678");
titleRow1.setCellStyle(style); titleRow1.setCellStyle(style);*/
//声明列对象 //声明列对象
HSSFCell cell = null; HSSFCell cell = null;
//创建标题 //创建标题
HSSFRow row1 = sheet.createRow(2); HSSFRow row1 = sheet.createRow(1);
for(int i=0;i<col.length;i++){ for(int i=0;i<col1.length;i++){
cell = row1.createCell(i); cell = row1.createCell(i);
cell.setCellValue(col[i]); cell.setCellValue(col1[i]);
cell.setCellStyle(style); cell.setCellStyle(style);
} }
//创建内容 //创建内容
for(int i=0;i<content.length;i++){ for(int i=0;i<productNums.size();i++){
row = sheet.createRow(i + 2); row = sheet.createRow(i + 2);
for(int j=0;j<content[i].length;j++){
//将内容按顺序赋给对应的列对象 //将内容按顺序赋给对应的列对象
row.createCell(j).setCellValue(content[i][j]); //"序号","厂商编码","厂商名称","商品代码","商品条码","商品名称","单位","进价","售价","箱规","订货数量","订货金额(元)","合计","税票","降价折扣%"
}
row.createCell(0).setCellValue(i);
row.createCell(1).setCellValue(productNums.get(i).getSupplierCode());
row.createCell(2).setCellValue(productNums.get(i).getSupplierName());
row.createCell(3).setCellValue(productNums.get(i).getCode());
row.createCell(4).setCellValue(productNums.get(i).getBarCode());
row.createCell(5).setCellValue(productNums.get(i).getName());
row.createCell(6).setCellValue(productNums.get(i).getUnit());
row.createCell(7).setCellValue(productNums.get(i).getPurchasePrice());//进价
row.createCell(8).setCellValue(productNums.get(i).getValence());//进价
row.createCell(9).setCellValue(productNums.get(i).getPrice());//售价
row.createCell(10).setCellValue(productNums.get(i).getBoxGauge());
row.createCell(11).setCellValue(productNums.get(i).getNum());
row.createCell(12).setCellValue(productNums.get(i).getOrderAmount());
row.createCell(13).setCellValue("0");
row.createCell(14).setCellValue(productNums.get(i).getTaxReceipt());
row.createCell(15).setCellValue(productNums.get(i).getDiscount());
row.createCell(16).setCellValue(productNums.get(i).getState());
row.createCell(17).setCellValue(productNums.get(i).getRemarks());
} }
return wb; return wb;
} }

3
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/productinformation/ProductInformationMapper.java

@ -64,4 +64,7 @@ public interface ProductInformationMapper extends BaseMapper<ProductInformation>
List<ProductInformationVo> selectListVo(); List<ProductInformationVo> selectListVo();
ProductInformationVo selectByCode(@Param("code")String code); ProductInformationVo selectByCode(@Param("code")String code);
@Select("SELECT * FROM `product_information` WHERE (brandSid IN(SELECT CODE FROM restricted_brand) " +
"AND categoryKey IN(SELECT dictKey FROM restricted_category) AND CODE = #{code}) or (categoryKey in('081101','081102','081103'))")
ProductInformationVo limitJudgement(String code);
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/productinformation/ProductInformationService.java

@ -552,4 +552,8 @@ public class ProductInformationService extends MybatisBaseService<ProductInforma
public ProductInformationVo selectByCode(String code) { public ProductInformationVo selectByCode(String code) {
return baseMapper.selectByCode(code); return baseMapper.selectByCode(code);
} }
public ProductInformationVo limitJudgement(String code) {
return baseMapper.limitJudgement(code);
}
} }

4
yxt_supervise/supervise-supplychain/pom.xml

@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>anrui</artifactId> <artifactId>yxt_supervise</artifactId>
<groupId>com.yxt.anrui</groupId> <groupId>com.yxt.supervise</groupId>
<version>0.0.1</version> <version>0.0.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

Loading…
Cancel
Save