|
|
@ -1,19 +1,28 @@
|
|
|
|
package com.dsic.gj_erp.controller.jcsj;
|
|
|
|
package com.dsic.gj_erp.controller.jcsj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
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.ResultBean;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmBzry;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmBzry;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmBzzz;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmBzzz;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.bean.sy.Dm_zhbmp;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.dao.sy.Dm_zhbmpRepository;
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBzryService;
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBzryService;
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBzzzService;
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBzzzService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
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.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
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.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <p>
|
|
|
|
* <p>
|
|
|
@ -28,13 +37,85 @@ import java.util.List;
|
|
|
|
public class DmBzryController {
|
|
|
|
public class DmBzryController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
DmBzryService service;
|
|
|
|
DmBzryService service;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
Dm_zhbmpRepository dm_zhbmpRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getList")
|
|
|
|
@PostMapping(value = "/getList")
|
|
|
|
public ResultBean getList(@RequestBody DmBzry t){
|
|
|
|
public ResultBean getList(@RequestBody Map map){
|
|
|
|
List<DmBzry> list=service.list(new QueryWrapper<DmBzry>()
|
|
|
|
List<DmBzry> list=service.list(new QueryWrapper<DmBzry>()
|
|
|
|
.eq("resources_code",t.getResourcesCode())
|
|
|
|
|
|
|
|
.eq("flag_status","1"));
|
|
|
|
.eq("flag_status","1").eq(
|
|
|
|
|
|
|
|
StrUtil.isNotEmpty((String)map.get("resourcesCode")),"resources_code",(String)map.get("resourcesCode")).eq(
|
|
|
|
|
|
|
|
StrUtil.isNotEmpty((String)map.get("zyq")),"zyq",(String)map.get("zyq")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
).like( StrUtil.isNotEmpty((String)map.get("userName")),"user_name",(String)map.get("userName"))
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
// list.forEach(e->{
|
|
|
|
|
|
|
|
// e.setZzt(e.getZt());
|
|
|
|
|
|
|
|
// });
|
|
|
|
return new ResultBean(list);
|
|
|
|
return new ResultBean(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getBzryUpdate")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
@AuthFunction
|
|
|
|
|
|
|
|
public ResultBean getBzryUpdate(@RequestBody List<DmBzry> t, HttpServletRequest request){
|
|
|
|
|
|
|
|
String bzry= (String) request.getAttribute("yhms");
|
|
|
|
|
|
|
|
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
|
|
|
|
|
|
|
|
t.forEach(e->{
|
|
|
|
|
|
|
|
e.setXgrq(bzrq);
|
|
|
|
|
|
|
|
e.setXgry(bzry);
|
|
|
|
|
|
|
|
service.updateById(e);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getryBase")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
public ResultBean getryBase(@RequestBody Map mapp, HttpServletRequest request){
|
|
|
|
|
|
|
|
List<DmBzry> resourcesCodes = service.list(new QueryWrapper<DmBzry>().select("DISTINCT resources_code as resourcesCode ")
|
|
|
|
|
|
|
|
.eq("flag_status", "1").ne("isnull(resources_code,'')","").orderBy(true,true,"resources_code"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DmBzry> zyqs = service.list(new QueryWrapper<DmBzry>().select("DISTINCT zyq as zyq ")
|
|
|
|
|
|
|
|
.eq("flag_status", "1").ne("isnull(zyq,'')","").ne("isnull(user_name,'')","").orderBy(true,true,"zyq"));
|
|
|
|
|
|
|
|
List<Dm_zhbmp> kwxxs = dm_zhbmpRepository.findByBMLB("PBBM");
|
|
|
|
|
|
|
|
Map map = new HashMap<>();
|
|
|
|
|
|
|
|
map.put("kwxxs",kwxxs);
|
|
|
|
|
|
|
|
map.put("resourcesCodes",resourcesCodes);
|
|
|
|
|
|
|
|
map.put("zyqs",zyqs);
|
|
|
|
|
|
|
|
return new ResultBean(map);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getBzryInsert")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
@AuthFunction
|
|
|
|
|
|
|
|
public ResultBean getBzryInsert(@RequestBody List<DmBzry> t, HttpServletRequest request){
|
|
|
|
|
|
|
|
String bzry= (String) request.getAttribute("yhms");
|
|
|
|
|
|
|
|
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
|
|
|
|
|
|
|
|
t.forEach(e->{
|
|
|
|
|
|
|
|
e.setXgrq(bzrq);
|
|
|
|
|
|
|
|
e.setXgry(bzry);
|
|
|
|
|
|
|
|
e.setFlagStatus("1");
|
|
|
|
|
|
|
|
service.save(e);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getBzryDel")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
@AuthFunction
|
|
|
|
|
|
|
|
public ResultBean getBzryDel(@RequestBody List<DmBzry> t, HttpServletRequest request){
|
|
|
|
|
|
|
|
String bzry= (String) request.getAttribute("yhms");
|
|
|
|
|
|
|
|
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
|
|
|
|
|
|
|
|
t.forEach(e->{
|
|
|
|
|
|
|
|
service.removeById(e.getId());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|