打包管理

This commit is contained in:
梁琦涛
2021-09-09 18:27:09 +08:00
parent 3761a3560a
commit 5f95170c10
2 changed files with 48 additions and 21 deletions
@@ -11,9 +11,11 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.ValidUtil;
import com.jero.pack.entity.PayPackCompany;
import com.jero.pack.service.IPayPackCompanyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -21,12 +23,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* @Description: pay_pack_company
* @Description: 打包关联
* @Author: jeecg-boot
* @Date: 2021-09-07
* @Version: V1.0
*/
@Api(tags="pay_pack_company")
@Api(tags="打包关联")
@RestController
@RequestMapping("/pack/payPackCompany")
@Slf4j
@@ -43,8 +45,8 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param req
* @return
*/
@AutoLog(value = "pay_pack_company-分页列表查询")
@ApiOperation(value="pay_pack_company-分页列表查询", notes="pay_pack_company-分页列表查询")
@AutoLog(value = "打包关联-分页列表查询")
@ApiOperation(value="打包关联-分页列表查询", notes="打包关联-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(PayPackCompany payPackCompany,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -62,10 +64,14 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param payPackCompany
* @return
*/
@AutoLog(value = "pay_pack_company-添加")
@ApiOperation(value="pay_pack_company-添加", notes="pay_pack_company-添加")
@AutoLog(value = "打包关联-添加")
@ApiOperation(value="打包关联-添加", notes="打包关联-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody PayPackCompany payPackCompany) {
StringBuilder msg = ValidUtil.validateAll(payPackCompany);
if(!StringUtils.isBlank(msg)){
return Result.error(msg.toString());
}
payPackCompanyService.save(payPackCompany);
return Result.OK("添加成功!");
}
@@ -76,10 +82,14 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param payPackCompany
* @return
*/
@AutoLog(value = "pay_pack_company-编辑")
@ApiOperation(value="pay_pack_company-编辑", notes="pay_pack_company-编辑")
@PutMapping(value = "/edit")
@AutoLog(value = "打包关联-编辑")
@ApiOperation(value="打包关联-编辑", notes="打包关联-编辑")
@PostMapping(value = "/edit")
public Result<?> edit(@RequestBody PayPackCompany payPackCompany) {
StringBuilder msg = ValidUtil.validateAll(payPackCompany);
if(!StringUtils.isBlank(msg)){
return Result.error(msg.toString());
}
payPackCompanyService.updateById(payPackCompany);
return Result.OK("编辑成功!");
}
@@ -90,10 +100,13 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param id
* @return
*/
@AutoLog(value = "pay_pack_company-通过id删除")
@ApiOperation(value="pay_pack_company-通过id删除", notes="pay_pack_company-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
@AutoLog(value = "打包关联-通过id删除")
@ApiOperation(value="打包关联-通过id删除", notes="打包关联-通过id删除")
@GetMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id") String id) {
if(StringUtils.isBlank(id)){
return Result.error("id不能为空!");
}
payPackCompanyService.removeById(id);
return Result.OK("删除成功!");
}
@@ -104,10 +117,19 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param ids
* @return
*/
@AutoLog(value = "pay_pack_company-批量删除")
@ApiOperation(value="pay_pack_company-批量删除", notes="pay_pack_company-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
@AutoLog(value = "打包关联-批量删除")
@ApiOperation(value="打包关联-批量删除", notes="打包关联-批量删除")
@GetMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
if(StringUtils.isBlank(ids)){
return Result.error("id不能为空!");
}
String[] s = ids.split(",");
for (String s1 : s) {
if(StringUtils.isBlank(s1)){
return Result.error("id不能为空!");
}
}
this.payPackCompanyService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@@ -118,10 +140,13 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param id
* @return
*/
@AutoLog(value = "pay_pack_company-通过id查询")
@ApiOperation(value="pay_pack_company-通过id查询", notes="pay_pack_company-通过id查询")
@AutoLog(value = "打包关联-通过id查询")
@ApiOperation(value="打包关联-通过id查询", notes="打包关联-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
public Result<?> queryById(@RequestParam(name="id") String id) {
if(StringUtils.isBlank(id)){
return Result.error("id不能为空!");
}
PayPackCompany payPackCompany = payPackCompanyService.getById(id);
if(payPackCompany==null) {
return Result.error("未找到对应数据");
@@ -135,7 +160,7 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
* @param request
* @param payPackCompany
*/
@RequestMapping(value = "/exportXls")
@GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PayPackCompany payPackCompany) {
return super.exportXls(request, payPackCompany, PayPackCompany.class, "pay_pack_company");
}
@@ -13,6 +13,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.Size;
/**
* @Description: pay_pack_company
* @Author: jeecg-boot