Parcourir la source

货品档案新增字段及收支凭证导入修改

hu il y a 4 mois
Parent
commit
a92fea77b1

+ 13 - 9
src/custom/restcontroller/sale/cashbill/IncomeExportExcel.java

@@ -1,14 +1,12 @@
 package restcontroller.sale.cashbill;
 
 
-import org.apache.poi.ss.usermodel.BorderStyle;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.*;
 
 import java.awt.*;
+import java.awt.Color;
 
 public class IncomeExportExcel {
 	 /**
@@ -106,7 +104,7 @@ public class IncomeExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 单据日期 宽度
         sheet.setColumnWidth((short) 3, (short) 11000);// 设置 备注 宽度
     }
     
@@ -122,7 +120,7 @@ public class IncomeExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 单据日期 宽度
         sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
         sheet.setColumnWidth((short) 7, (short) 8000);// 设置 错误信息 宽度
     }
@@ -157,6 +155,12 @@ public class IncomeExportExcel {
         cellStyle2.setBorderRight(BorderStyle.THIN);//右边框
         cellStyle2.setWrapText(true);
 
+        DataFormat format = workbook.createDataFormat();
+        cellStyle1.setDataFormat(format.getFormat("@"));
+        cellStyle2.setDataFormat(format.getFormat("@"));
+        cellStyle3.setDataFormat(format.getFormat("@"));
+        cellStyle4.setDataFormat(format.getFormat("@"));
+
    	 /*第一行*/
        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
 
@@ -185,7 +189,7 @@ public class IncomeExportExcel {
 
         cell = row.createCell(2);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 收入金额(必填)");
+        cell.setCellValue("收入金额(必填)");
 
         cell = row.createCell(3);
         cell.setCellStyle(cellStyle2);
@@ -197,7 +201,7 @@ public class IncomeExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue("归属日期");
+        cell.setCellValue("单据日期");
 
         cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);
@@ -302,7 +306,7 @@ public class IncomeExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 归属日期");
+        cell.setCellValue(" 单据日期");
 
         cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);

+ 14 - 10
src/custom/restcontroller/sale/cashbill/PayExportExcel.java

@@ -1,14 +1,12 @@
 package restcontroller.sale.cashbill;
 
 
-import org.apache.poi.ss.usermodel.BorderStyle;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.*;
 
 import java.awt.*;
