|
|
|
@ -2,6 +2,8 @@ package com.dsic.gj_erp.controller.jcsj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.EmGcrl;
|
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
|
|
|
|
@ -12,7 +14,10 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>
|
|
|
|
@ -32,15 +37,23 @@ public class EmGcrlController {
|
|
|
|
|
@ApiOperation(value = "查询")
|
|
|
|
|
@PostMapping(value = "/getList")
|
|
|
|
|
public ResultBean getList(@RequestBody JSONObject json) {
|
|
|
|
|
List<EmGcrl> emGcrls= emGcrlService.getList(json);
|
|
|
|
|
return new ResultBean(emGcrls);
|
|
|
|
|
// List<EmGcrl> emGcrls= emGcrlService.getList(json);
|
|
|
|
|
List<EmGcrl> emGcrls=emGcrlService.list(new QueryWrapper<EmGcrl>().orderByAsc("gl"));
|
|
|
|
|
Map<String,List<EmGcrl>> years= emGcrls.stream().collect(Collectors.groupingBy(EmGcrl::getNf));
|
|
|
|
|
List<String> restDays= emGcrls.stream().filter(l->l.getXxr().equals("0")).map(EmGcrl::getGl).collect(Collectors.toList());
|
|
|
|
|
int nextYear=Integer.parseInt(emGcrls.get(emGcrls.size()-1).getNf())+1;
|
|
|
|
|
Map map=new HashMap();
|
|
|
|
|
map.put("years",years.keySet());
|
|
|
|
|
map.put("restDays",restDays);
|
|
|
|
|
map.put("nextYear",nextYear);
|
|
|
|
|
return new ResultBean(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "批量修改")
|
|
|
|
|
@PostMapping(value = "/update")
|
|
|
|
|
public ResultBean update(@RequestBody List<EmGcrl> emGcrls) {
|
|
|
|
|
emGcrlService.update(emGcrls);
|
|
|
|
|
public ResultBean update(@RequestBody EmGcrl emGcrl) {
|
|
|
|
|
emGcrlService.update(new UpdateWrapper<EmGcrl>().set("xxr",emGcrl.getXxr()).eq("gl",emGcrl.getGl()));
|
|
|
|
|
|
|
|
|
|
return new ResultBean();
|
|
|
|
|
}
|
|
|
|
|