|
|
@ -1,11 +1,16 @@
|
|
|
|
package com.dsic.gj_erp.controller.pgd;
|
|
|
|
package com.dsic.gj_erp.controller.pgd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.annotation.AuthFunction;
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
|
|
|
|
import com.dsic.gj_erp.bean.pgd.DmPpxxb;
|
|
|
|
import com.dsic.gj_erp.bean.pgd.DmPpxxb;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.mapper.pgd.PgdQmjhMapper;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmQfxqService;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmQfxqService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmYdjhLjService;
|
|
|
|
import com.dsic.gj_erp.service.pgd.DmPpxxbService;
|
|
|
|
import com.dsic.gj_erp.service.pgd.DmPpxxbService;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -15,7 +20,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <p>
|
|
|
|
* <p>
|
|
|
@ -32,22 +40,86 @@ public class DmPpxxbController {
|
|
|
|
|
|
|
|
|
|
|
|
private final DmQfxqService qfxqService;
|
|
|
|
private final DmQfxqService qfxqService;
|
|
|
|
private final DmPpxxbService ppxxbService;
|
|
|
|
private final DmPpxxbService ppxxbService;
|
|
|
|
|
|
|
|
private final PgdQmjhMapper pgdQmjhMapper;
|
|
|
|
|
|
|
|
private final DmYdjhLjService dmYdjhLjService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @PostMapping("getDmppxxbList")
|
|
|
|
|
|
|
|
// public ResultBean<?> getDmppxxbList(@RequestBody DmPpxxb dmPpxxb){
|
|
|
|
|
|
|
|
// List<DmPpxxb> list = ppxxbService.list(Wrappers.<DmPpxxb>lambdaQuery()
|
|
|
|
|
|
|
|
// .eq(DmPpxxb::getDcCh, dmPpxxb.getDcCh())
|
|
|
|
|
|
|
|
// .eq(StrUtil.isNotEmpty(dmPpxxb.getDwh()),DmPpxxb::getDwh, dmPpxxb.getDwh())
|
|
|
|
|
|
|
|
// .eq(StrUtil.isNotEmpty(dmPpxxb.getQy()),DmPpxxb::getQy, dmPpxxb.getQy())
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// return new ResultBean<>(list);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("getDmppxxbList")
|
|
|
|
@PostMapping("getDmppxxbList")
|
|
|
|
public ResultBean<?> getDmppxxbList(@RequestBody DmPpxxb dmPpxxb){
|
|
|
|
public ResultBean<?> getDmppxxbList(@RequestBody Map map){
|
|
|
|
List<DmPpxxb> list = ppxxbService.list(Wrappers.<DmPpxxb>lambdaQuery()
|
|
|
|
List<DmYdjhLj> dmYdjhLjs = pgdQmjhMapper.selectQmByQgAndJh1(map);
|
|
|
|
.eq(DmPpxxb::getDcCh, dmPpxxb.getDcCh())
|
|
|
|
return new ResultBean<>(dmYdjhLjs);
|
|
|
|
.eq(StrUtil.isNotEmpty(dmPpxxb.getDwh()),DmPpxxb::getDwh, dmPpxxb.getDwh())
|
|
|
|
|
|
|
|
.eq(StrUtil.isNotEmpty(dmPpxxb.getQy()),DmPpxxb::getQy, dmPpxxb.getQy())
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return new ResultBean<>(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("saveDmppxxb")
|
|
|
|
@PostMapping("saveDmppxxb")
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public ResultBean<?> save(@RequestBody List<DmPpxxb> list){
|
|
|
|
public ResultBean<?> save(@RequestBody List<DmYdjhLj> list){
|
|
|
|
list.forEach(item-> item.setZt("00"));
|
|
|
|
List<DmYdjhLj>adds =new ArrayList<>();
|
|
|
|
ppxxbService.saveOrUpdateBatchByMultiId(list);
|
|
|
|
list.forEach(e->{
|
|
|
|
|
|
|
|
DmYdjhLj dmYdjhLj= new DmYdjhLj();
|
|
|
|
|
|
|
|
dmYdjhLj.setId(e.getId());
|
|
|
|
|
|
|
|
dmYdjhLj.setQq(e.getQq());
|
|
|
|
|
|
|
|
dmYdjhLj.setDw(e.getDw());
|
|
|
|
|
|
|
|
dmYdjhLj.setPpzt("02");
|
|
|
|
|
|
|
|
adds.add(dmYdjhLj);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
dmYdjhLjService.updateBatchById(adds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// list.forEach(item-> item.setZt("00"));
|
|
|
|
|
|
|
|
// ppxxbService.saveOrUpdateBatchByMultiId(list);
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("saveDmppxxbpg")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
@AuthFunction
|
|
|
|
|
|
|
|
public ResultBean<?> saveDmppxxbpg(@RequestBody List<DmYdjhLj> list, HttpServletRequest request){
|
|
|
|
|
|
|
|
String bzry= (String) request.getAttribute("yhms");
|
|
|
|
|
|
|
|
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
|
|
|
|
|
|
|
|
List<DmYdjhLj>adds =new ArrayList<>();
|
|
|
|
|
|
|
|
list.forEach(e->{
|
|
|
|
|
|
|
|
DmYdjhLj dmYdjhLj= new DmYdjhLj();
|
|
|
|
|
|
|
|
dmYdjhLj.setId(e.getId());
|
|
|
|
|
|
|
|
dmYdjhLj.setPpzt("03");
|
|
|
|
|
|
|
|
dmYdjhLj.setRkry(bzry);
|
|
|
|
|
|
|
|
dmYdjhLj.setRkrq(bzrq);
|
|
|
|
|
|
|
|
adds.add(dmYdjhLj);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
dmYdjhLjService.updateBatchById(adds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// list.forEach(item-> item.setZt("00"));
|
|
|
|
|
|
|
|
// ppxxbService.saveOrUpdateBatchByMultiId(list);
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("saveDmppxxbqr")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
@AuthFunction
|
|
|
|
|
|
|
|
public ResultBean<?> saveDmppxxbqr(@RequestBody List<DmYdjhLj> list, HttpServletRequest request){
|
|
|
|
|
|
|
|
String bzry= (String) request.getAttribute("yhms");
|
|
|
|
|
|
|
|
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
|
|
|
|
|
|
|
|
List<DmYdjhLj>adds =new ArrayList<>();
|
|
|
|
|
|
|
|
list.forEach(e->{
|
|
|
|
|
|
|
|
DmYdjhLj dmYdjhLj= new DmYdjhLj();
|
|
|
|
|
|
|
|
dmYdjhLj.setId(e.getId());
|
|
|
|
|
|
|
|
dmYdjhLj.setPpzt("04");
|
|
|
|
|
|
|
|
dmYdjhLj.setQrry(bzry);
|
|
|
|
|
|
|
|
dmYdjhLj.setQrrq(bzrq);
|
|
|
|
|
|
|
|
adds.add(dmYdjhLj);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
dmYdjhLjService.updateBatchById(adds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// list.forEach(item-> item.setZt("00"));
|
|
|
|
|
|
|
|
// ppxxbService.saveOrUpdateBatchByMultiId(list);
|
|
|
|
return new ResultBean<>();
|
|
|
|
return new ResultBean<>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|