diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java index 664a7edd3..a0b5b20ff 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/PaymentRuleConfigController.java @@ -17,6 +17,10 @@ public class PaymentRuleConfigController extends BaseController { public ResponseObject getList(PaymentRuleConfig paymentRuleConfig){ return getSuccessResult(paymentRuleConfigService.selectList(paymentRuleConfig)); } + @GetMapping("/selectList") + public ResponseObject selectList(PaymentRuleConfig paymentRuleConfig){ + return getSuccessResult(paymentRuleConfigService.selectListRuleConfig(paymentRuleConfig)); + } @GetMapping("{id}") public ResponseObject getInfo(@PathVariable Integer id){ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java index 05b169a50..0f7be990b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/PaymentRuleConfigService.java @@ -14,6 +14,8 @@ public interface PaymentRuleConfigService extends IService { */ List selectList(PaymentRuleConfig paymentRuleConfig); + List selectListRuleConfig(PaymentRuleConfig paymentRuleConfig); + /** * 根据id查询详情信息 * @param id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java index b9ce6afa5..1de8ac36a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/PaymentRuleConfigServiceImpl.java @@ -38,6 +38,20 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl selectListRuleConfig(PaymentRuleConfig paymentRuleConfig) { + + List paymentRuleConfigs = baseMapper.selectList(new QueryWrapper<>(paymentRuleConfig)); + if (ObjectUtil.isNotEmpty(paymentRuleConfigs)) { + for (PaymentRuleConfig ruleConfig : paymentRuleConfigs) { + List oilConfigs = oilConfigService.selectListByRuleConfigId(ruleConfig.getId()); + ruleConfig.setRuleList(oilConfigs); + } + return paymentRuleConfigs; + } + return paymentRuleConfigs; + } + @Override public PaymentRuleConfig selectRuleById(Integer id) { PaymentRuleConfig paymentRuleConfig = baseMapper.selectById(id); @@ -64,10 +78,12 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl page, MessageTemplate messageTemplate) { + //获取当前登录用户 + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); if (!StringUtils.isEmpty(messageTemplate.getName())){ queryWrapper.like(MessageTemplate::getName,messageTemplate.getName()); @@ -59,6 +66,10 @@ public class MessageTemplateController extends BaseController { if (!StringUtils.isEmpty(messageTemplate.getStatus())){ queryWrapper.eq(MessageTemplate::getStatus,messageTemplate.getStatus()); } + queryWrapper.eq(MessageTemplate::getStoreId,nowAccountInfo.getStoreId()); + if (messageTemplate.getRoeleList() != null && messageTemplate.getRoeleList().size() > 0 ) { + queryWrapper.like(MessageTemplate::getRoleIds, messageTemplate.getRoeleList().get(0)); + } queryWrapper.orderByDesc(MessageTemplate::getCreateTime); IPage page1 = this.messageTemplateService.page(page,queryWrapper); for (MessageTemplate record : page1.getRecords()) { @@ -67,7 +78,15 @@ public class MessageTemplateController extends BaseController { deptIdList.add(Integer.parseInt(s)); } record.setDeptIdList(deptIdList); - } + + if (record.getRoleIds() != null && !record.getRoleIds().equals("")) { + String roleById = ""; + for (String s : record.getRoleIds().split(",")) { + roleById += dutyService.getRoleById(Long.parseLong(s)).getDutyName(); + } + record.setRoleIds(roleById); + } + } return getSuccessResult(page1); } @@ -105,8 +124,21 @@ public class MessageTemplateController extends BaseController { tempId+=dept.getDeptId()+","; } + String roleIds = ""; + for (Integer integer : messageTemplate.getRoeleList()) { + roleIds += integer + ","; + } + messageTemplate.setRoleIds(roleIds); messageTemplate.setDeptNames(tempName.substring(0,tempName.length()-1)); messageTemplate.setDeptIds(tempId.substring(0,tempId.length()-1)); + messageTemplate.setStoreId(nowAccountInfo.getStoreId()); + + // 校验添加时名称是否存在 + int nameList = messageTemplateService.selectMessagesName(messageTemplate.getName()); + + if (nameList == 1) { + return getFailureResult(201,"模版名称已存在"); + } return getSuccessResult(this.messageTemplateService.save(messageTemplate)); } @@ -133,6 +165,11 @@ public class MessageTemplateController extends BaseController { } messageTemplate.setDeptNames(tempName.substring(0,tempName.length()-1)); messageTemplate.setDeptIds(tempId.substring(0,tempId.length()-1)); +// // 校验添加时名称是否存在 +// int nameList = this.getNameList(messageTemplate.getName()); +// if (nameList == 1) { +// return getFailureResult(201,"模版名称已存在"); +// } return getSuccessResult(this.messageTemplateService.updateById(messageTemplate)); } @@ -154,5 +191,20 @@ public class MessageTemplateController extends BaseController { } return getSuccessResult(this.messageTemplateService.removeByIds(idList)); } + + /** + * 查询消息模板名称是否存在 + * @param name 模板名称 + * @return 1 , 0 + */ + @GetMapping("/getMessageTemplate") + public ResponseObject getMessageTemplate(String name){ + return getSuccessResult( messageTemplateService.selectMessagesName(name)); + } + + private int getNameList(String name) { + int i = messageTemplateService.selectMessagesName(name); + return i; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/controller/ReceiptPrintingController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/controller/ReceiptPrintingController.java new file mode 100644 index 000000000..a31b36d6a --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/controller/ReceiptPrintingController.java @@ -0,0 +1,43 @@ +package com.fuint.business.setting.controller; + +import com.fuint.business.setting.entity.ReceiptPrinting; +import com.fuint.business.setting.service.ReceiptPrintingService; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author : ls + * @className: ReceiptPrintingController + * @date : 2024-08-30 10:18 + **/ +@RestController +@RequestMapping("receiptPrinting") +public class ReceiptPrintingController extends BaseController { + + @Resource + private ReceiptPrintingService receiptPrintingService; + + @PostMapping("/addReceiptPrinting") + public ResponseObject addReceiptPrinting(@RequestBody ReceiptPrinting receiptPrinting) { + + int i = receiptPrintingService.addReceiptPrinting(receiptPrinting); + if (i > 0) { + return getSuccessResult("成功"); + } + return getFailureResult(1000, "失败"); + } + + /** + * 根据 油站id查询 + * @param receiptPrinting + * @return + */ + @GetMapping("/queryReceiptPrintingList") + public ResponseObject queryReceiptPrintingList(ReceiptPrinting receiptPrinting) { + return getSuccessResult(receiptPrintingService.queryReceiptPrintingList(receiptPrinting)); + } + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageCostRechargeRecordRepVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageCostRechargeRecordRepVO.java new file mode 100644 index 000000000..e7ed894cd --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageCostRechargeRecordRepVO.java @@ -0,0 +1,24 @@ +package com.fuint.business.setting.entity; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author : ls + * @className: MessageCostRechargeRecordRepVO + * @date : 2024-08-29 11:17 + **/ +@Data +public class MessageCostRechargeRecordRepVO { + + private String deptName; + + private BigDecimal amount; + private BigDecimal unitPrice; + private int messageNum; + private String rechargeUser; + private Date createTime; + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecord.java index 791a4446b..a0b5d3cac 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecord.java @@ -1,12 +1,15 @@ package com.fuint.business.setting.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fuint.framework.entity.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; import java.io.Serializable; @@ -78,5 +81,26 @@ public class MessageRecord extends BaseEntity implements Serializable { */ private String updateBy; + /** + * 发送时间 + */ + private Date sendTime; + + /** + *发送人 + */ + @TableField(exist = false) + private String messageSendee; + /** + *模板名称 + */ + @TableField(exist = false) + private String name; + /** + *模板内容 + */ + @TableField(exist = false) + private String content; + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecordChild.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecordChild.java index 035472009..79d2d32e0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecordChild.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageRecordChild.java @@ -1,6 +1,7 @@ package com.fuint.business.setting.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fuint.framework.entity.BaseEntity; @@ -69,5 +70,10 @@ public class MessageRecordChild extends BaseEntity implements Serializable { * 更新人 */ private String updateBy; + /** + * 所属机构 + */ + @TableField(exist = false) + private String deptNames; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageTemplate.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageTemplate.java index 59de663eb..5658deb91 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageTemplate.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/MessageTemplate.java @@ -49,6 +49,10 @@ public class MessageTemplate extends Model { @TableField(exist = false) private List deptIdList; private String deptNames; + private Integer storeId; + + @TableField(exist = false) + private List roeleList; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/ReceiptPrinting.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/ReceiptPrinting.java new file mode 100644 index 000000000..b5b5ff391 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/entity/ReceiptPrinting.java @@ -0,0 +1,156 @@ +package com.fuint.business.setting.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fuint.framework.entity.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 短信记录(MessageRecord)实体类 + * + * @author makejava + * @since 2024-08-26 16:47:15 + */ +@Data +@TableName("receipt_printing") +@ApiModel(value = "ReceiptPrinting对象", description = "小票打印设置") +public class ReceiptPrinting extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @ApiModelProperty("ID") + @TableId(value = "ID", type = IdType.AUTO) + private Integer id; + /** + * logo设置(0 定义,1 不定义) + */ + private String logoSet; + /** + * 抬头、脚注设置(0 店铺名称,1 标题,2小票类型,3 脚注) + */ + private String headfootSet; + @TableField(exist = false) + private List headfootSets; + /** + * 店铺名称 + */ + private String shopName; + /** + * 标题 + */ + private String title; + /** + * 小票类型 + */ + private String receiptType; + /** + * 脚注 + */ + private String foot; + /** + * 顶部设置(0订单号,1会员号,2车牌号,3会员等级,4手机,5余额,6积分) + */ + private String topSet; + @TableField(exist = false) + private List topSets; + /** + * 订单编号 + */ + private String orderNumber; + /** + * 会员卡号 + */ + private String memberCard; + /** + * 车牌号 + */ + private String plateNumber; + /** + * 会员等级 + */ + private String membershipLevel; + /** + * 手机号码 + */ + private String phoneNumber; + /** + * 会员积分 + */ + private String memberPoints; + /** + * 底部设置(0操作时间,1联系方式,2操作员,3地址,4备注) + */ + private String bottomSet; + @TableField(exist = false) + private List bottomSets; + /** + * 操作时间 + */ + private Date operateTime; + /** + * 联系方式 + */ + private String contactWay; + /** + * 操作员 + */ + private String consoleOperator; + /** + * 地址 + */ + private String address; + /** + * 备注 + */ + private String remarks; + /** + * 二维码设置 + */ + private String codeSet; + /** + * 是否删除 + */ + private Integer deleted; + /** + * 二维码图片 + */ + private String codeImage; + /** + * logo图片 + */ + private String logeImage; + /** + * 油站id + */ + private Integer storeId; + /** + * 创建人名称 + */ + private String createName; + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private String createBy; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 更新人 + */ + private String updateBy; + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageCostMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageCostMapper.java index 1195e2857..49498c8a4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageCostMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageCostMapper.java @@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.setting.entity.MessageCost; +import com.fuint.business.setting.entity.MessageCostRechargeRecordRepVO; import org.apache.ibatis.annotations.Param; public interface MessageCostMapper extends BaseMapper { IPage queryPage(Page page, @Param("entity") MessageCost messageCost); + + IPage getRechargeList(Page page,@Param("storeId")Integer storeId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageRecordMapper.java index fc15c88fe..13835db54 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageRecordMapper.java @@ -4,8 +4,17 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.setting.entity.MessageRecord; +import com.fuint.business.setting.entity.MessageRecordChild; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface MessageRecordMapper extends BaseMapper { IPage queryPage(Page page, @Param("entity") MessageRecord messageRecord); + + int insertRecord(@Param("messageRecord") MessageRecord messageRecord); + + IPage selectPage(Page page, @Param("entity") MessageRecord messageRecord); + + IPage selectChildList(Page page,@Param("messageRecordId") Integer messageRecordId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageTemplateMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageTemplateMapper.java index 1c17f4b5d..fbe4e59a6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageTemplateMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/MessageTemplateMapper.java @@ -2,8 +2,11 @@ package com.fuint.business.setting.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fuint.business.setting.entity.MessageTemplate; +import org.apache.ibatis.annotations.Param; import org.mapstruct.Mapper; +import java.util.List; + /** * (MessageTemplate)表数据库访问层 * @@ -13,5 +16,12 @@ import org.mapstruct.Mapper; @Mapper public interface MessageTemplateMapper extends BaseMapper { + /** + * 查询消息模板名称是否存在 + * @param name 模板名称 + * @return list + */ + List selectMessagesName(@Param("templateName") String name); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/ReceiptPrintingMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/ReceiptPrintingMapper.java new file mode 100644 index 000000000..e87bd301d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/ReceiptPrintingMapper.java @@ -0,0 +1,23 @@ +package com.fuint.business.setting.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.fuint.business.setting.entity.ReceiptPrinting; +import org.apache.ibatis.annotations.Param; +import org.mapstruct.Mapper; + +import java.util.List; + +/** + * (ReceiptPrinting)表数据库访问层 + * + * @author makejava + * @since 2024-07-18 15:37:16 + */ +@Mapper +public interface ReceiptPrintingMapper extends BaseMapper { + + // 更具 stordid查询当前油站小票打印配置 + List queryReceiptPrintingList(@Param("receiptPrinting") ReceiptPrinting receiptPrinting); + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageCostMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageCostMapper.xml index 7bc2c6d45..6fe52e18f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageCostMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageCostMapper.xml @@ -2,7 +2,7 @@ - --> + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageRecordMapper.xml index 182bf5a52..dc052568f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageRecordMapper.xml @@ -26,5 +26,54 @@ ORDER BY create_time DESC + + + INSERT INTO message_record(message_id,store_id,send_status,create_time,create_by,send_time, create_name, send_num, success_num) + VALUES(#{messageRecord.messageId},#{messageRecord.storeId},#{messageRecord.sendStatus},#{messageRecord.createTime}, + #{messageRecord.createBy},#{messageRecord.sendTime},#{messageRecord.createName},#{messageRecord.sendNum}, #{messageRecord.successNum}) + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageTemplateMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageTemplateMapper.xml new file mode 100644 index 000000000..c704c9fb6 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/MessageTemplateMapper.xml @@ -0,0 +1,15 @@ + + + + + + id,name,content,dept_ids,dept_names,role_ids,status,create_name,create_time,create_by,update_time,update_by, + message_id + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/ReceiptPrintingMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/ReceiptPrintingMapper.xml new file mode 100644 index 000000000..9875f02cc --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/mapper/xml/ReceiptPrintingMapper.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageCostService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageCostService.java index f0236133a..20cc7e577 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageCostService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageCostService.java @@ -3,6 +3,7 @@ package com.fuint.business.setting.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.setting.entity.MessageCost; +import com.fuint.business.setting.entity.MessageCostRechargeRecordRepVO; /** * 短信费用信息表(MessageCost)表服务接口 @@ -53,4 +54,11 @@ public interface MessageCostService { */ int deleteById(Integer id); + /** + * 根据stroeId获取充值记录 + * @param storeId 油站id + * @return 分页列表 + */ + IPage getRechargeList(Page page, Integer storeId); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageRecordService.java index fcad05943..d4df0213b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageRecordService.java @@ -3,8 +3,11 @@ package com.fuint.business.setting.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.setting.entity.MessageRecord; +import com.fuint.business.setting.entity.MessageRecordChild; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 短信记录(MessageRecord)表服务接口 * @@ -52,4 +55,6 @@ public interface MessageRecordService { */ int deleteById(Integer id); + IPage selectChildList(Page page,Integer messageRecordId); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageTemplateService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageTemplateService.java index 4cbdbb75c..12b40ba50 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageTemplateService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/MessageTemplateService.java @@ -11,5 +11,7 @@ import com.fuint.business.setting.entity.MessageTemplate; */ public interface MessageTemplateService extends IService { + int selectMessagesName(String name); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/ReceiptPrintingService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/ReceiptPrintingService.java new file mode 100644 index 000000000..a9ac86f6c --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/ReceiptPrintingService.java @@ -0,0 +1,23 @@ +package com.fuint.business.setting.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.fuint.business.setting.entity.ReceiptPrinting; +import com.fuint.framework.web.ResponseObject; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author : ls + * @interfaceName: ReceiptPrintingService + * @date : 2024-08-30 09:59 + **/ +public interface ReceiptPrintingService extends IService { + + int addReceiptPrinting(ReceiptPrinting receiptPrinting); + + ReceiptPrinting queryReceiptPrintingList(ReceiptPrinting receiptPrinting); + + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageCostServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageCostServiceImpl.java index e9c5dfd26..2f5377d3a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageCostServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageCostServiceImpl.java @@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.setting.entity.MessageCost; +import com.fuint.business.setting.entity.MessageCostRechargeRecordRepVO; import com.fuint.business.setting.mapper.MessageCostMapper; import com.fuint.business.setting.service.MessageCostService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.Objects; @@ -24,8 +26,13 @@ import java.util.Objects; @Service("messageCostService") public class MessageCostServiceImpl extends ServiceImpl implements MessageCostService { + @Resource + private MessageCostMapper messageCostMapper; + @Override public IPage queryPage(Page page, MessageCost messageCost) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + messageCost.setStoreId(nowAccountInfo.getStoreId()); return baseMapper.queryPage(page,messageCost); } @@ -62,6 +69,7 @@ public class MessageCostServiceImpl extends ServiceImpl getRechargeList(Page page, Integer storeId) { + return messageCostMapper.getRechargeList(page, storeId); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageRechargeRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageRechargeRecordServiceImpl.java index b6e944656..99476fa74 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageRechargeRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageRechargeRecordServiceImpl.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.setting.entity.MessageRechargeRecord; import com.fuint.business.setting.mapper.MessageRechargeRecordMapper; import com.fuint.business.setting.service.MessageRechargeRecordService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import org.springframework.stereotype.Service; /** @@ -34,6 +36,10 @@ public class MessageRechargeRecordServiceImpl extends ServiceImpl implements MessageRecordService { + @Resource + private MessageRecordChildMapper messageRecordChildMapper; + + @Resource + private MessageRecordMapper messageRecordMapper; + + @Resource + private DutyService dutyService; + @Override public IPage queryPage(Page page, MessageRecord messageRecord) { - return baseMapper.queryPage(page,messageRecord); + AccountInfo nowAccountInfo = this.getUserInfo(); + messageRecord.setStoreId(nowAccountInfo.getStoreId()); + /*Date date = new Date(String.valueOf(messageRecord.getSendTime())); + messageRecord.setSendTime(date);*/ + + IPage record = messageRecordMapper.selectPage(page, messageRecord); + + if (record.getRecords() != null && record.getRecords().size() > 0) { + for (MessageRecord recordRecord : record.getRecords()) { + if (recordRecord.getRoleIds() != null && !recordRecord.getRoleIds().equals("")) { + String roleById = ""; + for (String s : recordRecord.getRoleIds().split(",")) { + roleById += dutyService.getRoleById(Long.parseLong(s)).getDutyName(); + } + recordRecord.setRoleIds(roleById); + } + } + } + return record; +// return baseMapper.queryPage(page,messageRecord); } /** @@ -41,7 +80,51 @@ public class MessageRecordServiceImpl extends ServiceImpl selectChildList(Page page,Integer messageRecordId) { + return messageRecordMapper.selectChildList(page, messageRecordId); + + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageTemplateServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageTemplateServiceImpl.java index 51722a1c2..25c390b6d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageTemplateServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/MessageTemplateServiceImpl.java @@ -6,6 +6,9 @@ import com.fuint.business.setting.entity.MessageTemplate; import com.fuint.business.setting.service.MessageTemplateService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * (MessageTemplate)表服务实现类 * @@ -15,5 +18,16 @@ import org.springframework.stereotype.Service; @Service("messageTemplateService") public class MessageTemplateServiceImpl extends ServiceImpl implements MessageTemplateService { + @Resource + private MessageTemplateMapper messageTemplateMapper; + + @Override + public int selectMessagesName(String name) { + List messageTemplatesList = messageTemplateMapper.selectMessagesName(name); + if (messageTemplatesList != null && messageTemplatesList.size() >0) { + return 1; + } + return 0; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/ReceiptPrintingServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/ReceiptPrintingServiceImpl.java new file mode 100644 index 000000000..eb91e18aa --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/setting/service/impl/ReceiptPrintingServiceImpl.java @@ -0,0 +1,105 @@ +package com.fuint.business.setting.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.setting.entity.ReceiptPrinting; +import com.fuint.business.setting.mapper.ReceiptPrintingMapper; +import com.fuint.business.setting.service.ReceiptPrintingService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author : ls + * @className: ReceiptPrintingServiceImpl + * @date : 2024-08-30 10:00 + **/ +@Service +public class ReceiptPrintingServiceImpl extends ServiceImpl implements ReceiptPrintingService { + + @Resource + private ReceiptPrintingMapper receiptPrintingMapper; + + + @Override + @Transactional + public int addReceiptPrinting(ReceiptPrinting receiptPrinting) { + + // id不为空 查询 删除 + if (receiptPrinting.getId() != null) { + ReceiptPrinting receiptPrinting1 = new ReceiptPrinting(); + receiptPrinting1.setId(receiptPrinting.getId()); + receiptPrinting1.setDeleted(1); + receiptPrintingMapper.updateById(receiptPrinting1); + } + // 为空进行新增 + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + receiptPrinting.setStoreId(nowAccountInfo.getStoreId()); + + if (receiptPrinting.getHeadfootSets() != null && receiptPrinting.getHeadfootSets().size() > 0 ) { + receiptPrinting.setHeadfootSet(chke(receiptPrinting.getHeadfootSets())); + } + + if (receiptPrinting.getTopSets() != null && receiptPrinting.getTopSets().size() > 0 ) { + receiptPrinting.setTopSet(chke(receiptPrinting.getTopSets())); + } + + if (receiptPrinting.getBottomSets() != null && receiptPrinting.getBottomSets().size() > 0 ) { + receiptPrinting.setBottomSet(chke(receiptPrinting.getBottomSets())); + } + + + int insert = receiptPrintingMapper.insert(receiptPrinting); + + return insert; + } + + + + @Override + public ReceiptPrinting queryReceiptPrintingList(ReceiptPrinting receiptPrinting) { + + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + receiptPrinting.setStoreId(nowAccountInfo.getStoreId()); + + List receiptPrintings = receiptPrintingMapper.queryReceiptPrintingList(receiptPrinting); + + // 处理参数 + if (receiptPrintings != null && receiptPrintings.size() > 0 ) { + ReceiptPrinting printing = receiptPrintings.get(0); + if (ObjectUtil.isNotEmpty(printing.getHeadfootSet())) { + printing.setHeadfootSets(getList(printing.getHeadfootSet())); + } + + if (ObjectUtil.isNotEmpty(printing.getTopSet())) { + printing.setTopSets(getList(printing.getTopSet())); + } + + if (ObjectUtil.isNotEmpty(printing.getBottomSet())) { + printing.setBottomSets(getList(printing.getBottomSet())); + } + return printing; + } + return null; + } + + public String chke(List list) { + return list + .stream() + .map(String::valueOf) + .collect(Collectors.joining(", ", "[", "]")); + } + + public List getList(String str) { + String cleanedStr = str.replaceAll("[\\[\\]]", ""); + return Arrays.stream(cleanedStr.split(",\\s*")) + .map(Integer::parseInt) + .collect(Collectors.toList()); + } +} diff --git a/fuintBackend/fuint-application/src/main/resources/application.properties b/fuintBackend/fuint-application/src/main/resources/application.properties index 11db598c7..4c1260df6 100644 --- a/fuintBackend/fuint-application/src/main/resources/application.properties +++ b/fuintBackend/fuint-application/src/main/resources/application.properties @@ -4,7 +4,7 @@ env.profile=dev #env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/ #env.properties.path=F:/work/oilSystem/fuintBackend/configure/ #env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/ -env.properties.path=D:/Code/yuzhan/oil-station/fuintBackend/configure +env.properties.path=D:/dianliang/server/fuintBackend/configure/ #env.properties.path=/www/wwwroot/shenlanshuke/oilAdmin/ # \u6570\u636E\u5E93\u914D\u7F6E