master
parent
75cff9277e
commit
a7723d2b11
@ -0,0 +1,75 @@
|
|||||||
|
package com.dsic.gj_erp.controller.fd;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.dsic.gj_erp.annotation.AuthFunction;
|
||||||
|
import com.dsic.gj_erp.bean.ResultBean;
|
||||||
|
import com.dsic.gj_erp.bean.fd.DmXqdwcjcd;
|
||||||
|
import com.dsic.gj_erp.service.fd.DmXqdwcjcdService;
|
||||||
|
import io.swagger.annotations.Authorization;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xhj
|
||||||
|
* @since 2023-06-16
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/dmXqdwcjcd")
|
||||||
|
public class DmXqdwcjcdController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
DmXqdwcjcdService dmXqdwcjcdService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getXqdwcjcdList")
|
||||||
|
@AuthFunction
|
||||||
|
public ResultBean getXqdwcjcdList(@RequestBody Map<String, Object> map){
|
||||||
|
QueryWrapper<DmXqdwcjcd>qw= new QueryWrapper<>();
|
||||||
|
qw.eq(StrUtil.isNotEmpty((String)map.get("cjmc")),"cjmc",(String)map.get("cjmc"));
|
||||||
|
qw.eq(StrUtil.isNotEmpty((String)map.get("cdmc")),"cdmc",(String)map.get("cdmc"));
|
||||||
|
qw.eq(StrUtil.isNotEmpty((String)map.get("dwbm")),"dwbm",(String)map.get("dwbm"));
|
||||||
|
qw.orderBy(true,true,"dwbm","cjmc","cdmc");
|
||||||
|
List<DmXqdwcjcd> list = dmXqdwcjcdService.list(qw);
|
||||||
|
return new ResultBean(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/saveXqdwcjcd")
|
||||||
|
@AuthFunction
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResultBean saveXqdwcjcd(@RequestBody List<DmXqdwcjcd>list){
|
||||||
|
dmXqdwcjcdService.saveBatch(list);
|
||||||
|
return new ResultBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateXqdwcjcd")
|
||||||
|
@AuthFunction
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResultBean updateXqdwcjcd(@RequestBody List<DmXqdwcjcd>list){
|
||||||
|
dmXqdwcjcdService.updateBatchById(list);
|
||||||
|
return new ResultBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delXqdwcjcd")
|
||||||
|
@AuthFunction
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResultBean delXqdwcjcd(@RequestBody List<DmXqdwcjcd>list){
|
||||||
|
list.forEach(e->{
|
||||||
|
dmXqdwcjcdService.removeById(e.getCdid());
|
||||||
|
});
|
||||||
|
return new ResultBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue