Browse Source

Merge pull request '金蝶更新' (#165) from feature_jindie into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_CHEERSSON_BACKEND/pulls/165
pull/166/head
zhangxin 3 years ago
parent
commit
aa77ab9459
4 changed files with 46 additions and 4 deletions
  1. +14
    -4
      services/ap/implments/CustDemandVerHead.service.impl.go
  2. +14
    -0
      utils/k3cloud.go
  3. +8
    -0
      utils/k3cloud/service/pln_forecast.go
  4. +10
    -0
      utils/k3cloud/struct/request/delete.go

+ 14
- 4
services/ap/implments/CustDemandVerHead.service.impl.go View File

@ -774,7 +774,7 @@ func (impl *CustDemandVerHeadServiceImplement) Select(user *global.User, urlPara
* @Reference leit.com/LAPP_CHEERSSON_BACKEND/services/ap/CustDemandVerHeadService.SelectData
*
******************************************************************************/
func (impl *CustDemandVerHeadServiceImplement) SelectData(user *global.User, urlParameters map[string]string, grouptype string,customerId string, versionId string, artId string, status string, Valid bool) (grmi.PagingResult, error) {
func (impl *CustDemandVerHeadServiceImplement) SelectData(user *global.User, urlParameters map[string]string, grouptype string, customerId string, versionId string, artId string, status string, Valid bool) (grmi.PagingResult, error) {
grmi.Log(user, "/services/ap/implments/CustDemandVerHead.service.impl.go", "SelectCustDemandVerHead", "查询CustDemandVerHead")
@ -788,11 +788,11 @@ func (impl *CustDemandVerHeadServiceImplement) SelectData(user *global.User, url
condition := DefaultConditionOfCustDemandVerHeadAndPaging
condition.Fill(urlParameters)
result, err := dao.SelectData(condition.Paging,grouptype, customerId, versionId, artId, status, Valid)
result, err := dao.SelectData(condition.Paging, grouptype, customerId, versionId, artId, status, Valid)
if err != nil {
return grmi.EmptyPagingResult, err
}
result.Count, err = dao.SelectDataCount(grouptype,customerId, versionId, artId, status, Valid)
result.Count, err = dao.SelectDataCount(grouptype, customerId, versionId, artId, status, Valid)
if err != nil {
return grmi.EmptyPagingResult, err
}
@ -3348,17 +3348,27 @@ func (impl *CustDemandVerHeadServiceImplement) RemoveIssueGlobalAllVersion(user
if isErp {
return errors.New(fmt.Sprintf("当前周%s已经同步ERP,不可以反全局发布!", nowVersionId))
}
for _, v := range issueData {
ids := ""
for k, v := range issueData {
entity := new(model.CustDemandVerHead)
entity.CustomerId = v.CustomerId
entity.VersionId = v.VersionId
entity.PublishStatus = baseModel.STATUS_INT_NO
err = dao.IssueGlobalVersion(entity)
if k > 0 {
ids += ","
}
ids += v.PublishId
if err != nil {
session.Rollback()
return err
}
}
err = utilService.PlnForecastInit().DeleteForecast(ids)
if err != nil {
_ = session.Rollback()
return err
}
err = session.Commit()
if err != nil {
return err


+ 14
- 0
utils/k3cloud.go View File

@ -131,6 +131,20 @@ func (K3config *K3config) BillCloseApi(formId string, opNumber string, saveData
return &response, nil
}
func (K3config *K3config) DeleteApi(formId string, saveData request.DeleteRequest) (*response.K3ResponseStruct, error) {
formParams := util.CreateBusinessPostData(formId, util.Struct2Map(saveData))
res, err := K3config.GetSession().PostJson(K3config.CloudUrl+util.DELETE_API, formParams)
if err != nil {
return nil, err
}
response := response.K3ResponseToStruct(res)
if !response.Result.ResponseStatus.IsSuccess {
return nil, fmt.Errorf("%s", response.Result.ResponseStatus.Errors)
}
fmt.Print(response)
return &response, nil
}
/**
返回session
*/


+ 8
- 0
utils/k3cloud/service/pln_forecast.go View File

@ -37,3 +37,11 @@ func (_this *PlnForecastService) CloseForecast(ids string) error {
_, err := _this.BillCloseApi(_this.FormID, "BillClose", request)
return err
}
func (_this *PlnForecastService) DeleteForecast(ids string) error {
request := request2.DeleteRequest{
Ids: ids,
}
_, err := _this.DeleteApi(_this.FormID, request)
return err
}

+ 10
- 0
utils/k3cloud/struct/request/delete.go View File

@ -0,0 +1,10 @@
package request
type DeleteRequest struct {
//CreateOrgId string `json:"CreateOrgId"`
//Numbers []string `json:"Numbers"`
Ids string `json:"Ids"`
//PkEntryIds interface{} `json:"PkEntryIds"`
//NetworkCtrl bool `json:"NetworkCtrl"`
//IgnoreInterationFlag bool `json:"IgnoreInterationFlag"`
}

Loading…
Cancel
Save