kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/java/com/kidgrow/oprationcenter/mapper/ProductOrderMapper.java
@@ -1,8 +1,8 @@ package com.kidgrow.oprationcenter.mapper; import com.kidgrow.oprationcenter.model.ProductOrder; import com.kidgrow.db.mapper.SuperMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.kidgrow.db.mapper.SuperMapper; import com.kidgrow.oprationcenter.model.ProductOrder; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -38,4 +38,13 @@ * @return */ int delProductDetail(@Param("orderId") Long orderId); /** * 获取用户套餐的使用状态(正式 和 试用) * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 * @param productOrder * @return */ int getStatus(ProductOrder productOrder); } kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/java/com/kidgrow/oprationcenter/service/IProductOrderService.java
@@ -51,5 +51,14 @@ * @return */ boolean saveProductDetail(Map<String,Object> params,SysUser sysUser); /** * 获取用户套餐的使用状态(正式 和 试用) * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 * @param productOrder * @return */ ResultBody getStatus(ProductOrder productOrder); } kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/java/com/kidgrow/oprationcenter/service/impl/ProductOrderServiceImpl.java
@@ -201,4 +201,21 @@ } return false; } /** * 获取用户套餐的使用状态(正式 和 试用) * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 * @param productOrder * @return */ @Override public ResultBody getStatus(ProductOrder productOrder) { int status = baseMapper.getStatus(productOrder); if (status>0) { return ResultBody.ok().data(true); }else { return ResultBody.ok().data(false); } } } kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/ProductOrderMapper.xml
@@ -153,4 +153,38 @@ UPDATE product_order_record SET is_del=1,update_time=now() WHERE order_id= #{orderId}; UPDATE product_order_detail SET is_del=1,update_time=now() WHERE order_id= #{orderId}; </update> <select id="getStatus" parameterType="com.kidgrow.oprationcenter.model.ProductOrder" resultType="int"> SELECT SUM(total) FROM ( SELECT count(*) total FROM `product_order` order_order LEFT JOIN product_order_record record ON order_order.id = record.order_id WHERE order_order.hospital_id = #{hospitalId} AND order_order.department_id = #{departmentId} AND record.pro_type = 1 AND order_order.enabled = 1 AND order_order.is_del = 0 AND record.enabled = 1 AND record.is_del = 0 UNION ALL SELECT count(*) total FROM `product_order` order_order LEFT JOIN product_order_record record ON order_order.id = record.order_id WHERE order_order.hospital_id = #{hospitalId} AND record.pro_type = 1 AND record.is_share = 1 AND order_order.enabled = 1 AND order_order.is_del = 0 AND record.enabled = 1 AND record.is_del = 0 ) cc </select> </mapper> kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/SaasClientPayMapper.xml
@@ -51,7 +51,7 @@ <if test="p.prepayId != null and p.prepayId !=''"> and prepay_id = #{p.prepayId} </if> <if test="p.type != null "> <if test="p.type != null and p.type !=''"> and type = #{p.type} </if> <if test="p.createUserId != null and p.createUserId !=''"> @@ -128,7 +128,7 @@ <if test="p.prepayId != null and p.prepayId !=''"> and prepay_id = #{p.prepayId} </if> <if test="p.type != null "> <if test="p.type != null and p.type !='' "> and type = #{p.type} </if> <if test="p.createUserId != null and p.createUserId !=''"> kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/controller/ProductOrderController.java
@@ -192,4 +192,10 @@ } return resultBody; } @ApiOperation(value = "获取用户套餐的使用状态") @PostMapping("/getStatus") public ResultBody getStatus(@RequestBody ProductOrder productOrder) { return productOrderService.getStatus(productOrder); } } kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/resources/application.yml
@@ -95,6 +95,7 @@ ignoreSqls: - com.kidgrow.usercenter.mapper.SysRoleMapper.findAll - com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper.findDetailList - com.kidgrow.oprationcenter.mapper.ProductOrderMapper.getStatus pay: