zouxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
b2984bf215

+ 54 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ChargeTypeController.java

@@ -0,0 +1,54 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.ChargeType;
+import com.ym.mec.web.service.ChargeTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+@RequestMapping("chargeType")
+@Api(tags = "收费类型服务")
+@RestController
+public class ChargeTypeController extends BaseController {
+
+    @Autowired
+    private ChargeTypeService chargeTypeService;
+
+    @ApiOperation(value = "新增收费类型")
+    @PostMapping("/add")
+    public Object add(@RequestBody ChargeType chargeType) {
+        Date date = new Date();
+        chargeType.setCreateTime(date);
+        chargeType.setUpdateTime(date);
+        chargeTypeService.insert(chargeType);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除收费类型")
+    @DeleteMapping("/del/{id}")
+    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
+        chargeTypeService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改收费类型")
+    @PutMapping("/update")
+    public Object update(@RequestBody ChargeType chargeType) {
+        chargeType.setUpdateTime(new Date());
+        chargeTypeService.update(chargeType);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询收费类型列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(@RequestBody QueryInfo queryInfo) {
+        return succeed(chargeTypeService.queryPage(queryInfo));
+    }
+
+}

+ 61 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -0,0 +1,61 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.web.service.MusicGroupPaymentCalenderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.Date;
+import java.util.List;
+
+@RequestMapping("musicGroupPaymentCalender")
+@Api(tags = "乐团缴费日历服务")
+@RestController
+public class MusicGroupPaymentCalenderController extends BaseController {
+
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
+
+    @ApiOperation(value = "新增乐团缴费日历")
+    @PostMapping("/add")
+    public Object add(@RequestBody MusicGroupPaymentCalender musicGroupPaymentCalender) {
+        Date date = new Date();
+        musicGroupPaymentCalender.setCreateTime(date);
+        musicGroupPaymentCalender.setUpdateTime(date);
+        musicGroupPaymentCalenderService.insert(musicGroupPaymentCalender);
+        return succeed();
+    }
+
+    @ApiOperation(value = "批量新增、修改乐团缴费周期")
+    @PostMapping("/batchAdd")
+    public Object batchAdd(@RequestBody List<MusicGroupPaymentCalender> musicGroupPaymentCalenders) {
+        musicGroupPaymentCalenderService.batchInsert(musicGroupPaymentCalenders);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除乐团缴费日历")
+    @DeleteMapping("/del/{id}")
+    public Object del(@ApiParam(value = "乐团缴费日历编号", required = true) @PathVariable("id") Long id) {
+        musicGroupPaymentCalenderService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改乐团缴费日历")
+    @PutMapping("/update")
+    public Object update(@RequestBody MusicGroupPaymentCalender musicGroupPaymentCalender) {
+        musicGroupPaymentCalender.setUpdateTime(new Date());
+        musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询乐团缴费日历列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(@RequestBody QueryInfo queryInfo) {
+        return succeed(musicGroupPaymentCalenderService.queryPage(queryInfo));
+    }
+
+}

+ 5 - 5
mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -69,7 +69,7 @@ public class SubjectController extends BaseController {
         return succeed(subjectService.queryPageTree(queryInfo));
     }
 
-    @ApiOperation(value = "通过乐团编号查询科目列表")
+    @ApiOperation(value = "通过乐团编号查询乐团科目规划")
     @PostMapping("/querySubByMusicGroupId")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
     public Object findSubByMusicGroupId(@RequestBody Integer musicGroupId){
@@ -77,9 +77,9 @@ public class SubjectController extends BaseController {
     }
 
     @ApiOperation(value = "通过乐团收费类型,获取默认的声部列表")
-    @PostMapping("/findSubByChargeType")
-    @ApiImplicitParams({ @ApiImplicitParam(name = "chargeTypeId", value = "收费类型编号", required = true, dataType = "Integer")})
-    public Object findSubByChargeType(@RequestBody Integer chargeTypeId){
-        return succeed(subjectService.findSubByChargeType(chargeTypeId));
+    @PostMapping("/findDefaultSubByGroupId")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
+    public Object findDefaultSubByGroupId(@RequestBody Integer musicGroupId){
+        return succeed(subjectService.findDefaultSubByGroupId(musicGroupId));
     }
 }

+ 6 - 1
mec-web/src/main/java/com/ym/mec/web/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -5,5 +5,10 @@ import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
 
 public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPaymentCalender> {
 
-	
+
+    /**
+     * 根据乐团编号删除乐团缴费周期
+     * @param musicGroupId
+     */
+    void delByGroupId(Integer musicGroupId);
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/SubjectDao.java

@@ -36,4 +36,11 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      * @return
      */
     List<Subject> findByParentId(@Param("parentId") String parentId, @Param("delFlag") YesOrNoEnum delFlag);
+
+    /**
+     * 通过乐团收费类型,获取默认的声部列表
+     * @param musicGroupId
+     * @return
+     */
+    List<Subject> findDefaultSubByGroupId(Integer musicGroupId);
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/service/MusicGroupPaymentCalenderService.java

@@ -3,6 +3,13 @@ package com.ym.mec.web.service;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
 
+import java.util.List;
+
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
 
+    /**
+     * 批量新增、修改乐团缴费周期
+     * @param musicGroupPaymentCalenders
+     */
+    void batchInsert(List<MusicGroupPaymentCalender> musicGroupPaymentCalenders);
 }

+ 0 - 13
mec-web/src/main/java/com/ym/mec/web/service/MusicGroupService.java

@@ -8,17 +8,4 @@ import com.ym.mec.web.dal.utilEntity.SubSettingUtilEntity;
 import java.util.List;
 
 public interface MusicGroupService extends BaseService<String, MusicGroup> {
-
-    /**
-     * 建团申请,提交声部设置
-     * @param subSettingUtilEntitys
-     */
-    void subSetting(List<SubSettingUtilEntity> subSettingUtilEntitys);
-
-    /**
-     * 建团申请,根据乐团编号获取已有声部设置
-     * @param musicGroupId
-     * @return
-     */
-    List<SubSetViewUtilEntity> getSubSetting(Integer musicGroupId);
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/service/SubjectService.java

@@ -37,4 +37,11 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      * @return
      */
     PageInfo<Subject> queryPageTree(SubjectQueryInfo queryInfo);
+
+    /**
+     * 通过乐团收费类型,获取默认的声部列表
+     * @param musicGroupId
+     * @return
+     */
+    List<Subject> findDefaultSubByGroupId(Integer musicGroupId);
 }

+ 14 - 1
mec-web/src/main/java/com/ym/mec/web/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -7,6 +7,9 @@ import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.web.service.MusicGroupPaymentCalenderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
 
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -18,5 +21,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
 		return musicGroupPaymentCalenderDao;
 	}
-	
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void batchInsert(List<MusicGroupPaymentCalender> musicGroupPaymentCalenders) {
+		if(musicGroupPaymentCalenders != null && musicGroupPaymentCalenders.size() > 0){
+			musicGroupPaymentCalenderDao.delByGroupId(musicGroupPaymentCalenders.get(0).getMusicGroupId());
+			musicGroupPaymentCalenders.forEach(e -> {
+				musicGroupPaymentCalenderDao.insert(e);
+			});
+		}
+	}
 }

+ 2 - 69
mec-web/src/main/java/com/ym/mec/web/service/impl/MusicGroupServiceImpl.java

@@ -1,89 +1,22 @@
 package com.ym.mec.web.service.impl;
 
-import com.ym.mec.web.dal.dao.MusicGroupSubjectGoodsGroupDao;
-import com.ym.mec.web.dal.dao.MusicGroupSubjectPlanDao;
-import com.ym.mec.web.dal.dao.SubjectDao;
-import com.ym.mec.web.dal.entity.MusicGroupSubjectGoodsGroup;
-import com.ym.mec.web.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.web.dal.entity.Subject;
-import com.ym.mec.web.dal.utilEntity.SubSetViewUtilEntity;
-import com.ym.mec.web.dal.utilEntity.SubSettingUtilEntity;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.web.dal.dao.MusicGroupDao;
 import com.ym.mec.web.dal.entity.MusicGroup;
 import com.ym.mec.web.service.MusicGroupService;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>  implements MusicGroupService {
 	
 	@Autowired
 	private MusicGroupDao musicGroupDao;
-	@Autowired
-	private SubjectDao subjectDao;
-	@Autowired
-	private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
-	@Autowired
-	private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
 
 	@Override
 	public BaseDAO<String, MusicGroup> getDAO() {
 		return musicGroupDao;
 	}
 
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void subSetting(List<SubSettingUtilEntity> subSettingUtilEntitys) {
-		Subject subject = null;
-		MusicGroupSubjectPlan musicGroupSubjectPlan;
-		Date date = new Date();
-		for (SubSettingUtilEntity e:subSettingUtilEntitys) {
-			subject = subjectDao.get(e.getSubId());
-			//保存、修改乐团科目规划
-			if(subject != null){
-				musicGroupSubjectPlan = new MusicGroupSubjectPlan();
-				musicGroupSubjectPlan.setMusicGroupId(e.getMusicGroupId());
-				musicGroupSubjectPlan.setSubjectId(e.getSubId());
-				musicGroupSubjectPlan.setExpectedStudentNum(e.getExpectedStudentNum());
-				musicGroupSubjectPlan.setUpdateTime(date);
-				if(e.getPlanId() != null){
-					musicGroupSubjectPlan.setId(e.getPlanId());
-					musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
-				}else {
-					musicGroupSubjectPlan.setCreateTime(date);
-					musicGroupSubjectPlanDao.insert(musicGroupSubjectPlan);
-				}
-				//保存、修改乐团科目乐器范围,以及打包商品
-				for (MusicGroupSubjectGoodsGroup m:e.getMusicGroupSubjectGoodsGroups()) {
-					if(m.getId() == null){
-						musicGroupSubjectGoodsGroupDao.insert(m);
-					}else {
-						m.setUpdateTime(date);
-						musicGroupSubjectGoodsGroupDao.update(m);
-					}
-				}
-			}
-		}
-	}
-
-	@Override
-	public List<SubSetViewUtilEntity> getSubSetting(Integer musicGroupId) {
-		//获取已选择的声部
-		List<SubSetViewUtilEntity> subSetViewUtilEntities = musicGroupSubjectPlanDao.findSubByGroupId(musicGroupId);
-		//获取已选的商品组
-		for (SubSetViewUtilEntity subSetViewUtilEntity:subSetViewUtilEntities) {
-			subSetViewUtilEntity.setMusicGroupSubjectGoodsGroups(musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId,subSetViewUtilEntity.getSubId()));
-		}
-		return subSetViewUtilEntities;
-	}
 }

+ 5 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/SubjectServiceImpl.java

@@ -48,6 +48,11 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  imple
 		return pageInfo;
 	}
 
+	@Override
+	public List<Subject> findDefaultSubByGroupId(Integer musicGroupId) {
+		return subjectDao.findDefaultSubByGroupId(musicGroupId);
+	}
+
 	private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
 		//得到根节点对象
 		//获取子节点list

+ 4 - 5
mec-web/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -28,11 +28,6 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
         INSERT INTO music_group_payment_calender
         (id_,music_group_id_,payment_month_,start_payment_date_,create_time_,update_time_)
         VALUES(#{id},#{musicGroupId},#{paymentMonth},#{startPaymentDate},now(),now())
@@ -63,6 +58,10 @@
 		DELETE FROM music_group_payment_calender WHERE id_ = #{id} 
 	</delete>
 
+    <delete id="delByGroupId">
+        DELETE FROM music_group_payment_calender WHERE music_group_id_ = #{musicGroupId}
+    </delete>
+
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupPaymentCalender" parameterType="map">
         SELECT * FROM music_group_payment_calender ORDER BY id_

+ 3 - 0
mec-web/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -94,6 +94,9 @@
     <select id="findByParentId" resultMap="Subject">
         SELECT * FROM subject <include refid="querySubPageSql"/>
     </select>
+    <select id="findDefaultSubByGroupId" resultMap="Subject">
+
+    </select>
     <sql id="querySubPageSql">
         <where>
             <if test="parentId != null">