瀏覽代碼

房间设置-房价方案+营销-协议单位(部分完成)

WIN-B904R0U0NNS\Administrator 2 年之前
父節點
當前提交
e382feecd5
共有 17 個文件被更改,包括 1121 次插入39 次删除
  1. 5 1
      jeecg-module-system/jeecg-system-biz/pom.xml
  2. 1 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictItemController.java
  3. 244 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusMarketAgreementUnitController.java
  4. 27 30
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusMarketMemberController.java
  5. 21 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusSalesPersonController.java
  6. 205 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusMarketAgreementUnit.java
  7. 54 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/enums/AgreenmentAccountStatus.java
  8. 54 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/enums/AgreenmentCheckStatus.java
  9. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusMarketAgreementUnitMapper.java
  10. 8 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusMarketAgreementUnitMapper.xml
  11. 18 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusMarketAgreementUnitService.java
  12. 29 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusMarketMarketAgreementUnitServiceImpl.java
  13. 4 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/Vo/CesHousePriceSchemeVo.java
  14. 117 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/controller/CesHousePriceSchemeController.java
  15. 22 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/entity/CesHousePriceScheme.java
  16. 67 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/service/CesHousePriceSchemeServiceImpl.java
  17. 231 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/util/Pinyin4jUtil.java

+ 5 - 1
jeecg-module-system/jeecg-system-biz/pom.xml

@@ -48,7 +48,11 @@
 			<groupId>org.springframework.integration</groupId>
 			<artifactId>spring-integration-redis</artifactId>
 		</dependency>
-
+		<dependency>
+			<groupId>com.belerweb</groupId>
+			<artifactId>pinyin4j</artifactId>
+			<version>2.5.0</version>
+		</dependency>
 	</dependencies>
 
 </project>

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusDictItemController.java

@@ -274,6 +274,7 @@ public class BusDictItemController extends JeecgController<BusDictItem, IBusDict
 		 LambdaQueryWrapper<BusDictItem> queryWrapper = new LambdaQueryWrapper<BusDictItem>();
 		 queryWrapper.eq(BusDictItem::getItemValue,busDictItem.getItemValue());
 		 queryWrapper.eq(BusDictItem::getDictId,busDictItem.getDictId());
