parent
5a6c9475af
commit
e7a207c0a6
@ -0,0 +1,30 @@
|
||||
package com.dsic.gj_erp.bean.zyjh;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DmYppyz {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
public Integer id;
|
||||
|
||||
public String dcCh;
|
||||
|
||||
private String dcPl;
|
||||
|
||||
private String dcFd;
|
||||
|
||||
private String kw;
|
||||
|
||||
private String zl;
|
||||
|
||||
private String tz;
|
||||
|
||||
private String lx;
|
||||
|
||||
private String xj;
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.dsic.gj_erp.controller.zyjh;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.zyjh.DmYppyz;
|
||||
import com.dsic.gj_erp.service.zyjh.DmYppyzService;
|
||||
import lombok.AllArgsConstructor;
|
||||
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;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("yppyz")
|
||||
@AllArgsConstructor
|
||||
public class DmYppyzController {
|
||||
|
||||
private final DmYppyzService service;
|
||||
|
||||
@PostMapping("submit")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<?> list(@RequestBody Map<String,List<DmYppyz>> map){
|
||||
if (map.get("add")!=null){
|
||||
map.get("add").forEach(service::save);
|
||||
}
|
||||
|
||||
if (map.get("edit")!=null){
|
||||
service.updateBatchById(map.get("edit"));
|
||||
}
|
||||
|
||||
if (map.get("remove")!=null){
|
||||
List<Integer> remove = map.get("remove").stream().map(DmYppyz::getId).collect(Collectors.toList());
|
||||
service.removeByIds(remove);
|
||||
}
|
||||
|
||||
return new ResultBean<>();
|
||||
}
|
||||
|
||||
@PostMapping("list")
|
||||
public ResultBean<?> list(@RequestBody DmYppyz entity){
|
||||
List<DmYppyz> list = service.list(Wrappers.<DmYppyz>lambdaQuery()
|
||||
.eq(StrUtil.isNotEmpty(entity.getDcCh()), DmYppyz::getDcCh, entity.getDcCh())
|
||||
);
|
||||
return new ResultBean<>(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.dsic.gj_erp.mapper.zyjh;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.zyjh.DmYppyz;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface DmYppyzMapper extends BaseMapper<DmYppyz> {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.dsic.gj_erp.service.zyjh;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dsic.gj_erp.bean.zyjh.DmYppyz;
|
||||
import com.dsic.gj_erp.mapper.zyjh.DmYppyzMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DmYppyzService extends ServiceImpl<DmYppyzMapper, DmYppyz> {
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dsic.gj_erp.mapper.zyjh.YcldwInfoMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue