|
@@ -48,123 +48,86 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
|
|
|
@Override
|
|
|
public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
- String type = paramsMap.get("type");//信息类型
|
|
|
- String date = paramsMap.get("date");
|
|
|
+ Integer type = Integer.parseInt(paramsMap.get("type"));//信息类型
|
|
|
+ String date = paramsMap.get("data");//状态
|
|
|
+ String pageSize = paramsMap.get("pageSize");
|
|
|
+ String pageNum = paramsMap.get("pageNum");
|
|
|
+ if (pageSize == null || pageSize == "") {
|
|
|
+ pageSize = "10";
|
|
|
+ }
|
|
|
+ if (pageNum == null || pageNum == "") {
|
|
|
+ pageNum = "1";
|
|
|
+ }
|
|
|
|
|
|
- JSONArray jsonArray = new JSONArray();
|
|
|
- if (type == "1") { //检疫申请
|
|
|
+ System.out.println(type);
|
|
|
+ if (type == 1) { //检疫申请
|
|
|
QueryWrapper<BillLandingInspection> queryWrapper = new QueryWrapper<>();
|
|
|
if (date == null || date == "") {
|
|
|
queryWrapper.orderByDesc("create_time");
|
|
|
} else {
|
|
|
- queryWrapper.orderByDesc("create_time").eq("inspection_sch",date);
|
|
|
- }
|
|
|
- List<BillLandingInspection> billLandingInspections = billLandingInspectionMapper.selectList(queryWrapper);
|
|
|
- for (BillLandingInspection billLandingInspection : billLandingInspections) {
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("name", billLandingInspection.getInspectionName());
|
|
|
- jsonObject.put("id", billLandingInspection.getId());
|
|
|
- jsonObject.put("time", billLandingInspection.getCreateTime());
|
|
|
- jsonObject.put("state", billLandingInspection.getInspectionSch());
|
|
|
- jsonObject.put("num", billLandingInspection.getInspectionNum());
|
|
|
- jsonArray.add(jsonObject);
|
|
|
+ queryWrapper.orderByDesc("create_time").eq("inspection_sch", date);
|
|
|
}
|
|
|
- return new Result(ResultCode.SUCCESS, jsonArray);
|
|
|
+ Page<BillLandingInspection> billLandingInspectionPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, billLandingInspectionMapper.selectPage(billLandingInspectionPage, queryWrapper));
|
|
|
}
|
|
|
//交易信息
|
|
|
- if (type == "2") {
|
|
|
+ if (type == 2) {
|
|
|
QueryWrapper<BillBuyInfo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.orderByDesc("create_time");
|
|
|
- List<BillBuyInfo> billBuyInfos = buyInfoMapper.selectList(queryWrapper);
|
|
|
- for (BillBuyInfo billBuyInfo : billBuyInfos) {
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("name", billBuyInfo.getBuyName());
|
|
|
- jsonObject.put("id", billBuyInfo.getId());
|
|
|
- jsonObject.put("time", billBuyInfo.getCreateTime());
|
|
|
- jsonObject.put("num", billBuyInfo.getInspectionNum());
|
|
|
- jsonArray.add(jsonObject);
|
|
|
- }
|
|
|
- return new Result(ResultCode.SUCCESS, jsonArray);
|
|
|
+ Page<BillBuyInfo> buyInfoPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, buyInfoMapper.selectPage(buyInfoPage, queryWrapper));
|
|
|
}
|
|
|
//补贴申请
|
|
|
- if (type == "3") {
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
|
|
|
}
|
|
|
//验收信息
|
|
|
- if (type == "4") {
|
|
|
+ if (type == 4) {
|
|
|
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);
|
|
|
- }
|
|
|
+ Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
|
|
|
}
|
|
|
//支付信息
|
|
|
- if (type == "5") {
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
|
|
|
}
|
|
|
- return new Result(ResultCode.SUCCESS, jsonArray);
|
|
|
+ return new Result(ResultCode.FAIL);
|
|
|
}
|
|
|
|
|
|
@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");
|
|
|
+ String num = paramsMap.get("num");//检疫证号
|
|
|
+ Integer type = Integer.parseInt(paramsMap.get("type"));//消息类型
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- if (type == "1") {
|
|
|
+ if (type == 1) {
|
|
|
//检疫
|
|
|
jsonObject.put("data1", billLandingInspectionMapper.selectById(id));
|
|
|
jsonObject.put("data2", isolatedMapper.selectOne(new QueryWrapper<BillIsolated>().eq("inspection_num", num)));
|
|
|
}
|
|
|
- if (type == "2") {
|
|
|
+ if (type == 2) {
|
|
|
//交易
|
|
|
jsonObject.put("data1", buyInfoMapper.selectById(id));
|
|
|
jsonObject.put("data2", billLandingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", num)));
|
|
|
}
|
|
|
- if (type == "3") {
|
|
|
+ if (type == 3) {
|
|
|
//补贴
|
|
|
jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
- jsonObject.put("data2","");
|
|
|
+ jsonObject.put("data2", "");
|
|
|
}
|
|
|
- if (type == "4") {
|
|
|
+ if (type == 4) {
|
|
|
//验收
|
|
|
jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
- jsonObject.put("data2","");
|
|
|
+ jsonObject.put("data2", "");
|
|
|
}
|
|
|
- if (type == "5") {
|
|
|
+ if (type == 5) {
|
|
|
//支付
|
|
|
jsonObject.put("data1", subsidyMapper.selectById(id));
|
|
|
jsonObject.put("data2", "");
|
|
@@ -174,19 +137,30 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Result addPay(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String id = paramsMap.get("id");
|
|
|
+ String url = paramsMap.get("url");
|
|
|
+ BillSubsidy billSubsidy = subsidyMapper.selectById(id);
|
|
|
+ billSubsidy.setPayImgUrl(url);
|
|
|
+ billSubsidy.setIsPay(2);
|
|
|
+ subsidyMapper.updateById(billSubsidy);
|
|
|
+ return new Result(ResultCode.SUCCESS);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Result addApplication(HttpServletRequest httpServletRequest, BillLandingInspection billLandingInspection) {
|
|
|
QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
|
|
|
- landingInspectionQueryWrapper.eq("inspection_num",billLandingInspection.getInspectionNum());
|
|
|
- if (this.count(landingInspectionQueryWrapper) != 0){
|
|
|
- return new Result(10001,"存在相同检疫证号!",false);
|
|
|
+ landingInspectionQueryWrapper.eq("inspection_num", billLandingInspection.getInspectionNum());
|
|
|
+ if (this.count(landingInspectionQueryWrapper) != 0) {
|
|
|
+ return new Result(10001, "存在相同检疫证号!", false);
|
|
|
}
|
|
|
- billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest)+"的落地检疫申请");
|
|
|
+ billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest) + "的落地检疫申请");
|
|
|
billLandingInspection.setCreateTime(DateTime.now());
|
|
|
billLandingInspection.setCreateUser(TokenSign.getUserName(httpServletRequest));
|
|
|
billLandingInspection.setInspectionType(0);
|
|
|
- if (this.save(billLandingInspection)){
|
|
|
+ if (this.save(billLandingInspection)) {
|
|
|
return Result.SUCCESS();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return Result.FAIL();
|
|
|
}
|
|
|
}
|
|
@@ -210,8 +184,6 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
|
|
|
@Override
|
|
|
public Result listApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
- String pageNum = paramsMap.get("pageNum");
|
|
|
- String pageSize = paramsMap.get("pageSize");
|
|
|
String startTime = paramsMap.get("startTime");
|
|
|
String endTime = paramsMap.get("endTime");
|
|
|
String inspectionSch = paramsMap.get("inspectionSch");
|
|
@@ -233,15 +205,10 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
landingInspectionQueryWrapper.le("create_time",endTime);
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(inspectionSch)){
|
|
|
- if (inspectionSch.equals("4")){
|
|
|
- landingInspectionQueryWrapper.eq("inspection_sch",4).or().eq("inspection_sch",5);
|
|
|
- }else {
|
|
|
- landingInspectionQueryWrapper.eq("inspection_sch",inspectionSch);
|
|
|
- }
|
|
|
+ landingInspectionQueryWrapper.eq("inspection_sch",inspectionSch);
|
|
|
}
|
|
|
landingInspectionQueryWrapper.orderByDesc("create_time");
|
|
|
- Page<BillLandingInspection> page = new Page(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
- return new Result(ResultCode.SUCCESS,billLandingInspectionMapper.selectPage(page,landingInspectionQueryWrapper));
|
|
|
+ return new Result(ResultCode.SUCCESS,billLandingInspectionMapper.selectList(landingInspectionQueryWrapper));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -249,7 +216,8 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
String id = paramsMap.get("id");
|
|
|
String rejectReason = paramsMap.get("rejectReason");
|
|
|
BillLandingInspection billLandingInspection = this.getById(id);
|
|
|
- billLandingInspection.setInspectionSch(5);
|
|
|
+// billLandingInspection.setInspectionSch(4);
|
|
|
+ billLandingInspection.setInspectionSch(3);
|
|
|
billLandingInspection.setRejectReason(rejectReason);
|
|
|
billLandingInspection.setReviewed(TokenSign.getUserName(httpServletRequest));
|
|
|
billLandingInspection.setReviewedTime(DateTime.now());
|
|
@@ -261,7 +229,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
public Result agreeApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
String id = paramsMap.get("id");
|
|
|
BillLandingInspection landingInspection = this.getById(id);
|
|
|
- landingInspection.setInspectionSch(2);
|
|
|
+ landingInspection.setInspectionSch(1);
|
|
|
landingInspection.setReviewed(TokenSign.getUserName(httpServletRequest));
|
|
|
landingInspection.setReviewedTime(DateTime.now());
|
|
|
if (this.updateById(landingInspection)){
|