|
@@ -1,6 +1,8 @@
|
|
|
package org.jeecg.modules.business.controller;
|
|
package org.jeecg.modules.business.controller;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.sql.Time;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -8,6 +10,7 @@ import java.util.stream.Collectors;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
@@ -26,13 +29,15 @@ 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.modules.business.entity.BusMarketAgreementContacts;
|
|
|
|
|
-import org.jeecg.modules.business.entity.BusMarketAgreementCustomer;
|
|
|
|
|
-import org.jeecg.modules.business.entity.BusMarketAgreementUnit;
|
|
|
|
|
-import org.jeecg.modules.business.entity.BusOrderSound;
|
|
|
|
|
|
|
+import org.jeecg.modules.business.entity.*;
|
|
|
import org.jeecg.modules.business.enums.AgreementCommonEnum;
|
|
import org.jeecg.modules.business.enums.AgreementCommonEnum;
|
|
|
import org.jeecg.modules.business.enums.CommissionTypeEnum;
|
|
import org.jeecg.modules.business.enums.CommissionTypeEnum;
|
|
|
|
|
+import org.jeecg.modules.business.enums.CommissionUnitEnum;
|
|
|
|
|
+import org.jeecg.modules.business.service.IBusMarketAgreementCustomerHousePriceService;
|
|
|
import org.jeecg.modules.business.service.IBusMarketAgreementCustomerService;
|
|
import org.jeecg.modules.business.service.IBusMarketAgreementCustomerService;
|
|
|
|
|
+import org.jeecg.modules.business.vo.AgreementCustomerHousePriceVo;
|
|
|
|
|
+import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
|
|
|
+import org.jeecg.modules.rooms.mapper.CesRoomLayoutMapper;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -64,6 +69,11 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IBusMarketAgreementCustomerService busMarketAgreementCustomerService;
|
|
private IBusMarketAgreementCustomerService busMarketAgreementCustomerService;
|
|
|
|
|
|
|
|
|
|
+// @Autowired
|
|
|
|
|
+// private IBusMarketAgreementCustomerHousePriceService busMarketAgreementCustomerHousePriceService;
|
|
|
|
|
+//
|
|
|
|
|
+// @Resource
|
|
|
|
|
+// private CesRoomLayoutMapper cesRoomLayoutMapper;
|
|
|
/**
|
|
/**
|
|
|
* 分页列表查询
|
|
* 分页列表查询
|
|
|
*
|
|
*
|
|
@@ -106,7 +116,7 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
List<BusMarketAgreementCustomer> list = busMarketAgreementCustomerService.list(queryWrapper);
|
|
List<BusMarketAgreementCustomer> list = busMarketAgreementCustomerService.list(queryWrapper);
|
|
|
return Result.OK(list);
|
|
return Result.OK(list);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ String _tenantId = "";
|
|
|
/**
|
|
/**
|
|
|
* 添加
|
|
* 添加
|
|
|
*
|
|
*
|
|
@@ -119,8 +129,8 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
@PostMapping(value = "/add")
|
|
@PostMapping(value = "/add")
|
|
|
public Result<String> add(@RequestBody BusMarketAgreementCustomer busMarketAgreementCustomer) {
|
|
public Result<String> add(@RequestBody BusMarketAgreementCustomer busMarketAgreementCustomer) {
|
|
|
busMarketAgreementCustomer.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
busMarketAgreementCustomer.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
|
|
+ LoginUser user = TokenUtils.getAuthUser();
|
|
|
if(busMarketAgreementCustomer.getTenantId() == null || busMarketAgreementCustomer.getTenantId().equals("")){
|
|
if(busMarketAgreementCustomer.getTenantId() == null || busMarketAgreementCustomer.getTenantId().equals("")){
|
|
|
- LoginUser user = TokenUtils.getAuthUser();
|
|
|
|
|
if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
busMarketAgreementCustomer.setTenantId(user.getRelTenantIds());
|
|
busMarketAgreementCustomer.setTenantId(user.getRelTenantIds());
|
|
|
} else {
|
|
} else {
|
|
@@ -143,7 +153,36 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
busMarketAgreementCustomer.setCommission(AgreementCommonEnum.yes.getKey());
|
|
busMarketAgreementCustomer.setCommission(AgreementCommonEnum.yes.getKey());
|
|
|
busMarketAgreementCustomer.setFixedDiscount(AgreementCommonEnum.yes.getKey());
|
|
busMarketAgreementCustomer.setFixedDiscount(AgreementCommonEnum.yes.getKey());
|
|
|
busMarketAgreementCustomer.setDiscount(BigDecimal.valueOf(100));
|
|
busMarketAgreementCustomer.setDiscount(BigDecimal.valueOf(100));
|
|
|
- busMarketAgreementCustomerService.save(busMarketAgreementCustomer);
|
|
|
|
|
|
|
+ busMarketAgreementCustomerService.saveCustomer(busMarketAgreementCustomer,user.getRelTenantIds());
|
|
|
|
|
+
|
|
|
|
|
+// busMarketAgreementCustomerService.save(busMarketAgreementCustomer);
|
|
|
|
|
+// //客户协议添加完成后,处理关联的房价信息
|
|
|
|
|
+// // 获取到所有房型
|
|
|
|
|
+// List<CesRoomLayout> layoutList = cesRoomLayoutMapper.selectList(new QueryWrapper<CesRoomLayout>()
|
|
|
|
|
+// .eq(CesRoomLayout.HOTEL_ID, busMarketAgreementCustomer.getHotelId())
|
|
|
|
|
+// .eq(CesRoomLayout.INVALID,false));
|
|
|
|
|
+// List<BusMarketAgreementCustomerHousePrice> customerHousePriceList = new ArrayList<>();
|
|
|
|
|
+// if (layoutList != null && layoutList.size() >0) {
|
|
|
|
|
+// LoginUser user = TokenUtils.getAuthUser();
|
|
|
|
|
+// if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
|
|
+// _tenantId = user.getRelTenantIds();
|
|
|
|
|
+// }
|
|
|
|
|
+// layoutList.forEach(item -> {
|
|
|
|
|
+// BusMarketAgreementCustomerHousePrice customerHousePrice = new BusMarketAgreementCustomerHousePrice();
|
|
|
|
|
+// customerHousePrice.setCustomerId(busMarketAgreementCustomer.getId());
|
|
|
|
|
+// customerHousePrice.setLayoutId(item.getId());
|
|
|
|
|
+// customerHousePrice.setAgreementPrice(item.getMarketPrice());
|
|
|
|
|
+// customerHousePrice.setAgreementDiscount(BigDecimal.valueOf(100));
|
|
|
|
|
+// customerHousePrice.setAgreementDiscount(BigDecimal.valueOf(100));
|
|
|
|
|
+// customerHousePrice.setBreakfastNumber(0);
|
|
|
|
|
+// customerHousePrice.setMonthPrice(BigDecimal.valueOf(0));
|
|
|
|
|
+// customerHousePrice.setCommissionUnit(CommissionUnitEnum.yuan.getKey());
|
|
|
|
|
+// customerHousePrice.setDailyCommission(BigDecimal.valueOf(0));
|
|
|
|
|
+// customerHousePrice.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
|
|
+// customerHousePriceList.add(customerHousePrice);
|
|
|
|
|
+// });
|
|
|
|
|
+// busMarketAgreementCustomerHousePriceService.saveBatch(customerHousePriceList);
|
|
|
|
|
+// }
|
|
|
return Result.OK("添加成功!");
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -159,8 +198,8 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
public Result<String> edit(@RequestBody BusMarketAgreementCustomer busMarketAgreementCustomer) {
|
|
public Result<String> edit(@RequestBody BusMarketAgreementCustomer busMarketAgreementCustomer) {
|
|
|
// busMarketAgreementCustomerService.updateById(busMarketAgreementCustomer);
|
|
// busMarketAgreementCustomerService.updateById(busMarketAgreementCustomer);
|
|
|
|
|
+ LoginUser user = TokenUtils.getAuthUser();
|
|
|
if(busMarketAgreementCustomer.getTenantId() == null || busMarketAgreementCustomer.getTenantId().equals("")){
|
|
if(busMarketAgreementCustomer.getTenantId() == null || busMarketAgreementCustomer.getTenantId().equals("")){
|
|
|
- LoginUser user = TokenUtils.getAuthUser();
|
|
|
|
|
if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
busMarketAgreementCustomer.setTenantId(user.getRelTenantIds());
|
|
busMarketAgreementCustomer.setTenantId(user.getRelTenantIds());
|
|
|
} else {
|
|
} else {
|
|
@@ -194,6 +233,38 @@ public class BusMarketAgreementCustomerController extends JeecgController<BusMar
|
|
|
return Result.OK("编辑成功!");
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 编辑
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param agreementCustomerHousePriceVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @AutoLog(value = "客户协议房价-编辑")
|
|
|
|
|
+ @ApiOperation(value="客户协议房价-编辑", notes="客户协议房价-编辑")
|
|
|
|
|
+ @RequestMapping(value = "/editHousePrice", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
|
+ public Result<String> editHousePrice(@RequestBody AgreementCustomerHousePriceVo agreementCustomerHousePriceVo) {
|
|
|
|
|
+ LoginUser user = TokenUtils.getAuthUser();
|
|
|
|
|
+ BusMarketAgreementCustomer busMarketAgreementCustomer = agreementCustomerHousePriceVo.getAgreementCustomer();
|
|
|
|
|
+ if(busMarketAgreementCustomer.getTenantId() == null || busMarketAgreementCustomer.getTenantId().equals("")){
|
|
|
|
|
+ if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
|
|
+ busMarketAgreementCustomer.setTenantId(user.getRelTenantIds());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new JeecgBootException("当前登录人租户信息错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ BusMarketAgreementCustomer editModel = busMarketAgreementCustomerService.getById(busMarketAgreementCustomer.getId());
|
|
|
|
|
+ editModel.setRoomType(busMarketAgreementCustomer.getRoomType());
|
|
|
|
|
+ editModel.setCommissionUnit(busMarketAgreementCustomer.getCommissionUnit());
|
|
|
|
|
+ editModel.setDailyCommission(busMarketAgreementCustomer.getDailyCommission());
|
|
|
|
|
+ editModel.setCommission(busMarketAgreementCustomer.getCommission());
|
|
|
|
|
+ editModel.setFixedDiscount(busMarketAgreementCustomer.getFixedDiscount());
|
|
|
|
|
+ editModel.setDiscount(busMarketAgreementCustomer.getDiscount());
|
|
|
|
|
+ //协议房价信息处理
|
|
|
|
|
+ List<BusMarketAgreementCustomerHousePrice> customerHousePriceList = agreementCustomerHousePriceVo.getCustomerHousePriceList();
|
|
|
|
|
+ busMarketAgreementCustomerService.editCustomer(editModel,customerHousePriceList);
|
|
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 通过id删除
|
|
* 通过id删除
|
|
|
*
|
|
*
|