价格配置加个状态

This commit is contained in:
Jerry Yan 2025-04-08 15:05:20 +08:00
parent 692df3a1a2
commit 75eb3732fc
8 changed files with 58 additions and 7 deletions

View File

@ -47,6 +47,15 @@ public class PriceConfigController {
public ApiResponse<Boolean> deletePriceConfig(@PathVariable Integer id) {
priceRepository.clearPriceCache(id);
priceConfigService.removeById(id);
priceRepository.clearPriceCache(id);
return ApiResponse.success(true);
}
@PostMapping("/{id}/status")
public ApiResponse<Boolean> updateStatus(@PathVariable Integer id) {
priceRepository.clearPriceCache(id);
priceConfigService.updateStatus(id);
priceRepository.clearPriceCache(id);
return ApiResponse.success(true);
}

View File

@ -17,4 +17,6 @@ public interface PriceConfigMapper extends BaseMapper<PriceConfigEntity> {
List<PriceConfigRespVO> listByCondition(@Param("req") PriceConfigListReq req);
PriceConfigEntity getPriceByScenicTypeGoods(Long scenicId, Integer type, String goodsId);
int updateStatus(Integer id);
}

View File

@ -33,6 +33,7 @@ public class PriceConfigEntity {
* 划线价格
*/
private BigDecimal slashPrice;
private Integer status;
private Date createTime;
private Date updateTime;
}

View File

@ -30,5 +30,6 @@ public class PriceConfigRespVO {
* 划线价格
*/
private BigDecimal slashPrice;
private Integer status;
private Date createTime;
}

View File

@ -47,12 +47,37 @@ public class FeiETicketPrinter {
//根据打印纸张的宽度自行调整内容的格式可参考下面的样例格式
String content;
content = "<CB>帧途AI旅拍</CB><BR>";
content += "┏━━━━━━━━━━━━━━┓<BR>";
content += "┃┉3制67表01符45制89表23符6┉┃<BR>";
content += "┣━━★━━♢━━◈━━◉━━┫<BR>";
content += "┃123制67表01符45制89表23符678┃<BR>";
content += "┗━━━━━━━━━━━━━━┛<BR>";
content = "<BR><B>世界再大</B><BR>";
content += "<B>你永远是这段旅途</B><BR>";
content += "<B>的焦点</B><BR>";
content += "━━━━━━━━━━━━━━━━<BR>";
content += "<B>正片主演:</B><BR>";
content += "旅途中最靓的你(测试名字很长很长故意不换行)<BR><BR>";
content += "<B>拍摄地点:</B><BR>";
content += "泸定桥<BR><BR>";
content += "<B>拍摄日期:</B><BR>";
content += "2025年4月4日<BR><BR>";
content += "<B>大片内容:</B><BR>";
content += "1.打卡泸定桥专属微电影(2部+)<BR>";
content += "2.打卡录像集(5条)<BR>";
content += "3.打卡照片集(5-10张)<BR>";
content += "━━━━━━━━━━━━━━━━<BR>";
content += "<C>帧帧皆故事 途途有回忆</C>";
content += "<C>扫码即可观赏您的照片及视频</C>";
content += "<BR><QR>https://zhentuai.com</QR>";
content += "<CB>游后微信扫码查看</CB>";
content += "<C>精彩指数:★★★★★</C><BR>";
// content += "┏━━━━━━━━━━━━━━┓<BR>";
// content += "┏━━━━━━━━━━━━━━┓<BR>";
// content += "┏━━━━━━━━━━━━━━┓<BR>";
// content += "┃┉3制67表01符45制89表23符6┉┃<BR>";
// content += "┣━━★━━♢━━◈━━◉━━┫<BR>";
// content += "┣━━★━━♢━━◈━━◉━━┫<BR>";
// content += "┣━━★━━♢━━◈━━◉━━┫<BR>";
// content += "┣━━★━━♢━━◈━━◉━━┫<BR>";
// content += "┃123制67表01符45制89表23符678┃<BR>";
// content += "┗━━━━━━━━━━━━━━┛<BR>";
return doPrint(sn,content,1);
}

View File

@ -19,4 +19,6 @@ public interface PriceConfigService extends IService<PriceConfigEntity> {
void fillGoodsName(List<PriceConfigRespVO> result);
void fillGoodsName(PriceConfigRespVO config);
void updateStatus(Integer id);
}

View File

@ -74,4 +74,9 @@ public class PriceConfigServiceImpl extends ServiceImpl<PriceConfigMapper, Price
item.setGoodsNames(StringUtils.join(goodsNames, ","));
}
}
@Override
public void updateStatus(Integer id) {
baseMapper.updateStatus(id);
}
}

View File

@ -22,6 +22,12 @@
</set>
where id = #{id}
</update>
<update id="updateStatus">
update price_config
set `status` = IF(`status` = 0, 1, 0),
update_time = now()
where id = #{id}
</update>
<delete id="deleteById">
delete from price_config where id = #{id}
@ -51,7 +57,7 @@
<select id="getPriceByScenicTypeGoods" resultType="com.ycwl.basic.model.pc.price.entity.PriceConfigEntity">
select * from price_config
where scenic_id = #{scenicId}
and type = #{type}
and type = #{type} and status = 1
<if test="goodsId != null and goodsId != ''">
and goods_ids like concat('%', #{goodsId}, '%')
</if>