|
|
@@ -1438,7 +1438,7 @@ func (this *OilSupplierController) GetEntityAndCert() {
|
|
|
|
|
|
var sql string
|
|
|
sql = `select a.*, b.Id as CertId, b.AccessCardNo, b.SupplierTypeCode, b.SupplierTypeName, b.Step, b.WorkerTotal, b.ContractNum, b.UniversityNum, b.TechnicalNum, b.AboveProfNum, b.InFlag, b.ApplyTime,
|
|
|
- b.MiddleProfNum, b.NationalRegNum, b.NationalCertTotal, b.DesignerTotal, b.SkillerTotal, b.InStyle, b.WorkflowId, b.Status, b.ThirdAudit, b.BusinessKey, b.AuditIndex ,b.ProcessKey, b.IsRestrict from ` + OilSupplierName + ` a `
|
|
|
+ b.MiddleProfNum, b.NationalRegNum, b.NationalCertTotal, b.DesignerTotal, b.SkillerTotal, b.InStyle, b.WorkflowId, b.Status, b.ThirdAudit, b.BusinessKey, b.AuditIndex ,b.ProcessKey, b.IsRestrict, a.Remark as Remark, b.Remark as Remark1 from ` + OilSupplierName + ` a `
|
|
|
sql += ` left join ` + OilSupplierCertName + " b on b.SupplierId = a.Id"
|
|
|
sql += ` where b.Id ='` + Id + `'`
|
|
|
utils.DBE.SQL(sql).Get(&model)
|
|
|
@@ -1656,7 +1656,7 @@ func (this *OilSupplierController) AddEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// @Title 已入库列表修改实体
|
|
|
+// @Title 准入修改实体
|
|
|
// @Description 修改实体
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
// @router /update/:id/:type/:instyle [post]
|
|
|
@@ -1761,6 +1761,116 @@ func (this *OilSupplierController) UpdateEntity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// @Title 已入库列表修改实体
|
|
|
+// @Description 修改实体
|
|
|
+// @Success 200 {object} controllers.Request
|
|
|
+// @router /update1/:id/:type/:instyle/:certId [post]
|
|
|
+func (this *OilSupplierController) UpdateEntity1() {
|
|
|
+ id := this.Ctx.Input.Param(":id")
|
|
|
+ typeCode := this.Ctx.Input.Param(":type")
|
|
|
+ instyle := this.Ctx.Input.Param(":instyle")
|
|
|
+ certId := this.Ctx.Input.Param(":certId")
|
|
|
+ var errinfo ErrorInfo
|
|
|
+ if id == "" {
|
|
|
+ errinfo.Message = "操作失败!请求信息不完整"
|
|
|
+ errinfo.Code = -2
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var model supplier.OilSupplier
|
|
|
+ var model1 supplier.OilSupplierView
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
+ json.Unmarshal(jsonBlob, &model)
|
|
|
+ json.Unmarshal(jsonBlob, &model1)
|
|
|
+ model1.Remark = model1.Remark1
|
|
|
+
|
|
|
+ var list []supplier.OilSupplierView
|
|
|
+ service := supplier.GetOilSupplierService(utils.DBE)
|
|
|
+ service.CheckUpdateRepeatApplyInfo(OilSupplierName, OilSupplierCertName, typeCode, strconv.Itoa(model.Id), model.SupplierName, model.CommercialNo, model.OrganCode, model.BankAccount, model.CompanyUrl, &list)
|
|
|
+ if len(list) > 0 {
|
|
|
+ errinfo.Message = "修改失败! 已存在相关企业的信息,或与其他企业信息重复"
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ svc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
+ model.ModifiedOn = time.Now()
|
|
|
+ model.ModifiedBy = this.User.Realname
|
|
|
+ model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+
|
|
|
+ // 获取原本的工商注册号
|
|
|
+ var oldModel supplier.OilSupplier
|
|
|
+ svc.GetEntityById(model.Id, &oldModel)
|
|
|
+ if oldModel.SupplierName != model.SupplierName || oldModel.CommercialNo != model.CommercialNo {
|
|
|
+ cols := []string{"CommercialNo", "SupplierName"}
|
|
|
+ var info register.OilCorporateInfo
|
|
|
+ where1 := "CommercialNo = '" + oldModel.CommercialNo + "'"
|
|
|
+ svc.GetEntityByWhere(OilCorporateInfoName, where1, &info)
|
|
|
+ info.CommercialNo = model.CommercialNo
|
|
|
+ info.SupplierName = model.SupplierName
|
|
|
+ err1 := svc.UpdateEntityBywheretbl(OilCorporateInfoName, &info, cols, where1)
|
|
|
+ if err1 == nil {
|
|
|
+ var user userRole.Base_User
|
|
|
+ user.Realname = model.SupplierName
|
|
|
+ svc.UpdateEntityBywheretbl("Base_User", &user, []string{"Realname"}, "Id = "+strconv.Itoa(info.UserId))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ svc1 := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ var cert suppliercert.OilSupplierCert
|
|
|
+ svc1.GetEntityByWhere(OilSupplierCertName, "SupplierId = "+id+" and SupplierTypeCode='"+typeCode+"'", &cert)
|
|
|
+ //对资质的检查
|
|
|
+ //svc1.IsSupplierCertCanSubmit(strconv.Itoa(model.Id), strconv.Itoa(cert.Id))
|
|
|
+ type1 := 0
|
|
|
+ if model.OperType == "制造商" {
|
|
|
+ type1 = 1
|
|
|
+ }
|
|
|
+ if model.OperType == "代理商" || model.OperType == "贸易商" {
|
|
|
+ type1 = 2
|
|
|
+ }
|
|
|
+ result := this.CheckSupplierFileNew(model.Id, type1, instyle, "3", "")
|
|
|
+ if result != "" {
|
|
|
+ errinfo.Message = "修改失败!" + result
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断基本信息是否可修改
|
|
|
+ updateCols := svc.GetUpdateCols(OilSupplierCertName, typeCode, model.Id)
|
|
|
+ err := svc.UpdateEntityBytbl(OilSupplierName, id, &model, updateCols)
|
|
|
+
|
|
|
+ //isPay := "0"
|
|
|
+ //if instyle == suppliercert.PINGSHEN {
|
|
|
+ // isPay = "0"
|
|
|
+ //} else {
|
|
|
+ // isPay = "2"
|
|
|
+ //}
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ svc.UpdateEntityBytbl(OilSupplierCertName, certId, &model1, []string{"Remark"})
|
|
|
+ svc.DBE.Exec("update OilSupplierCert set InStyle='" + instyle + "' where SupplierId=" + id + " and SupplierTypeCode='" + typeCode + "'") // "', IsPay= " + isPay +
|
|
|
+ //一级变二级删除一级准入范围
|
|
|
+ if model.Grade == "2" {
|
|
|
+ svc.DeleteEntityBytbl(OilSupplierCertSubName, "SupplierTypeCode = '01' and GoodsLevel = '1' and SupplierId = "+id)
|
|
|
+ }
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// @Title 修改企业人员情况实体
|
|
|
// @Description 修改实体
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
@@ -2620,7 +2730,7 @@ func (this *OilSupplierController) CheckSupplierFileNew(supplierId int,type1 int
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
filesvc := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
- for _, certSubItem := range certSubList {
|
|
|
+ for index, certSubItem := range certSubList {
|
|
|
if certSubItem.GoodsLevel == supplier.GOODS_LEVEL_1 && grade == supplier.GOODS_LEVEL_2{
|
|
|
return "二级供应商不能准入一级物资!"
|
|
|
}
|
|
|
@@ -2665,6 +2775,10 @@ func (this *OilSupplierController) CheckSupplierFileNew(supplierId int,type1 int
|
|
|
//三证合一或五证合一的证件,不需要验证了
|
|
|
continue
|
|
|
}
|
|
|
+ if (index < len(certSubList) - 1) && (needHeader.FileName == "国家企业信用信息公示系统截屏" || needHeader.FileName == "诚信合规承诺书" || needHeader.FileName == "营业执照" || needHeader.FileName == "银行开户许可证或基本存款账户信息") && index != 0 {
|
|
|
+ //通用的4个只验证两次
|
|
|
+ continue
|
|
|
+ }
|
|
|
var fileist1 supplierfile.OilSupplierFile
|
|
|
where1 := " SupplierId = '" + strconv.Itoa(supplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
|
|
|
filesvc.GetEntityByWhere("OilSupplierFile", where1, &fileist1)
|