Browse Source

Merge remote-tracking branch 'origin/saas' into saas

zouxuan 3 years ago
parent
commit
1862689182

+ 1 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupSellPriceService.java

@@ -2,9 +2,7 @@ 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> {
 
-}
+}

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupSellPriceServiceImpl.java

@@ -1,15 +1,16 @@
 package com.ym.mec.biz.service.impl;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
 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 {
+public class PracticeGroupSellPriceServiceImpl extends BaseServiceImpl<Integer, PracticeGroupSellPrice> implements PracticeGroupSellPriceService {
 	
 	@Autowired
 	private PracticeGroupSellPriceDao practiceGroupSellPriceDao;
@@ -18,4 +19,5 @@ public class PracticeGroupSellPriceServiceImpl extends BaseServiceImpl<Integer,
 	public BaseDAO<Integer, PracticeGroupSellPrice> getDAO() {
 		return practiceGroupSellPriceDao;
 	}
-}
+
+}

+ 57 - 39
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupSellPriceController.java

@@ -1,51 +1,69 @@
 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.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+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;
 
-@Api(tags = "网管课价格配置")
 @RequestMapping("practiceGroupSellPrice")
+@Api(tags = "网管课价格配置")
 @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();
-    }
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private PracticeGroupSellPriceService practiceGroupSellPriceService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/list')")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(practiceGroupSellPriceService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "organId", value = "分部编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/query')")
+	public Object query(Integer organId) {
+		return succeed(practiceGroupSellPriceService.get(organId));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/add')")
+	public Object add(PracticeGroupSellPrice practiceGroupSellPrice) {
+
+		Date date = new Date();
+		practiceGroupSellPrice.setCreateTime(date);
+		practiceGroupSellPrice.setUpdateTime(date);
+		practiceGroupSellPriceService.insert(practiceGroupSellPrice);
+		return succeed();
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('practiceGroupSellPrice/update')")
+	public Object update(PracticeGroupSellPrice practiceGroupSellPrice) {
+		practiceGroupSellPrice.setUpdateTime(new Date());
+		practiceGroupSellPriceService.update(practiceGroupSellPrice);
+		return succeed();
+	}
 }