|
@@ -1,6 +1,5 @@
|
|
package com.huimv.admin.service.secondary.impl;
|
|
package com.huimv.admin.service.secondary.impl;
|
|
|
|
|
|
-import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
import com.huimv.admin.domain.secondary.DaJqda;
|
|
import com.huimv.admin.domain.secondary.DaJqda;
|
|
import com.huimv.admin.domain.secondary.DaZsda;
|
|
import com.huimv.admin.domain.secondary.DaZsda;
|
|
import com.huimv.admin.repo.secondary.DaJqdaRepo;
|
|
import com.huimv.admin.repo.secondary.DaJqdaRepo;
|
|
@@ -14,7 +13,6 @@ import org.springframework.stereotype.Service;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
-@DS("thired")
|
|
|
|
public class DaZsdaServiceImpl implements DaZsdaService {
|
|
public class DaZsdaServiceImpl implements DaZsdaService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -29,28 +27,32 @@ public class DaZsdaServiceImpl implements DaZsdaService {
|
|
|
|
|
|
return new Result(ResultCode.FAIL);
|
|
return new Result(ResultCode.FAIL);
|
|
}
|
|
}
|
|
- try {
|
|
|
|
|
|
+// try {
|
|
|
|
|
|
entity.setMcid(11);
|
|
entity.setMcid(11);
|
|
- Integer id = rep.findMax().get(0);
|
|
|
|
|
|
+
|
|
entity.setXgsj(new Date());
|
|
entity.setXgsj(new Date());
|
|
|
|
+ entity.setZfbz(0);
|
|
rep.save(entity);
|
|
rep.save(entity);
|
|
|
|
|
|
|
|
|
|
- String JQID = jqdaRepo.findMax().get(0);
|
|
|
|
|
|
|
|
- String jqid = "000"+(Integer.parseInt(JQID)+1);
|
|
|
|
|
|
+ Integer id = rep.findMax().get(0);
|
|
|
|
+ Integer JQID = jqdaRepo.findMax().get(0);
|
|
|
|
+ String Jqid = jqdaRepo.findById(JQID).get().getJQID();
|
|
|
|
+ String jqid = "000"+(Integer.parseInt(Jqid)+1);
|
|
DaJqda daJqda =new DaJqda() ;
|
|
DaJqda daJqda =new DaJqda() ;
|
|
daJqda.setZSID(id);
|
|
daJqda.setZSID(id);
|
|
daJqda.setJQID(jqid);
|
|
daJqda.setJQID(jqid);
|
|
|
|
+ daJqda.setXGSJ(new Date());
|
|
|
|
|
|
jqdaRepo.save(daJqda);
|
|
jqdaRepo.save(daJqda);
|
|
|
|
|
|
|
|
|
|
return new Result(ResultCode.SUCCESS);
|
|
return new Result(ResultCode.SUCCESS);
|
|
- }catch (Exception e){
|
|
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
- }
|
|
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// return new Result(ResultCode.FAIL);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -78,6 +80,7 @@ public class DaZsdaServiceImpl implements DaZsdaService {
|
|
try {
|
|
try {
|
|
entity.setMcid(11);
|
|
entity.setMcid(11);
|
|
entity.setXgsj(new Date());
|
|
entity.setXgsj(new Date());
|
|
|
|
+ entity.setZfbz(0);
|
|
rep.save(entity);
|
|
rep.save(entity);
|
|
return new Result(ResultCode.SUCCESS);
|
|
return new Result(ResultCode.SUCCESS);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -87,16 +90,17 @@ public class DaZsdaServiceImpl implements DaZsdaService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result findAll(String name , Integer pageNum , Integer pageSize) {
|
|
public Result findAll(String name , Integer pageNum , Integer pageSize) {
|
|
- try {
|
|
|
|
|
|
+// try {
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
Integer startPage = (pageNum-1) * pageSize;
|
|
Integer startPage = (pageNum-1) * pageSize;
|
|
List<DaZsda> all = rep.findAll(name,startPage,pageSize);
|
|
List<DaZsda> all = rep.findAll(name,startPage,pageSize);
|
|
- int size = all.size() ;
|
|
|
|
|
|
+ int size = rep.findAlla().size();
|
|
map.put("total",size);
|
|
map.put("total",size);
|
|
map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
- Map map1 = new HashMap();
|
|
|
|
|
|
+
|
|
List list = new ArrayList();
|
|
List list = new ArrayList();
|
|
for (DaZsda daZsda : all) {
|
|
for (DaZsda daZsda : all) {
|
|
|
|
+ Map map1 = new HashMap();
|
|
Integer id = daZsda.getId();
|
|
Integer id = daZsda.getId();
|
|
map1.put("id",id);
|
|
map1.put("id",id);
|
|
map1.put("csq1",daZsda.getCsq1());
|
|
map1.put("csq1",daZsda.getCsq1());
|
|
@@ -118,15 +122,21 @@ public class DaZsdaServiceImpl implements DaZsdaService {
|
|
map1.put("zsmc",daZsda.getZsmc());
|
|
map1.put("zsmc",daZsda.getZsmc());
|
|
map1.put("zsqy",daZsda.getZsqy());
|
|
map1.put("zsqy",daZsda.getZsqy());
|
|
map1.put("ssqy",daZsda.getSsqy());
|
|
map1.put("ssqy",daZsda.getSsqy());
|
|
- map1.put("jqid",jqdaRepo.findAllByZSID(id).get(0).getJQID());
|
|
|
|
|
|
+ List<DaJqda> allByZSID = jqdaRepo.findAllByZSID(id);
|
|
|
|
+ if (allByZSID != null && allByZSID.size()>0){
|
|
|
|
+ map1.put("jqid",allByZSID.get(0).getJQID());
|
|
|
|
+ }else {
|
|
|
|
+ map1.put("jqid",null);
|
|
|
|
+ }
|
|
|
|
+
|
|
list.add(map1);
|
|
list.add(map1);
|
|
}
|
|
}
|
|
map.put("data",list);
|
|
map.put("data",list);
|
|
|
|
|
|
return new Result(ResultCode.SUCCESS,map);
|
|
return new Result(ResultCode.SUCCESS,map);
|
|
- }catch (Exception e){
|
|
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
- }
|
|
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// return new Result(ResultCode.FAIL);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|