From 1d8ac9029153d13e057e74d4c5fce56093318374 Mon Sep 17 00:00:00 2001 From: zhangtq <2452618307@qq.com> Date: Fri, 21 Feb 2025 16:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=BF=E7=AB=99=EF=BC=9A=E4=BF=9D=E6=B4=81?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CleaningServicesAppController.java | 66 +++ .../CleaningServicesOrderController.java | 72 ++++ .../app/dto/CleaningServicesDTO.java | 67 +++ .../app/dto/CleaningServicesOrderDTO.java | 106 +++++ .../app/entity/CleaningServicesEntity.java | 72 ++++ .../app/entity/CleaningServicesOrder.java | 68 ++++ .../app/mapper/CleaningServicesMapper.java | 81 ++++ .../mapper/CleaningServicesOrderMapper.java | 10 + .../service/CleaningServicesOrderService.java | 19 + .../CleaningServicesOrderServiceImpl.java | 385 ++++++++++++++++++ .../service/ICleaningServiceWebService.java | 30 ++ .../impl/CleaningServiceWebServiceImpl.java | 204 ++++++++++ .../mapper/app/CleaningServicesMapper.xml | 218 ++++++++++ .../app/CleaningServicesOrderMapper.xml | 316 ++++++++++++++ .../app/WashClothingOrderInfoMapper.xml | 2 +- 15 files changed, 1715 insertions(+), 1 deletion(-) create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesAppController.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesOrderController.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesDTO.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesOrderDTO.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesEntity.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesOrder.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesMapper.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesOrderMapper.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/CleaningServicesOrderService.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CleaningServicesOrderServiceImpl.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/ICleaningServiceWebService.java create mode 100644 bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/impl/CleaningServiceWebServiceImpl.java create mode 100644 bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesMapper.xml create mode 100644 bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesOrderMapper.xml diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesAppController.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesAppController.java new file mode 100644 index 00000000..1702fdb4 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesAppController.java @@ -0,0 +1,66 @@ +package com.bonus.sharedstation.app.controller; + + +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.sharedstation.app.dto.CleaningServicesDTO; +import com.bonus.sharedstation.app.entity.CleaningServicesEntity; +import com.bonus.sharedstation.web.service.ICleaningServiceWebService; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; + +@Tag(name = "app-清洗服务") +@RestController +@RequestMapping("/information/cleaningservicesapp") +public class CleaningServicesAppController { + + @Resource + private ICleaningServiceWebService service; + + @PostMapping(value = "/add", produces = "application/json; charset=utf-8") + @ApiOperation("清洗服务-新增") + public AjaxResult add(@RequestBody @Valid CleaningServicesEntity dto) { + return service.insert(dto); + } + + + @PostMapping(value = "/delete", produces = "application/json; charset=utf-8") + @ApiOperation("清洗服务-删除") + public AjaxResult deleteById(@RequestBody CleaningServicesEntity dto) { + return service.delete(dto); + } + + @ApiOperation("清洗服务-修改") + @PostMapping("/update") + public AjaxResult update(@RequestBody @Valid CleaningServicesEntity dto) { + return service.updateInfoById(dto); + } + + @ApiOperation("清洗服务-查询") + @PostMapping("/getList") + public AjaxResult getList(@RequestBody CleaningServicesDTO dto) { + return service.getListPage(dto); + + } + + @ApiOperation("清洗服务-查询") + @PostMapping("/getListPageApp") + public AjaxResult getListPage(@RequestBody CleaningServicesDTO dto) { + return service.getListPageApp(dto); + + } + + @PostMapping(value = "selectById", produces = "application/json; charset=utf-8") + @ApiOperation("清洗服务-查询详情") + public AjaxResult selectInfoById(@RequestBody CleaningServicesEntity dto) { + return service.selectInfoById(dto); + } + + +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesOrderController.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesOrderController.java new file mode 100644 index 00000000..ceca7975 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CleaningServicesOrderController.java @@ -0,0 +1,72 @@ +package com.bonus.sharedstation.app.controller; + + +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.sharedstation.app.dto.CleaningServicesOrderDTO; +import com.bonus.sharedstation.app.entity.CleaningServicesOrder; +import com.bonus.sharedstation.app.service.CleaningServicesOrderService; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Date; + +/** + * 便民服务信息表保洁(CleaningServicesOrder)表控制层 + * + * @author makejava + * @since 2024-12-10 17:01:59 + */ +@RestController +@RequestMapping("information/cleaningServicesOrder") +public class CleaningServicesOrderController { + /** + * 服务对象 + */ + @Resource + private CleaningServicesOrderService cleaningServicesOrderService; + + @ApiOperation("新增") + @PostMapping("/insert") + public AjaxResult insert(@RequestBody CleaningServicesOrder cleaningServicesOrder) { + return AjaxResult.success(cleaningServicesOrderService.insertAndPay(cleaningServicesOrder)); + + } + + @ApiOperation("修改") + @PostMapping("/update") + public AjaxResult update(@RequestBody CleaningServicesOrder cleaningServicesOrder) { + //得到登录人 + cleaningServicesOrder.setUpdatedBy(SecurityUtils.getUsername()); + cleaningServicesOrder.setUpdatedTime(new Date()); + return AjaxResult.success(this.cleaningServicesOrderService.updateById(cleaningServicesOrder)); + } + + @ApiOperation("分页查询") + @PostMapping("/getListApp") + public AjaxResult getList(@RequestBody CleaningServicesOrderDTO dto) { + return cleaningServicesOrderService.getListPageApp(dto); + + } + + + @PostMapping(value = "selectById", produces = "application/json; charset=utf-8") + @ApiOperation("查询详情") + public AjaxResult selectInfoById(@RequestBody CleaningServicesOrder dto) { + return cleaningServicesOrderService.selectInfoById(dto); + } + + + @ApiOperation("查询") + @PostMapping("/getOrderListSeller") + public AjaxResult getListWeb(@RequestBody CleaningServicesOrderDTO dto){ + return cleaningServicesOrderService.getListWeb(dto); + } + + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesDTO.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesDTO.java new file mode 100644 index 00000000..7322f7f6 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesDTO.java @@ -0,0 +1,67 @@ +package com.bonus.sharedstation.app.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.bonus.sharedstation.common.pojo.PageDTO; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("yz_cleaning_services") +public class CleaningServicesDTO extends PageDTO implements Serializable { + private static final long serialVersionUID = 336859169423180427L; + + private Integer id; + /** + * 服务名称 + */ + private String serviceName; + /** + * 价格 + */ + private Double price; + /** + * 单位(如:元/小时、元/台等) + */ + private String unit; + /** + * 服务描述或备注 + */ + private String description; + /** + * 创建人 + */ + private String createdBy; + /** + * 创建时间 + */ + private Date createdTime; + /** + * 修改时间 + */ + private Date updatedTime; + /** + * 修改人 + */ + private String updatedBy; + /** + * 逻辑删除标识,1表示已删除,0表示未删除 + */ + private String isDeleted; + + private Integer tenantId; + + /** + * 类型 + */ + private String type; + + @TableField(exist = false) + private String typeName; + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesOrderDTO.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesOrderDTO.java new file mode 100644 index 00000000..18363d07 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CleaningServicesOrderDTO.java @@ -0,0 +1,106 @@ +package com.bonus.sharedstation.app.dto; + +import com.bonus.sharedstation.common.pojo.PageDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + + +@EqualsAndHashCode(callSuper = true) +@Data +public class CleaningServicesOrderDTO extends PageDTO implements Serializable { + private static final long serialVersionUID = 336859169423180427L; + private Integer id; + //服务名称 + private String serviceName; + //用户 id + private String userId; + //用户名 + private String name; + //状态 0 未完成 1 已完成 + private String status; + //下单时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date orderTime; + //消费金额 + private Double usePrice; + //单价 + private Double price; + //单位(如:元/小时、元/台等) + private String unit; + //服务描述或备注 + private String description; + //创建人 + private String createdBy; + //创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + //修改时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; + //修改人 + private String updatedBy; + //逻辑删除标识,1表示已删除,0表示未删除 + private String isDeleted; + + private Integer tenantId; + /** + * 手机号 + * + * @return + */ + private String phone; + + + /** + * 关联的服务 id + */ + private Integer serviceId; + /** + * 自定义开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date beginTime; + /** + * 自定义结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + /** + * 时间 type 0 自定义,1 是 月份 2 是季度 3 是年 + * + * @return + */ + private String timeType; + + /** + * 年 + */ + private Integer year; + /** + * 季度 1,2,3,4 + */ + private Integer quarter; + + /** + * 月份 + */ + private String yearMonth; + + /** + * 结束时间 + */ + private String stopTime; + + /** + * 开始时间 + */ + private String runTime; + + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesEntity.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesEntity.java new file mode 100644 index 00000000..5961c9cb --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesEntity.java @@ -0,0 +1,72 @@ +package com.bonus.sharedstation.app.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 便民服务信息表(CleaningServices)实体类 + * + * @author makejava + * @since 2024-12-10 16:28:16 + */ +@Data +@TableName("yz_cleaning_services") +public class CleaningServicesEntity implements Serializable { + private static final long serialVersionUID = 336859169423180427L; + private Integer id; + /** + * 服务名称 + */ + private String serviceName; + /** + * 价格 + */ + private Double price; + /** + * 单位(如:元/小时、元/台等) + */ + private String unit; + /** + * 服务描述或备注 + */ + private String description; + /** + * 创建人 + */ + private String createdBy; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + /** + * 修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; + /** + * 修改人 + */ + private String updatedBy; + /** + * 逻辑删除标识,1表示已删除,0表示未删除 + */ + private String isDeleted; + + + private Integer tenantId; + + /** + * 类型 + */ + private String type; + + @TableField(exist = false) + private String typeName; +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesOrder.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesOrder.java new file mode 100644 index 00000000..eae239c2 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/entity/CleaningServicesOrder.java @@ -0,0 +1,68 @@ +package com.bonus.sharedstation.app.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 便民服务信息表保洁(CleaningServicesOrder)表实体类 + * + * @author makejava + * @since 2024-12-10 17:01:59 + */ +@Data +@TableName("yz_cleaning_services_order") +public class CleaningServicesOrder implements Serializable { + private static final long serialVersionUID = 716556758843254410L; + private Integer id; + //服务名称 + private String serviceName; + + /** + * 关联的服务 id + */ + private Integer serviceId; + //用户 id + private String userId; + //用户名 + private String name; + //单位 + private String status; + //下单时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date orderTime; + //消费金额 + private Double usePrice; + //单价 + private Double price; + //单位(如:元/小时、元/台等) + private String unit; + //服务描述或备注 + private String description; + //创建人 + private String createdBy; + //创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; + //修改时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; + //修改人 + private String updatedBy; + //逻辑删除标识,1表示已删除,0表示未删除 + private String isDeleted; + /** + * 手机号 + */ + private String phone; + //流水号 + private String ordno; + + private Integer tenantId; + + private String orderPayInfo; +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesMapper.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesMapper.java new file mode 100644 index 00000000..6875df2b --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesMapper.java @@ -0,0 +1,81 @@ +package com.bonus.sharedstation.app.mapper; + +import com.bonus.sharedstation.app.domain.TherapyAppointments; +import com.bonus.sharedstation.app.entity.CleaningServicesEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import java.util.List; + +@Mapper +public interface CleaningServicesMapper extends BaseMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + TherapyAppointments queryById(Integer id); + + /** + * 查询指定行数据 + * + * @param therapyAppointments 查询条件 + * @param pageable 分页对象 + * @return 对象列表 + */ + List queryAllByLimit(TherapyAppointments therapyAppointments, @Param("pageable") Pageable pageable); + + /** + * 统计总行数 + * + * @param therapyAppointments 查询条件 + * @return 总行数 + */ + long count(TherapyAppointments therapyAppointments); + + /** + * 新增数据 + * + * @param therapyAppointments 实例对象 + * @return 影响行数 + */ + int insert(TherapyAppointments therapyAppointments); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param therapyAppointments 实例对象 + * @return 影响行数 + */ + int update(TherapyAppointments therapyAppointments); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 影响行数 + */ + int deleteById(Integer id); + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesOrderMapper.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesOrderMapper.java new file mode 100644 index 00000000..6d089e45 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/mapper/CleaningServicesOrderMapper.java @@ -0,0 +1,10 @@ +package com.bonus.sharedstation.app.mapper; + +import com.bonus.sharedstation.app.entity.CleaningServicesOrder; +import org.apache.ibatis.annotations.Mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +@Mapper +public interface CleaningServicesOrderMapper extends BaseMapper { + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/CleaningServicesOrderService.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/CleaningServicesOrderService.java new file mode 100644 index 00000000..5a349efb --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/CleaningServicesOrderService.java @@ -0,0 +1,19 @@ +package com.bonus.sharedstation.app.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.sharedstation.app.dto.CleaningServicesOrderDTO; +import com.bonus.sharedstation.app.entity.CleaningServicesOrder; + +public interface CleaningServicesOrderService extends IService { + + AjaxResult getListPageApp(CleaningServicesOrderDTO dto); + + AjaxResult insertAndPay(CleaningServicesOrder dto); + + AjaxResult getListWeb(CleaningServicesOrderDTO dto); + + AjaxResult selectInfoById(CleaningServicesOrder dto); +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CleaningServicesOrderServiceImpl.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CleaningServicesOrderServiceImpl.java new file mode 100644 index 00000000..be6a7c82 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CleaningServicesOrderServiceImpl.java @@ -0,0 +1,385 @@ +package com.bonus.sharedstation.app.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.sharedstation.app.dto.CleaningServicesOrderDTO; +import com.bonus.sharedstation.app.dto.PaymentDto; +import com.bonus.sharedstation.app.entity.CleaningServicesOrder; +import com.bonus.sharedstation.app.feign.OtherServiceClient; +import com.bonus.sharedstation.app.mapper.CleaningServicesOrderMapper; +import com.bonus.sharedstation.app.service.CleaningServicesOrderService; +import com.bonus.sharedstation.app.vo.AjaxResultVo; +import com.bonus.sharedstation.common.Constant.Constant; +import com.bonus.sharedstation.common.utils.OrderNumberGeneratorUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.time.format.DateTimeFormatter; +import java.util.Date; + +@Service("cleaningServicesOrderService") +@Slf4j +public class CleaningServicesOrderServiceImpl extends ServiceImpl implements CleaningServicesOrderService { + + @Resource + private CleaningServicesOrderMapper dao; + + @Resource + private OtherServiceClient otherServiceClient; + + @Override + @Transactional + public AjaxResult insertAndPay(CleaningServicesOrder dto) { + //得到登录人 + dto.setCreatedBy(SecurityUtils.getUsername()); + dto.setCreatedTime(new Date()); + dto.setUserId(String.valueOf(SecurityUtils.getUserId())); + dto.setOrderTime(new Date()); + dto.setIsDeleted("0"); + //流水号 + dto.setOrdno(OrderNumberGeneratorUtils.generateOrderNumber()); + //支付相关接入第三方小牛支付 + return payment(dto); + } + + private AjaxResult payment(CleaningServicesOrder dto) { + PaymentDto bean = new PaymentDto(); + bean.setMoney(dto.getUsePrice()); + bean.setCustId(SecurityUtils.getLoginUser().getCustId()); + try { + if (ObjectUtil.isEmpty(dto.getUsePrice())) { + throw new IllegalArgumentException("价格不能为空"); + } + AjaxResult result = otherServiceClient.payMoneyForStage(bean); + AjaxResultVo ajaxResultVo = JSON.parseObject(JSON.toJSONString(result), AjaxResultVo.class); + if (!ajaxResultVo.getCode().equals("200")) { + return AjaxResult.error(ajaxResultVo.getMsg()); + } + dto.setOrderPayInfo(ajaxResultVo.getMsg()); + bean.setOrderPayInfo(ajaxResultVo.getMsg()); + } catch (Exception e) { + log.error("支付失败", e); + return AjaxResult.error("支付失败"); + } + try { + int payInsert = dao.insert(dto); + if (payInsert == 0) { + return AjaxResult.error("数据新增失败"); + } + } catch (Exception e) { + //调用食堂卡退款 + AjaxResult refundResultVo = refundOperation(bean); + if (refundResultVo != null) return refundResultVo; + //删除当前订单 + int delCode = dao.deleteById(dto.getId()); + if (delCode == 0) { + return AjaxResult.error("数据新增-订单删除失败,请联系管理员进行处理!"); + } + return AjaxResult.error("数据新增失败"); + } + return AjaxResult.success("支付成功"); + } + + /** + * 退款操作 + * + * @param bean 退款信息 + * @return 结果 + */ + private AjaxResult refundOperation(PaymentDto bean) { + AjaxResult refundResult = otherServiceClient.refundMoneyForStage(bean); + AjaxResultVo refundResultVo = JSON.parseObject(JSON.toJSONString(refundResult), AjaxResultVo.class); + if (!refundResultVo.getCode().equals("200")) { + return AjaxResult.error(refundResultVo.getMsg()); + } + return null; + } + +// +// /** +// * 支付相关接入第三方小牛支付 +// * +// * @param userInfo +// * @param dto +// * @return +// */ +// private RestResult payByNiu(GreenUserInfo userInfo, CleaningServicesOrder dto) { +// //1 先查询人员对应的卡号 +// //应用秘钥 +// String appsecret = applicationidpsw; +// //传参 +// HashMap bodyMap = new HashMap<>(2); +// if (StringUtils.isEmpty(userInfo.getMobile())) { +// log.info("下单没有配置手机号,无法下单,请联系管理员配置"); +// return new RestResult(Constant.FAILED, "没有配置手机号,无法下单,请联系管理员配置"); +// } +//// bodyMap.put("mobile", "15996330508"); +// bodyMap.put("mobile", userInfo.getMobile()); +// //请求内容字典排序,转换为String +// String content = JSON.toJSONString(bodyMap, SerializerFeature.MapSortField, SerializerFeature.WriteMapNullValue); +// log.info("请求内容转换为JSON字符串,字典排序:{}", content); +// //构造请求验签参数方法 +// +//// Map map = makeSign(content, appsecret, bodyMap); +// Map map = makeSign(content, applicationidpsw, bodyMap); +//// HttpRequest request = HttpUtil.createPost(IpConfig.SEARCH_USER); +// HttpRequest request = HttpUtil.createPost(niusearchuserurl); +// log.info("request=" + JSONUtil.toJsonStr(map)); +// request.body(JSONUtil.toJsonStr(map), ContentType.JSON.toString()); +// HttpResponse response = request.execute(); +// log.info("response={}", response.body()); +// //转成实体类 +// ObjectMapper objectMapper = new ObjectMapper(); +// try { +// ApiResponse apiResponse = objectMapper.readValue(response.body(), ApiResponse.class); +// ResponseDatad data = apiResponse.getData(); +// List customerList = data.getCustomerList(); +// if (StringUtils.isEmpty(customerList)) { +// log.info("没有找到对应餐卡,无法下单,请联系管理员配置"); +// return new RestResult(Constant.FAILED, "没有找到对应餐卡,无法下单,请联系管理员配置"); +// } +// Customer customer = customerList.get(0); +// //传参 +// HashMap bodyMapForPayContent = new HashMap<>(2); +// //构建 content +// intoMapEnity(bodyMapForPayContent, dto, customer); +// String payContent = JSON.toJSONString(bodyMapForPayContent, SerializerFeature.MapSortField, SerializerFeature.WriteMapNullValue); +// log.info("content: " + payContent); +//// Map payBodyMap = makeSign(payContent, appsecret, bodyMapForPayContent); +// Map payBodyMap = makeSign(payContent, applicationidpsw, bodyMapForPayContent); +// +//// HttpRequest requestForPay = HttpUtil.createPost(IpConfig.PAY_URL_TEST); +// HttpRequest requestForPay = HttpUtil.createPost(niupayurl); +// log.info("request=" + JSONUtil.toJsonStr(payBodyMap)); +// requestForPay.body(JSONUtil.toJsonStr(payBodyMap), ContentType.JSON.toString()); +// HttpResponse responseForPay = requestForPay.execute(); +// log.info("response={}", response.body()); +// log.info("responseForPay={}", responseForPay.body()); +// //转成实体类响应数据 +// ApiResponseForPay apiResponseForPay = objectMapper.readValue(responseForPay.body(), ApiResponseForPay.class); +// if (apiResponseForPay == null) { +// log.error("扣款食堂卡失败,请检查"); +// return new RestResult(Constant.FAILED, "扣款食堂卡无响应,请联系管理员"); +// } +// if (StringUtils.isNotNull(apiResponseForPay) && apiResponseForPay.getCode() == 10000) { +// int result = dao.insert(dto); +// if (result == 1) { +// return new RestResult(Constant.SUCCESS, "扣款成功," + "扣款金额为:" + apiResponseForPay.getData().getRealAmount() + "余额为:" + apiResponseForPay.getData().getWalletBal()); +// } +// } +// return new RestResult(Constant.FAILED, "小牛支付提示:" + apiResponseForPay.getCode() + apiResponseForPay.getMsg()); +// } catch (Exception e) { +// log.error("下单失败"); +// e.printStackTrace(); +// return new RestResult(Constant.FAILED, "有异常 请处理"); +// } +// } +// +// private void intoMapEnity(HashMap bodyMap, CleaningServicesOrder dto, Customer customer) { +// //金额 +// Double usePrice = dto.getUsePrice(); +// int convertedPrice = (int) (usePrice * 100); +// bodyMap.put("amount", convertedPrice); +// //人员 id +// bodyMap.put("custId", Long.valueOf(customer.getCustId())); +// //流水号 +// bodyMap.put("macOrdId", dto.getOrdno()); +// //sn码 +// bodyMap.put("machineSn", sncode); +// // +// bodyMap.put("nuClearMode", 2); +// +// bodyMap.put("ordTime", DateUtils.formatDate(dto.getOrderTime())); +// +// bodyMap.put("deliveryType", "2"); +// } +// +// +// private Map makeSign(String content, String appsecret, HashMap bodyMap) { +// Map map = new TreeMap<>(); +//// map.put("appid", IpConfig.APPLICATION_ID); +// map.put("appid", applicationid); +// map.put("version", "1.0.0"); +// map.put("signtype", "md5"); +// map.put("timestamp", String.valueOf(System.currentTimeMillis())); +// map.put("nonce", RandomUtil.randomNumbers(10)); +// map.put("content", content); +// //生成sign,防篡改 +// String toSignStr = Joiner.on("&") +// .useForNull("") +// .withKeyValueSeparator("=") +// .join(map) + "&appsecret=" + appsecret; +// log.info("所有参数字典排序,待加签String:{}", toSignStr); +// +// // md5/sha256 加签(其他方式待提供) +// String sign = DigestUtils.md5Hex(toSignStr).toUpperCase(); +// System.err.println("sign: " + sign); +// log.info("加签String:{}", sign); +// map.put("sign", sign); +// +// //post请求 +// map.replace("content", bodyMap); +// return map; +// } + + @Override + public AjaxResult getListPageApp(CleaningServicesOrderDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + queryWrapper.eq(CleaningServicesOrder::getUserId, SecurityUtils.getUserId()); + queryWrapper + .eq(CleaningServicesOrder::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CleaningServicesOrder::getCreatedTime); // 降序排序 + + Page result = dao.selectPage(page, queryWrapper); + return AjaxResult.success(result); + } + + @Override + public AjaxResult getListWeb(CleaningServicesOrderDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + if (StringUtils.isNotEmpty(dto.getName())) { + queryWrapper.like(CleaningServicesOrder::getName, dto.getName()); + } + queryWrapper + .eq(CleaningServicesOrder::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CleaningServicesOrder::getCreatedTime); // 降序排序 + + if (StringUtils.isNotEmpty(dto.getTimeType())) { + switch (dto.getTimeType()) { + case Constant.CUTHOTIMS_TIME: + return listByCustomDateRange(page, dto.getBeginTime(), dto.getEndTime(), dto); + case Constant.MNONTH_TIME://2024-12 + return listByMonth(page, dto.getYearMonth(), dto); + case Constant.QUARTER_TIME: + return listByQuarter(page, dto.getYear(), dto.getQuarter(), dto); + case Constant.YEAR_TIME: + return listByYear(page, dto.getYear(), dto); + default: + break; + } + } + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + + // 按月查询订单列表 + public AjaxResult listByMonth(Page page, String yearMonth, CleaningServicesOrderDTO dto) { + //格式为2024-12 + LocalDate startOfMonth = LocalDate.parse(yearMonth + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd")); + LocalDate endOfMonth = startOfMonth.withDayOfMonth(startOfMonth.lengthOfMonth()); + + LambdaQueryWrapper queryWrapper = buildDateRangeQuery( + toUtilDate(startOfMonth.atStartOfDay()), + toUtilDate(endOfMonth.atTime(23, 59, 59)), dto + ); + + + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + // 按季度查询订单列表 + public AjaxResult listByQuarter(Page page, Integer year, Integer quarter, CleaningServicesOrderDTO dto) { + LocalDate startOfQuarter = LocalDate.of(year, (quarter - 1) * 3 + 1, 1); + int lastMonthOfQuarter = ((quarter - 1) * 3 + 3) % 12 + 1; + YearMonth yearMonth = YearMonth.of(year, lastMonthOfQuarter); + int daysInLastMonth = yearMonth.lengthOfMonth(); + LocalDate endOfQuarter = LocalDate.of(year, lastMonthOfQuarter, daysInLastMonth); + + LambdaQueryWrapper queryWrapper = buildDateRangeQuery( + toUtilDate(startOfQuarter.atStartOfDay()), + toUtilDate(endOfQuarter.atTime(23, 59, 59)), dto + ); + + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + // 按年查询订单列表 + public AjaxResult listByYear(Page page, Integer year, CleaningServicesOrderDTO dto) { + LocalDate startOfYear = LocalDate.of(year, 1, 1); + LocalDate endOfYear = LocalDate.of(year, 12, 31); + + LambdaQueryWrapper queryWrapper = buildDateRangeQuery( + toUtilDate(startOfYear.atStartOfDay()), + toUtilDate(endOfYear.atTime(23, 59, 59)), dto + ); + + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + + // 将 LocalDateTime 转换为 Date + private Date toUtilDate(LocalDateTime localDateTime) { + return java.sql.Timestamp.valueOf(localDateTime); + } + + + // 按自定义时间段查询订单列表 + public AjaxResult listByCustomDateRange(Page page, Date startDate, Date endDate, CleaningServicesOrderDTO dto) { + LambdaQueryWrapper queryWrapper = buildDateRangeQuery(startDate, endDate, dto); + + Page result = dao.selectPage(page, queryWrapper); + return AjaxResult.success(result); + + } + + // 构建日期范围查询条件 + private LambdaQueryWrapper buildDateRangeQuery(Date startTime, Date endTime, CleaningServicesOrderDTO dto) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (StringUtils.isNotEmpty(dto.getName())) { + queryWrapper.like(CleaningServicesOrder::getName, dto.getName()); + } + queryWrapper.eq(CleaningServicesOrder::getIsDeleted, "0") + .orderByDesc(CleaningServicesOrder::getCreatedTime); // 降序排序; // 只查询未删除的记录 + queryWrapper.between(CleaningServicesOrder::getOrderTime, startTime, endTime); + return queryWrapper; + } + + @Override + public AjaxResult selectInfoById(CleaningServicesOrder dto) { + CleaningServicesOrder result = dao.selectById(dto.getId()); + if (StringUtils.isNull(result)) { + return AjaxResult.error("此服务不存在"); + } + //处理参数问题 + return AjaxResult.success(result); + } + + + // 构建日期范围查询条件 + private LambdaQueryWrapper buildDateRangeQueryNoPage(Date startTime, Date endTime, CleaningServicesOrderDTO dto) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (StringUtils.isNotEmpty(dto.getName())) { + queryWrapper.like(CleaningServicesOrder::getName, dto.getName()); + } + queryWrapper.eq(CleaningServicesOrder::getIsDeleted, "0"); // 只查询未删除的记录 + queryWrapper.between(CleaningServicesOrder::getOrderTime, startTime, endTime); + return queryWrapper; + } + +} + diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/ICleaningServiceWebService.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/ICleaningServiceWebService.java new file mode 100644 index 00000000..ca952b85 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/ICleaningServiceWebService.java @@ -0,0 +1,30 @@ + package com.bonus.sharedstation.web.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.sharedstation.app.dto.CleaningServicesDTO; +import com.bonus.sharedstation.app.entity.CleaningServicesEntity; + +/** + * 清洁服务 web 维护 Service + * + * @author zhh + * @date 2024-11-15 + */ +public interface ICleaningServiceWebService extends IService { + + AjaxResult insert(CleaningServicesEntity dto); + + + AjaxResult updateInfoById(CleaningServicesEntity dto); + + AjaxResult delete(CleaningServicesEntity dto); + + AjaxResult getListPage(CleaningServicesDTO dto); + + AjaxResult getListPageApp(CleaningServicesDTO dto); + + AjaxResult selectAll(CleaningServicesEntity dto); + + AjaxResult selectInfoById(CleaningServicesEntity dto); +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/impl/CleaningServiceWebServiceImpl.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/impl/CleaningServiceWebServiceImpl.java new file mode 100644 index 00000000..e1d16d2f --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/service/impl/CleaningServiceWebServiceImpl.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2021, orioc and/or its affiliates. All rights reserved. + * Use, Copy is subject to authorized license. + */ +package com.bonus.sharedstation.web.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.sharedstation.api.DictDataApi; +import com.bonus.sharedstation.api.vo.DictDataInfoDO; +import com.bonus.sharedstation.app.dto.CleaningServicesDTO; +import com.bonus.sharedstation.app.entity.CleaningServicesEntity; +import com.bonus.sharedstation.app.mapper.CleaningServicesMapper; +import com.bonus.sharedstation.web.service.ICleaningServiceWebService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Service实现 + * + * @author hyq + * @date 2024-03-15 + */ +@Service +@Transactional(readOnly = true) +@Slf4j +public class CleaningServiceWebServiceImpl extends ServiceImpl implements ICleaningServiceWebService +{ + + + /** + * Dao + */ + @Resource + private CleaningServicesMapper dao; + + @Resource + private DictDataApi dictDataApi; + + @Override + @Transactional(readOnly = false) + public AjaxResult insert(CleaningServicesEntity dto) { + log.info("新增 入参:{} ", dto); + dto.setCreatedBy(SecurityUtils.getUsername()); + dto.setCreatedTime(new Date()); + dto.setIsDeleted("0"); + boolean b = save(dto); + if (!b) { + return AjaxResult.error("新增清洁服务品类价格失败"); + } + return AjaxResult.success("新增清洁服务品类价格成功"); + } + + + @Override + @Transactional(readOnly = false) + public AjaxResult updateInfoById(CleaningServicesEntity dto) { + log.info("修改 入参: {}", dto); + dto.setCreatedBy(SecurityUtils.getUsername()); + dto.setCreatedTime(new Date()); + boolean b = updateById(dto); + if (!b) { + return AjaxResult.error("清洁服务品类价格修改失败"); + } + return AjaxResult.success("清洁服务品类价格修改成功"); + } + + /** + * 分页查询 + * + * @param dto + * @return + */ + @Override + public AjaxResult getListPage(CleaningServicesDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + if (StringUtils.isNotEmpty( dto.getServiceName())){ + queryWrapper.like(CleaningServicesEntity::getServiceName,dto.getServiceName()); + } + if (StringUtils.isNotEmpty( dto.getType())){ + queryWrapper.eq(CleaningServicesEntity::getType,dto.getType()); + } + queryWrapper + .eq(CleaningServicesEntity::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CleaningServicesEntity::getCreatedTime); // 降序排序 + + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + getTypeNameMethd(result); + return AjaxResult.success(result); + } + + /** + * 分页查询 + * + * @param dto + * @return + */ + @Override + public AjaxResult getListPageApp(CleaningServicesDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + if (StringUtils.isNotEmpty( dto.getServiceName())){ + queryWrapper.like(CleaningServicesEntity::getServiceName,dto.getServiceName()); + } + if (StringUtils.isNotEmpty(dto.getType())){ + queryWrapper.eq(CleaningServicesEntity::getType,dto.getType()); + } + queryWrapper + .eq(CleaningServicesEntity::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CleaningServicesEntity::getCreatedTime); // 降序排序 + + Page result = dao.selectPage(page, queryWrapper); + //处理参数问题 + + getTypeNameMethd(result); + return AjaxResult.success(result); + } + + /** + * type类型转换 + * @param result + */ + private void getTypeNameMethd(Page result) { + //处理参数问题 + DictDataInfoDO dictDataInfoDO = new DictDataInfoDO(); + //字典类型 + dictDataInfoDO.setDataType("equipment_type"); + List equipmentTypeList = dictDataApi.getDictionaryInfo("cleaning_type"); + if (StringUtils.isEmpty(equipmentTypeList)) { + throw new RuntimeException("字典数据为空"); + } + Map map = equipmentTypeList.stream() + .collect(Collectors.toMap(DictDataInfoDO::getDataCode, DictDataInfoDO::getDataValue)); + List records = result.getRecords(); + + if (StringUtils.isNotEmpty(records)) { + records.stream().forEach(emergencyEquipment -> { + if (map.containsKey(emergencyEquipment.getType())) { + emergencyEquipment.setTypeName(map.get(emergencyEquipment.getType())); + } + + }); + } + } + + @Override + @Transactional(readOnly = false) + public AjaxResult delete(CleaningServicesEntity dto) { + return AjaxResult.success(dao.deleteById(dto.getId())); + } + + /** + * 查询全部 + * + * @param + * @return + */ + @Override + public AjaxResult selectAll(CleaningServicesEntity dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + queryWrapper + .eq(CleaningServicesEntity::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CleaningServicesEntity::getCreatedTime); // 降序排序 + + List result = dao.selectList(queryWrapper); + return AjaxResult.success(result); + } + + + /** + * 详情 + * + * @param + * @return + */ + @Override + public AjaxResult selectInfoById(CleaningServicesEntity dto) { + CleaningServicesEntity result = dao.selectById(dto.getId()); + if (StringUtils.isNull(result)) { + return AjaxResult.error("不存在"); + } + //处理参数问题 + return AjaxResult.success(result); + } +} diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesMapper.xml new file mode 100644 index 00000000..48131b2d --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesMapper.xml @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into yz_cleaning_services(service_name,type, price, unit, description, created_by, created_time, updated_time, + updated_by, is_deleted, tenant_id) + values (#{serviceName},#{type}, #{price}, #{unit}, #{description}, #{createdBy}, #{createdTime}, #{updatedTime}, + #{updatedBy}, #{isDeleted}, #{tenantId}) + + + + insert into yz_cleaning_services(service_name,type,price, unit, description, created_by, created_time, updated_time, + updated_by, is_deleted, tenant_id) + values + + (#{entity.serviceName}, #{entity.type},#{entity.price}, #{entity.unit}, #{entity.description}, #{entity.createdBy}, + #{entity.createdTime}, #{entity.updatedTime}, #{entity.updatedBy}, #{entity.isDeleted}, #{entity.tenantId}) + + + + + insert into yz_cleaning_services(service_name, type,price, unit, description, created_by, created_time, updated_time, + updated_by, is_deleted, tenant_id) + values + + (#{entity.serviceName}, #{entity.type}, #{entity.price}, #{entity.unit}, #{entity.description}, #{entity.createdBy}, + #{entity.createdTime}, #{entity.updatedTime}, #{entity.updatedBy}, #{entity.isDeleted}, #{entity.tenantId}) + + on duplicate key update + service_name = values(service_name), + price = values(price), + unit = values(unit), + description = values(description), + created_by = values(created_by), + created_time = values(created_time), + updated_time = values(updated_time), + updated_by = values(updated_by), + is_deleted = values(is_deleted), + type = values(type), + tenant_id = values(tenant_id) + + + + + update yz_cleaning_services + + + service_name = #{serviceName}, + + + price = #{price}, + + + unit = #{unit}, + + + description = #{description}, + + + created_by = #{createdBy}, + + + created_time = #{createdTime}, + + + updated_time = #{updatedTime}, + + + updated_by = #{updatedBy}, + + + is_deleted = #{isDeleted}, + + + type = #{type}, + + + tenant_id = #{tenantId}, + + + where id = #{id} + + + + + delete + from yz_cleaning_services + where id = #{id} + + + + diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesOrderMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesOrderMapper.xml new file mode 100644 index 00000000..e78890d7 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/CleaningServicesOrderMapper.xml @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into yz_cleaning_services_order(service_name, ordno, user_id, name, status, order_time, use_price, price, + unit, + description, created_by, created_time, updated_time, updated_by, is_deleted, + tenant_id, phone, service_id,order_pay_info) + values (#{serviceName}, #{ordno},#{userId}, #{name},#{status}, #{orderTime}, #{usePrice}, #{price}, #{unit}, + #{description}, #{createdBy}, #{createdTime}, #{updatedTime}, #{updatedBy}, #{isDeleted}, #{tenantId}, + #{phone}, #{serviceId},#{orderPayInfo}) + + + + insert into yz_cleaning_services_order(service_name, ordno,user_id, name, status, order_time, use_price, price, + unit, + description, created_by, created_time, updated_time, updated_by, is_deleted, tenant_id, phone, service_id) + values + + (#{entity.serviceName}, #{entity.ordno},#{entity.userId}, #{entity.name}, #{entity.status}, + #{entity.orderTime}, + #{entity.usePrice}, #{entity.price}, #{entity.unit}, #{entity.description}, #{entity.createdBy}, + #{entity.createdTime}, #{entity.updatedTime}, #{entity.updatedBy}, #{entity.isDeleted}, #{entity.tenantId}, + #{entity.phone}, #{entity.serviceId}) + + + + + insert into yz_cleaning_services_order(service_name,ordno, user_id, name, status, order_time, use_price, price, + unit, + description, created_by, created_time, updated_time, updated_by, is_deleted, tenant_id, phone, service_id) + values + + (#{entity.serviceName}, #{entity.userId},#{entity.ordno}, #{entity.name}, #{entity.status}, + #{entity.orderTime}, + #{entity.usePrice}, #{entity.price}, #{entity.unit}, #{entity.description}, #{entity.createdBy}, + #{entity.createdTime}, #{entity.updatedTime}, #{entity.updatedBy}, #{entity.isDeleted}, #{entity.tenantId}, + #{entity.phone}, #{entity.serviceId}) + + on duplicate key update + service_name = values(service_name), + user_id = values(user_id), + name = values(name), + status = values(status), + order_time = values(order_time), + use_price = values(use_price), + price = values(price), + unit = values(unit), + description = values(description), + created_by = values(created_by), + created_time = values(created_time), + updated_time = values(updated_time), + updated_by = values(updated_by), + is_deleted = values(is_deleted), + tenant_id = values(tenant_id), + phone = values(phone), + ordno = values(ordno), + service_id = values(service_id) + + + + + update yz_cleaning_services_order + + + service_name = #{serviceName}, + + + user_id = #{userId}, + + + name = #{name}, + + + status = #{status}, + + + order_time = #{orderTime}, + + + use_price = #{usePrice}, + + + price = #{price}, + + + unit = #{unit}, + + + description = #{description}, + + + created_by = #{createdBy}, + + + created_time = #{createdTime}, + + + updated_time = #{updatedTime}, + + + updated_by = #{updatedBy}, + + + is_deleted = #{isDeleted}, + + + tenant_id = #{tenantId}, + + + phone = #{phone}, + + + ordno = #{ordno}, + + + service_id = #{serviceId}, + + + order_pay_info = #{orderPayInfo}, + + + where id = #{id} + + + + + delete + from yz_cleaning_services_order + where id = #{id} + + + + diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/WashClothingOrderInfoMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/WashClothingOrderInfoMapper.xml index 4d494f66..9fe61708 100644 --- a/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/WashClothingOrderInfoMapper.xml +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/app/WashClothingOrderInfoMapper.xml @@ -195,7 +195,7 @@ - delete from yz_wash_clothing_order_info where id = #{id} + update yz_wash_clothing_order_info set is_deleted = '1' where id = #{id}