add:
1. add price list
This commit is contained in:
@@ -49,7 +49,9 @@ public interface PriceListMapper extends BaseMapper<PriceListEntity> {
|
||||
*/
|
||||
List<PriceListVO> selectPriceListPage(IPage page, PriceListVO priceList);
|
||||
|
||||
boolean initByCrossJoin(String tenantId, Long targetDept, Long deptId, Long userId );
|
||||
void initWallByCrossJoin(String tenantId, Long targetDept, Long deptId, Long userId );
|
||||
|
||||
void initShelfByCrossJoin(String tenantId, Long targetDept, Long deptId, Long userId );
|
||||
|
||||
List<PriceListSummaryVO> selectSummaryListPage(IPage page, Long deptId);
|
||||
|
||||
|
||||
@@ -69,8 +69,33 @@
|
||||
order by kpl.price, kc.type
|
||||
</select>
|
||||
|
||||
<insert id="initByCrossJoin">
|
||||
INSERT INTO kiosk_price_list (category_id, shape, material, size, dept_id, tenant_id, create_user, create_dept, create_time,update_user, update_time)
|
||||
<insert id="initWallByCrossJoin">
|
||||
INSERT INTO kiosk_price_list (category_id, shape, material, size, dept_id, tenant_id, create_user, create_dept,
|
||||
create_time, update_user, update_time)
|
||||
SELECT c.id AS category_id,
|
||||
c.shape AS shape,
|
||||
CAST(m.dict_key AS SIGNED) AS material,
|
||||
CAST(s.dict_key AS SIGNED) AS size,
|
||||
#{targetDept} AS dept_id,
|
||||
#{tenantId} AS tenant_id,
|
||||
#{userId},
|
||||
#{deptId},
|
||||
NOW(),
|
||||
#{userId},
|
||||
NOW()
|
||||
FROM kiosk_category c
|
||||
CROSS JOIN blade_dict_biz m
|
||||
ON m.code = 'material_type' AND m.tenant_id = #{tenantId} and m.parent_id != 0
|
||||
CROSS JOIN blade_dict_biz s
|
||||
ON s.code = 'size_type' AND s.tenant_id = #{tenantId} and s.parent_id != 0
|
||||
WHERE c.is_deleted = 0
|
||||
AND c.tenant_id = #{tenantId}
|
||||
AND c.type = 2
|
||||
</insert>
|
||||
|
||||
<insert id="initShelfByCrossJoin">
|
||||
INSERT INTO kiosk_price_list (category_id, shape, material, size, dept_id, tenant_id, create_user, create_dept,
|
||||
create_time, update_user, update_time)
|
||||
SELECT c.id AS category_id,
|
||||
CAST(sh.dict_key AS SIGNED) AS shape,
|
||||
CAST(m.dict_key AS SIGNED) AS material,
|
||||
@@ -83,13 +108,15 @@
|
||||
#{userId},
|
||||
NOW()
|
||||
FROM kiosk_category c
|
||||
CROSS JOIN blade_dict_biz sh
|
||||
ON sh.code = 'shape_type' AND sh.tenant_id = #{tenantId} and sh.parent_id != 0
|
||||
CROSS JOIN blade_dict_biz m
|
||||
ON m.code = 'material_type' AND m.tenant_id = #{tenantId} and m.parent_id != 0
|
||||
CROSS JOIN blade_dict_biz s ON s.code = 'size_type' AND s.tenant_id = #{tenantId} and s.parent_id != 0
|
||||
CROSS JOIN blade_dict_biz s
|
||||
ON s.code = 'size_type' AND s.tenant_id = #{tenantId} and s.parent_id != 0
|
||||
CROSS JOIN blade_dict_biz sh
|
||||
ON sh.code = 'shape_type' AND sh.tenant_id = #{tenantId} and sh.parent_id != 0
|
||||
WHERE c.is_deleted = 0
|
||||
AND c.tenant_id = #{tenantId};
|
||||
AND c.tenant_id = #{tenantId}
|
||||
AND c.type = 1
|
||||
</insert>
|
||||
|
||||
<select id="selectSummaryListPage" resultType="org.springblade.modules.kiosk.pojo.vo.PriceListSummaryVO">
|
||||
|
||||
@@ -67,7 +67,9 @@ public class PriceListServiceImpl extends BaseServiceImpl<PriceListMapper, Price
|
||||
if (dept == null || !Objects.equals(dept.getTenantId(), AuthUtil.getTenantId())) {
|
||||
throw new ServiceException("Invalid parameters");
|
||||
}
|
||||
return baseMapper.initByCrossJoin(AuthUtil.getTenantId(), deptId, Long.valueOf(AuthUtil.getDeptId()), AuthUtil.getUserId() );
|
||||
baseMapper.initWallByCrossJoin(AuthUtil.getTenantId(), deptId, Long.valueOf(AuthUtil.getDeptId()), AuthUtil.getUserId());
|
||||
baseMapper.initShelfByCrossJoin(AuthUtil.getTenantId(), deptId, Long.valueOf(AuthUtil.getDeptId()), AuthUtil.getUserId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user