第五部分、开发实例。
--在帮深圳恒伟电子有限公司实施过程中,用户提出了许多新的要求,如增加产品编号输入框、物料成本价格要用4位小数、增加税率、增加财务系统中的试算平衡、科目余额表和各种反结算结转等。
1、调整产品档案中的成本和实际成本价格小数位数位4位,以适应公司几厘甚至几毫厘价格的零零件物料:
ALTER TABLE ondemand1.`design_file` CHANGE `COST_PRICE` `COST_PRICE` DOUBLE( 15, 4 ) NOT NULL DEFAULT '0.0000',CHANGE `REAL_COST_PRICE` `REAL_COST_PRICE` DOUBLE( 15, 4 ) NOT NULL DEFAULT '0.0000';
修改相应的jsp文件:C:\APPDIR\webapps\erp\design\file\register.jsp,C:\APPDIR\webapps\erp\design\file\check.jsp;
修改相应java程序:C:\workspace\erpv7.0\src\design\file\register_ok.java,C:\workspace\erpv7.0\src\design\file\check_ok.java
2、增加”采购管理--采购计划管理--采购计划反审核“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('05','06','05','采购管理','purchase','采购计划管理','apply','','采购计划反审核','否','apply_check_list.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 17:50:30','1800-01-01 00:00:00','2007-06-01 16:24:29','','admin',2,'','','uncheck_list.jsp',0);
INSERT INTO `purchase_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('050605 采购计划反审核','',37,34,'Y','uncheck_list.jsp','050605','采购计划反审核 ',0,'purchase/apply/','采购管理--采购计划管理--采购计划反审核','nseer33.png',0);
INSERT INTO `purchase_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('050605 采购计划审核','',37,34,'Y','uncheck_list.jsp','050605','采购计划反审核',0,'09020001010100100000','admin','purchase/apply/','',0);
增加jsp文件C:\APPDIR\webapps\erp\purchase\apply\{uncheck.jsp,uncheck_list.jsp,uncheck_ok.jsp};
增加java文件C:\workspace\erpv7.0\src\purchase\apply\uncheck_ok.java,编译并拷贝到C:\APPDIR\webapps\erp\WEB-INF\classes\purchase\apply下;
修改C:\APPDIR\webapps\erp\WEB-INF\web.xml,增加以下几行:
<servlet>
<servlet-name>purchase_apply_uncheck_ok</servlet-name>
<servlet-class>purchase.apply.uncheck_ok</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>purchase_apply_uncheck_ok</servlet-name>
<url-pattern>/purchase_apply_uncheck_ok</url-pattern>
</servlet-mapping>
重启tomcat服务器:
关闭tomcat: 开始-->所有程序-->nseererp v7.0-->关闭恩信开源ERP TOMCAT服务器;
启动tomcat: 开始-->所有程序-->nseererp v7.0-->启动恩信开源ERP TOMCAT服务器;
3、增加”财务系统--账务管理--试算平衡试算平衡“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','03','09','财务系统','finance','账务管理','account','','试算平衡 ','否','account_testBalance.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:33','1800-01-01 00:00:00','2007-06-01 17:22:45','','admin',2,'','','testBalance_locate.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080309 试算平衡','',35,18,'Y','testBalance_locate.jsp','080309','试算平衡',0,'finance/account/','财务系统--账务管理--试算平衡','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080309 试算平衡','',35,18,'Y','testBalance_locate.jsp','080309','试算平衡',0,'09020001010100100000','admin','finance/account/','',0);
增加jsp文件C:\APPDIR
4、增加”财务系统--账务管理--期末反结账“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','03','11','财务系统','finance','账务管理','account','','期末反结账 ','否','account_unperiodFinish.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:57','1800-01-01 00:00:00','2007-06-01 17:21:08','','admin',2,'','','unperiodFinish.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080311 期末反结账','',35,18,'Y','unperiodFinish.jsp','080311','期末反结账',0,'finance/account/','财务系统--账务管理--期末反结账','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080311 期末反结账','',35,18,'Y','unperiodFinish.jsp','080311','期末反结账',0,'09020001010100100000','admin','finance/account/','',0);
5、增加”财务系统--账务管理--期末反结转成本“功能模块:
INSERT INTO `document_sec务ond` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','03','12','财务系统','finance','账务管理','account','','期末反结转成本','否','account_unperiodFinish.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:57','1800-01-01 00:00:00','2007-06-01 17:21:08','','admin',2,'','','uncalculateCost_list.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080312 期末反结转成本','',35,18,'Y','uncalculateCost_list.jsp','080312','期末反结转成本 ',0,'finance/account/','财务系统--账务管理--期末反结转成本','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080312 期末反结转成本','',35,18,'Y','uncalculateCost_list.jsp','080312','期末反结转成本 ',0,'09020001010100100000','admin','finance/account/','',0);
6、增加”财务系统--账务管理--期末反结转利润“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','03','13','财务系统','finance','账务管理','account','','期末反结转利润','否','account_unperiodFinish.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:57','1800-01-01 00:00:00','2007-06-01 17:21:08','','admin',2,'','','uncalculate_list.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080313 期末反结转利润','',35,18,'Y','uncalculate_list.jsp','080313','期末反结转利润 ',0,'finance/account/','财务系统--账务管理--期末反结转利润','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080313 期末反结转利润','',35,18,'Y','uncalculate_list.jsp','080313','期末反结转利润 ',0,'09020001010100100000','admin','finance/account/','',0);
7、增加”财务系统--账务管理--年终反结转“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','03','14','财务系统','finance','账务管理','account','','年终反结转 ','否','account_unperiodFinish.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:57','1800-01-01 00:00:00','2007-06-01 17:21:08','','admin',2,'','','unyearBegin.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080314 年终反结转','',35,18,'Y','unyearBegin.jsp','080314','年终反结转',0,'finance/account/','财务系统--账务管理--年终反结转','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080314 年终反结转','',35,18,'Y','unyearBegin.jsp','080314','年终反结转',0,'09020001010100100000','admin','finance/account/','',0);
对于上面4、5、6、7增加java文件C:\workspace\erpv7.0\src\finance\account\{uncalculate_ok.java,uncalculateCost_ok.java,unperiodFinish_ok.java};
8、增加”财务系统--账务管理--报表查询“功能模块:
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080404 报表查询','',76,19,'Y','query_locate.jsp','080404','报表查询',0,'finance/reports/','财务系统--账务管理--报表查询','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080404 报表查询','',76,19,'Y','query_locate.jsp','080404','报表查询',0,'09020001010100100000','admin','finance/reports/','',0);
9、增加”财务系统--账务管理--生成科目余额表“功能模块:
INSERT INTO `document_second` (`main_code`,`first_code`,`second_code`,`main_kind_ID`,`main_kind_name`,`first_kind_ID`,`first_kind_name`,`second_kind_name`,`second_kind_ID`,`module_tag`,`picture`,`topic`,`object`,`range`,`reader`,`reference`,`comment`,`attachment1`,`attachment2`,`standard`,`attachment3`,`attachment4`,`mains`,`attachment5`,`attachment6`,`relation`,`attachment7`,`attachment8`,`function`,`attachment9`,`attachment10`,`filesystem`,`attachment11`,`attachment12`,`dbsystem`,`attachment13`,`attachment14`,`remark`,`lately_change_time`,`register_time`,`change_time`,`register`,`changer`,`change_amount`,`doc_id`,`doc_ver`,`head_file`,`task_tag`) VALUES('08','04','05','财务系统','finance','财务报表','reports','','生成科目余额表','否','account_unperiodFinish.gif','','','','','','详见<a href=javascript:winopen('../../comment/query_locate.jsp& amp;#39;)>术语与缩写解释管理</a>','','','','','','','','','','','','','','','','','','','','','','2007-05-15 19:08:57','1800-01-01 00:00:00','2007-06-01 17:21:08','','admin',2,'','','file_balance.jsp',0);
INSERT INTO `finance_tree` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`FILE_PATH`,`CHAIN_NAME`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080405 生成科目余额表','',77,19,'Y','file_balance.jsp','080405','生成科目余额表 ',0,'finance/reports/','财务系统--账务管理--生成科目余额表','nseer34.png',0);
INSERT INTO `finance_view` (`MODULE_NAME`,`reason`,`CATEGORY_ID`,`PARENT_CATEGORY_ID`,`ACTIVE_STATUS`,`HREFLINK`,`FILE_ID`,`FILE_NAME`,`DETAILS_TAG`,`HUMAN_ID`,`NAME`,`FILE_PATH`,`PICTURE`,`WORKFLOW_TAG`) VALUES('080405 生成科目余额表','',77,19,'Y','file_balance.jsp','080405','生成科目余额表',0,'09020001010100100000','admin','finance/reports/','',0);
第六部分、使用别人的库。
有时需要使用别人的数据库作为我们自己的基础数据库,而且别人可能修改了单位名称、编号和用户名前缀(默认的是nseer),那么这时要导入别人的数据库,可以这样操作:
1、先安装默认的数据库,并且测试登陆通过;
2、然后导入别人的数据库:
c:\> mysql -uroot
mysql> use ondemand1;
mysql> source ondemand1.sql;
mysql> flush privileges;
然后修改表mysql.unit_info中的单位名称和单位id两个字段;
第七部分、数据移植(从6.3到7.10)。
把恩信6.3数据库ondemand1导入到恩信7.0数据库所在的mysql中,由于我的新版ERP数据库已经改成了rely_db,所以两个数据库可以同时存在。
use rely_db;
1、移植design_file:
INSERT INTO DESIGN_FILE(PRODUCT_ID,PRODUCT_NAME,PRODUCT_NICK,PRODUCT_CLASS,type,PRODUCT_DESCRIBE,FACTORY_NAME,FACTORY_ID,AMOUNT_UNIT,PROVIDER_GROUP,PHOTO1,PHOTO2,WARRANTY,LIST_PRICE,COST_PRICE,REAL_COST_PRICE,LIFECYCLE,PERSONAL_UNIT,PERSONAL_VALUE,TWIN_NAME,TWIN_ID,REMARK,CHECK_TAG,ACHIEVEMENT_SUM,ATTACHMENT_NAME,RETURN_SUM,RETURN_AMOUNT,FILE_CHANGE_AMOUNT,USED_PRODUCT_NAME,RESPONSIBLE_PERSON_NAME,RESPONSIBLE_PERSON_ID,REGISTER,CHECKER,CHANGER,REGISTER_ID,CHECKER_ID,CHANGER_ID,REGISTER_TIME,CHECK_TIME,CHANGE_TIME,LATELY_CHANGE_TIME,LATELY_TRADE_TIME,DELETE_TIME,RECOVERY_TIME,MODIFY_TAG,EXCEL_TAG,EXCEL_TAG2,EXCEL_TAG3,EXCEL_TAG4,DESIGN_MODULE_TAG,DESIGN_PROCEDURE_TAG,DESIGN_CELL_TAG,RECOMMEND_PROVIDER_TAG,PRICE_CHANGE_TAG,PRICE_ALARM_TAG,ORDER_SALE_BONUS_RATE,ORDER_PROFIT_BONUS_RATE,RETAIL_SALE_BONUS_RATE,RETAIL_PROFIT_BONUS_RATE,COST_CALCULATE_TYPE,SERIAL_NUMBER_TAG,CALCULATE_BONUS_SN_TAG,QCS_TAG,QCS_APPLY_TAG,CHAIN_ID,CHAIN_NAME)
SELECT PRODUCT_ID,PRODUCT_NAME,PRODUCT_NICK,PRODUCT_CLASS,type,PRODUCT_DESCRIBE,FACTORY_NAME,FACTORY_ID,AMOUNT_UNIT,PROVIDER_GROUP,PHOTO1,PHOTO2,WARRANTY,LIST_PRICE,COST_PRICE,REAL_COST_PRICE,LIFECYCLE,PERSONAL_UNIT,PERSONAL_VALUE,TWIN_NAME,TWIN_ID,REMARK,CHECK_TAG,ACHIEVEMENT_SUM,ATTACHMENT_NAME,RETURN_SUM,RETURN_AMOUNT,FILE_CHANGE_AMOUNT,USED_PRODUCT_NAME,RESPONSIBLE_PERSON_NAME,RESPONSIBLE_PERSON_ID,REGISTER,CHECKER,CHANGER,REGISTER_ID,CHECKER_ID,CHANGER_ID,REGISTER_TIME,CHECK_TIME,CHANGE_TIME,LATELY_CHANGE_TIME,LATELY_TRADE_TIME,DELETE_TIME,RECOVERY_TIME,MODIFY_TAG,EXCEL_TAG,1,1,1,DESIGN_MODULE_TAG,DESIGN_PROCEDURE_TAG,DESIGN_CELL_TAG,RECOMMEND_PROVIDER_TAG,PRICE_CHANGE_TAG,PRICE_ALARM_TAG,ORDER_SALE_BONUS_RATE,ORDER_PROFIT_BONUS_RATE,RETAIL_SALE_BONUS_RATE,RETAIL_PROFIT_BONUS_RATE,COST_CALCULATE_TYPE,SERIAL_NUMBER_TAG,CALCULATE_BONUS_SN_TAG,0,0,CONCAT(FIRST_KIND_ID,SECOND_KIND_ID,THIRD_KIND_ID),CONCAT(FIRST_KIND_NAME,'-',SECOND_KIND_NAME,'-',THIRD_KIND_NAME) FROM ondemand1.design_file
where check_tag<'2'
2、移植design_file_dig:
INSERT INTO DESIGN_FILE_dig(PRODUCT_ID,PRODUCT_NAME,PRODUCT_NICK,PRODUCT_CLASS,type,PRODUCT_DESCRIBE,FACTORY_NAME,FACTORY_ID,AMOUNT_UNIT,PROVIDER_GROUP,PHOTO1,PHOTO2,WARRANTY,LIST_PRICE,COST_PRICE,REAL_COST_PRICE,LIFECYCLE,PERSONAL_UNIT,PERSONAL_VALUE,TWIN_NAME,TWIN_ID,REMARK,CHECK_TAG,ACHIEVEMENT_SUM,ATTACHMENT_NAME,RETURN_SUM,RETURN_AMOUNT,FILE_CHANGE_AMOUNT,USED_PRODUCT_NAME,RESPONSIBLE_PERSON_NAME,RESPONSIBLE_PERSON_ID,REGISTER,CHECKER,CHANGER,REGISTER_ID,CHECKER_ID,CHANGER_ID,REGISTER_TIME,CHECK_TIME,CHANGE_TIME,LATELY_CHANGE_TIME,LATELY_TRADE_TIME,DELETE_TIME,RECOVERY_TIME,MODIFY_TAG,EXCEL_TAG,EXCEL_TAG2,EXCEL_TAG3,EXCEL_TAG4,DESIGN_MODULE_TAG,DESIGN_PROCEDURE_TAG,DESIGN_CELL_TAG,RECOMMEND_PROVIDER_TAG,PRICE_CHANGE_TAG,PRICE_ALARM_TAG,ORDER_SALE_BONUS_RATE,ORDER_PROFIT_BONUS_RATE,RETAIL_SALE_BONUS_RATE,RETAIL_PROFIT_BONUS_RATE,COST_CALCULATE_TYPE,SERIAL_NUMBER_TAG,CALCULATE_BONUS_SN_TAG,QCS_TAG,QCS_APPLY_TAG,CHAIN_ID,CHAIN_NAME)
SELECT PRODUCT_ID,PRODUCT_NAME,PRODUCT_NICK,PRODUCT_CLASS,type,PRODUCT_DESCRIBE,FACTORY_NAME,FACTORY_ID,AMOUNT_UNIT,PROVIDER_GROUP,PHOTO1,PHOTO2,WARRANTY,LIST_PRICE,COST_PRICE,REAL_COST_PRICE,LIFECYCLE,PERSONAL_UNIT,PERSONAL_VALUE,TWIN_NAME,TWIN_ID,REMARK,CHECK_TAG,ACHIEVEMENT_SUM,ATTACHMENT_NAME,RETURN_SUM,RETURN_AMOUNT,FILE_CHANGE_AMOUNT,USED_PRODUCT_NAME,RESPONSIBLE_PERSON_NAME,RESPONSIBLE_PERSON_ID,REGISTER,CHECKER,CHANGER,REGISTER_ID,CHECKER_ID,CHANGER_ID,REGISTER_TIME,CHECK_TIME,CHANGE_TIME,LATELY_CHANGE_TIME,LATELY_TRADE_TIME,DELETE_TIME,RECOVERY_TIME,MODIFY_TAG,EXCEL_TAG,excel_tag2,excel_tag3,excel_tag4,DESIGN_MODULE_TAG,DESIGN_PROCEDURE_TAG,DESIGN_CELL_TAG,RECOMMEND_PROVIDER_TAG,PRICE_CHANGE_TAG,PRICE_ALARM_TAG,ORDER_SALE_BONUS_RATE,ORDER_PROFIT_BONUS_RATE,RETAIL_SALE_BONUS_RATE,RETAIL_PROFIT_BONUS_RATE,COST_CALCULATE_TYPE,SERIAL_NUMBER_TAG,CALCULATE_BONUS_SN_TAG,0,0,CONCAT(FIRST_KIND_ID,SECOND_KIND_ID,THIRD_KIND_ID),CONCAT(FIRST_KIND_NAME,'-',SECOND_KIND_NAME,'-',THIRD_KIND_NAME) FROM ondemand1.design_file_dig
3、移植design_workflow(for design_file):
insert into design_workflow(config_id,object_id,describe1,describe2,type_id) select '14',product_id,'09020001010100100000','admin','01' from design_file where check_tag='0' and excel_tag!='0' order by register_time;
insert into design_workflow(config_id,object_id,describe1,describe2,checker,check_time,check_tag,type_id) select '14',product_id,'09020001010100100000','admin',checker,check_time,'1','01' from design_file where check_tag='1' and excel_tag!='0' order by register_time;
4、移植design_module:
INSERT INTO DESIGN_MODULE(DESIGN_ID,PRODUCT_ID,PRODUCT_NAME,MODULE_DESCRIBE,COST_PRICE_SUM,DESIGNER,DESIGNER_ID,REGISTER,REGISTER_ID,REGISTER_TIME,CHECKER,CHANGER,CHECKER_ID,CHANGER_ID,CHECK_TIME,CHANGE_TIME,CHECK_TAG,CHANGE_TAG,EXCEL_TAG,CHAIN_ID,CHAIN_NAME)
SELECT DESIGN_ID,PRODUCT_ID,PRODUCT_NAME,MODULE_DESCRIBE,COST_PRICE_SUM,DESIGNER,DESIGNER_ID,REGISTER,REGISTER_ID,REGISTER_TIME,CHECKER,CHANGER,CHECKER_ID,CHANGER_ID,CHECK_TIME,CHANGE_TIME,CHECK_TAG,CHANGE_TAG,EXCEL_TAG,CONCAT(FIRST_KIND_ID,SECOND_KIND_ID,THIRD_KIND_ID),CONCAT(FIRST_KIND_NAME,'-',SECOND_KIND_NAME,'-',THIRD_KIND_NAME) FROM ondemand1.design_module;
5、移植design_workflow(for design_module):
insert into `design_workflow`(config_id,object_id, describe1,describe2,check_tag,type_id) select '13',design_id,'09020001010100100000','admin','0','03' from design_module where check_tag='0' and excel_tag='2';
6、移植design_workflow(for design_price_change):
insert into `design_workflow`(config_id,object_id, describe1,describe2,check_tag,type_id) select '4',product_id,'09020001010100100000','admin','0','02' from design_file where check_tag='1' and price_change_tag='1';
7、移植design_module_details:
insert into 'design_module_details' select * from ondemand1.design_module_details;
8、移植design_config_file_kind:
老版本用三个表来存放产品分类设置信息,而新版只用一个表存放,所以这个表的移植是最复杂的,建议如果记录数不多直接通过菜单重建一次,但要{jd1}注意:分类编号
一定要与旧版本的一致,因为产品档案表记录(上面已经移植)的分类编号已经固定了。
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('5', '4', '0208 电容', '0208', '电容', 'dr', '0', '1', '0208', 'PCB控制板-电容');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('6', '4', '0209 电阻', '0209', '电阻', 'dz', '0', '1', '0209', 'PCB控制板-电阻');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('7', '4', '0210 PCB板', '0210', 'PCB板', 'PCBB', '0', '1', '0210', 'PCB控制板-PCB板');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('8', '4', '0211 继电器', '0211', '继电器', 'jdq', '0', '1', '0211', 'PCB控制板-继电器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('9', '4', '0212 开关', '0212', '开关', 'kg', '0', '1', '0212', 'PCB控制板-开关');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('10', '4', '0213 三极管', '0213', '三极管', 'sjg', '0', '1', '0213', 'PCB控制板-三极管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('11', '4', '0214 二极管', '0214', '二极管', 'ejg', '0', '1', '0214', 'PCB控制板-二极管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('12', '4', '0215 数码管', '0215', '数码管', 'smg', '0', '1', '0215', 'PCB控制板-数码管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('13', '4', '0216 LED', '0216', 'LED', 'LED', '0', '1', '0216', 'PCB控制板-LED');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('14', '4', '0217 可控硅', '0217', '可控硅', 'kkg', '0', '1', '0217', 'PCB控制板-可控硅');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('15', '4', '0218 IC', '0218', 'IC', 'ic', '0', '1', '0218', 'PCB控制板-IC');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('16', '4', '0219 跳线', '0219', '跳线', 'tx', '0', '1', '0219', 'PCB控制板-跳线');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('17', '4', '0220 IC插座', '0220', 'IC插座', 'iccz', '0', '1', '0220', 'PCB控制板-IC插座');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('18', '4', '0221 LCD支架扣', '0221', 'LCD支架扣', 'lcdzjk', '0', '1', '0221', 'PCB控制板-LCD支架扣');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('19', '4', '0222 LED柱', '0222', 'LED柱', 'ledz', '0', '1', '0222', 'PCB控制板-LED柱');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('20', '4', '0223 USB接口', '0223', 'USB接口', 'usbjk', '0', '1', '0223', 'PCB控制板-USB接口');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('21', '4', '0224 UV灯', '0224', 'UV灯', 'uvd', '0', '1', '0224', 'PCB控制板-UV灯');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('22', '4', '0225 保护套', '0225', '保护套', 'bht', '0', '1', '0225', 'PCB控制板-保护套');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('23', '4', '0226 保险丝', '0226', '保险丝', 'bxs', '0', '1', '0226', 'PCB控制板-保险丝');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('24', '4', '0227 保险丝座', '0227', '保险丝座', 'bxsz', '0', '1', '0227', 'PCB控制板-保险丝座');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('25', '4', '0228 背光板', '0228', '背光板', 'bgb', '0', '1', '0228', 'PCB控制板-背光板');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('26', '4', '0229 变换器', '0229', '变换器', 'bhq', '0', '1', '0229', 'PCB控制板-变换器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('27', '4', '0230 变压器', '0230', '变压器', 'byq', '0', '1', '0230', 'PCB控制板-变压器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('28', '4', '0231 插座', '0231', '插座', 'cz', '0', '1', '0231', 'PCB控制板-插座');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('29', '4', '0232 场效应管', '0232', '场效应管', 'cxyg', '0', '1', '0232', 'PCB控制板-场效应管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('30', '4', '0233 电池壳盖', '0233', '电池壳盖', 'dckg', '0', '1', '0233', 'PCB控制板-电池壳盖');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('31', '4', '0234 电感', '0234', '电感', 'dg', '0', '1', '0234', 'PCB控制板-电感');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('32', '4', '0235 电位器', '0235', '电位器', 'dwq', '0', '1', '0235', 'PCB控制板-电位器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('33', '4', '0236 垫片', '0236', '垫片', 'dp', '0', '1', '0236', 'PCB控制板-垫片');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('34', '4', '0237 端子', '0237', '端子', 'dz', '0', '1', '0237', 'PCB控制板-端子');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('35', '4', '0238 发光二极管', '0238', '发光二极管', 'fgejg', '0', '1', '0238', 'PCB控制板-发光二极管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('36', '4', '0239 发射二极管', '0239', '发射二极管', 'fsejg', '0', '1', '0239', 'PCB控制板-发射二极管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('37', '4', '0240 蜂鸣器', '0240', '蜂鸣器', 'fmq', '0', '1', '0240', 'PCB控制板-蜂鸣器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('38', '4', '0241 高温套管', '0241', '高温套管', 'gwtg', '0', '1', '0241', 'PCB控制板-高温套管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('39', '4', '0242 硅堆', '0242', '硅堆', 'gd', '0', '1', '0242', 'PCB控制板-硅堆');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('40', '4', '0243 接收器', '0243', '接收器', 'jsq', '0', '1', '0243', 'PCB控制板-接收器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('41', '4', '0245 螺母', '0245', '螺母', 'lm', '0', '1', '0245', 'PCB控制板-螺母');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('42', '4', '0246 螺丝', '0246', '螺丝', 'ls', '0', '1', '0246', 'PCB控制板-螺丝');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('43', '4', '0247 氖灯', '0247', '氖灯', 'nd', '0', '1', '0247', 'PCB控制板-氖灯');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('44', '4', '0248 排线', '0248', '排线', 'px', '0', '1', '0248', 'PCB控制板-排线');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('45', '4', '0249 热敏电阻', '0249', '热敏电阻', 'rmdz', '0', '1', '0249', 'PCB控制板-热敏电阻');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('46', '4', '0250 热缩套管', '0250', '热缩套管', 'rstg', '0', '1', '0250', 'PCB控制板-热缩套管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('47', '4', '0251 散热片', '0251', '散热片', 'srp', '0', '1', '0251', 'PCB控制板-散热片');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('48', '4', '0252 双面背胶', '0252', '双面背胶', 'smbj', '0', '1', '0252', 'PCB控制板-双面背胶');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('49', '4', '0253 套管', '0253', '套管', 'tg', '0', '1', '0253', 'PCB控制板-套管');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('50', '4', '0254 温度传感器', '0254', '温度传感器', 'wdcgq', '0', '1', '0254', 'PCB控制板-温度传感器');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('51', '4', '0255 线材', '0255', '线材', 'xc', '0', '1', '0255', 'PCB控制板-线材');
insert into design_config_file_kind(category_id,parent_category_id,category_name,file_id,file_name,nick_name,delete_tag,details_tag,chain_id,chain_name) values('52', '4', '0256 压敏电阻', '0256', '压敏电阻', 'ymdz', '0', '1', '0256', 'PCB控制板-压敏电阻');
insert into design_con