|
@@ -9,14 +9,8 @@ import com.huimv.farm.damsubsidy.common.token.TokenSign;
|
|
import com.huimv.farm.damsubsidy.common.utils.Result;
|
|
import com.huimv.farm.damsubsidy.common.utils.Result;
|
|
import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
import com.huimv.farm.damsubsidy.common.utils.ResultCode;
|
|
-import com.huimv.farm.damsubsidy.entity.BillBuyInfo;
|
|
|
|
-import com.huimv.farm.damsubsidy.entity.BillIsolated;
|
|
|
|
-import com.huimv.farm.damsubsidy.entity.BillLandingInspection;
|
|
|
|
-import com.huimv.farm.damsubsidy.mapper.BillBuyInfoMapper;
|
|
|
|
-import com.huimv.farm.damsubsidy.mapper.BillIsolatedMapper;
|
|
|
|
-import com.huimv.farm.damsubsidy.entity.SysUser;
|
|
|
|
-import com.huimv.farm.damsubsidy.mapper.BillLandingInspectionMapper;
|
|
|
|
-import com.huimv.farm.damsubsidy.mapper.SysUserMapper;
|
|
|
|
|
|
+import com.huimv.farm.damsubsidy.entity.*;
|
|
|
|
+import com.huimv.farm.damsubsidy.mapper.*;
|
|
import com.huimv.farm.damsubsidy.service.IBillLandingInspectionService;
|
|
import com.huimv.farm.damsubsidy.service.IBillLandingInspectionService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -39,12 +33,14 @@ import java.util.Map;
|
|
@Service
|
|
@Service
|
|
public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingInspectionMapper, BillLandingInspection> implements IBillLandingInspectionService {
|
|
public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingInspectionMapper, BillLandingInspection> implements IBillLandingInspectionService {
|
|
|
|
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private BillLandingInspectionMapper billLandingInspectionMapper;
|
|
private BillLandingInspectionMapper billLandingInspectionMapper;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private BillIsolatedMapper isolatedMapper;
|
|
private BillIsolatedMapper isolatedMapper;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
private BillBuyInfoMapper buyInfoMapper;
|
|
private BillBuyInfoMapper buyInfoMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BillSubsidyMapper subsidyMapper;
|
|
@Resource
|
|
@Resource
|
|
private SysUserMapper sysUserMapper;
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
|
@@ -52,22 +48,15 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String type = paramsMap.get("type");//信息类型
|
|
String type = paramsMap.get("type");//信息类型
|
|
String date = paramsMap.get("date");
|
|
String date = paramsMap.get("date");
|
|
- String startTime = paramsMap.get("startTime");
|
|
|
|
- String endTime = paramsMap.get("endTime");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (startTime != null) {
|
|
|
|
- startTime = startTime + " 00:00:00";
|
|
|
|
- }
|
|
|
|
- if (endTime != null) {
|
|
|
|
- endTime = endTime + " 23:59:59";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
JSONArray jsonArray = new JSONArray();
|
|
if (type == "1") { //检疫申请
|
|
if (type == "1") { //检疫申请
|
|
QueryWrapper<BillLandingInspection> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BillLandingInspection> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.orderByDesc("create_time").between("create_time", startTime, endTime);
|
|
|
|
|
|
+ if (date == null || date == "") {
|
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
|
+ } else {
|
|
|
|
+ queryWrapper.orderByDesc("create_time").eq("inspection_sch",date);
|
|
|
|
+ }
|
|
List<BillLandingInspection> billLandingInspections = billLandingInspectionMapper.selectList(queryWrapper);
|
|
List<BillLandingInspection> billLandingInspections = billLandingInspectionMapper.selectList(queryWrapper);
|
|
for (BillLandingInspection billLandingInspection : billLandingInspections) {
|
|
for (BillLandingInspection billLandingInspection : billLandingInspections) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -75,45 +64,111 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
jsonObject.put("id", billLandingInspection.getId());
|
|
jsonObject.put("id", billLandingInspection.getId());
|
|
jsonObject.put("time", billLandingInspection.getCreateTime());
|
|
jsonObject.put("time", billLandingInspection.getCreateTime());
|
|
jsonObject.put("state", billLandingInspection.getInspectionSch());
|
|
jsonObject.put("state", billLandingInspection.getInspectionSch());
|
|
- jsonArray.add(jsonObject);
|
|
|
|
- }
|
|
|
|
- return new Result(ResultCode.SUCCESS, jsonArray);
|
|
|
|
- }
|
|
|
|
- if (type == "2") { //隔离申请
|
|
|
|
- QueryWrapper<BillIsolated> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.orderByDesc("str_isolated").between("str_isolated", startTime, endTime);
|
|
|
|
- List<BillIsolated> billIsolateds = isolatedMapper.selectList(queryWrapper);
|
|
|
|
- for (BillIsolated billIsolated : billIsolateds) {
|
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
|
- jsonObject.put("name", billIsolated.getInspectionName());
|
|
|
|
- jsonObject.put("time", billIsolated.getStrIsolated());
|
|
|
|
- jsonObject.put("id", billIsolated.getId());
|
|
|
|
- jsonObject.put("state", billIsolated.getIsolatedSch());
|
|
|
|
|
|
+ jsonObject.put("num", billLandingInspection.getInspectionNum());
|
|
jsonArray.add(jsonObject);
|
|
jsonArray.add(jsonObject);
|
|
}
|
|
}
|
|
return new Result(ResultCode.SUCCESS, jsonArray);
|
|
return new Result(ResultCode.SUCCESS, jsonArray);
|
|
}
|
|
}
|
|
//交易信息
|
|
//交易信息
|
|
- if (type == "3") {
|
|
|
|
|
|
+ if (type == "2") {
|
|
QueryWrapper<BillBuyInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BillBuyInfo> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.orderByDesc("create_time").between("create_time", startTime, endTime);
|
|
|
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
List<BillBuyInfo> billBuyInfos = buyInfoMapper.selectList(queryWrapper);
|
|
List<BillBuyInfo> billBuyInfos = buyInfoMapper.selectList(queryWrapper);
|
|
for (BillBuyInfo billBuyInfo : billBuyInfos) {
|
|
for (BillBuyInfo billBuyInfo : billBuyInfos) {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("name", billBuyInfo.getBuyName());
|
|
jsonObject.put("name", billBuyInfo.getBuyName());
|
|
jsonObject.put("id", billBuyInfo.getId());
|
|
jsonObject.put("id", billBuyInfo.getId());
|
|
jsonObject.put("time", billBuyInfo.getCreateTime());
|
|
jsonObject.put("time", billBuyInfo.getCreateTime());
|
|
|
|
+ jsonObject.put("num", billBuyInfo.getInspectionNum());
|
|
jsonArray.add(jsonObject);
|
|
jsonArray.add(jsonObject);
|
|
}
|
|
}
|
|
return new Result(ResultCode.SUCCESS, jsonArray);
|
|
return new Result(ResultCode.SUCCESS, jsonArray);
|
|
}
|
|
}
|
|
//补贴申请
|
|
//补贴申请
|
|
|
|
+ if (type == "3") {
|
|
|
|
+ QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
|
+ List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
|
|
|
|
+ for (BillSubsidy billSubsidy : billSubsidies) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("name", billSubsidy.getSubsidyName());
|
|
|
|
+ jsonObject.put("time", billSubsidy.getCreateTime());
|
|
|
|
+ jsonObject.put("id", billSubsidy.getId());
|
|
|
|
+ jsonObject.put("num", billSubsidy.getInspectionNum());
|
|
|
|
+ jsonArray.add(jsonObject);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //验收信息
|
|
if (type == "4") {
|
|
if (type == "4") {
|
|
- QueryWrapper<BillBuyInfo> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.between("create_time", startTime, endTime).orderByDesc("create_time");
|
|
|
|
|
|
+ QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
|
+
|
|
|
|
+ List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
|
|
|
|
+ for (BillSubsidy billSubsidy : billSubsidies) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("name", billSubsidy.getSubsidyName());
|
|
|
|
+ jsonObject.put("time", billSubsidy.getCreateTime());
|
|
|
|
+ jsonObject.put("state", billSubsidy.getSubsidySch());
|
|
|
|
+ jsonObject.put("id", billSubsidy.getId());
|
|
|
|
+ jsonObject.put("num", billSubsidy.getInspectionNum());
|
|
|
|
+ jsonArray.add(jsonObject);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //支付信息
|
|
|
|
+ if (type == "5") {
|
|
|
|
+ QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.orderByDesc("create_time").eq("subsidy_sch", 3);
|
|
|
|
+ List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
|
|
|
|
+ for (BillSubsidy billSubsidy : billSubsidies) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("name", billSubsidy.getFarmerName() + "的支付信息");
|
|
|
|
+ if (ObjectUtil.isEmpty(billSubsidy.getPayTime())) {
|
|
|
|
+ jsonObject.put("state", "未支付");
|
|
|
|
+ } else {
|
|
|
|
+ jsonObject.put("state", "已支付");
|
|
|
|
+ }
|
|
|
|
+ jsonObject.put("id", billSubsidy.getId());
|
|
|
|
+ jsonObject.put("time", billSubsidy.getCreateTime());
|
|
|
|
+ jsonObject.put("num", billSubsidy.getInspectionNum());
|
|
|
|
+ jsonArray.add(jsonObject);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return new Result(ResultCode.SUCCESS, jsonArray);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
|
+ Integer id = Integer.valueOf(paramsMap.get("id"));
|
|
|
|
+ String num = paramsMap.get("num");
|
|
|
|
+ String type = paramsMap.get("type");
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ if (type == "1") {
|
|
|
|
+ //检疫
|
|
|
|
+ jsonObject.put("data1", billLandingInspectionMapper.selectById(id));
|
|
|
|
+ jsonObject.put("data2", isolatedMapper.selectOne(new QueryWrapper<BillIsolated>().eq("inspection_num", num)));
|
|
|
|
+ }
|
|
|
|
+ if (type == "2") {
|
|
|
|
+ //交易
|
|
|
|
+ jsonObject.put("data1", buyInfoMapper.selectById(id));
|
|
|
|
+ jsonObject.put("data2", billLandingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", num)));
|
|
|
|
+ }
|
|
|
|
+ if (type == "3") {
|
|
|
|
+ //补贴
|
|
|
|
+ jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
|
+ jsonObject.put("data2","");
|
|
|
|
+ }
|
|
|
|
+ if (type == "4") {
|
|
|
|
+ //验收
|
|
|
|
+ jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
|
+ jsonObject.put("data2","");
|
|
|
|
+ }
|
|
|
|
+ if (type == "5") {
|
|
|
|
+ //支付
|
|
|
|
+ jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
|
+ jsonObject.put("data2", "");
|
|
}
|
|
}
|
|
|
|
+ return new Result(ResultCode.SUCCESS, jsonObject);
|
|
|
|
|
|
- return null;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -125,7 +180,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
}
|
|
}
|
|
billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest)+"的落地检疫申请");
|
|
billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest)+"的落地检疫申请");
|
|
billLandingInspection.setCreateTime(DateTime.now());
|
|
billLandingInspection.setCreateTime(DateTime.now());
|
|
- billLandingInspection.setCreateUser(Long.valueOf(TokenSign.getUserName(httpServletRequest)));
|
|
|
|
|
|
+ billLandingInspection.setCreateUser(TokenSign.getUserName(httpServletRequest));
|
|
billLandingInspection.setInspectionType(0);
|
|
billLandingInspection.setInspectionType(0);
|
|
if (this.save(billLandingInspection)){
|
|
if (this.save(billLandingInspection)){
|
|
return Result.SUCCESS();
|
|
return Result.SUCCESS();
|