+		 queryWrapper.eq(BusDictItem::getHotelId,busDictItem.getHotelId());
 		 if (StringUtils.isNotBlank(busDictItem.getId())) {
 			 // 编辑页面校验
 			 queryWrapper.ne(BusDictItem::getId,busDictItem.getId());

+ 244 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusMarketAgreementUnitController.java

@@ -0,0 +1,244 @@
+package org.jeecg.modules.business.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TokenUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.business.entity.*;
+import org.jeecg.modules.business.enums.AgreenmentAccountStatus;
+import org.jeecg.modules.business.enums.AgreenmentCheckStatus;
+import org.jeecg.modules.business.service.IBusMarketAgreementUnitService;
+import org.jeecg.modules.business.service.IBusHotelService;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+/**
+ * @Description: 协议单位
+ * @Author: jeecg-boot
+ * @Date:   2023-03-25
+ * @Version: V1.0
+ */
+@Api(tags="协议单位")
+@RestController
+@RequestMapping("/business/busMarketAgreementUnit")
+@Slf4j
+public class BusMarketAgreementUnitController extends JeecgController<BusMarketAgreementUnit, IBusMarketAgreementUnitService> {
+	@Autowired
+	private IBusMarketAgreementUnitService busAgreementUnitService;
+
+	 @Autowired
+	 private IBusHotelService busHotelService;
+	/**
+	 * 分页列表查询
+	 *
+	 * @param busMarketAgreementUnit
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "协议单位-分页列表查询")
+	@ApiOperation(value="协议单位-分页列表查询", notes="协议单位-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BusMarketAgreementUnit>> queryPageList(BusMarketAgreementUnit busMarketAgreementUnit,
+															   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+															   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+															   HttpServletRequest req) {
+		QueryWrapper<BusMarketAgreementUnit> queryWrapper = QueryGenerator.initQueryWrapper(busMarketAgreementUnit, req.getParameterMap());
+		Page<BusMarketAgreementUnit> page = new Page<BusMarketAgreementUnit>(pageNo, pageSize);
+		IPage<BusMarketAgreementUnit> pageList = busAgreementUnitService.page(page, queryWrapper);
+		pageList.getRecords().forEach(item->{
+			BusHotel hotle = busHotelService.getById(item.getHotelId());
+			if (hotle != null) {
+				item.setHotelName(hotle.getName());
+			}
+		});
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param busMarketAgreementUnit
+	 * @return
+	 */
+	@AutoLog(value = "协议单位-添加")
+	@ApiOperation(value="协议单位-添加", notes="协议单位-添加")
+	//@RequiresPermissions("business:bus_agreement_unit_info:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody BusMarketAgreementUnit busMarketAgreementUnit) {
+		busMarketAgreementUnit.setDelFlag(CommonConstant.DEL_FLAG_0);
+		busMarketAgreementUnit.setAccountStatus(AgreenmentAccountStatus.normal.getKey());
+		busMarketAgreementUnit.setCheckStatus(AgreenmentCheckStatus.unaudited.getKey());
+		if (busMarketAgreementUnit.getTenantId() == null || busMarketAgreementUnit.getTenantId().equals("")) {
+			LoginUser user = TokenUtils.getAuthUser();
+			if (user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")) {
+				busMarketAgreementUnit.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		//获取当前最大账号
+		String _maxAccount = busAgreementUnitService.getMaxAccount();
+		Integer _num = Integer.parseInt(_maxAccount.split("A")[1]) + 1;
+		String _account = "A" + String.format( "%05d", _num);
+		busMarketAgreementUnit.setAccountNo(_account);
+		busAgreementUnitService.save(busMarketAgreementUnit);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param busMarketAgreementUnit
+	 * @return
+	 */
+	@AutoLog(value = "协议单位-编辑")
+	@ApiOperation(value="协议单位-编辑", notes="协议单位-编辑")
+	//@RequiresPermissions("business:bus_agreement_unit_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody BusMarketAgreementUnit busMarketAgreementUnit) {
+//		busAgreementUnitService.updateById(busAgreementUnit);
+		if(busMarketAgreementUnit.getTenantId() == null || busMarketAgreementUnit.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busMarketAgreementUnit.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		BusMarketAgreementUnit editModel = busAgreementUnitService.getById(busMarketAgreementUnit.getId());
+		editModel.setCustomerName(busMarketAgreementUnit.getCustomerName());
+		editModel.setCustomerShortName(busMarketAgreementUnit.getCustomerShortName());
+		editModel.setSystemType(busMarketAgreementUnit.getSystemType());
+		editModel.setCustomerNo(busMarketAgreementUnit.getCustomerNo());
+		editModel.setContactsName(busMarketAgreementUnit.getContactsName());
+		editModel.setCustomerType(busMarketAgreementUnit.getCustomerType());
+		editModel.setSellerId(busMarketAgreementUnit.getSellerId());
+		editModel.setPhone(busMarketAgreementUnit.getPhone());
+		editModel.setStatus(busMarketAgreementUnit.getStatus());
+		editModel.setRegion(busMarketAgreementUnit.getRegion());
+		editModel.setPostalCode(busMarketAgreementUnit.getPostalCode());
+		editModel.setAddress(busMarketAgreementUnit.getAddress());
+		editModel.setCompanyPhone(busMarketAgreementUnit.getCompanyPhone());
+		editModel.setFax(busMarketAgreementUnit.getFax());
+		editModel.setCustomerSource(busMarketAgreementUnit.getCustomerSource());
+		editModel.setHomepage(busMarketAgreementUnit.getHomepage());
+		editModel.setEmail(busMarketAgreementUnit.getEmail());
+		editModel.setCustomerIndustry(busMarketAgreementUnit.getCustomerIndustry());
+		busAgreementUnitService.updateById(editModel);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "协议单位-通过id删除")
+	@ApiOperation(value="协议单位-通过id删除", notes="协议单位-通过id删除")
+	//@RequiresPermissions("business:bus_agreement_unit_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		busAgreementUnitService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "协议单位-批量删除")
+	@ApiOperation(value="协议单位-批量删除", notes="协议单位-批量删除")
+	//@RequiresPermissions("business:bus_agreement_unit_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.busAgreementUnitService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "协议单位-通过id查询")
+	@ApiOperation(value="协议单位-通过id查询", notes="协议单位-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BusMarketAgreementUnit> queryById(@RequestParam(name="id",required=true) String id) {
+		BusMarketAgreementUnit busMarketAgreementUnit = busAgreementUnitService.getById(id);
+		if(busMarketAgreementUnit ==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(busMarketAgreementUnit);
+	}
+
+	 /**
+	  * 列表查询
+	  *
+	  * @param busMarketAgreementUnit
+	  * @param req
+	  * @return
+	  */
+	 //@AutoLog(value = "协议单位-列表查询")
+	 @ApiOperation(value="协议单位-列表查询", notes="协议单位-列表查询")
+	 @GetMapping(value = "/queryList")
+	 public Result<List<BusMarketAgreementUnit>> queryList(BusMarketAgreementUnit busMarketAgreementUnit, HttpServletRequest req) {
+		 QueryWrapper<BusMarketAgreementUnit> queryWrapper = QueryGenerator.initQueryWrapper(busMarketAgreementUnit, req.getParameterMap());
+		 LoginUser user = TokenUtils.getAuthUser();
+		 if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+			 queryWrapper.eq("tenant_id",user.getRelTenantIds());
+		 }
+		 queryWrapper.eq("del_flag",0);
+		 List<BusMarketAgreementUnit> list = busAgreementUnitService.list(queryWrapper);
+		 return Result.OK(list);
+	 }
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param busMarketAgreementUnit
+    */
+    //@RequiresPermissions("business:bus_agreement_unit_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BusMarketAgreementUnit busMarketAgreementUnit) {
+        return super.exportXls(request, busMarketAgreementUnit, BusMarketAgreementUnit.class, "协议单位");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("business:bus_agreement_unit_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BusMarketAgreementUnit.class);
+    }
+
+}

+ 27 - 30
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusMarketMemberController.java

@@ -1,28 +1,17 @@
 package org.jeecg.modules.business.controller;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 
-import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.TokenUtils;
-import org.jeecg.common.util.dynamic.db.DataSourceCachePool;
-import org.jeecg.common.util.oConvertUtils;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -33,28 +22,15 @@ import org.jeecg.modules.business.entity.BusHotel;
 import org.jeecg.modules.business.entity.BusMarketMember;
 import org.jeecg.modules.business.service.IBusHotelService;
 import org.jeecg.modules.business.service.IBusMarketMemberService;
-import org.jeecg.modules.rooms.Vo.SelectVo;
-import org.jeecg.modules.rooms.entity.CesRoomPricePlan;
-import org.jeecg.modules.system.entity.SysDataSource;
-import org.jeecg.modules.system.entity.SysUser;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 
- /**
+/**
  * @Description: bus_market_member_info
  * @Author: jeecg-boot
  * @Date:   2023-03-02
@@ -69,7 +45,7 @@ public class BusMarketMemberController extends JeecgController<BusMarketMember,
 	private IBusMarketMemberService busMarketMemberService;
 	 @Autowired
 private IBusHotelService busHotelService;
-	
+
 	/**
 	 * 分页列表查询
 	 *
@@ -133,7 +109,7 @@ private IBusHotelService busHotelService;
 		busMarketMemberService.save(busMarketMember);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -155,7 +131,7 @@ private IBusHotelService busHotelService;
 		busMarketMemberService.updateById(busMarketMember);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -170,7 +146,7 @@ private IBusHotelService busHotelService;
 		busMarketMemberService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -185,7 +161,7 @@ private IBusHotelService busHotelService;
 		this.busMarketMemberService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *
@@ -203,6 +179,27 @@ private IBusHotelService busHotelService;
 		return Result.OK(busMarketMember);
 	}
 
+	 /**
+	  * 列表查询
+	  *
+	  * @param busMarketMember
+	  * @param req
+	  * @return
+	  */
+	 //@AutoLog(value = "会员信息-列表查询")
+	 @ApiOperation(value="会员信息-列表查询", notes="会员信息-列表查询")
+	 @GetMapping(value = "/queryList")
+	 public Result<List<BusMarketMember>> queryList(BusMarketMember busMarketMember, HttpServletRequest req) {
+		 QueryWrapper<BusMarketMember> queryWrapper = QueryGenerator.initQueryWrapper(busMarketMember, req.getParameterMap());
+		 LoginUser user = TokenUtils.getAuthUser();
+		 if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+			 queryWrapper.eq("tenant_id",user.getRelTenantIds());
+		 }
+//		 queryWrapper.eq("del_flag",0);
+		 List<BusMarketMember> list = busMarketMemberService.list(queryWrapper);
+		 return Result.OK(list);
+	 }
+
     /**
     * 导出excel
     *

+ 21 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusSalesPersonController.java

@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.modules.business.entity.BusRoomPayType;
 import org.jeecg.modules.business.entity.BusSalesPerson;
 import org.jeecg.modules.business.entity.BusSalesPersonPost;
 import org.jeecg.modules.business.entity.BusWaiter;
@@ -286,5 +287,24 @@ public class BusSalesPersonController extends JeecgController<BusSalesPerson, IB
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, BusSalesPerson.class);
     }
-
+	 /**
+	  * 列表查询
+	  *
+	  * @param busRoomPayType
+	  * @param req
+	  * @return
+	  */
+	 //@AutoLog(value = "营销人员管理-列表查询")
+	 @ApiOperation(value="营销人员管理-列表查询", notes="营销人员管理-列表查询")
+	 @GetMapping(value = "/queryList")
+	 public Result<List<BusSalesPerson>> queryList(BusSalesPerson busRoomPayType, HttpServletRequest req) {
+		 QueryWrapper<BusSalesPerson> queryWrapper = QueryGenerator.initQueryWrapper(busRoomPayType, req.getParameterMap());
+		 LoginUser user = TokenUtils.getAuthUser();
+		 if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+			 queryWrapper.eq("tenant_id",user.getRelTenantIds());
+		 }
+		 queryWrapper.eq("del_flag",0);
+		 List<BusSalesPerson> list = busSalesPersonService.list(queryWrapper);
+		 return Result.OK(list);
+	 }
 }

