ソースを参照

网管课价格配置接口

zouxuan 3 年 前
コミット
1e46c89f17

+ 11 - 1
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/TenantInfo.java

@@ -30,13 +30,23 @@ public class TenantInfo {
 	
 	/** 数据源 */
 	private String dataSource;
+
+	private Integer userId;
 	
 	/**  */
 	private java.util.Date createTime;
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

+ 5 - 5
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysRoleServiceImpl.java

@@ -1,12 +1,17 @@
 package com.ym.mec.auth.service.impl;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysRole;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.auth.api.entity.TenantInfo;
 import com.ym.mec.auth.dal.dao.SysRoleDao;
 import com.ym.mec.auth.dal.dao.SysRoleMenuDao;
 import com.ym.mec.auth.service.SysRoleService;
+import com.ym.mec.auth.service.TenantInfoService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -78,12 +83,7 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 	private void batchSave(SysRole sysRole){
 		List<Integer> menuIds = sysRole.getMenuIds();
 		if(menuIds != null && menuIds.size() > 0){
-//			SysRoleMenu sysRoleMenu = new SysRoleMenu(sysRole.getId(),null);
 			sysRoleMenuDao.batchAdd(sysRole.getId(),menuIds, sysRole.getTenantId());
-//			menuIds.forEach(e->{
-//				sysRoleMenu.setMenuId(e);
-//				sysRoleMenuDao.insert(sysRoleMenu);
-//			});
 		}
 	}
 

+ 3 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -12,6 +12,7 @@
 		<result column="contact_name_" property="contactName" />
 		<result column="contact_phone_" property="contactPhone" />
 		<result column="data_source_" property="dataSource" />
+		<result column="user_id_" property="userId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -32,8 +33,8 @@
 	<insert id="insert" parameterType="com.ym.mec.auth.api.entity.TenantInfo"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO tenant_info
-		(id_,name_,address_,domain_name_,logo_url_,contact_name_,contact_phone_,data_source_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{address},#{domainName},#{logoUrl},#{contactName},#{contactPhone},#{dataSource},#{createTime},#{updateTime})
+		(name_,address_,domain_name_,logo_url_,contact_name_,contact_phone_,data_source_,create_time_,update_time_)
+		VALUES(#{name},#{address},#{domainName},#{logoUrl},#{contactName},#{contactPhone},#{dataSource},#{createTime},#{updateTime})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroupSellPrice.java

@@ -13,6 +13,8 @@ public class PracticeGroupSellPrice extends BaseEntity {
 
     private Integer organId;
 
+    private String organName;
+
     private BigDecimal onceOriginalPrice;
 
     private BigDecimal onceActivityPrice;
@@ -51,6 +53,14 @@ public class PracticeGroupSellPrice extends BaseEntity {
 
     private Date updateTime;
 
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public BigDecimal getSingleClassMinutesPrice() {
         return singleClassMinutesPrice;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupSellPriceService.java

@@ -0,0 +1,10 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.common.service.BaseService;
+import org.springframework.stereotype.Service;
+
+@Service
+public interface PracticeGroupSellPriceService extends BaseService<Integer, PracticeGroupSellPrice> {
+
+}

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupSellPriceServiceImpl.java

@@ -0,0 +1,21 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.PracticeGroupSellPriceDao;
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.biz.service.PracticeGroupSellPriceService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PracticeGroupSellPriceServiceImpl extends BaseServiceImpl<Integer, PracticeGroupSellPrice>  implements PracticeGroupSellPriceService {
+	
+	@Autowired
+	private PracticeGroupSellPriceDao practiceGroupSellPriceDao;
+
+	@Override
+	public BaseDAO<Integer, PracticeGroupSellPrice> getDAO() {
+		return practiceGroupSellPriceDao;
+	}
+}

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -338,14 +338,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 vscps.add(new VipGroupStudentCoursePrice(canBuyStudentId, vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getTotalPrice()));
             }
         }
-//        Teacher teacher = teacherService.get(vipGroupApplyBaseInfoDto.getUserId());
-//		if(Objects.isNull(teacher)){
-//		    throw new BizException("教师不存在");
-//        }
-//		if(Objects.isNull(teacher.getTeacherOrganId())){
-//		    throw new BizException("教师部门异常");
-//        }
-//        vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(teacher.getOrganId()));
         //开课时间为排课的第一节课的开始时间
         vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
         //课程结束时间为排课的最后一节课的结束时间

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/PracticeGroupSellPriceMapper.xml

@@ -22,6 +22,7 @@
 		<result column="care_package_price" property="carePackagePrice" />
 		<result column="come_on_package_price" property="comeOnPackagePrice" />
 		<result column="single_class_minutes_price_" property="singleClassMinutesPrice" />
+		<result column="organ_name_" property="organName" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
         <result column="tenant_id_" property="tenantId"/>
@@ -80,7 +81,9 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="PracticeGroupSellPrice" parameterType="map">
-		SELECT * FROM practice_group_sell_price where tenant_id_ = #{tenantId} ORDER BY id_
+		SELECT pgsp.*,o.name_ organ_name_ FROM practice_group_sell_price pgsp
+		LEFT JOIN organization o ON o.id_ = pgsp.organ_id_
+		WHERE pgsp.tenant_id_ = #{tenantId} ORDER BY pgsp.organ_id_
 		<include refid="global.limit" />
 	</select>
 

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.ActivityPlanAddDto;
 import com.ym.mec.biz.dal.entity.ActivityPlan;
 import com.ym.mec.biz.dal.page.ActivityPlanQueryInfo;
@@ -24,8 +22,6 @@ public class ActivityPlanController extends BaseController {
 
     @Autowired
     private ActivityPlanService activityPlanService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private OrganizationService organizationService;
 

+ 51 - 0
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupSellPriceController.java

@@ -0,0 +1,51 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.biz.service.PracticeGroupSellPriceService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@Api(tags = "网管课价格配置")
+@RequestMapping("practiceGroupSellPrice")
+@RestController
+public class PracticeGroupSellPriceController extends BaseController {
+
+    @Autowired
+    private PracticeGroupSellPriceService practiceGroupSellPriceService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/add')")
+    public Object add(@RequestBody PracticeGroupSellPrice practiceGroupSellPrice){
+        practiceGroupSellPriceService.insert(practiceGroupSellPrice);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/update')")
+    public Object update(@RequestBody PracticeGroupSellPrice practiceGroupSellPrice){
+        practiceGroupSellPriceService.update(practiceGroupSellPrice);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/queryPage')")
+    public Object queryPage(QueryInfo queryInfo){
+        return succeed(practiceGroupSellPriceService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/delete")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/delete')")
+    public Object delete(Integer id){
+        practiceGroupSellPriceService.delete(id);
+        return succeed();
+    }
+}