diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/BillingOptionsController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/BillingOptionsController.java new file mode 100644 index 000000000..fed127381 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/BillingOptionsController.java @@ -0,0 +1,163 @@ +package org.jeecg.modules.business.controller.admin; + +import java.util.Arrays; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.business.entity.BillingOptions; +import org.jeecg.modules.business.service.IBillingOptionsService; + +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.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; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: billing options + * @Author: jeecg-boot + * @Date: 2024-10-23 + * @Version: V1.0 + */ +@Api(tags="billing options") +@RestController +@RequestMapping("/billingOptions") +@Slf4j +public class BillingOptionsController extends JeecgController { + @Autowired + private IBillingOptionsService billingOptionsService; + + /** + * 分页列表查询 + * + * @param billingOptions + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "billing options-分页列表查询") + @ApiOperation(value="billing options-分页列表查询", notes="billing options-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(BillingOptions billingOptions, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(billingOptions, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = billingOptionsService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param billingOptions + * @return + */ + @AutoLog(value = "billing options-添加") + @ApiOperation(value="billing options-添加", notes="billing options-添加") + @RequiresPermissions("business:billing_options:add") + @PostMapping(value = "/add") + public Result add(@RequestBody BillingOptions billingOptions) { + billingOptionsService.save(billingOptions); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param billingOptions + * @return + */ + @AutoLog(value = "billing options-编辑") + @ApiOperation(value="billing options-编辑", notes="billing options-编辑") + @RequiresPermissions("business:billing_options:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody BillingOptions billingOptions) { + billingOptionsService.updateById(billingOptions); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "billing options-通过id删除") + @ApiOperation(value="billing options-通过id删除", notes="billing options-通过id删除") + @RequiresPermissions("business:billing_options:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + billingOptionsService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "billing options-批量删除") + @ApiOperation(value="billing options-批量删除", notes="billing options-批量删除") + @RequiresPermissions("business:billing_options:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.billingOptionsService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "billing options-通过id查询") + @ApiOperation(value="billing options-通过id查询", notes="billing options-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + BillingOptions billingOptions = billingOptionsService.getById(id); + if(billingOptions==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(billingOptions); + } + + /** + * 导出excel + * + * @param request + * @param billingOptions + */ + @RequiresPermissions("business:billing_options:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, BillingOptions billingOptions) { + return super.exportXls(request, billingOptions, BillingOptions.class, "billing options"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("business:billing_options:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, BillingOptions.class); + } + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeController.java new file mode 100644 index 000000000..6eadbafbf --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeController.java @@ -0,0 +1,237 @@ +package org.jeecg.modules.business.controller.admin; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.base.CaseFormat; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.business.entity.ExtraFee; +import org.jeecg.modules.business.entity.ExtraFeeOption; +import org.jeecg.modules.business.service.IExtraFeeOptionService; +import org.jeecg.modules.business.service.IExtraFeeService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.modules.business.service.IShopService; +import org.jeecg.modules.business.vo.ExtraFeeParam; +import org.jeecg.modules.business.vo.ExtraFeeResult; +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; +import org.apache.shiro.authz.annotation.RequiresPermissions; + +import static org.jeecg.common.util.SqlInjectionUtil.specialFilterContentForDictSql; + +/** + * @Description: extra fee content + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Api(tags="extra fee content") +@RestController +@RequestMapping("/extraFee") +@Slf4j +public class ExtraFeeController extends JeecgController { + @Autowired + private IExtraFeeService extraFeeService; + @Autowired + private IExtraFeeOptionService extraFeeOptionService; + @Autowired + private IShopService shopService; + + /** + * 分页列表查询 + * + * @param pageNo page number + * @param pageSize page size + * @param column column to order by + * @param order result order + * @param shop shop code + * @param statuses fee status + * @return result + */ + //@AutoLog(value = "extra fee content-分页列表查询") + @ApiOperation(value="extra fee content-分页列表查询", notes="extra fee content-分页列表查询") + @GetMapping(value = "/list") + public Result> listWithFilters(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "column", defaultValue = "create_time") String column, + @RequestParam(name = "order", defaultValue = "DESC") String order, + @RequestParam(name = "shop", required = false) String shop, + @RequestParam(name = "status", required = false) String statuses + ) { + String parsedColumn = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, column.replace("_dictText", "")); + String parsedOrder = order.toUpperCase(); + if(!parsedOrder.equals("ASC") && !parsedOrder.equals("DESC")) { + return Result.error("Error 400 Bad Request"); + } + try { + specialFilterContentForDictSql(parsedColumn); + } catch (RuntimeException e) { + return Result.error("Error 400 Bad Request"); + } + List statusList = new ArrayList<>(); + if(statuses != null) + statusList = Arrays.asList(statuses.split(",")); + String status = null; + if(statusList.size() == 1) { + status = statusList.get(0); + } + int total = extraFeeService.countAllFees(shop, status); + List extraFeeResults = extraFeeService.listWithFilters(shop, status, pageNo, pageSize, parsedColumn, parsedOrder); + + IPage page = new Page<>(); + page.setRecords(extraFeeResults); + page.setCurrent(pageNo); + page.setSize(pageSize); + page.setTotal(total); + + return Result.OK(page); + } + + /** + * 添加 + * + * @param extraFees + * @return + */ + @AutoLog(value = "extra fee content-添加") + @ApiOperation(value="extra fee content-添加", notes="extra fee content-添加") + @RequiresPermissions("business:extra_fee:add") + @PostMapping(value = "/add") + public Result add(@RequestBody ExtraFee extraFees) { + extraFeeService.save(extraFees); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param extraFees + * @return + */ + @AutoLog(value = "extra fee content-编辑") + @ApiOperation(value="extra fee content-编辑", notes="extra fee content-编辑") + @RequiresPermissions("business:extra_fee:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody ExtraFee extraFees) { + extraFeeService.updateById(extraFees); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "extra fee content-通过id删除") + @ApiOperation(value="extra fee content-通过id删除", notes="extra fee content-通过id删除") + @RequiresPermissions("business:extra_fee:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + extraFeeService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "extra fee content-批量删除") + @ApiOperation(value="extra fee content-批量删除", notes="extra fee content-批量删除") + @RequiresPermissions("business:extra_fee:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.extraFeeService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "extra fee content-通过id查询") + @ApiOperation(value="extra fee content-通过id查询", notes="extra fee content-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ExtraFee extraFees = extraFeeService.getById(id); + if(extraFees==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(extraFees); + } + + /** + * 导出excel + * + * @param request + * @param extraFees + */ + @RequiresPermissions("business:extra_fee:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ExtraFee extraFees) { + return super.exportXls(request, extraFees, ExtraFee.class, "extra fee content"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("business:extra_fee:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ExtraFee.class); + } + + @PostMapping(value = "/create") + public Result create(@RequestBody ExtraFeeParam feeParam) { + String autresOptionName = "Autres"; + ExtraFeeOption option = extraFeeOptionService.getById(feeParam.getOptionId()); + String shopId = shopService.getIdByCode(feeParam.getShop()); + if(shopId == null) { + return Result.error(404, "Shop not found"); + } + if(option == null) { + return Result.error(404, "Option not found"); + } + ExtraFeeOption otherOption = extraFeeOptionService.getByName(autresOptionName); + if(option.getId().equals(otherOption.getId())) { + if(feeParam.getDescription().isEmpty()) + return Result.error(403, "Description is empty"); + } else { + feeParam.setDescription(null); + } + ExtraFee fee = new ExtraFee(); + fee.setShop_id(shopId); + fee.setOptionId(feeParam.getOptionId()); + fee.setDescription(feeParam.getDescription()); + fee.setQuantity(feeParam.getQuantity()); + fee.setUnitPrice(feeParam.getUnitPrice()); + extraFeeService.save(fee); + return Result.ok(); + } + + @PostMapping(value = "/update") + public Result update(@RequestBody ExtraFeeParam feeParam) throws Exception { + extraFeeService.updateFee(feeParam); + return Result.ok(); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeOptionController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeOptionController.java new file mode 100644 index 000000000..4e52363d7 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ExtraFeeOptionController.java @@ -0,0 +1,163 @@ +package org.jeecg.modules.business.controller.admin; + +import java.util.Arrays; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.business.entity.ExtraFeeOption; +import org.jeecg.modules.business.service.IExtraFeeOptionService; + +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.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; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: extra fee option + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Api(tags="extra fee option") +@RestController +@RequestMapping("/extraFeeOption") +@Slf4j +public class ExtraFeeOptionController extends JeecgController { + @Autowired + private IExtraFeeOptionService ExtraFeeOptionService; + + /** + * 分页列表查询 + * + * @param ExtraFeeOption + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "extra fee option-分页列表查询") + @ApiOperation(value="extra fee option-分页列表查询", notes="extra fee option-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(ExtraFeeOption ExtraFeeOption, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(ExtraFeeOption, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = ExtraFeeOptionService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param ExtraFeeOption + * @return + */ + @AutoLog(value = "extra fee option-添加") + @ApiOperation(value="extra fee option-添加", notes="extra fee option-添加") + @RequiresPermissions("business:extra_fee_option:add") + @PostMapping(value = "/add") + public Result add(@RequestBody ExtraFeeOption ExtraFeeOption) { + ExtraFeeOptionService.save(ExtraFeeOption); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param ExtraFeeOption + * @return + */ + @AutoLog(value = "extra fee option-编辑") + @ApiOperation(value="extra fee option-编辑", notes="extra fee option-编辑") + @RequiresPermissions("business:extra_fee_option:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody ExtraFeeOption ExtraFeeOption) { + ExtraFeeOptionService.updateById(ExtraFeeOption); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "extra fee option-通过id删除") + @ApiOperation(value="extra fee option-通过id删除", notes="extra fee option-通过id删除") + @RequiresPermissions("business:extra_fee_option:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + ExtraFeeOptionService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "extra fee option-批量删除") + @ApiOperation(value="extra fee option-批量删除", notes="extra fee option-批量删除") + @RequiresPermissions("business:extra_fee_option:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.ExtraFeeOptionService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "extra fee option-通过id查询") + @ApiOperation(value="extra fee option-通过id查询", notes="extra fee option-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ExtraFeeOption ExtraFeeOption = ExtraFeeOptionService.getById(id); + if(ExtraFeeOption==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(ExtraFeeOption); + } + + /** + * 导出excel + * + * @param request + * @param ExtraFeeOption + */ + @RequiresPermissions("business:extra_fee_option:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ExtraFeeOption ExtraFeeOption) { + return super.exportXls(request, ExtraFeeOption, ExtraFeeOption.class, "extra fee option"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("business:extra_fee_option:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ExtraFeeOption.class); + } + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ShopController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ShopController.java new file mode 100644 index 000000000..7bf2bb522 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/ShopController.java @@ -0,0 +1,167 @@ +package org.jeecg.modules.business.controller.admin; + +import java.util.Arrays; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.business.entity.Shop; +import org.jeecg.modules.business.service.IShopService; + +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.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; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: shop + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Api(tags="shop") +@RestController +@RequestMapping("/shop") +@Slf4j +public class ShopController extends JeecgController { + @Autowired + private IShopService shopService; + + /** + * 分页列表查询 + * + * @param shop + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "shop-分页列表查询") + @ApiOperation(value="shop-分页列表查询", notes="shop-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Shop shop, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(shop, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = shopService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param shop + * @return + */ + @AutoLog(value = "shop-添加") + @ApiOperation(value="shop-添加", notes="shop-添加") + @RequiresPermissions("shop:add") + @PostMapping(value = "/add") + public Result add(@RequestBody Shop shop) { + shopService.save(shop); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param shop + * @return + */ + @AutoLog(value = "shop-编辑") + @ApiOperation(value="shop-编辑", notes="shop-编辑") + @RequiresPermissions("shop:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Shop shop) { + shopService.updateById(shop); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "shop-通过id删除") + @ApiOperation(value="shop-通过id删除", notes="shop-通过id删除") + @RequiresPermissions("shop:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + shopService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "shop-批量删除") + @ApiOperation(value="shop-批量删除", notes="shop-批量删除") + @RequiresPermissions("shop:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.shopService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "shop-通过id查询") + @ApiOperation(value="shop-通过id查询", notes="shop-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + Shop shop = shopService.getById(id); + if(shop==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(shop); + } + + /** + * 导出excel + * + * @param request + * @param shop + */ + @RequiresPermissions("shop:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Shop shop) { + return super.exportXls(request, shop, Shop.class, "shop"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("shop:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Shop.class); + } + + @GetMapping(value = "/shopGroupedByClient") + public Result listShopGroupedByClient() { + return Result.OK(shopService.listShopGroupedByClient()); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BillingOptions.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BillingOptions.java new file mode 100644 index 000000000..a7717d115 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BillingOptions.java @@ -0,0 +1,69 @@ +package org.jeecg.modules.business.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +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: billing options + * @Author: jeecg-boot + * @Date: 2024-10-23 + * @Version: V1.0 + */ +@Data +@TableName("billing_options") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="billing_options对象", description="billing options") +public class BillingOptions implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**是否开全部票*/ + @Excel(name = "是否开全部票", width = 15) + @ApiModelProperty(value = "是否开全部票") + private java.lang.Integer isComplete; + /**is preshipping or postshipping*/ + @Excel(name = "is preshipping or postshipping", width = 15) + @ApiModelProperty(value = "is preshipping or postshipping") + private java.lang.Integer isPre; + /**automatic billing or manual*/ + @Excel(name = "automatic billing or manual", width = 15) + @ApiModelProperty(value = "automatic billing or manual") + private java.lang.Integer isAutomatic; + /**shop id*/ + @Excel(name = "shop id", width = 15, dictTable = "shop", dicText = "erp_code", dicCode = "id") + @Dict(dictTable = "shop", dicText = "erp_code", dicCode = "id") + @ApiModelProperty(value = "shop id") + private java.lang.String shopId; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFee.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFee.java new file mode 100644 index 000000000..dfb787d36 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFee.java @@ -0,0 +1,75 @@ +package org.jeecg.modules.business.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: extra fees content + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Data +@TableName("extra_fee") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="extra_fee对象", description="extra fee content") +public class ExtraFee implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**shop erpCode*/ + @Excel(name = "shop ID", width = 15) + @ApiModelProperty(value = "shop_id") + private java.lang.String shop_id; + /**option_id*/ + @Excel(name = "option_id", width = 15) + @ApiModelProperty(value = "option_id") + private java.lang.String optionId; + /**数量*/ + @Excel(name = "数量", width = 15) + @ApiModelProperty(value = "数量") + private java.lang.Integer quantity; + /**price per unit*/ + @Excel(name = "price per unit", width = 15) + @ApiModelProperty(value = "price per unit") + private java.math.BigDecimal unitPrice; + /**Précision pour les champs "autres"*/ + @Excel(name = "description for others", width = 15) + @ApiModelProperty(value = "description for others") + private java.lang.String description; + /**发票号*/ + @Excel(name = "发票号", width = 15) + @ApiModelProperty(value = "发票号") + private java.lang.String invoiceNumber; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFeeOption.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFeeOption.java new file mode 100644 index 000000000..d831d241c --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ExtraFeeOption.java @@ -0,0 +1,63 @@ +package org.jeecg.modules.business.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: extra fee option + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Data +@TableName("extra_fee_option") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="extra_fee_option对象", description="extra fee option") +public class ExtraFeeOption implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**英文名称*/ + @Excel(name = "英文名称", width = 15) + @ApiModelProperty(value = "英文名称") + private java.lang.String enName; + /**中文名称*/ + @Excel(name = "中文名称", width = 15) + @ApiModelProperty(value = "中文名称") + private java.lang.String zhName; + /**默认价格*/ + @Excel(name = "默认价格", width = 15) + @ApiModelProperty(value = "默认价格") + private java.math.BigDecimal defaultPrice; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BillingOptionsMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BillingOptionsMapper.java new file mode 100644 index 000000000..3774e169b --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BillingOptionsMapper.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.business.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.entity.BillingOptions; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * @Description: billing options + * @Author: jeecg-boot + * @Date: 2024-10-23 + * @Version: V1.0 + */ +@Repository +public interface BillingOptionsMapper extends BaseMapper { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeMapper.java new file mode 100644 index 000000000..cdb7e804a --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeMapper.java @@ -0,0 +1,32 @@ +package org.jeecg.modules.business.mapper; + +import java.math.BigDecimal; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.entity.ExtraFee; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.business.vo.ExtraFeeResult; +import org.springframework.stereotype.Repository; + +/** + * @Description: extra fees content + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Repository +public interface ExtraFeeMapper extends BaseMapper { + + List listWithFilters(@Param("shop") String shop, + @Param("status") String status, + @Param("offset") int offset, + @Param("size") Integer pageSize, + @Param("column") String column, + @Param("order") String order); + Integer countAllFees(@Param("shop") String shop, + @Param("status") String status); + + void updateFee(@Param("id") String id, @Param("description") String description, @Param("qty") Integer quantity, @Param("price") BigDecimal unitPrice); +} + diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeOptionMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeOptionMapper.java new file mode 100644 index 000000000..b2b45fbd4 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ExtraFeeOptionMapper.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.business.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.entity.ExtraFeeOption; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * @Description: extra fees options + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Repository +public interface ExtraFeeOptionMapper extends BaseMapper { + + ExtraFeeOption selectByEnName(@Param("name") String optionName); +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java index b21b81299..6c0e29330 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java @@ -4,6 +4,7 @@ import java.util.List; import org.jeecg.modules.business.entity.Shop; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.vo.ShopPage; import org.springframework.stereotype.Repository; /** @@ -28,4 +29,8 @@ public interface ShopMapper extends BaseMapper { String getNameById(@Param("shopId") String shopId); String getCodeById(@Param("shopId") String shopId); + + List listShopGroupedByClient(); + + String getIdByCode(@Param("code") String erpCode); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BillingOptionsMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BillingOptionsMapper.xml new file mode 100644 index 000000000..ec68d9e40 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BillingOptionsMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeMapper.xml new file mode 100644 index 000000000..26ffc1bc2 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeMapper.xml @@ -0,0 +1,59 @@ + + + + + + + UPDATE extra_fee + SET unit_price = #{price}, + quantity = #{qty}, + description = #{description} + WHERE id = #{id}; + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeOptionMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeOptionMapper.xml new file mode 100644 index 000000000..8212125ba --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ExtraFeeOptionMapper.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml index a55f5f0c9..e42722914 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml @@ -45,4 +45,19 @@ FROM shop WHERE id = #{shopId}; + + diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBillingOptionsService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBillingOptionsService.java new file mode 100644 index 000000000..12ced9a96 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBillingOptionsService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.business.service; + +import org.jeecg.modules.business.entity.BillingOptions; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: billing options + * @Author: jeecg-boot + * @Date: 2024-10-23 + * @Version: V1.0 + */ +public interface IBillingOptionsService extends IService { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeOptionService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeOptionService.java new file mode 100644 index 000000000..2d32140cb --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeOptionService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.business.service; + +import org.jeecg.modules.business.entity.ExtraFeeOption; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: extra fees options + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +public interface IExtraFeeOptionService extends IService { + + ExtraFeeOption getByName(String optionName); +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeService.java new file mode 100644 index 000000000..19be9498b --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IExtraFeeService.java @@ -0,0 +1,23 @@ +package org.jeecg.modules.business.service; + +import org.jeecg.modules.business.entity.ExtraFee; +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.business.vo.ExtraFeeParam; +import org.jeecg.modules.business.vo.ExtraFeeResult; + +import java.util.List; + +/** + * @Description: extra fees content + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +public interface IExtraFeeService extends IService { + + List listWithFilters(String shop, String status, Integer pageNo, Integer pageSize, String column, String order); + + Integer countAllFees(String shop, String status); + + void updateFee(ExtraFeeParam feeParam) throws Exception; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java index a73eca7b8..92c22577c 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java @@ -2,6 +2,8 @@ package org.jeecg.modules.business.service; import org.jeecg.modules.business.entity.Shop; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.business.vo.ShopPage; + import java.util.List; /** @@ -22,4 +24,7 @@ public interface IShopService extends IService { String getNameById(String shopId); String getCodeById(String shopId); + + List listShopGroupedByClient(); + String getIdByCode(String erpCode); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BillingOptionsServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BillingOptionsServiceImpl.java new file mode 100644 index 000000000..e2ff5ca18 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BillingOptionsServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.business.service.impl; + +import org.jeecg.modules.business.entity.BillingOptions; +import org.jeecg.modules.business.mapper.BillingOptionsMapper; +import org.jeecg.modules.business.service.IBillingOptionsService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: billing options + * @Author: jeecg-boot + * @Date: 2024-10-23 + * @Version: V1.0 + */ +@Service +public class BillingOptionsServiceImpl extends ServiceImpl implements IBillingOptionsService { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeOptionServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeOptionServiceImpl.java new file mode 100644 index 000000000..ab6b3552d --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeOptionServiceImpl.java @@ -0,0 +1,26 @@ +package org.jeecg.modules.business.service.impl; + +import org.jeecg.modules.business.entity.ExtraFeeOption; +import org.jeecg.modules.business.mapper.ExtraFeeOptionMapper; +import org.jeecg.modules.business.service.IExtraFeeOptionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: extra fees options + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Service +public class ExtraFeeOptionServiceImpl extends ServiceImpl implements IExtraFeeOptionService { + @Autowired + private ExtraFeeOptionMapper optionMapper; + + @Override + public ExtraFeeOption getByName(String optionName) { + return optionMapper.selectByEnName(optionName); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeServiceImpl.java new file mode 100644 index 000000000..290c12e95 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ExtraFeeServiceImpl.java @@ -0,0 +1,44 @@ +package org.jeecg.modules.business.service.impl; + +import org.jeecg.modules.business.entity.ExtraFee; +import org.jeecg.modules.business.mapper.ExtraFeeMapper; +import org.jeecg.modules.business.service.IExtraFeeService; +import org.jeecg.modules.business.vo.ExtraFeeParam; +import org.jeecg.modules.business.vo.ExtraFeeResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import java.util.List; + +/** + * @Description: extra fees content + * @Author: jeecg-boot + * @Date: 2024-11-15 + * @Version: V1.0 + */ +@Service +public class ExtraFeeServiceImpl extends ServiceImpl implements IExtraFeeService { + @Autowired + private ExtraFeeMapper extraFeeMapper; + + @Override + public List listWithFilters(String shop, String status, Integer pageNo, Integer pageSize, String column, String order) { + int offset = (pageNo - 1) * pageSize; + return extraFeeMapper.listWithFilters(shop, status, offset, pageSize, column, order); + } + @Override + public Integer countAllFees(String shop, String status) { + return extraFeeMapper.countAllFees(shop, status); + } + + @Override + public void updateFee(ExtraFeeParam feeParam) throws Exception { + ExtraFee fee = getById(feeParam.getId()); + if(fee == null) { + throw new Exception("Fee not found"); + } + extraFeeMapper.updateFee(feeParam.getId(), feeParam.getDescription(), feeParam.getQuantity(), feeParam.getUnitPrice()); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java index bac2d1635..3e66d7ac8 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.business.service.impl; import org.jeecg.modules.business.entity.Shop; import org.jeecg.modules.business.mapper.ShopMapper; import org.jeecg.modules.business.service.IShopService; +import org.jeecg.modules.business.vo.ShopPage; import org.springframework.stereotype.Service; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -48,4 +49,14 @@ public class ShopServiceImpl extends ServiceImpl implements IS public String getCodeById(String shopId) { return shopMapper.getCodeById(shopId); } + + @Override + public List listShopGroupedByClient() { + return shopMapper.listShopGroupedByClient(); + } + + @Override + public String getIdByCode(String erpCode) { + return shopMapper.getIdByCode(erpCode); + } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ExtraFeeParam.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ExtraFeeParam.java new file mode 100644 index 000000000..ad5fe9409 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ExtraFeeParam.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.business.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class ExtraFeeParam { + private String id; + private String shop; + private String optionId; + private Integer quantity; + private BigDecimal unitPrice; + private String description; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ShopPage.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ShopPage.java new file mode 100644 index 000000000..133c82d4b --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ShopPage.java @@ -0,0 +1,11 @@ +package org.jeecg.modules.business.vo; + +import lombok.Data; + +@Data +public class ShopPage { + private String shopCode; + private String clientCode; + private String clientName; + private String currency; +}