+ 205 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusMarketAgreementUnit.java

@@ -0,0 +1,205 @@
+package org.jeecg.modules.business.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 协议单位
+ * @Author: jeecg-boot
+ * @Date:   2023-03-25
+ * @Version: V1.0
+ */
+@Data
+@TableName("bus_market_agreement_unit_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="bus_market_agreement_unit_info对象", description="协议单位")
+public class BusMarketAgreementUnit implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    @Dict(dictTable = "bus_hotel_info", dicCode = "id", dicText = "name")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+    /**酒店名称*/
+    private transient String hotelName;
+
+    /**客户全称*/
+    @Excel(name = "客户全称", width = 15)
+    @ApiModelProperty(value = "客户全称")
+    private String customerName;
+	/**客户简称*/
+	@Excel(name = "客户简称", width = 15)
+    @ApiModelProperty(value = "客户简称")
+    private String customerShortName;
+	/**客户编号*/
+	@Excel(name = "客户编号", width = 15)
+    @ApiModelProperty(value = "客户编号")
+    private String customerNo;
+	/**联系人*/
+	@Excel(name = "联系人", width = 15)
+    @ApiModelProperty(value = "联系人")
+    private String contactsName;
+	/**系统类型*/
+	@Excel(name = "系统类型", width = 15)
+    @ApiModelProperty(value = "系统类型")
+    @Dict(dictTable = "bus_dict_item_info", dicCode = "id", dicText = "item_text")
+    private String systemType;
+	/**客户类型*/
+	@Excel(name = "客户类型", width = 15)
+    @ApiModelProperty(value = "客户类型")
+    @Dict(dictTable = "bus_dict_item_info", dicCode = "id", dicText = "item_text")
+    private String customerType;
+	/**销售人员*/
+	@Excel(name = "销售人员", width = 15)
+    @ApiModelProperty(value = "销售人员")
+    @Dict(dictTable = "bus_sales_person_info", dicCode = "id", dicText = "name")
+    private String sellerId;
+	/**手机号*/
+	@Excel(name = "手机号", width = 15)
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+	/**客户状态*/
+	@Excel(name = "客户状态", width = 15)
+    @ApiModelProperty(value = "客户状态")
+    @Dict(dictTable = "bus_dict_item_info", dicCode = "id", dicText = "item_text")
+    private String status;
+	/**地区*/
+	@Excel(name = "地区", width = 15)
+    @ApiModelProperty(value = "地区")
+    private String region;
+	/**邮编*/
+	@Excel(name = "邮编", width = 15)
+    @ApiModelProperty(value = "邮编")
+    private String postalCode;
+	/**地址*/
+	@Excel(name = "地址", width = 15)
+    @ApiModelProperty(value = "地址")
+    private String address;
+	/**公司电话*/
+	@Excel(name = "公司电话", width = 15)
+    @ApiModelProperty(value = "公司电话")
+    private String companyPhone;
+	/**传真*/
+	@Excel(name = "传真", width = 15)
+    @ApiModelProperty(value = "传真")
+    private String fax;
+	/**客户来源*/
+	@Excel(name = "客户来源", width = 15)
+    @ApiModelProperty(value = "客户来源")
+    @Dict(dictTable = "bus_dict_item_info", dicCode = "id", dicText = "item_text")
+    private String customerSource;
+	/**主页*/
+	@Excel(name = "主页", width = 15)
+    @ApiModelProperty(value = "主页")
+    private String homepage;
+	/**邮箱*/
+	@Excel(name = "邮箱", width = 15)
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+	/**客户行业*/
+	@Excel(name = "客户行业", width = 15)
+    @ApiModelProperty(value = "客户行业")
+    private String customerIndustry;
+	/**审核状态*/
+	@Excel(name = "审核状态", width = 15)
+    @ApiModelProperty(value = "审核状态")
+    @Dict(dicCode = "agreement_check_status")
+    private Integer checkStatus;
+	/**审核时间*/
+	@Excel(name = "审核时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "审核时间")
+    private Date checkTime;
+	/**审核人*/
+	@Excel(name = "审核人", width = 15)
+    @ApiModelProperty(value = "审核人")
+    private String checkBy;
+	/**审核备注*/
+	@Excel(name = "审核备注", width = 15)
+    @ApiModelProperty(value = "审核备注")
+    private String checkRemarks;
+	/**账户编号*/
+	@Excel(name = "账户编号", width = 15)
+    @ApiModelProperty(value = "账户编号")
+    private String accountNo;
+	/**账户状态*/
+	@Excel(name = "账户状态", width = 15)
+    @ApiModelProperty(value = "账户状态")
+    @Dict(dicCode = "agreement_status")
+    private Integer accountStatus;
+	/**已用额度*/
+	@Excel(name = "已用额度", width = 15)
+    @ApiModelProperty(value = "已用额度")
+    private BigDecimal amountUsed;
+	/**余额*/
+	@Excel(name = "余额", width = 15)
+    @ApiModelProperty(value = "余额")
+    private BigDecimal balance;
+	/**记账限额*/
+	@Excel(name = "记账限额", width = 15)
+    @ApiModelProperty(value = "记账限额")
+    private BigDecimal bookkeeping;
+	/**不允许该单位记账*/
+	@Excel(name = "不允许该单位记账", width = 15)
+    @ApiModelProperty(value = "不允许该单位记账")
+    private Integer bookkStatus;
+	/**前台是否查询*/
+	@Excel(name = "前台是否查询", width = 15)
+    @ApiModelProperty(value = "前台是否查询")
+    private Integer commission;
+	/**是否返佣*/
+	@Excel(name = "是否返佣", width = 15)
+    @ApiModelProperty(value = "是否返佣")
+    private Integer reception;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+    @TableLogic
+    private Integer delFlag;
+	/**createBy*/
+    @ApiModelProperty(value = "createBy")
+    private String createBy;
+	/**createTime*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+	/**updateBy*/
+    @ApiModelProperty(value = "updateBy")
+    private String updateBy;
+	/**updateTime*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 54 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/enums/AgreenmentAccountStatus.java

@@ -0,0 +1,54 @@
+package org.jeecg.modules.business.enums;
+
+import org.jeecg.common.system.annotation.EnumDict;
+import org.jeecg.common.system.vo.DictModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@EnumDict("AgreenmentAccountStatus")
+public enum AgreenmentAccountStatus {
+    normal(0, "正常"),
+    stop(1, "停用"),;
+
+    Integer key;
+
+    String title;
+
+    AgreenmentAccountStatus(Integer key, String title){
+        this.key = key;
+        this.title = title;
+    }
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 获取字典数据
+     * @return
+     */
+    public static List<DictModel> getDictList(){
+        List<DictModel> list = new ArrayList<>();
+        DictModel dictModel = null;
+        for(AgreenmentAccountStatus e: AgreenmentAccountStatus.values()){
+            dictModel = new DictModel();
+            dictModel.setValue(e.key.toString());
+            dictModel.setText(e.title);
+            list.add(dictModel);
+        }
+        return list;
+    }
+
+    public static AgreenmentAccountStatus val(Integer key){
+        for(AgreenmentAccountStatus bld: values()){
+            if(bld.key == key){
+                return bld;
+            }
+        }
+        return null;
+    }
+}

+ 54 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/enums/AgreenmentCheckStatus.java

@@ -0,0 +1,54 @@
+package org.jeecg.modules.business.enums;
+
+import org.jeecg.common.system.annotation.EnumDict;
+import org.jeecg.common.system.vo.DictModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@EnumDict("AgreenmentCheckStatus")
+public enum AgreenmentCheckStatus {
+    unaudited(0, "未审核"),
+    approved(1, "审核"),;
+
+    Integer key;
+
+    String title;
+
+    AgreenmentCheckStatus(Integer key, String title){
+        this.key = key;
+        this.title = title;
+    }
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 获取字典数据
+     * @return
+     */
+    public static List<DictModel> getDictList(){
+        List<DictModel> list = new ArrayList<>();
+        DictModel dictModel = null;
+        for(AgreenmentCheckStatus e: AgreenmentCheckStatus.values()){
+            dictModel = new DictModel();
+            dictModel.setValue(e.key.toString());
+            dictModel.setText(e.title);
+            list.add(dictModel);
+        }
+        return list;
+    }
+
+    public static AgreenmentCheckStatus val(Integer key){
+        for(AgreenmentCheckStatus bld: values()){
+            if(bld.key == key){
+                return bld;
+            }
+        }
+        return null;
+    }
+}

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusMarketAgreementUnitMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusMarketAgreementUnit;
+
+/**
+ * @Description: 协议单位
+ * @Author: jeecg-boot
+ * @Date:   2023-03-25
+ * @Version: V1.0
+ */
+public interface BusMarketAgreementUnitMapper extends BaseMapper<BusMarketAgreementUnit> {
+    public String queryMaxAccount();
+}

+ 8 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusMarketAgreementUnitMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.business.mapper.BusMarketAgreementUnitMapper">
+    <!-- 获取最大账号 -->
+    <select id="queryMaxAccount" resultType="String">
+		SELECT IFNULL(MAX(account_no),'A0000') FROM bus_market_agreement_unit_info
+	</select>
+</mapper>

+ 18 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusMarketAgreementUnitService.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.entity.BusMarketAgreementUnit;
+
+/**
+ * @Description: 协议单位
+ * @Author: jeecg-boot
+ * @Date:   2023-03-25
+ * @Version: V1.0
+ */
+public interface IBusMarketAgreementUnitService extends IService<BusMarketAgreementUnit> {
+    /**
+     * 添加数据日志
+     */
+    public String getMaxAccount();
+
+}

+ 29 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusMarketMarketAgreementUnitServiceImpl.java

@@ -0,0 +1,29 @@
+package org.jeecg.modules.business.service.impl;
+
+import org.jeecg.modules.business.entity.BusMarketAgreementUnit;
+import org.jeecg.modules.business.mapper.BusMarketAgreementUnitMapper;
+import org.jeecg.modules.business.service.IBusMarketAgreementUnitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 协议单位
+ * @Author: jeecg-boot
+ * @Date:   2023-03-25
+ * @Version: V1.0
+ */
+@Service
+public class BusMarketMarketAgreementUnitServiceImpl extends ServiceImpl<BusMarketAgreementUnitMapper, BusMarketAgreementUnit> implements IBusMarketAgreementUnitService {
+    @Autowired
+    BusMarketAgreementUnitMapper busMarketAgreementUnitMapper;
+    /**
+     * 获取最大账号
+     */
+    @Override
+    public String getMaxAccount() {
+        String maxAccount = busMarketAgreementUnitMapper.queryMaxAccount();
+        return  maxAccount;
+    }
+}

+ 4 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/Vo/CesHousePriceSchemeVo.java

@@ -14,5 +14,9 @@ import org.jeecg.modules.rooms.entity.CesHousePriceScheme;
  */
 @Data
 public class CesHousePriceSchemeVo extends CesHousePriceScheme {
+    private String guestTypeName;
 
+    private String checkInTimeText;
+
+    private String validTimeText;
 }

+ 117 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/controller/CesHousePriceSchemeController.java

@@ -9,15 +9,21 @@ import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.Enum.ResultCode;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.business.enums.CustomerTypeEnum;
 import org.jeecg.modules.rooms.DTO.CesHourRoomRuleModifyDto;
 import org.jeecg.modules.rooms.DTO.CesHousePriceSchemeDto;
 import org.jeecg.modules.rooms.DTO.CesHousePriceSchemeSearchDto;
+import org.jeecg.modules.rooms.DTO.CesRoomLayoutDto;
 import org.jeecg.modules.rooms.entity.CesHousePriceScheme;
 import org.jeecg.modules.rooms.service.CesHousePriceSchemeServiceImpl;
+import org.jeecg.modules.rooms.util.Pinyin4jUtil;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -45,7 +51,7 @@ public class CesHousePriceSchemeController extends JeecgController<CesHousePrice
         if (ObjectUtils.isEmpty(dto)){
             return Result.error(ResultCode.PARAM_MISS);
         }
-        if (0>=dto.getPageNo()){
+        if (0>dto.getPageNo()){
             return Result.error("页数不能小于等于0");
         }
         if (0>=dto.getPageSize()){
@@ -71,9 +77,75 @@ public class CesHousePriceSchemeController extends JeecgController<CesHousePrice
         if (StringUtils.isBlank(dto.getPriceScheme())){
             return Result.error(ResultCode.PARAM_MISS);
         }
-        if (StringUtils.isBlank(dto.getSimpleCode())){
+        String _code = Pinyin4jUtil.toPinYinLowercase(dto.getPriceScheme());
+        dto.setSimpleCode(_code);
+//        if (StringUtils.isBlank(dto.getSimpleCode())){
+//            return Result.error(ResultCode.PARAM_MISS);
+//        }
+        if (StringUtils.isBlank(dto.getNumber())){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if (null==dto.getGuestSource()){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if (null==dto.getGuestType()){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if (null==dto.getCheckInTime()){
+            return Result.error(ResultCode.PARAM_MISS);
+        }else{
+            if (1==dto.getCheckInTime().intValue()){
+                //如果入住时间为时间段,就要判断时间的非空
+                if (null==dto.getStartTime()){ return Result.error(ResultCode.PARAM_MISS); }
+                if (null==dto.getEndTime()){ return Result.error(ResultCode.PARAM_MISS); }
+            }
+        }
+        if (null==dto.getValidTime()){
+            return Result.error(ResultCode.PARAM_MISS);
+        }else{
+            if (1==dto.getValidTime().intValue()){
+                //如果有效期为时间段,就要判断时间的非空
+                if (null==dto.getValidStartTime()){ return Result.error(ResultCode.PARAM_MISS); }
+                if (null==dto.getValidEndTime()){ return Result.error(ResultCode.PARAM_MISS); }
+            }
+        }
+        if (null==dto.getOpen()||(0!=dto.getOpen().intValue()&&1!=dto.getOpen().intValue())){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if (null==dto.getSort()||1>dto.getSort().intValue()){
+            return Result.error("排序不能为空且不能小于1!");
+        }
+        if(CustomerTypeEnum.val(dto.getGuestType()) == null){
+            throw new JeecgBootException("客人类型不正确");
+        }
+        try{
+            return cesHousePriceSchemeService.create(dto);
+        }catch (Exception e){
+            return Result.error(e.getMessage());
+        }
+    }
+
+    @AutoLog(value = "修改房价方案")
+    @ApiOperation(value="修改房价方案", notes="修改房价方案")
+    @PutMapping(value = "/modify")
+    public Result modify(@RequestBody CesHousePriceSchemeDto dto){
+        if (ObjectUtils.isEmpty(dto)){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if(StringUtils.isBlank(dto.getId())){
             return Result.error(ResultCode.PARAM_MISS);
         }
+        if(StringUtils.isBlank(dto.getHotelId())){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if (StringUtils.isBlank(dto.getPriceScheme())){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        String _code = Pinyin4jUtil.toPinYinLowercase(dto.getPriceScheme());
+        dto.setSimpleCode(_code);
+//        if (StringUtils.isBlank(dto.getSimpleCode())){
+//            return Result.error(ResultCode.PARAM_MISS);
+//        }
         if (StringUtils.isBlank(dto.getNumber())){
             return Result.error(ResultCode.PARAM_MISS);
         }
@@ -107,8 +179,31 @@ public class CesHousePriceSchemeController extends JeecgController<CesHousePrice
         if (null==dto.getSort()||1>dto.getSort().intValue()){
             return Result.error("排序不能为空且不能小于1!");
         }
+        if(CustomerTypeEnum.val(dto.getGuestType()) == null){
+            throw new JeecgBootException("客人类型不正确");
+        }
         try{
-            return cesHousePriceSchemeService.create(dto);
+            return  cesHousePriceSchemeService.modify(dto);
+        }catch (Exception e){
+            return Result.error(e.getMessage());
+        }
+    }
+
+    @AutoLog(value = "修改上架状态")
+    @ApiOperation(value="修改上架状态", notes="修改上架状态")
+    @PutMapping(value = "/modifyOpen/{id}")
+    public Result modifyOpen(@PathVariable String id, @RequestParam String hotelId, @RequestParam Integer open){
+        if(StringUtils.isBlank(id)){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if(StringUtils.isBlank(hotelId)){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        if(open < 0){
+            return Result.error(ResultCode.PARAM_MISS);
+        }
+        try{
+            return  cesHousePriceSchemeService.modifyOpen(id,hotelId, open);
         }catch (Exception e){
             return Result.error(e.getMessage());
         }
@@ -143,5 +238,24 @@ public class CesHousePriceSchemeController extends JeecgController<CesHousePrice
         }
     }
 
+    /**
+     *  批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "房价方案-批量删除")
+    @ApiOperation(value="房价方案-批量删除", notes="房价方案-批量删除")
+    //@RequiresPermissions("business:bus_advert_info:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+        try{
+            List<String> _ids = Stream.of(ids.split(",")).collect(Collectors.toList());
+            return  cesHousePriceSchemeService.batchDelete(_ids);
+        }catch (Exception e){
+            return Result.error(e.getMessage());
+        }
+    }
+
 }
 

+ 22 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/entity/CesHousePriceScheme.java

@@ -51,7 +51,7 @@ public class CesHousePriceScheme extends Model<CesHousePriceScheme> {
     /**
      * 客人来源
      */
-    private Integer guestSource;
+    private String guestSource;
 
     /**
      * 客人类型
@@ -59,6 +59,21 @@ public class CesHousePriceScheme extends Model<CesHousePriceScheme> {
     private Integer guestType;
 
     /**
+     * 关联会员
+     */
+    private String martketMemberId;
+
+    /**
+     * 关联协议单位
+     */
+    private String agreementUnitId;
+
+    /**
+     * 联系人
+     */
+    private String mediation;
+
+    /**
      * 入住时间(0代表无限制,1代表时间段)
      */
     private Integer checkInTime;
@@ -140,6 +155,12 @@ public class CesHousePriceScheme extends Model<CesHousePriceScheme> {
 
     public static final String GUEST_TYPE = "guest_type";
 
+    public static final String MARTKET_MEMBER_ID = "martket_member_id";
+
+    public static final String AGREEMENT_UNIT_ID = "agreement_unit_id";
+
+    public static final String MEDIATION = "mediation";
+
     public static final String CHECK_IN_TIME = "check_in_time";
 
     public static final String START_TIME = "start_time";

+ 67 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/service/CesHousePriceSchemeServiceImpl.java

@@ -13,19 +13,28 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.CommonUtils;
+import org.jeecg.common.util.TokenUtils;
+import org.jeecg.modules.business.enums.CustomerTypeEnum;
 import org.jeecg.modules.rooms.DTO.CesHousePriceSchemeDto;
 import org.jeecg.modules.rooms.DTO.CesHousePriceSchemeSearchDto;
+import org.jeecg.modules.rooms.DTO.CesRoomLayoutDto;
 import org.jeecg.modules.rooms.Vo.CesHousePriceSchemeVo;
 import org.jeecg.modules.rooms.entity.CesHourRoomRule;
 import org.jeecg.modules.rooms.entity.CesHousePriceScheme;
+import org.jeecg.modules.rooms.entity.CesRoomLayout;
+import org.jeecg.modules.rooms.entity.CesStockType;
 import org.jeecg.modules.rooms.mapper.CesHousePriceSchemeMapper;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -50,20 +59,34 @@ public class CesHousePriceSchemeServiceImpl extends ServiceImpl<CesHousePriceSch
             queryWrapper.and(wrapper->wrapper
                     .like(CesHousePriceScheme.SIMPLE_CODE, CommonUtils.escapeChar(dto.getParamName()))
                     .or()
-                    .like(CesHousePriceScheme.NUMBER, CommonUtils.escapeChar(dto.getParamName()))
-                    .or()
                     .like(CesHousePriceScheme.PRICE_SCHEME, CommonUtils.escapeChar(dto.getParamName()))
                     .or()
-                    .like(CesHousePriceScheme.GUEST_TYPE,CommonUtils.escapeChar(dto.getParamName())));
+                    .like(CesHousePriceScheme.NUMBER, CommonUtils.escapeChar(dto.getParamName())));
         }
         queryWrapper.eq(CesHousePriceScheme.INVALID,false);
         queryWrapper.orderByAsc(CesHousePriceScheme.SORT);
         IPage<CesHousePriceScheme> dataPage = cesHousePriceSchemeMapper.selectPage(new Page<>(dto.getPageNo().intValue(),dto.getPageSize().intValue()),queryWrapper);
         List<CesHousePriceScheme> records = dataPage.getRecords();
         List<CesHousePriceSchemeVo> vos = new ArrayList<>();
+
         records.forEach(v->{
             CesHousePriceSchemeVo vo = new CesHousePriceSchemeVo();
             BeanUtil.copyProperties(v, vo);
+
+            vo.setGuestTypeName(CustomerTypeEnum.val(vo.getGuestType()).getTitle());
+
+            DateFormat startDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+            String _checkText = vo.getCheckInTime() == 0?"无限制":(vo.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))+" - "
+                    +vo.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+            vo.setCheckInTimeText(_checkText);
+            String _validText = vo.getValidTime() == 0?"无限制":(vo.getValidStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))+" - "
+                    +vo.getValidEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+            vo.setValidTimeText(_validText);
+
+//            vo.setCheckInTimeText(vo.getStartTime()+" - "+vo.getEndTime());
+//            vo.setValidTimeText(vo.getValidStartTime()+" - "+vo.getValidEndTime());
+
             vos.add(vo);
         });
         Map<String,Object> map = new HashedMap();
@@ -81,6 +104,47 @@ public class CesHousePriceSchemeServiceImpl extends ServiceImpl<CesHousePriceSch
         cesHousePriceSchemeMapper.insert(cesHousePriceScheme);
         return Result.ok("创建成功!");
     }
+    /**
+     * 修改
+     * @param dto
+     * @return
+     */
+    public Result  modify(CesHousePriceSchemeDto dto){
+        //查询是否有相同名称的房型
+        QueryWrapper<CesHousePriceScheme> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(CesHousePriceScheme.HOTEL_ID, dto.getHotelId());
+        queryWrapper.eq(CesHousePriceScheme.ID,dto.getId());
+        queryWrapper.eq(CesHousePriceScheme.INVALID, false);
+        CesHousePriceScheme model = cesHousePriceSchemeMapper.selectOne(queryWrapper);
+        if(ObjectUtils.isEmpty(model)) return Result.error("房价方案数据未找到!");
+
+        //忽略空值 不然会覆盖
+        BeanUtil.copyProperties(dto,model, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
+        model.setUpdateAt(LocalDateTime.now());
+        cesHousePriceSchemeMapper.updateById(model);
+        return Result.ok("修改成功!");
+    }
+
+    /**
+     * 修改状态
+     * @param id
+     * @param hotelId
+     * @param open
+     * @return
+     */
+    public Result modifyOpen(String id,String hotelId, Integer open){
+        QueryWrapper<CesHousePriceScheme> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(CesHousePriceScheme.HOTEL_ID, hotelId);
+        queryWrapper.eq(CesHousePriceScheme.ID,id);
+        queryWrapper.eq(CesHousePriceScheme.INVALID, false);
+        CesHousePriceScheme model = cesHousePriceSchemeMapper.selectOne(queryWrapper);
+        if(ObjectUtils.isEmpty(model)) return Result.error("房价方案数据未找到!");
+
+        model.setOpen(open);
+        model.setUpdateAt(LocalDateTime.now());
+        cesHousePriceSchemeMapper.updateById(model);
+        return Result.ok("修改成功!");
+    }
 
     public Result deleteOne(String id) {
         CesHousePriceScheme cesHousePriceScheme = cesHousePriceSchemeMapper.selectOne(new QueryWrapper<CesHousePriceScheme>()

+ 231 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/rooms/util/Pinyin4jUtil.java

@@ -0,0 +1,231 @@
+package org.jeecg.modules.rooms.util;
+
+import net.sourceforge.pinyin4j.PinyinHelper;
+import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
+import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
+import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
+import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
+
+public class Pinyin4jUtil {
+    /** pinyin4j格式类 */
+    private static HanyuPinyinOutputFormat format;
+
+    /** 拼音字符串数组 */
+    private static String[] pinyin;
+
+    enum Type {
+        /** 全部大写 */
+        UPPERCASE,
+        /** 全部小写 */
+        LOWERCASE,
+        /** 首字母大写 */
+        FIRSTUPPER
+    }
+
+    private Pinyin4jUtil(){
+        // 私有类构造方法
+    }
+
+    static{
+        format = new HanyuPinyinOutputFormat();
+        /*
+         * 设置需要转换的拼音格式
+         * 以汉字 ‘天’ 为例
+         * HanyuPinyinToneType.WITHOUT_TONE 转换为tian
+         * HanyuPinyinToneType.WITH_TONE_MARK 转换为tian1
+         * HanyuPinyinVCharType.WITH_U_UNICODE 转换为tiān
+         *
+         */
+        format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+        pinyin = null;
+    }
+
+    /**
+     * 对单个中文字符进行转换, 当转换的符串不是汉字,就返回null
+     * @param c 需转换的汉字字符串
+     * @return 拼音字符
+     */
+    public static String getCharacterPinYin(char c) {
+        try {
+            // 执行转换
+            pinyin = PinyinHelper.toHanyuPinyinStringArray(c, format);
+        } catch(BadHanyuPinyinOutputFormatCombination e) {
+            e.printStackTrace();
+        }
+
+        // pinyin4j规则,当转换的符串不是汉字,就返回null
+        if(null == pinyin) {
+            return null;
+        }
+
+        // 多音字会返回一个多音字拼音的数组,pinyiin4j并不能有效判断该字的读音
+        // 多音字取第一个值
+        return pinyin[0];
+    }
+
+    /**
+     * 对单个字进行转换,默认分隔符是空格
+     * @param str 需转换的汉字字符串
+     * @return 拼音字符串
+     */
+    public static String getStringPinYin(String str) {
+        return getStringPinYin(str, " ");
+    }
+
+    /**
+     * 对单个字进行转换
+     * @param str 需转换的汉字字符串
+     * @param spera 分隔符,例如 \'
+     * @return 拼音字符串
+     */
+    public static String getStringPinYin(String str, String spera) {
+        StringBuilder sb = new StringBuilder();
+        String tempStr;
+
+        for(int i = 0; i < str.length(); ++i) {
+            tempStr = getCharacterPinYin(str.charAt(i));
+            if(tempStr == null) {
+                // 如果str.charAt(i)不是汉字,则保持原样
+                sb.append(str.charAt(i));
+            } else {
+                sb.append(tempStr);
+                // 分词
+                if ( i < str.length() - 1 && null != getCharacterPinYin(str.charAt(i + 1))) {
+                    sb.append(spera);
+                }
+            }
+        }
+        return sb.toString().trim();
+    }
+
+    /**
+     * 获取拼音首字母(大写)
+     * @param str 字符串
+     * @return str为颐和园 ,return获取到的是YHY
+     */
+    public static String toPinYinUppercase(String str) {
+        return toPinYin(str, "", Type.UPPERCASE);
+    }
+
+    /**
+     * 获取拼音首字母(大写)
+     * @param str 字符串
+     * @param spera 转换字母间隔加的字符串,如果不需要为""
+     * @return str为颐和园 ,spera为** return获取到的是Y**H**Y
+     */
+    public static String toPinYinUppercase(String str,String spera) {
+        return toPinYin(str, spera, Type.UPPERCASE);
+    }
+
+    /**
+     * 获取拼音首字母(小写)
+     * @param str 字符串
+     * @return  str为颐和园 ,return获取到的是yhy
+     */
+    public static String toPinYinLowercase(String str) {
+        return toPinYin(str, "", Type.LOWERCASE);
+    }
+
+    /**
+     * 获取拼音首字母(小写)
+     * @param str 字符串
+     * @param spera 转换字母间隔加的字符串,如果不需要为""
+     * @return  str为颐和园 ,spera为** return获取到的是y**h**y
+     */
+    public static String toPinYinLowercase(String str,String spera){
+        return toPinYin(str, spera, Type.LOWERCASE);
+    }
+
+    /**
+     * 获取第一个字符的拼音首字母(大写)
+     * @param str 字符串
+     * @return str为颐和园 ,return获取到的是Y
+     */
+    public static String toPinYinUppercaseInitials(String str) {
+        String initials = null;
+        String py = toPinYinUppercase(str);
+        if(py.length()>1){
+            initials = py.substring(0, 1);
+        }
+        if(py.length()<=1){
+            initials = py;
+        }
+        return initials.trim();
+    }
+
+    /**
+     * 获取第一个字符的拼音首字母(小写)
+     * @param str 字符串
+     * @return str为颐和园 ,return获取到的是y
+     */
+    public static String toPinYinLowercaseInitials(String str) {
+        String initials = null;
+        String py = toPinYinLowercase(str);
+        if(py.length()>1){
+            initials = py.substring(0, 1);
+        }
+        if(py.length()<=1){
+            initials = py;
+        }
+        return initials.trim();
+    }
+
+    /**
+     * 获取拼音首字母,如果不是汉字或者没有对应的拼音,则不作转换
+     * @param str    字符串
+     * @param spera  默认,可为""
+     * @param type   转换格式
+     * @return 按照转换格式转换成字符串
+     */
+    public static String toPinYin(String str, String spera, Type type) {
+        if(str == null || str.trim().length()==0) {
+            return "";
+        }
+        try {
+            if(type == Type.UPPERCASE) {
+                format.setCaseType(HanyuPinyinCaseType.UPPERCASE);
+            } else{
+                format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
+            }
+            StringBuilder sb = new StringBuilder();
+            String tempStr;
+            String[] t;
+            for(int i=0;i<str.length();i++){
+                char c = str.charAt(i);
+                if((int)c <= 128)  {
+                    sb.append(c);
+                }else{
+                    t = PinyinHelper.toHanyuPinyinStringArray(c, format);
+                    if(t == null) {
+                        sb.append(c);
+                    }else{
+                        tempStr = t[0];
+                        if(type == Type.FIRSTUPPER) {
+                            tempStr = t[0].toUpperCase().charAt(0) + tempStr.substring(1);
+                        }
+                        if(tempStr.length()>=1){
+                            tempStr = tempStr.substring(0, 1);
+                        }
+                        sb.append(tempStr).append(i == str.length() - 1 ? "" : spera);
+                    }
+                }
+            }
+            return sb.toString().trim();
+        } catch (BadHanyuPinyinOutputFormatCombination e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    public static void main(String[] args) {
+
+        String s = "明旭";
+        System.out.println(Pinyin4jUtil.toPinYin(s,"", Type.FIRSTUPPER)); //输出结果:YHY
+        System.out.println(Pinyin4jUtil.toPinYinUppercase(s)); //输出结果:YHY
+        System.out.println(Pinyin4jUtil.toPinYinUppercase(s, "**")); //输出结果:Y**H**Y
+        System.out.println(Pinyin4jUtil.toPinYinLowercase(s)); //输出结果:yhy
+        System.out.println(Pinyin4jUtil.toPinYinLowercase(s,"**")); //输出结果:y**h**y
+        System.out.println(Pinyin4jUtil.toPinYinUppercaseInitials(s)); //输出结果:Y
+        System.out.println(Pinyin4jUtil.toPinYinLowercaseInitials(s)); //输出结果:y
+    }
+}