|
@@ -5,6 +5,8 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
@@ -17,12 +19,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
+import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.business.entity.*;
|
|
import org.jeecg.modules.business.entity.*;
|
|
|
import org.jeecg.modules.business.enums.AgreenmentAccountStatus;
|
|
import org.jeecg.modules.business.enums.AgreenmentAccountStatus;
|
|
|
import org.jeecg.modules.business.enums.AgreenmentCheckStatus;
|
|
import org.jeecg.modules.business.enums.AgreenmentCheckStatus;
|
|
|
import org.jeecg.modules.business.service.IBusMarketAgreementUnitService;
|
|
import org.jeecg.modules.business.service.IBusMarketAgreementUnitService;
|
|
|
import org.jeecg.modules.business.service.IBusHotelService;
|
|
import org.jeecg.modules.business.service.IBusHotelService;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
|
+import org.jeecg.modules.system.entity.SysDictItem;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
@@ -64,6 +68,13 @@ public class BusMarketAgreementUnitController extends JeecgController<BusMarketA
|
|
|
HttpServletRequest req) {
|
|
HttpServletRequest req) {
|
|
|
QueryWrapper<BusMarketAgreementUnit> queryWrapper = QueryGenerator.initQueryWrapper(busMarketAgreementUnit, req.getParameterMap());
|
|
QueryWrapper<BusMarketAgreementUnit> queryWrapper = QueryGenerator.initQueryWrapper(busMarketAgreementUnit, req.getParameterMap());
|
|
|
Page<BusMarketAgreementUnit> page = new Page<BusMarketAgreementUnit>(pageNo, pageSize);
|
|
Page<BusMarketAgreementUnit> page = new Page<BusMarketAgreementUnit>(pageNo, pageSize);
|
|
|
|
|
+ String keyWord = req.getParameter("keyWord");
|
|
|
|
|
+ if(oConvertUtils.isNotEmpty(keyWord)){
|
|
|
|
|
+ queryWrapper.and(i -> i.like("customer_name",keyWord)
|
|
|
|
|
+ .or().like("customer_no",keyWord)
|
|
|
|
|
+ .or().like("contacts_name",keyWord)
|
|
|
|
|
+ .or().like("phone",keyWord));
|
|
|
|
|
+ }
|
|
|
IPage<BusMarketAgreementUnit> pageList = busAgreementUnitService.page(page, queryWrapper);
|
|
IPage<BusMarketAgreementUnit> pageList = busAgreementUnitService.page(page, queryWrapper);
|
|
|
pageList.getRecords().forEach(item->{
|
|
pageList.getRecords().forEach(item->{
|
|
|
BusHotel hotle = busHotelService.getById(item.getHotelId());
|
|
BusHotel hotle = busHotelService.getById(item.getHotelId());
|
|
@@ -125,6 +136,18 @@ public class BusMarketAgreementUnitController extends JeecgController<BusMarketA
|
|
|
throw new JeecgBootException("当前登录人租户信息错误");
|
|
throw new JeecgBootException("当前登录人租户信息错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //客户编号校验
|
|
|
|
|
+ LambdaQueryWrapper<BusMarketAgreementUnit> queryWrapper = new LambdaQueryWrapper<BusMarketAgreementUnit>();
|
|
|
|
|
+ queryWrapper.eq(BusMarketAgreementUnit::getCustomerNo,busMarketAgreementUnit.getCustomerNo());
|
|
|
|
|
+ if (StringUtils.isNotBlank(busMarketAgreementUnit.getId())) {
|
|
|
|
|
+ // 编辑页面校验
|
|
|
|
|
+ queryWrapper.ne(BusMarketAgreementUnit::getId,busMarketAgreementUnit.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ long num = busAgreementUnitService.count(queryWrapper);
|
|
|
|
|
+ if (num != 0) {
|
|
|
|
|
+ // 该值不可用
|
|
|
|
|
+ return Result.error("客户编号已存在!");
|
|
|
|
|
+ }
|
|
|
BusMarketAgreementUnit editModel = busAgreementUnitService.getById(busMarketAgreementUnit.getId());
|
|
BusMarketAgreementUnit editModel = busAgreementUnitService.getById(busMarketAgreementUnit.getId());
|
|
|
editModel.setCustomerName(busMarketAgreementUnit.getCustomerName());
|
|
editModel.setCustomerName(busMarketAgreementUnit.getCustomerName());
|
|
|
editModel.setCustomerShortName(busMarketAgreementUnit.getCustomerShortName());
|
|
editModel.setCustomerShortName(busMarketAgreementUnit.getCustomerShortName());
|
|
@@ -168,6 +191,18 @@ public class BusMarketAgreementUnitController extends JeecgController<BusMarketA
|
|
|
throw new JeecgBootException("当前登录人租户信息错误");
|
|
throw new JeecgBootException("当前登录人租户信息错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //客户编号校验
|
|
|
|
|
+ LambdaQueryWrapper<BusMarketAgreementUnit> queryWrapper = new LambdaQueryWrapper<BusMarketAgreementUnit>();
|
|
|
|
|
+ queryWrapper.eq(BusMarketAgreementUnit::getCustomerNo,busMarketAgreementUnit.getCustomerNo());
|
|
|
|
|
+ if (StringUtils.isNotBlank(busMarketAgreementUnit.getId())) {
|
|
|
|
|
+ // 编辑页面校验
|
|
|
|
|
+ queryWrapper.ne(BusMarketAgreementUnit::getId,busMarketAgreementUnit.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ long num = busAgreementUnitService.count(queryWrapper);
|
|
|
|
|
+ if (num != 0) {
|
|
|
|
|
+ // 该值不可用
|
|
|
|
|
+ return Result.error("客户编号已存在!");
|
|
|
|
|
+ }
|
|
|
BusMarketAgreementUnit editModel = busAgreementUnitService.getById(busMarketAgreementUnit.getId());
|
|
BusMarketAgreementUnit editModel = busAgreementUnitService.getById(busMarketAgreementUnit.getId());
|
|
|
editModel.setBookkeeping(busMarketAgreementUnit.getBookkeeping());
|
|
editModel.setBookkeeping(busMarketAgreementUnit.getBookkeeping());
|
|
|
editModel.setRemarks(busMarketAgreementUnit.getRemarks());
|
|
editModel.setRemarks(busMarketAgreementUnit.getRemarks());
|