+import java.awt.Color;
 
 public class PayExportExcel {
 	 /**
@@ -106,7 +104,7 @@ public class PayExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 单据日期 宽度
         sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
     }
     
@@ -122,7 +120,7 @@ public class PayExportExcel {
         sheet.setColumnWidth((short) 2, (short) 5500);// 设置 金额 宽度
         sheet.setColumnWidth((short) 3, (short) 5500);// 设置 分类 宽度
         sheet.setColumnWidth((short) 4, (short) 5500);// 设置 分类明细 宽度
-        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 归属日期 宽度
+        sheet.setColumnWidth((short) 5, (short) 5500);// 设置 单据日期 宽度
         sheet.setColumnWidth((short) 6, (short) 11000);// 设置 备注 宽度
         sheet.setColumnWidth((short) 7, (short) 8000);// 设置 错误信息 宽度
     }
@@ -157,6 +155,12 @@ public class PayExportExcel {
         cellStyle2.setBorderRight(BorderStyle.THIN);//右边框
         cellStyle2.setWrapText(true);
 
+        DataFormat format = workbook.createDataFormat();
+        cellStyle1.setDataFormat(format.getFormat("@"));
+        cellStyle2.setDataFormat(format.getFormat("@"));
+        cellStyle3.setDataFormat(format.getFormat("@"));
+        cellStyle4.setDataFormat(format.getFormat("@"));
+
    	 /*第一行*/
        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
 
@@ -185,7 +189,7 @@ public class PayExportExcel {
 
         cell = row.createCell(2);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 支出金额(必填)");
+        cell.setCellValue("支出金额(必填)");
 
         cell = row.createCell(3);
         cell.setCellStyle(cellStyle2);
@@ -193,11 +197,11 @@ public class PayExportExcel {
 
         cell = row.createCell(4);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 分类明细");
+        cell.setCellValue("分类明细");
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 归属日期");
+        cell.setCellValue("单据日期");
 
         cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);
@@ -302,7 +306,7 @@ public class PayExportExcel {
 
         cell = row.createCell(5);
         cell.setCellStyle(cellStyle2);
-        cell.setCellValue(" 归属日期");
+        cell.setCellValue(" 单据日期");
 
         cell = row.createCell(6);
         cell.setCellStyle(cellStyle2);

+ 9 - 6
src/custom/restcontroller/sale/cashbill/cashbill.java

@@ -136,12 +136,15 @@ public class cashbill extends Controller {
                     msg = msg + "【账户名称为空】";
 
                 }
-                if (!isValidFormat(row.getString("period"))) {
-                    iserr = true;
-                    msg = msg + "【归属日期格式错误】";
+                if(StringUtils.isNotBlank(row.getString("period"))){
+                    if (!isValidFormat(row.getString("period"))) {
+                        iserr = true;
+                        msg = msg + "【单据日期格式错误】";
 
+                    }
                 }
 
+
                 if (!isBigDecimal(row.getString("amount"))) {
                     iserr = true;
                     msg = msg + "【金额错误:" + row.getString("amount") + "】";
@@ -231,9 +234,9 @@ public class cashbill extends Controller {
                     sqlFactoryupload.addParameter("discountamount", 0);
                     if (StringUtils.isBlank(row.getString("period"))) {
                         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                        sqlFactoryupload.addParameter("period", sdf.format(new Date()));
+                        sqlFactoryupload.addParameter("billdate", sdf.format(new Date()));
                     } else {
-                        sqlFactoryupload.addParameter("period", row.getString("period"));
+                        sqlFactoryupload.addParameter("billdate", row.getString("period"));
                     }
 
                     sqllist.add(sqlFactoryupload.getSQL());
@@ -250,7 +253,7 @@ public class cashbill extends Controller {
                 map.put("amount", "金额");
                 map.put("type", "分类");
                 map.put("typemx", "分类明细");
-                map.put("period", "归属日期");
+                map.put("period", "单据日期");
                 map.put("remarks", "备注");
                 map.put("msg", "错误信息");
                 ArrayList<String> colNameList = new ArrayList<String>();

+ 3 - 2
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -248,7 +248,7 @@ public class Item extends Controller {
         sqlFactory.addParameter("gysmc", content.getStringValue("gysmc"));
         sqlFactory.addParameter("poday", content.getIntValue("poday"));
         sqlFactory.addParameter("sa_supplierid", content.getLongValue("sa_supplierid"));
-
+        sqlFactory.addParameter("u8subject", content.getStringValue("u8subject"));
 
         String topclassnum="";
         if (content.containsKey("itemclassids")) {
@@ -525,6 +525,7 @@ public class Item extends Controller {
         sqlFactory.addParameter("gysmc", item.getString("gysmc"));
         sqlFactory.addParameter("poday", item.getLong("poday"));
         sqlFactory.addParameter("sa_supplierid", item.getLong("sa_supplierid"));
+        sqlFactory.addParameter("u8subject", item.getString("u8subject"));
         sqlList.add(sqlFactory.getSQL());
         // 货品档案扩展属性字段表
 
@@ -1802,7 +1803,7 @@ public class Item extends Controller {
                     sqlFactory.addParameter("gysmc", row.getString("gysmc"));
                     sqlFactory.addParameter("poday", row.getLong("poday"));
                     sqlFactory.addParameter("sa_supplierid", row.getLong("sa_supplierid"));
-
+                    sqlFactory.addParameter("u8subject", row.getString("u8subject"));
                     sqlList.add(sqlFactory.getSQL());
                     // 货品档案扩展属性字段表
 

+ 1 - 0
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案列表.sql

@@ -66,6 +66,7 @@ SELECT t1.itemid,
        t1.topclassnum,
        t1.kw,
        t1.gysmc,
+       t1.u8subject,
        t6.auxunitid,
        t6.unitgroupname,
        t7.unitname axunitname,

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案新增.sql

@@ -6,7 +6,7 @@ insert into plm_item (siteid, itemid, createby, createdate, changeuserid, change
                       sa_customschemeid, cheek, delistingstatus, financeclasstype, stockno, volume, marketingcategory,
                       pricingmetod,cheekschemeid,colorschemeid,materialschemeid,cost,grossprofit,grossprofitmargin,saleprice,
                       rate,grade,custamount,safeqty,icaddqty,icminqty,iswriteoff,isnegative,ispartorderautocheck,islimitemparts,itemname_print,
-                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace,repairattribute,shapesize,topclassnum,aftersalesitemno,kw,gysmc,poday,sa_supplierid)
+                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace,repairattribute,shapesize,topclassnum,aftersalesitemno,kw,gysmc,poday,sa_supplierid,u8subject)
 values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURRENT_TIME, $itemno$, $unitid$,
         $isauxunit$, $unitgroupid$, $itemname$, $isonsale$, '新建', $model$, $spec$, $orderminqty$, $orderaddqty$,
         $orderminqty_auxunit$, $orderaddqty_auxunit$, $remarks$, $barcode$, $skucontrol$, $batchcontrol$, $grossweight$,
@@ -15,4 +15,4 @@ values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURR
         $iswoodproducts$, $sa_customschemeid$, $cheek$, $delistingstatus$, $financeclasstype$, $stockno$, $volume$,
         $marketingcategory$, $pricingmetod$,$cheekschemeid$,$colorschemeid$,$materialschemeid$,$cost$,$grossprofit$,$grossprofitmargin$,$saleprice$,
         $rate$,$grade$,$custamount$,$safeqty$,$icaddqty$,$icminqty$,$iswriteoff$,$isnegative$,$ispartorderautocheck$,$islimitemparts$,$itemname_print$,
-        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$,$repairattribute$,$shapesize$,$topclassnum$,$aftersalesitemno$,$kw$,$gysmc$,$poday$,$sa_supplierid$)
+        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$,$repairattribute$,$shapesize$,$topclassnum$,$aftersalesitemno$,$kw$,$gysmc$,$poday$,$sa_supplierid$,$u8subject$)

+ 2 - 1
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案更新.sql

@@ -78,7 +78,8 @@ SET changeuserid=$userid$,
     kw=$kw$,
     gysmc=$gysmc$,
     poday=$poday$,
-    sa_supplierid=$sa_supplierid$
+    sa_supplierid=$sa_supplierid$,
+    u8subject=$u8subject$
 WHERE itemid = $itemid$
   and siteid = $siteid$