|
@@ -97,6 +97,19 @@ func (this *BusinessTrip) ApplyAdd() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //校验申请人,是否被邀请为同行人,并且出差日期冲突
|
|
|
|
+ {
|
|
|
|
+ peerCount, err := business_trip.CheckBusinessApplyPeerDate(req.ArriveDate, req.ReturnDate, "'待审批','已审批'", sysUser.AdminId, 0)
|
|
|
|
+ if err != nil {
|
|
|
|
+ this.FailWithMessage("时间冲突检测失败", "时间冲突检测失败-CheckBusinessApplyPeerDate!Err:"+err.Error())
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if peerCount > 0 {
|
|
|
|
+ this.FailWithMessage("所选日期您被设置为同行人,请重新选择!", "所选日期您被设置为同行人,请重新选择!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//校验同行人,出差日期冲突
|
|
//校验同行人,出差日期冲突
|
|
{
|
|
{
|
|
if req.PeerPeopleId != "" {
|
|
if req.PeerPeopleId != "" {
|
|
@@ -299,6 +312,19 @@ func (this *BusinessTrip) ApplyEdit() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //校验申请人,是否被邀请为同行人,并且出差日期冲突
|
|
|
|
+ {
|
|
|
|
+ peerCount, err := business_trip.CheckBusinessApplyPeerDate(req.ArriveDate, req.ReturnDate, "'待审批','已审批'", sysUser.AdminId, 0)
|
|
|
|
+ if err != nil {
|
|
|
|
+ this.FailWithMessage("时间冲突检测失败", "时间冲突检测失败-CheckBusinessApplyPeerDate!Err:"+err.Error())
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if peerCount > 0 {
|
|
|
|
+ this.FailWithMessage("所选日期您被设置为同行人,请重新选择!", "所选日期您被设置为同行人,请重新选择!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//校验同行人,出差日期冲突
|
|
//校验同行人,出差日期冲突
|
|
{
|
|
{
|
|
if req.PeerPeopleId != "" {
|
|
if req.PeerPeopleId != "" {
|