|
|
@@ -711,7 +711,7 @@ func (this *OilSupplierCertController) CompanyAuditEntity() {
|
|
|
supplierCertEntity.BusinessKey = businessKey
|
|
|
supplierCertEntity.WorkflowId = processInstanceId
|
|
|
supplierCertEntity.CommitComId = unitId
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
+ certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols) // 不能在下一步工作流完成后再更新,会找不到分办人
|
|
|
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
@@ -733,9 +733,9 @@ func (this *OilSupplierCertController) CompanyAuditEntity() {
|
|
|
// @router /unit-audit/:id [post]
|
|
|
func (this *OilSupplierCertController) UnitAuditEntity() {
|
|
|
certId := this.Ctx.Input.Param(":id")
|
|
|
- firstAudit := this.GetString("FirstAudit")
|
|
|
- secondAudit := this.GetString("SecondAudit")
|
|
|
- thirdAudit := this.GetString("ThirdAudit")
|
|
|
+ firstAudit := this.GetString("FirstAudit") // 初审人ID
|
|
|
+ secondAudit := this.GetString("SecondAudit") // 复审人ID
|
|
|
+ thirdAudit := this.GetString("ThirdAudit") // 专业处室部门ID
|
|
|
// typeCode := this.GetString("TypeCode")
|
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
|
userId := this.User.Id
|
|
|
@@ -760,6 +760,9 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
+ if firstAudit == "" || secondAudit == "" {
|
|
|
+ panic("请选择审批人")
|
|
|
+ }
|
|
|
//取出准入表信息
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
@@ -804,7 +807,7 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
|
|
|
supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
|
|
|
supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
|
|
|
supplierCertEntity.CommitComId = strconv.Itoa(unitId)
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
+ certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols) // 不能在下一步工作流完成后再更新,会找不到初审人
|
|
|
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
@@ -816,7 +819,7 @@ func (this *OilSupplierCertController) UnitAuditEntity() {
|
|
|
ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
if receiveVal != "true" {
|
|
|
- panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
+ panic("提交失败,请刷新!")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -849,6 +852,10 @@ func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
+ if firstAudit == "" || secondAudit == "" {
|
|
|
+ panic("请选择审批人")
|
|
|
+ }
|
|
|
+
|
|
|
// 取出准入表信息
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
@@ -877,7 +884,7 @@ func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
if receiveVal != "true" {
|
|
|
- panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
+ panic("任务已审批,请刷新!")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1488,7 +1495,7 @@ func (this *OilSupplierCertController) SendingSMSSupplierFile() {
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
month, _ := strconv.Atoi(paramSvc.GetBaseparameterMessage("GFGL", "paramset", "QualificationMonth"))
|
|
|
var expireFile []supplier.ExpireFile
|
|
|
- where := " b.EffectDate LIKE '%" + time.Now().AddDate(0, month, 0).Format("2006-01-02") + "%'"
|
|
|
+ where := " DATE_FORMAT(b.EffectDate, '%Y-%m-%d') = '" + time.Now().AddDate(0, month, 0).Format("2006-01-02") + "'"
|
|
|
err := svcsupp.GetExpireFile(OilSupplierName, OilSupplierFileName, &expireFile, where)
|
|
|
|
|
|
if err == nil {
|
|
|
@@ -1523,32 +1530,59 @@ func (this *OilSupplierCertController) ChangeSupplierStatus() {
|
|
|
|
|
|
svcsupp := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var fileData []supplier.ExpireFileList
|
|
|
- where := " b.EffectDate <= '" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "'"
|
|
|
+ where := " b.EffectDate <= '" + time.Now().Format("2006-01-02") + "'"
|
|
|
svcsupp.GetExpireFileList(OilSupplierName, OilSupplierFileName, &fileData, where)
|
|
|
|
|
|
for _, item := range fileData {
|
|
|
- var sert suppliercert.OilSupplierCert
|
|
|
cols := []string{
|
|
|
"InFlag",
|
|
|
"Remark",
|
|
|
}
|
|
|
- sert.InFlag = "2"
|
|
|
- sert.Remark = "资质过期"
|
|
|
-
|
|
|
- where := "SupplierId=" + strconv.Itoa(item.Id) + " AND InFlag = '1'"
|
|
|
+ where := "SupplierId=" + strconv.Itoa(item.Id)
|
|
|
if item.SupplierTypeCode != "000" {
|
|
|
where = where + " and SupplierTypeCode='" + item.SupplierTypeCode + "'"
|
|
|
}
|
|
|
- svcsupp.UpdateEntityBywheretbl(OilSupplierCertName, &sert, cols, where)
|
|
|
+ var tmpCertList []suppliercert.OilSupplierCert
|
|
|
+ svcsupp.GetEntitysByWhere(OilSupplierCertName, where, &tmpCertList)
|
|
|
+ for _, tmpCertItem := range tmpCertList {
|
|
|
+ if tmpCertItem.InFlag == "1" {
|
|
|
+ tmpCertItem.InFlag = "2"
|
|
|
+ if tmpCertItem.ApplyTime.Before(time.Now()) {
|
|
|
+ // 年审到期
|
|
|
+ tmpCertItem.Remark = strings.Trim("年审过期,资质过期," + tmpCertItem.Remark, ",")
|
|
|
+ } else {
|
|
|
+ tmpCertItem.Remark = strings.Trim("资质过期," + tmpCertItem.Remark, ",")
|
|
|
+ }
|
|
|
+ svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
|
|
|
+
|
|
|
+ } else if tmpCertItem.InFlag == "2" && !strings.Contains(tmpCertItem.Remark, "资质过期") {
|
|
|
+ tmpCertItem.InFlag = "2"
|
|
|
+ tmpCertItem.Remark = strings.Trim("资质过期," + tmpCertItem.Remark, ",")
|
|
|
+ svcsupp.UpdateEntityByIdCols(tmpCertItem.Id, &tmpCertItem, cols)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 查询年审过期 和 资质都过期的
|
|
|
- sqlYearCertLost := "update OilSupplierCert set Remark=CONCAT_WS(',', '年审过期', Remark) where Remark in ('资质过期', '不良记录', '资质过期,不良记录') AND InFlag = '2' AND ApplyTime <= '" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "'"
|
|
|
+ sqlYearCertLost := "update OilSupplierCert set Remark=CONCAT_WS(',', '年审过期', Remark) where locate('年审过期', Remark) = 0 and locate('年检过期', Remark) = 0 AND InFlag = '2' AND ApplyTime <= '" + time.Now().Format("2006-01-02") + "'"
|
|
|
utils.DBE.Query(sqlYearCertLost)
|
|
|
|
|
|
// 查询年审过期的
|
|
|
- sqlYearLost := "update OilSupplierCert set Remark='年审过期', InFlag = '2' where InFlag = '1' AND ApplyTime <= '" + time.Now().AddDate(0, 0, -1).Format("2006-01-02") + "'"
|
|
|
+ sqlYearLost := "update OilSupplierCert set Remark=CONCAT_WS(',', '年审过期', Remark), InFlag = '2' where InFlag = '1' AND ApplyTime <= '" + time.Now().Format("2006-01-02") + "'"
|
|
|
utils.DBE.Query(sqlYearLost)
|
|
|
+
|
|
|
+ // 将过期时间的更正过来,SQL备份
|
|
|
+ /*
|
|
|
+ -- SELECT id, cert.SupplierId, Inflag, Remark FROM OilSupplierCert cert
|
|
|
+ UPDATE OilSupplierCert cert SET cert.InFlag='1', cert.Remark=''
|
|
|
+ WHERE cert.InFlag='2' AND cert.Remark = '资质过期'
|
|
|
+ AND NOT EXISTS (
|
|
|
+ SELECT Id, `NeedFileType`, a.EffectDate FROM `OilSupplierFile` a
|
|
|
+ WHERE a.EffectDate <= NOW()
|
|
|
+ AND a.SupplierTypeCode IN ('000', cert.SupplierTypeCode)
|
|
|
+ AND a.SupplierId = cert.SupplierId
|
|
|
+ ) */
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// @Title 更新Inflag状态
|