lining пре 6 година
родитељ
комит
35d4a6932b

+ 77 - 0
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -80,6 +80,83 @@ type OilSupplier struct {
 	SupplierCertificate string    `xorm:"comment('中石油物资供应商证书') VARCHAR(200)"`
 }
 
+type Del_OilSupplier struct {
+	Id                  int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierName        string    `xorm:"comment('企业名称') VARCHAR(255)"`
+	OilCertificateNo    string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
+	Grade               string    `xorm:"comment('级别') VARCHAR(2)"`
+	MgrUnit             string    `xorm:"comment('管理单位') VARCHAR(50)"`
+	OperType            string    `xorm:"comment('经营方式') VARCHAR(50)"`
+	Country             string    `xorm:"comment('国家') VARCHAR(20)"`
+	MaunAgent           string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
+	ConstructTeam       string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`
+	CredentialFlag      string    `xorm:"default '1' comment('证件合一标志') VARCHAR(5)"`
+	CommercialNo        string    `xorm:"comment('工商注册号') VARCHAR(50)"`
+	OrganCode           string    `xorm:"comment('组织机构代码') VARCHAR(50)"`
+	CountryTaxNo        string    `xorm:"comment('税务登记证国税编号') VARCHAR(50)"`
+	LocalTaxNo          string    `xorm:"comment('税务登记证地税编号') VARCHAR(50)"`
+	Address             string    `xorm:"comment('单位地址') VARCHAR(500)"`
+	AllAddress          string    `xorm:"comment('注册地址') VARCHAR(500)"`
+	LinkAllAddress      string    `xorm:"comment('通信地址') VARCHAR(500)"`
+	Province            string    `xorm:"comment('省直辖市') VARCHAR(20)"`
+	City                string    `xorm:"comment('地市区县') VARCHAR(20)"`
+	Street              string    `xorm:"comment('街道') VARCHAR(20)"`
+	HouseNo             string    `xorm:"comment('门牌号') VARCHAR(10)"`
+	ZipCode             string    `xorm:"comment('邮编') VARCHAR(20)"`
+	LinkAddress         string    `xorm:"comment('通信地址-单位地址') VARCHAR(500)"`
+	LinkProvince        string    `xorm:"comment('通信地址-省直辖市') VARCHAR(20)"`
+	LinkCity            string    `xorm:"comment('通信地址-地市区县') VARCHAR(20)"`
+	LinkStreet          string    `xorm:"comment('通信地址-街道') VARCHAR(20)"`
+	LinkHouseNo         string    `xorm:"comment('通信地址-门牌号') VARCHAR(10)"`
+	LinkZipCode         string    `xorm:"comment('通信地址-邮编') VARCHAR(20)"`
+	HseTraining         string    `xorm:"comment('是否需要进行HSE审查培训') VARCHAR(2)"`
+	QualitySystemCert   string    `xorm:"comment('质量管理体系认证情况及认证机构') VARCHAR(200)"`
+	ProductQualityCert  string    `xorm:"comment('产品质量认证情况及认证机构') VARCHAR(200)"`
+	MaunLicense         string    `xorm:"comment('生产制造许可证获证情况及编号') VARCHAR(200)"`
+	QualifCert          string    `xorm:"comment('企业资质证书编号') VARCHAR(200)"`
+	QualifCertLevel     string    `xorm:"comment('企业资质证书级别') VARCHAR(10)"`
+	SafetyLicense       string    `xorm:"comment('安全生产许可证') VARCHAR(200)"`
+	TechServiceLic      string    `xorm:"comment('技术服务类准入许可证') VARCHAR(200)"`
+	TjinNotify          string    `xorm:"comment('外地企业进津备案通知书') VARCHAR(50)"`
+	SpecIndustryCert    string    `xorm:"comment('行业特殊要求的认证证书') VARCHAR(200)"`
+	BusinessScope       string    `xorm:"comment('营业范围') TEXT"`
+	LegalPerson         string    `xorm:"comment('法定代表人姓名') VARCHAR(20)"`
+	CategoryCode        string    `xorm:"comment('行业类别代码') VARCHAR(10)"`
+	CategoryName        string    `xorm:"comment('行业类别名称') VARCHAR(20)"`
+	RegCapital          float64   `xorm:"default 0 comment('注册资本') FLOAT"`
+	Currency            string    `xorm:"comment('币种') VARCHAR(10)"`
+	ContactName         string    `xorm:"comment('联系人姓名') VARCHAR(20)"`
+	CompanyType         string    `xorm:"comment('公司类型') VARCHAR(20)"`
+	SetupTime           time.Time `xorm:"comment('成立时间') Date"`
+	DepositBank         string    `xorm:"comment('开户银行') VARCHAR(50)"`
+	BankAccount         string    `xorm:"comment('银行账号') VARCHAR(50)"`
+	EMail               string    `xorm:"comment('电子邮箱') VARCHAR(50)"`
+	BankCreditRating    string    `xorm:"comment('银行信用等级') VARCHAR(10)"`
+	Mobile              string    `xorm:"comment('移动电话') VARCHAR(20)"`
+	Telphone            string    `xorm:"comment('固定电话') VARCHAR(20)"`
+	Fax                 string    `xorm:"comment('传真') VARCHAR(20)"`
+	CompanyTel          string    `xorm:"comment('公司电话') VARCHAR(20)"`
+	QQ                  string    `xorm:"comment('QQ号码') VARCHAR(20)"`
+	CompanyUrl          string    `xorm:"comment('公司网址') VARCHAR(20)"`
+	SpecSupplier        string    `xorm:"default '0' comment('是否特殊业务供应商(可不招标)') VARCHAR(2)"`
+	SpecTypeCode        string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(2)"`
+	SpecTypeName        string    `xorm:"comment('业务类型(1战略合作,2内部多经,3区域关键,4专业化实施)') VARCHAR(20)"`
+	WZAccessCardNo      string    `xorm:"comment('准入证编码--物质') VARCHAR(20)"`
+	JSAccessCardNo      string    `xorm:"comment('准入证编码--基建') VARCHAR(20)"`
+	JFAccessCardNo      string    `xorm:"comment('准入证编码--技术服务类') VARCHAR(20)"`
+	Remark              string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete            int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn            time.Time `xorm:"DATETIME"`
+	CreateUserId        int       `xorm:"INT(10)"`
+	CreateBy            string    `xorm:"VARCHAR(50)"`
+	ModifiedOn          time.Time `xorm:"DATETIME"`
+	ModifiedUserId      int       `xorm:"INT(10)"`
+	ModifiedBy          string    `xorm:"VARCHAR(50)"`
+	PACNumber           string    `xorm:"comment('中石油准入证编号') VARCHAR(50)"`
+	SupplierCertificate string    `xorm:"comment('中石油物资供应商证书') VARCHAR(200)"`
+	DeleteDate          time.Time `xorm:"DATETIME"`
+}
+
 type OilSupplierView struct {
 	OilSupplier       `xorm:"extends"`
 	CertId            string

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplierService.go

@@ -72,7 +72,7 @@ func (s *OilSupplierService) CheckRepeatApplyInfo(supplierTableName, supplierCer
 
 
 
-	where2 := " b.SupplierTypeCode = '" + typeCode + "' AND b.InFlag != '4'"
+	where2 := " b.SupplierTypeCode = '" + typeCode
 
 	where := ""
 	if SupplierName != "" {

+ 65 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercert.go

@@ -68,6 +68,71 @@ type OilSupplierCert struct {
 	GfId              int       `xorm:"INT(11)"`
 }
 
+type Del_OilSupplierCert struct {
+	Id                int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierId        int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	AccessCardNo      string    `xorm:"comment('准入证号') VARCHAR(20)"`
+	SupplierTypeCode  string    `xorm:"comment('准入类别代码(1 物资类,2 基建类,3 技术服务类)') VARCHAR(5)"`
+	SupplierTypeName  string    `xorm:"comment('准入类别名称(1 物资类,2 基建类,3 技术服务类)') VARCHAR(50)"`
+	RecUnitReason     string    `xorm:"comment('推荐单位的推荐意见') VARCHAR(800)"`
+	RecUnitPerson     string    `xorm:"comment('推荐单位负责人') VARCHAR(20)"`
+	RecDate           time.Time `xorm:"comment('推荐日期') DATETIME"`
+	RecUnitId         string    `xorm:"comment('推荐单位编码') VARCHAR(10)"`
+	RecUnitName       string    `xorm:"comment('推荐单位名称') VARCHAR(50)"`
+	Status            string    `xorm:"not null default '0' comment('状态标识(0未申请,1办理完毕)') VARCHAR(10)"`
+	BackReason        string    `xorm:"comment('退回原因') VARCHAR(500)"`
+	InFlag            string    `xorm:"default '0' comment('准入标识') VARCHAR(10)"`
+	InStyle           string    `xorm:"default '1' comment('准入方式') VARCHAR(10)"`
+	EffectStartTime   time.Time `xorm:"comment('有效期起') DATETIME"`
+	EffectEndTime     time.Time `xorm:"comment('有效期止') DATETIME"`
+	AuditProcessNote  string    `xorm:"comment('办理过程备注') VARCHAR(100)"`
+	AuditDate         time.Time `xorm:"comment('审核日期') DATETIME"`
+	PayNotice         string    `xorm:"default '0' comment('交费通知') VARCHAR(2)"`
+	SupplierStatus    string    `xorm:"comment('供应商状态(null:正常,1中止,2终止)') VARCHAR(255)"`
+	MgrType           string    `xorm:"comment('供应商管理类型') VARCHAR(255)"`
+	Type              string    `xorm:"comment('供应商类型') VARCHAR(255)"`
+	MgrUnit           string    `xorm:"comment('管理单位') VARCHAR(255)"`
+	AddinTime         string    `xorm:"comment('准入日期') VARCHAR(255)"`
+	EffectTime        string    `xorm:"comment('生效日期') VARCHAR(255)"`
+	ApplyTime         time.Time `xorm:"comment('年审到期日期') DATETIME"`
+	SupplierNo        string    `xorm:"comment('供应商准入证编号') VARCHAR(255)"`
+	MdmFlag           string    `xorm:"default '0' comment('MDM标志') VARCHAR(2)"`
+	InternalFlag      string    `xorm:"comment('国内采购') VARCHAR(255)"`
+	ImportFlag        string    `xorm:"comment('进口采购') VARCHAR(255)"`
+	OutsideFlog       string    `xorm:"comment('境外项目') VARCHAR(255)"`
+	Step              int       `xorm:"comment('页面上第几步') INT(10)"`
+	Remark            string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete          int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	WorkerTotal       int       `xorm:"default 0 comment('企业员工总数') INT(10)"`
+	ContractNum       int       `xorm:"default 0 comment('合同化用工数量') INT(10)"`
+	UniversityNum     int       `xorm:"default 0 comment('大学及以上学历人员数量') INT(10)"`
+	TechnicalNum      int       `xorm:"default 0 comment('技术、管理人员数量') INT(10)"`
+	AboveProfNum      int       `xorm:"default 0 comment('高级及以上职称人员数量') INT(10)"`
+	MiddleProfNum     int       `xorm:"default 0 comment('中级职称人员数量') INT(10)"`
+	NationalRegNum    int       `xorm:"default 0 comment('具有国家注册执业资格人员数量') INT(10)"`
+	NationalCertTotal int       `xorm:"default 0 comment('具有国家注册执业资格证书总数') INT(10)"`
+	DesignerTotal     int       `xorm:"default 0 comment('设计人员总数') INT(10)"`
+	SkillerTotal      int       `xorm:"default 0 comment('技术工人总数') INT(10)"`
+	WorkflowId        string    `xorm:"default '0' comment('工作流的ID') VARCHAR(255)"`
+	ProcessKey        string    `xorm:"default '0' comment('工作流的名称') VARCHAR(255)"`
+	FirstAudit        int       `xorm:"default 0 comment('初审') INT(10)"`
+	SecondAudit       int       `xorm:"default 0 comment('复审') INT(10)"`
+	ThirdAudit        int       `xorm:"default 0 comment('专业科室审批') INT(10)"`
+	FourthAudit       int       `xorm:"default 0 comment('集中审批') INT(10)"`
+	AuditIndex        int       `xorm:"default 0 comment('审批次数') INT(11)"`
+	CommitComId       string    `xorm:"default '0' comment('提交二级单位Id') VARCHAR(50)"`
+	BusinessKey       string    `xorm:"VARCHAR(255)"`
+	StorageOn         time.Time `xorm:"DATETIME"`
+	CreateOn          time.Time `xorm:"DATETIME"`
+	CreateUserId      int       `xorm:"INT(10)"`
+	CreateBy          string    `xorm:"VARCHAR(50)"`
+	ModifiedOn        time.Time `xorm:"DATETIME"`
+	ModifiedUserId    int       `xorm:"INT(10)"`
+	ModifiedBy        string    `xorm:"VARCHAR(50)"`
+	GfId              int       `xorm:"INT(11)"`
+	DeleteDate        time.Time `xorm:"DATETIME"`
+}
+
 type OilSupplierVM struct {
 	AccessCardNo     string
 	SupplierTypeCode string

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercertService.go

@@ -123,7 +123,7 @@ func (s *OilSupplierCertService) IsCanApplyByExtOrganizeUser(applyType, commerci
 	if extOrganizeId == departmentId {*/
 	if isCompanyUser == 1 {
 		var tempMap []map[string]string
-		sql:= "select 1 from OilSupplier a left join OilSupplierCert b on a.Id=b.SupplierId where b.SupplierTypeCode = '" + applyType + "' and (b.CreateUserId = '" + userId + "' or a.CommercialNo='"+commercialNo+"') and b.InFlag != '4'"
+		sql:= "select 1 from OilSupplier a left join OilSupplierCert b on a.Id=b.SupplierId where b.SupplierTypeCode = '" + applyType + "' and (b.CreateUserId = '" + userId + "' or a.CommercialNo='"+commercialNo+"')"
 		tempMap,_=s.DBE.QueryString(sql)
 		if tempMap!=nil && tempMap[0]["1"] !="" {
 			return false

+ 24 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -25,6 +25,30 @@ type OilSupplierCertSub struct {
 	ModifiedUserId       int       `xorm:"INT(10)"`
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
 }
+
+type Del_OilSupplierCertSub struct {
+	Id                   int       `xorm:<- not null pk autoincr INT(10)"`
+	SupplierId           int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	SupplierCertId       int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
+	SupplierCertAppendId int       `xorm:"not null comment('增项信息表ID') INT(10)"`
+	SupplierTypeCode     string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
+	SubClassId           int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
+	Code                 string    `xorm:"not null default '' comment('分类编码') VARCHAR(8)"`
+	AppendStatus         string    `xorm:"not null default '' comment('增项审核状态') VARCHAR(10)"`
+	Type                 string    `xorm:"not null default '' comment('类型') VARCHAR(10)"`
+	Name                 string    `xorm:"not null default '' comment('分类名称') VARCHAR(50)"`
+	CertSubStatus        string    `xorm:"null default '1' comment('1:正常2:不良记录暂停') VARCHAR(10)"`
+	Remark               string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete             int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn             time.Time `xorm:"DATETIME created"`
+	CreateUserId         int       `xorm:"INT(10)"`
+	CreateBy             string    `xorm:"VARCHAR(50)"`
+	ModifiedOn           time.Time `xorm:"DATETIME"`
+	ModifiedUserId       int       `xorm:"INT(10)"`
+	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+	DeleteDate           time.Time `xorm:"DATETIME"`
+}
+
 type goodsChecked struct {
 	Id       string `json:"id"`
 	Code     string

+ 26 - 0
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfile.go

@@ -28,3 +28,29 @@ type OilSupplierFile struct {
 	ModifiedUserId    int       `xorm:"INT(10)"`
 	ModifiedBy        string    `xorm:"VARCHAR(50)"`
 }
+
+type Del_OilSupplierFile struct {
+	Id                int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierId        int       `xorm:"INT(10)"`
+	SupplierTypeCode  string    `xorm:"VARCHAR(5)"`
+	SupplierCertSubId int       `xorm:"INT(10)"`
+	CertSubName       string    `xorm:"VARCHAR(50)"`
+	NeedFileType      string    `xorm:"VARCHAR(50)"`
+	NeedFileCode      string    `xorm:"VARCHAR(20)"`
+	FileType          int       `xorm:"INT(10)"`
+	SupType           int       `xorm:"INT(10)"`
+	FileExt           string    `xorm:"VARCHAR(10)"`
+	FileName          string    `xorm:"VARCHAR(50)"`
+	EffectDate        time.Time `xorm:"DATETIME"`
+	FileUrl           string    `xorm:"VARCHAR(100)"`
+	OtherRemark       string    `xorm:"VARCHAR(500)"`
+	Remark            string    `xorm:"VARCHAR(500)"`
+	IsDelete          int       `xorm:"INT(10)"`
+	CreateOn          time.Time `xorm:"DATETIME created"`
+	CreateUserId      int       `xorm:"INT(10)"`
+	CreateBy          string    `xorm:"VARCHAR(50)"`
+	ModifiedOn        time.Time `xorm:"DATETIME"`
+	ModifiedUserId    int       `xorm:"INT(10)"`
+	ModifiedBy        string    `xorm:"VARCHAR(50)"`
+	DeleteDate        time.Time `xorm:"DATETIME"`
+}

+ 27 - 0
src/dashoo.cn/backend/api/business/paymentinfo/paymentinfo.go

@@ -28,6 +28,33 @@ type OilPaymentInfo struct {
 	SureBatchNo    string    `xorm:"VARCHAR(50)"`
 }
 
+type Del_OilPaymentInfo struct {
+	Id             int       `xorm:"not null pk autoincr INT(11)"`
+	SrcId          int       `xorm:"INT(11)"`
+	SupplierId     int       `xorm:"comment('Supplier表') INT(11)"`
+	SupplierCertId int       `xorm:"comment('SupplierCert表') INT(11)"`
+	USCCode        string    `xorm:"comment('统一社会信用代码') VARCHAR(40)"`
+	SupplierName   string    `xorm:"comment('企业名称') VARCHAR(100)"`
+	ProjectName    string    `xorm:"comment('项目名称') VARCHAR(100)"`
+	Amount         string    `xorm:"comment('缴费金额') DECIMAL(10,2)"`
+	IsPay          string    `xorm:"comment('是否缴费 1 是 2否') VARCHAR(5)"`
+	PayMode        string    `xorm:"comment('缴费方式') VARCHAR(10)"`
+	PayType        string    `xorm:"comment('缴费类型 1 准入缴费 2 年审缴费') VARCHAR(10)"`
+	PayDate        time.Time `xorm:"comment('缴费日期') DATETIME"`
+	BankSerialNum  string    `xorm:"comment('银行流水号') VARCHAR(50)"`
+	BankName       string    `xorm:"comment('银行名称') VARCHAR(100)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId   int       `xorm:"INT(11)"`
+	CreateOn       time.Time `xorm:"DATETIME"`
+	CreateBy       string    `xorm:"VARCHAR(50)"`
+	ModifiedOn     time.Time `xorm:"DATETIME"`
+	ModifiedUserId int       `xorm:"INT(11)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+	ID_GF     	   int       `xorm:"INT(11)"`
+	SureBatchNo    string    `xorm:"VARCHAR(50)"`
+	DeleteDate     time.Time `xorm:"DATETIME"`
+}
+
 type PaymentinfoList struct {
 	OilPaymentInfo   `xorm:"extends"`
 	SupplierTypeCode string

+ 5 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -260,6 +260,11 @@ var (
 	OilPaymentInfoName                       string = "OilPaymentInfo"              //交费信息
 	OilActivityName                          string = "OilActivity" //
 	OilCatalogName                           string = "OilCatalog" //目录表
+	DelOilSupplierCertName                   string = "Del_OilSupplierCert"
+	DelOilSupplierName                       string = "Del_OilSupplier"
+	DelOilSupplierFileName                   string = "Del_OilSupplierFile"
+	DelOilPaymentInfoName                    string = "Del_OilPaymentInfo"
+	DelOilSupplierCertSubName                string = "Del_OilSupplierCertSub"
 )
 
 //分页信息及数据

+ 1 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -410,7 +410,7 @@ func (this *OilSupplierController) GetJoinCertEntityList() {
 	RegCapital2 := this.GetString("RegCapital2")
 	BusinessScope := this.GetString("BusinessScope")
 
-	where = where + " and b.InFlag != '4'"
+	//where = where + " and b.InFlag != '4'"
 
 	if SupplierName != "" {
 		where = where + " and a.SupplierName like '%" + SupplierName + "%'"

+ 214 - 104
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -8,6 +8,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/organize"
 	"dashoo.cn/backend/api/business/paymentinfo"
 	"dashoo.cn/business2/parameter"
@@ -500,7 +501,7 @@ func (this *OilSupplierCertController) UpdateStorage() {
 	} else {
 
 		var activity oilactivity.OilActivity
-		where := "EntityId=" +  id + " and ActType='" + oilactivity.STORAGE + "'"
+		where := "EntityId=" + id + " and ActType='" + oilactivity.STORAGE + "'"
 		svc.GetEntity(&activity, where)
 
 		svcActiviti := workflow.GetActivitiService(utils.DBE)
@@ -508,7 +509,7 @@ func (this *OilSupplierCertController) UpdateStorage() {
 		ActiComplete.ProcessKey = activity.ProcessKey
 		ActiComplete.BusinessKey = activity.BusinessKey
 		ActiComplete.UserId = this.User.Id
-		ActiComplete.Remarks =""
+		ActiComplete.Remarks = ""
 		ActiComplete.Result = "1"
 
 		receiveVal := svcActiviti.TaskComplete(ActiComplete)
@@ -518,7 +519,7 @@ func (this *OilSupplierCertController) UpdateStorage() {
 		model.Status = suppliercert.STORE_STATUS
 		model.Step = 7
 		model.StorageOn = time.Now()
-		model.ApplyTime = time.Now().AddDate(1, 0 ,0)
+		model.ApplyTime = time.Now().AddDate(1, 0, 0)
 		model.InFlag = "1"
 		model.ModifiedOn = time.Now()
 		model.ModifiedBy = this.User.Realname
@@ -537,8 +538,6 @@ func (this *OilSupplierCertController) UpdateStorage() {
 		err = svc.UpdateEntityBytbl(OilSupplierCertName, id, &model, cols)
 	}
 
-
-
 	if err == nil {
 		errinfo.Message = "提交成功!"
 		errinfo.Code = 0
@@ -673,7 +672,7 @@ func (this *OilSupplierCertController) AuditEntity() {
 	result := strconv.Itoa(this.User.IsCompanyUser)
 	if supplierCertEntity.WorkflowId == "0" || len(supplierCertEntity.WorkflowId) <= 0 {
 		//启动工作流
-		businessKey = certId + "-" +  strconv.Itoa(supplierCertEntity.AuditIndex)
+		businessKey = certId + "-" + strconv.Itoa(supplierCertEntity.AuditIndex)
 		// 1 评审准入  2 一级物资备案准入  3  二级物资备案准入  4 战略合作准入  5 内部多元准入  6 外部市场准入
 		if supplierCertEntity.InStyle == "2" || supplierCertEntity.InStyle == "4" || supplierCertEntity.InStyle == "6" {
 			processInstanceId = svcActiviti.StartProcess2(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, businessKey, this.User.Id, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
@@ -772,7 +771,7 @@ func (this *OilSupplierCertController) AuditEntity() {
 	supplierCertEntity.WorkflowId = processInstanceId
 	if this.User.IsCompanyUser == 1 {
 		supplierCertEntity.Status = suppliercert.FEN_TRIAL_STATUS //分办
-	}else if this.User.IsCompanyUser == 0 {
+	} else if this.User.IsCompanyUser == 0 {
 		supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
 	}
 
@@ -780,8 +779,8 @@ func (this *OilSupplierCertController) AuditEntity() {
 	supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
 	supplierCertEntity.AuditIndex = supplierCertEntity.AuditIndex + 1
 	supplierCertEntity.BusinessKey = ActiComplete.BusinessKey
-	supplierCertEntity.SecondAudit,_ = strconv.Atoi(secondAudit)
-	supplierCertEntity.ThirdAudit,_ = strconv.Atoi(thirdAudit)
+	supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
+	supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
 	supplierCertEntity.ProcessKey = ActiComplete.ProcessKey
 	supplierCertEntity.CommitComId = unitId
 	cols := []string{
@@ -849,7 +848,6 @@ func (this *OilSupplierCertController) AuditEntityadmission() {
 	certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
 }
 
-
 // @Title 审批
 // @Description 审批
 // @Param 	body body suppliercert.OilSupplierCert
@@ -865,7 +863,6 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 	thirdAudit := this.GetString("ThirdAudit")
 	//majorDept := this.GetString("majorDept")
 
-
 	//取出审批列表
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var supplierCertEntity suppliercert.OilSupplierCert
@@ -906,8 +903,8 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 		step = 2
 		supplierCertEntity.Step = 2
 		supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
-		supplierCertEntity.SecondAudit,_ = strconv.Atoi(secondAudit)
-		supplierCertEntity.ThirdAudit,_ = strconv.Atoi(thirdAudit)
+		supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
+		supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
 		cols := []string{
 			"Id",
 			"Step",
@@ -937,7 +934,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 		var setting auditsetting.Base_OilAuditSetting
 		usvc := userRole.GetUserService(utils.DBE)
 
-		if supplierCertEntity.InStyle == "3"{
+		if supplierCertEntity.InStyle == "3" {
 			status = suppliercert.THIRD_TRIAL_STATUS
 			where := "AuditStepCode='" + workflow.PROF_RECE + "'"
 			usvc.GetEntity(&setting, where)
@@ -956,7 +953,6 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 			businessKey := strconv.Itoa(supplierCertEntity.Id)
 			result := "1"
 
-
 			userIds := ""
 			var userlist []userRole.Base_User
 			var setting auditsetting.Base_OilAuditSetting
@@ -1003,10 +999,9 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 			certSrv.InsertEntityBytbl(OilActivityName, &activity)
 
-
 			status = suppliercert.STOREING_STATUS
 			step = 3
-		}  else {
+		} else {
 			status = suppliercert.THIRD_TRIAL_STATUS
 			where := "AuditStepCode='" + workflow.PROF_RECE + "'"
 			svc.GetEntity(&setting, where)
@@ -1024,7 +1019,6 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 		//var users []userRole.Base_RoleList
 		//certSrv.GetAuditUser(strconv.Itoa(supplierCertEntity.ThirdAudit), workflow.PROF_RECE, &users)
 
-
 		for _, tmpUser := range userlist {
 			userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
 		}
@@ -1099,7 +1093,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 					paysvc := paymentinfo.GetPaymentService(utils.DBE)
 					var Amount float64
 					asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
-					Amount = asvc.GetAmount("ZHUNRU",supplierCertEntity.SupplierTypeCode)
+					Amount = asvc.GetAmount("ZHUNRU", supplierCertEntity.SupplierTypeCode)
 					var payinfo paymentinfo.OilPaymentInfo
 					payinfo.SupplierId = supplierCertEntity.SupplierId
 					payinfo.SrcId = supplierCertEntity.Id
@@ -1107,7 +1101,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 					payinfo.USCCode = supplierEntity.CommercialNo
 					payinfo.SupplierName = supplierEntity.SupplierName
 					payinfo.PayType = "1"
-					payinfo.Amount = strconv.FormatFloat(Amount,'E',-1,64)
+					payinfo.Amount = strconv.FormatFloat(Amount, 'E', -1, 64)
 					payinfo.IsPay = "0"
 					payinfo.CreateUserId = supplierCertEntity.CreateUserId
 					payinfo.CreateBy = supplierCertEntity.CreateBy
@@ -1115,11 +1109,10 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 					wheresup := " SupplierCertId=" + strconv.Itoa(supplierCertEntity.Id)
 					var sup []suppliercertsub.OilSupplierCertSub
-					total := paysvc.GetPagingEntitiesWithOrder(1,10,"Id",true,&sup,wheresup)
-
-					if supplierCertEntity.SupplierTypeCode == "01" && total <= 50{
- 						status = suppliercert.STOREING_STATUS
+					total := paysvc.GetPagingEntitiesWithOrder(1, 10, "Id", true, &sup, wheresup)
 
+					if supplierCertEntity.SupplierTypeCode == "01" && total <= 50 {
+						status = suppliercert.STOREING_STATUS
 
 						svcActiviti := workflow.GetActivitiService(utils.DBE)
 						businessKey := strconv.Itoa(supplierCertEntity.Id)
@@ -1171,15 +1164,13 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 						paysvc.InsertEntityBytbl(OilActivityName, &activity)
 
-
-
 					} else {
 						paysvc.InsertEntity(&payinfo)
 						//发短信
 						toMobile := supplierEntity.Mobile
-						msg:= "您的"+supplierCertEntity.SupplierTypeName + "准入审核通过,请及时确认交费信息!"
+						msg := "您的" + supplierCertEntity.SupplierTypeName + "准入审核通过,请及时确认交费信息!"
 						msgService := msg2.GetMsgService(utils.DBE)
-						msgService.HandleMsg(toMobile,msg,"3-1",supplierCertEntity.CreateBy,supplierEntity.ContactName,strconv.Itoa(supplierCertEntity.CreateUserId))
+						msgService.HandleMsg(toMobile, msg, "3-1", supplierCertEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(supplierCertEntity.CreateUserId))
 					}
 
 					//paysvc.AddPaymentinfo(supplierCertEntity.SupplierId, supplierCertEntity.Id, Amount, "1")
@@ -1241,8 +1232,6 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 					certSrv.InsertEntityBytbl(OilActivityName, &activity)
 
-
-
 					supplierCertEntity.Status = suppliercert.STOREING_STATUS
 					supplierCertEntity.Step = step
 					cols := []string{
@@ -1303,14 +1292,13 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 				certSrv.InsertEntityBytbl(OilActivityName, &activity)
 
-
 				supplierCertEntity.Status = suppliercert.STOREING_STATUS
-					supplierCertEntity.Step = 3
-					cols := []string{
-						"Status",
-						"Step",
-					}
-					certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
+				supplierCertEntity.Step = 3
+				cols := []string{
+					"Status",
+					"Step",
+				}
+				certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
 			} else {
 				supplierCertEntity.Status = status
 				supplierCertEntity.Step = step
@@ -1370,9 +1358,9 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 			certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
 
 			toMobile := supplierEntity.Mobile
-			msg:= "您的"+supplierCertEntity.SupplierTypeName + "准入审核未通过,请及时查看!"
+			msg := "您的" + supplierCertEntity.SupplierTypeName + "准入审核未通过,请及时查看!"
 			msgService := msg2.GetMsgService(utils.DBE)
-			msgService.HandleMsg(toMobile,msg,"4-1",supplierCertEntity.CreateBy,supplierEntity.ContactName,strconv.Itoa(supplierCertEntity.CreateUserId))
+			msgService.HandleMsg(toMobile, msg, "4-1", supplierCertEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(supplierCertEntity.CreateUserId))
 			errinfo.Message = "提交成功!"
 			errinfo.Code = 0
 			this.Data["json"] = &errinfo
@@ -1454,7 +1442,7 @@ func (this *OilSupplierCertController) IsAccess() {
 		if res {
 			actisvc := workflow.GetActivitiService(utils.DBE)
 			ids := actisvc.GetMyTasks(processkey, this.User.Id)
-			res = strings.Contains(ids,id)
+			res = strings.Contains(ids, id)
 		}
 
 		//for _, user := range users {
@@ -1485,7 +1473,7 @@ func (this *OilSupplierCertController) CreateAccessCardNo() {
 	//codecSvc.GetEntities(&model, "")
 	seqStr := ""
 	cols := []string{}
-	if (typeCode == "01") {  // 物质
+	if (typeCode == "01") { // 物质
 		has := true
 		for has {
 			seqStr = codecSvc.GetWZAccessCardNo(this.User.AccCode)
@@ -1539,11 +1527,11 @@ func (this *OilSupplierCertController) UpdataInFlag() {
 	currenttime := time.Now()
 	//.Format("2006-01-02")
 	for i := 0; i < len(certentitys); i++ {
-		if currenttime.After(certentitys[i].ApplyTime) && !currenttime.After(certentitys[i].ApplyTime.AddDate(1,0,0)) && certentitys[i].InFlag != "2" {
+		if currenttime.After(certentitys[i].ApplyTime) && !currenttime.After(certentitys[i].ApplyTime.AddDate(1, 0, 0)) && certentitys[i].InFlag != "2" {
 			var certentity suppliercert.OilSupplierCert
 			certentity.InFlag = "2"
 			cols := []string{"InFlag"}
-			_,err = svc.UpdateEntityByIdCols(certentitys[i].Id, &certentity, cols)
+			_, err = svc.UpdateEntityByIdCols(certentitys[i].Id, &certentity, cols)
 			if err != nil {
 				session.Rollback()
 			}
@@ -1553,7 +1541,7 @@ func (this *OilSupplierCertController) UpdataInFlag() {
 			var certentity suppliercert.OilSupplierCert
 			certentity.InFlag = "3"
 			cols := []string{"InFlag"}
-			_,err = svc.UpdateEntityByIdCols(certentitys[i].Id, &certentity, cols)
+			_, err = svc.UpdateEntityByIdCols(certentitys[i].Id, &certentity, cols)
 			if err != nil {
 				session.Rollback()
 			}
@@ -1582,7 +1570,7 @@ func (this *OilSupplierCertController) SaveAccessCardNo() {
 	svc.GetEntities(&model, where)
 	supcols := []string{}
 	if model == nil || len(model) == 0 {
-		if (typeCode == "01") {  // 物质
+		if (typeCode == "01") { // 物质
 			supplier.WZAccessCardNo = accessCardNo
 			supcols = []string{"WZAccessCardNo"}
 		} else if typeCode == "03" { //技术服务
@@ -1623,33 +1611,31 @@ func (this *OilSupplierCertController) SendingSMS() {
 	svcsupp.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 0, 0, "Id", true, &list, where)
 	currenttime := time.Now()
 
-	for _,item := range list {
-		if currenttime.AddDate(0,3,0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
+	for _, item := range list {
+		if currenttime.AddDate(0, 3, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
 			toMobile := item.Mobile
-			msg:= "您的" + item.SupplierTypeName + "准入还有3个月到期"
+			msg := "您的" + item.SupplierTypeName + "准入还有3个月到期"
 			msgService := msg2.GetMsgService(utils.DBE)
-			msgService.HandleMsg(toMobile,msg,"1-1",item.CreateBy,item.ContactName,strconv.Itoa(item.CreateUserId))
+			msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId))
 		}
-		if currenttime.AddDate(0,2,0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
-			toMobile :=item.Mobile
-			msg:= "您的" + item.SupplierTypeName + "准入还有2个月到期"
+		if currenttime.AddDate(0, 2, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
+			toMobile := item.Mobile
+			msg := "您的" + item.SupplierTypeName + "准入还有2个月到期"
 			msgService := msg2.GetMsgService(utils.DBE)
-			msgService.HandleMsg(toMobile,msg,"1-1",item.CreateBy,item.ContactName,strconv.Itoa(item.CreateUserId))
+			msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId))
 		}
-		if currenttime.AddDate(0,1,0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
+		if currenttime.AddDate(0, 1, 0).Format("2006-01-02") == (item.ApplyTime.Format("2006-01-02")) {
 			toMobile := item.Mobile
-			msg:= "您的" + item.SupplierTypeName + "准入还有1个月到期"
+			msg := "您的" + item.SupplierTypeName + "准入还有1个月到期"
 			msgService := msg2.GetMsgService(utils.DBE)
-			msgService.HandleMsg(toMobile,msg,"1-1",item.CreateBy,item.ContactName,strconv.Itoa(item.CreateUserId))
+			msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId))
 		}
 	}
 	elapsed := time.Since(t)
 	fmt.Println(elapsed, "快到期提醒")
 
-
 }
 
-
 // @Title 资质快到期短信通知
 // @Description
 // @Success 200 {object} controllers.Request
@@ -1657,16 +1643,16 @@ func (this *OilSupplierCertController) SendingSMS() {
 func (this *OilSupplierCertController) SendingSMSSupplierFile() {
 	t := time.Now()
 	svcsupp := supplier.GetOilSupplierService(utils.DBE)
-	var expireFile  []supplier.ExpireFile
-	where := " b.EffectDate LIKE '%" + time.Now().AddDate(0,1,0).Format("2006-01-02") + "%'"
+	var expireFile []supplier.ExpireFile
+	where := " b.EffectDate LIKE '%" + time.Now().AddDate(0, 1, 0).Format("2006-01-02") + "%'"
 	err := svcsupp.GetExpireFile(OilSupplierName, OilSupplierFileName, &expireFile, where)
 
 	if err == nil {
 		for _, item := range expireFile {
 			toMobile := item.Mobile
-			msg:= "您的" + item.ExpireAllFile + "还有1个月到期"
+			msg := "您的" + item.ExpireAllFile + "还有1个月到期"
 			msgService := msg2.GetMsgService(utils.DBE)
-			msgService.HandleMsg(toMobile,msg,"1-1",item.CreateBy,item.ContactName,strconv.Itoa(item.CreateUserId))
+			msgService.HandleMsg(toMobile, msg, "1-1", item.CreateBy, item.ContactName, strconv.Itoa(item.CreateUserId))
 		}
 	}
 	elapsed := time.Since(t)
@@ -1680,11 +1666,11 @@ func (this *OilSupplierCertController) SendingSMSSupplierFile() {
 func (this *OilSupplierCertController) ChangeSupplierStatus() {
 
 	svcsupp := supplier.GetOilSupplierService(utils.DBE)
-	var fileData  []supplier.ExpireFile
-	where := " b.EffectDate LIKE '%" + time.Now().AddDate(0,0,-1).Format("2006-01-02") + "%'"
+	var fileData []supplier.ExpireFile
+	where := " b.EffectDate LIKE '%" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "%'"
 	svcsupp.GetExpireFile(OilSupplierName, OilSupplierFileName, &fileData, where)
 
-	for _,item := range fileData {
+	for _, item := range fileData {
 		var sert suppliercert.OilSupplierCert
 		cols := []string{
 			"InFlag",
@@ -1694,7 +1680,6 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 		svcsupp.UpdateEntityBywheretbl(OilSupplierCertName, &sert, cols, where)
 	}
 
-
 }
 
 // @Title 更新Inflag状态
@@ -1703,7 +1688,6 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
 // @router /reinput/:id [post]
 func (this *OilSupplierCertController) ReInput() {
 	id := this.Ctx.Input.Param(":id")
-	inFlag := this.GetString("InFlag")
 
 	var errinfo ErrorInfo
 	if id == "" {
@@ -1714,69 +1698,195 @@ func (this *OilSupplierCertController) ReInput() {
 		return
 	}
 
-	var model suppliercert.OilSupplierCert
-	svc := suppliercert.GetOilSupplierCertService(utils.DBE)
-	model.InFlag = inFlag
-	model.IsDelete = 1
-	model.ModifiedOn = time.Now()
-	model.ModifiedBy = this.User.Realname
-	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
-	cols := []string{
-		"IsDelete",
-		"InFlag",
-		"ModifiedOn",
-		"ModifiedUserId",
-		"ModifiedBy",
-	}
-	err := svc.UpdateEntityBytbl(OilSupplierCertName, id, &model, cols)
-	if err == nil {
-		errinfo.Message = "提交成功!"
-		errinfo.Code = 0
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	} else {
-		errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	}
-
-}
-
-
-
-
-
-
-
-
-
+	session := utils.DBE.NewSession()
+	svc := suppliercert.GetOilSupplierCertSession(session)
+	defer func() {
+		session.Close()
+	}()
+	err := session.Begin()
 
+	var model []suppliercert.Del_OilSupplierCert
 
+	where := "SupplierId=" + id
+	var sql string
+	sql = "select * from " + OilSupplierCertName + " where " + where
+	utils.DBE.SQL(sql).Find(&model)
 
+	isdelsupplier := false
+	if model != nil && len(model) > 0 {
+		isdelsupplier = true
+	}
 
+	for _, item := range model {
+		if item.InFlag == "3" {
+			where := "Id=" + strconv.Itoa(item.Id)
+			err = svc.DeleteEntityBytbl(OilSupplierCertName, where)
 
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
+			item.DeleteDate = time.Now()
+			_, err = svc.InsertEntityBytbl(DelOilSupplierCertName, &item)
 
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
+			// 交费信息
+			var delpay []paymentinfo.Del_OilPaymentInfo
+			wherepay := "SupplierCertId=" + strconv.Itoa(model[0].Id)
+			var sqlpay string
+			sqlpay = "select * from " + OilPaymentInfoName + " where " + wherepay
+			utils.DBE.SQL(sqlpay).Find(&delpay)
 
+			err = svc.DeleteEntityBytbl(OilPaymentInfoName, wherepay)
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
+			for idx, _ := range delpay {
+				delpay[idx].DeleteDate = time.Now()
+			}
 
+			_, err = svc.InsertEntityBytbl(DelOilPaymentInfoName, &delpay)
 
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
+			// 删除准入范围
+			var certsup []suppliercertsub.Del_OilSupplierCertSub
+			wheresup := "SupplierCertId=" + strconv.Itoa(model[0].Id)
+			var sqlsup string
+			sqlsup = "select * from " + OilSupplierCertSubName + " where " + wheresup
+			utils.DBE.SQL(sqlsup).Find(&certsup)
 
+			err = svc.DeleteEntityBytbl(OilSupplierCertSubName, wheresup)
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
+			for idx, _ := range certsup {
+				certsup[idx].DeleteDate = time.Now()
+			}
 
+			_, err = svc.InsertEntityBytbl(DelOilSupplierCertSubName, &certsup)
 
+			if err != nil {
+				session.Rollback()
+				errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
 
 
+		} else {
+			isdelsupplier = false
+		}
+	}
 
+	if isdelsupplier {
+		// 删除企业信息
+		var modelsupp supplier.Del_OilSupplier
+		where := "Id=" + strconv.Itoa(model[0].SupplierId)
+		var sql string
+		sql = "select * from " + OilSupplierName + " where " + where
+		utils.DBE.SQL(sql).Get(&modelsupp)
 
+		err = svc.DeleteEntityBytbl(OilSupplierName, where)
+		if err != nil {
+			session.Rollback()
+			errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+		modelsupp.DeleteDate = time.Now()
+		_, err = svc.InsertEntityBytbl(DelOilSupplierName, &modelsupp)
 
+		if err != nil {
+			session.Rollback()
+			errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
 
+		// 删除企业资质
+		var delfile []supplierfile.Del_OilSupplierFile
+		wheref := "SupplierId=" + strconv.Itoa(model[0].SupplierId)
+		var sqlw string
+		sqlw = "select * from " + OilSupplierFileName + " where " + wheref
+		utils.DBE.SQL(sqlw).Find(&delfile)
+
+		err = svc.DeleteEntityBytbl(OilSupplierFileName, wheref)
+		if err != nil {
+			session.Rollback()
+			errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
 
+		for idx, _ := range delfile {
+			delfile[idx].DeleteDate = time.Now()
+		}
 
+		_, err = svc.InsertEntityBytbl(DelOilSupplierFileName, &delfile)
 
+		if err != nil {
+			session.Rollback()
+			errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
 
+	}
 
+	err = session.Commit()
+	if err == nil {
+		errinfo.Message = "提交成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "提交失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
 
+}

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/basisedit.vue

@@ -489,13 +489,13 @@
           let params = {
             InFlag: '4'
           }
-          apiCert.reInput(this.certId, params, this.$axios).then(res => {
+          apiCert.reInput(this.formData.Id, params, this.$axios).then(res => {
             if (res.data.code === 0) {
-              this.initDatas()
               this.$message({
                 type: 'success',
                 message: res.data.message
               })
+              this.$router.push('/oilsupplier/supplierstore/basislist')
             } else {
               this.$message({
                 type: 'warning',

+ 3 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/goodsedit.vue

@@ -467,13 +467,14 @@
           let params = {
             InFlag: '4'
           }
-          apiCert.reInput(this.certId, params, this.$axios).then(res => {
+          console.log(this.formData, 'this.formDatathis.formData')
+          apiCert.reInput(this.formData.Id, params, this.$axios).then(res => {
             if (res.data.code === 0) {
-              this.initDatas()
               this.$message({
                 type: 'success',
                 message: res.data.message
               })
+              this.$router.push('/oilsupplier/supplierstore/goodslist')
             } else {
               this.$message({
                 type: 'warning',

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/techedit.vue

@@ -497,13 +497,13 @@
           let params = {
             InFlag: '4'
           }
-          apiCert.reInput(this.certId, params, this.$axios).then(res => {
+          apiCert.reInput(this.formData.Id, params, this.$axios).then(res => {
             if (res.data.code === 0) {
-              this.initDatas()
               this.$message({
                 type: 'success',
                 message: res.data.message
               })
+              this.$router.push('/oilsupplier/supplierstore/techlist')
             } else {
               this.$message({
                 type: 'warning',

+ 0 - 101
src/dashoo.cn/frontend_web/src/pages/select/badrecordselect/index.vue

@@ -216,107 +216,6 @@
     <el-dialog :title="addShowTitle"
                :visible.sync="addshow"
                width="85%">
-      <!-- <el-form :model="entityForm"
-               :rules="rules"
-               ref="EntityFormref"> -->
-      <!-- 第一行 -->
-      <!-- <el-row>
-          <el-col :span="24">
-            <el-form-item label="企业名称"
-                          prop="CompanyName">
-              <el-input placeholder="请选择企业名称"
-                        v-model="entityForm.CompanyName"
-                        readonly
-                        style="width:100%">
-                <el-button type="primary"
-                           style="width:30%"
-                           @click="companyDialog = true"
-                           slot="append">选择</el-button>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="准入范围">
-              <el-input placeholder="请选择准入范围"
-                        v-model="certNames"
-                        readonly
-                        style="width:100%">
-                <el-button type="primary"
-                           style="width:30%"
-                           @click="certDialog = true"
-                           slot="append">选择</el-button>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row> -->
-      <!-- 第二行 -->
-      <!-- <el-row>
-          <el-col :span="24">
-            <el-form-item label="准入类别" prop="Categorycode">
-              <el-select
-                default-first-option
-                placeholder="请选择"
-                style="width: 100%"
-                v-model="entityForm.Categorycode"
-              >
-                <el-option label="物资类" value="01"></el-option>
-                <el-option label="基建类" value="02"></el-option>
-                <el-option label="技术服务类" value="03"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row> -->
-
-      <!-- <el-row>
-          <el-form-item label="不良行为时间"> -->
-      <!-- <el-date-picker v-model="entityForm.Bak2"
-                            type="date"
-                            format="yyyy 年 MM 月 dd 日"
-                            value-format="yyyy-MM-dd"
-                            placeholder="选择日期"
-                            style="width: 100%"></el-date-picker> -->
-      <!-- <el-date-picker v-model="Bak2"
-                            type="daterange"
-                            range-separator="至"
-                            start-placeholder="开始日期"
-                            end-placeholder="结束日期"
-                            style="width:100%">
-            </el-date-picker>
-          </el-form-item>
-        </el-row>
-        <el-row>
-          <el-form-item label="状态"
-                        prop="Bak3">
-            <el-select v-model="entityForm.Bak3"
-                       placeholder="请选择"
-                       style="width:100%">
-              <el-option v-for="item in options"
-                         :key="item.value"
-                         :label="item.label"
-                         :value="item.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-row> -->
-      <!-- 第叁行 -->
-      <!-- <el-row>
-          <el-form-item label="不良行为"
-                        prop="Record">
-            <el-input type="textarea"
-                      v-model="entityForm.Record"></el-input>
-          </el-form-item>
-        </el-row>
-      </el-form>
-      <span style="float: right;margin-top:-10px;">
-        <el-button size="small"
-                   @click="addshow = false">取 消</el-button>
-        <el-button type="primary"
-                   size="small"
-                   @click="addAnnualAudit()">确 定</el-button>
-      </span> -->
       <el-tabs type="border-card">
         <el-tab-pane label="企业">
           <el-form :model="entityForm"