Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
5a872e0c08
|
|
@ -18,8 +18,8 @@ public class CodeGen {
|
|||
private final static String DATABASE = "czg_cashier_test";
|
||||
private final static String OLD_DATABASE = "fycashier";
|
||||
|
||||
private final static boolean IS_OLD_VERSION = false;
|
||||
// private final static boolean IS_OLD_VERSION = true;
|
||||
// private final static boolean IS_OLD_VERSION = false;
|
||||
private final static boolean IS_OLD_VERSION = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
//配置数据源
|
||||
|
|
@ -81,7 +81,7 @@ public class CodeGen {
|
|||
//设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
|
||||
globalConfig.getStrategyConfig()
|
||||
.setTablePrefix("tb_")
|
||||
.setGenerateTable("tb_shop_order_statistic", "tb_shop_prod_statistic", "tb_shop_table_order_statistic");
|
||||
.setGenerateTable("tb_shop_pay_type");
|
||||
|
||||
EntityConfig entityConfig = globalConfig.getEntityConfig();
|
||||
if (IS_OLD_VERSION) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ public class ShopInfoController {
|
|||
@Resource
|
||||
private CurConsInfoService curConsInfoService;
|
||||
|
||||
@Resource
|
||||
private CurShopPayTypeService curShopPayTypeService;
|
||||
|
||||
@RequestMapping("/consInfo")
|
||||
public CzgResult<String> consInfo() {
|
||||
return curConsInfoService.mergeConsData();
|
||||
|
|
@ -100,4 +103,9 @@ public class ShopInfoController {
|
|||
public CzgResult<String> mergeShopAd() {
|
||||
return curShopAdService.mergeShopAd();
|
||||
}
|
||||
|
||||
@RequestMapping("/payType")
|
||||
public CzgResult<String> mergePayType() {
|
||||
return curShopPayTypeService.mergeData();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
package com.czg.mergedata.cur.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺支付类型 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_pay_type")
|
||||
public class CurShopPayType implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 支付类型cash,alipay,weixin,deposit,arrears,virtual,member-account
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 支付类型名称支付类型名称:现金,支付宝,刷卡deposit,挂单arrears,储值member-account自定义virtual
|
||||
*/
|
||||
private String payName;
|
||||
|
||||
/**
|
||||
* 是否快捷展示1是0否
|
||||
*/
|
||||
private Integer isShowShortcut;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 0允许退款 1-不允许退款
|
||||
*/
|
||||
private Integer isRefundable;
|
||||
|
||||
/**
|
||||
* 是否打开钱箱
|
||||
*/
|
||||
private Integer isOpenCashDrawer;
|
||||
|
||||
/**
|
||||
* 0不是 1是 [系统级支付]
|
||||
*/
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 0-非虚拟 1虚拟 virtual
|
||||
*/
|
||||
private Integer isIdeal;
|
||||
|
||||
/**
|
||||
* 0-不显示1显示
|
||||
*/
|
||||
private Integer isDisplay;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sorts;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.czg.mergedata.cur.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.mergedata.cur.entity.CurShopPayType;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 店铺支付类型 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
public interface CurShopPayTypeMapper extends BaseMapper<CurShopPayType> {
|
||||
@Select("truncate tb_shop_pay_type")
|
||||
void truncateTable();
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.czg.mergedata.cur.service;
|
||||
|
||||
import com.czg.mergedata.common.resp.CzgResult;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.mergedata.cur.entity.CurShopPayType;
|
||||
|
||||
/**
|
||||
* 店铺支付类型 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
public interface CurShopPayTypeService extends IService<CurShopPayType> {
|
||||
|
||||
CzgResult<String> mergeData();
|
||||
|
||||
}
|
||||
|
|
@ -63,7 +63,6 @@ public class CurConsInfoServiceImpl extends ServiceImpl<CurConsInfoMapper, CurCo
|
|||
mergeConsGroup();
|
||||
mergeConsInfo();
|
||||
mergeProdConsRelation();
|
||||
|
||||
return CzgResult.success("合并耗材数据成功");
|
||||
}
|
||||
|
||||
|
|
@ -106,6 +105,7 @@ public class CurConsInfoServiceImpl extends ServiceImpl<CurConsInfoMapper, CurCo
|
|||
curConsInfo.setDefaultUnit(oldConsInfo.getDefaultUnit());
|
||||
curConsInfo.setCreateTime(oldConsInfo.getCreateTime());
|
||||
curConsInfo.setUpdateTime(oldConsInfo.getUpdateTime());
|
||||
curConsInfos.add(curConsInfo);
|
||||
});
|
||||
|
||||
saveBatch(curConsInfos);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.czg.mergedata.cur.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.mergedata.common.resp.CzgResult;
|
||||
import com.czg.mergedata.old.service.OldShopPayTypeService;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.mergedata.cur.entity.CurShopPayType;
|
||||
import com.czg.mergedata.cur.mapper.CurShopPayTypeMapper;
|
||||
import com.czg.mergedata.cur.service.CurShopPayTypeService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺支付类型 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
@Service
|
||||
public class CurShopPayTypeServiceImpl extends ServiceImpl<CurShopPayTypeMapper, CurShopPayType> implements CurShopPayTypeService{
|
||||
@Resource
|
||||
private OldShopPayTypeService oldShopPayTypeService;
|
||||
|
||||
@Override
|
||||
public CzgResult<String> mergeData() {
|
||||
mapper.truncateTable();
|
||||
oldShopPayTypeService.list().forEach(item -> {
|
||||
CurShopPayType payType = BeanUtil.copyProperties(item, CurShopPayType.class);
|
||||
payType.setCreateTime(DateUtil.date(item.getCreatedAt()).toLocalDateTime());
|
||||
payType.setUpdateTime(DateUtil.date(item.getUpdatedAt()).toLocalDateTime());
|
||||
save(payType);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.czg.mergedata.old.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_pay_type")
|
||||
public class OldShopPayType implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 支付类型cash,alipay,weixin,deposit,arrears,virtual,member-account
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 支付类型名称支付类型名称:现金,支付宝,刷卡deposit,挂单arrears,储值member-account自定义virtual
|
||||
*/
|
||||
private String payName;
|
||||
|
||||
/**
|
||||
* 是否快捷展示1是0否
|
||||
*/
|
||||
private Integer isShowShortcut;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private String shopId;
|
||||
|
||||
/**
|
||||
* 0允许退款 1-不允许退款
|
||||
*/
|
||||
private Integer isRefundable;
|
||||
|
||||
/**
|
||||
* 是否打开钱箱
|
||||
*/
|
||||
private Integer isOpenCashDrawer;
|
||||
|
||||
/**
|
||||
* 0不是 1是 [系统级支付]
|
||||
*/
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 0-非虚拟 1虚拟 virtual
|
||||
*/
|
||||
private Integer isIdeal;
|
||||
|
||||
/**
|
||||
* 0-不显示1显示
|
||||
*/
|
||||
private Integer isDisplay;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sorts;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.mergedata.old.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.mergedata.old.entity.OldShopPayType;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
public interface OldShopPayTypeMapper extends BaseMapper<OldShopPayType> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.mergedata.old.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.mergedata.old.entity.OldShopPayType;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
public interface OldShopPayTypeService extends IService<OldShopPayType> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.mergedata.old.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.mergedata.old.entity.OldShopPayType;
|
||||
import com.czg.mergedata.old.mapper.OldShopPayTypeMapper;
|
||||
import com.czg.mergedata.old.service.OldShopPayTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务层实现。
|
||||
*
|
||||
* @author Administrator
|
||||
* @since 2025-03-25
|
||||
*/
|
||||
@Service
|
||||
public class OldShopPayTypeServiceImpl extends ServiceImpl<OldShopPayTypeMapper, OldShopPayType> implements OldShopPayTypeService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.mergedata.cur.mapper.CurShopPayTypeMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.mergedata.old.mapper.OldShopPayTypeMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -220,5 +220,11 @@
|
|||
- tb_shop_table_order_statistic 表
|
||||
|
||||
|
||||
### 31. 支付方式
|
||||
> /merge/shopInfo/payType
|
||||
#### 执行表
|
||||
- tb_shop_pay_type 表
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue