|
@@ -80,9 +80,9 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
} else if (Integer.parseInt(type) == 1) {
|
|
|
queryWrapper.eq("subsidy_sch", 0).orderByDesc("create_time");
|
|
|
} else if (Integer.parseInt(type) == 2) {
|
|
|
- queryWrapper.in("subsidy_sch", 1,5).orderByDesc("create_time");
|
|
|
+ queryWrapper.in("subsidy_sch", 1, 5).orderByDesc("create_time");
|
|
|
} else {
|
|
|
- queryWrapper.in("subsidy_sch", 2,3).orderByDesc("create_time");
|
|
|
+ queryWrapper.in("subsidy_sch", 2, 3).orderByDesc("create_time");
|
|
|
}
|
|
|
Page<BillSubsidy> page = new Page(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
// List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
|
|
@@ -115,7 +115,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
if (type == 1) {
|
|
|
String refuseReason = paramsMap.get("refuseReason"); //拒绝理由
|
|
|
if (refuseReason == "" || refuseReason == null) {
|
|
|
- return new Result(10001, "拒绝理由不能为空!",false);
|
|
|
+ return new Result(10001, "拒绝理由不能为空!", false);
|
|
|
}
|
|
|
QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("id", id);
|
|
@@ -158,10 +158,10 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
if (type == 1) { //驳回
|
|
|
String rejectReason = paramsMap.get("rejectReason");
|
|
|
if (rejectReason == null || "".equals(rejectReason)) {
|
|
|
- return new Result(10001, "驳回理由不能为空!",false);
|
|
|
+ return new Result(10001, "驳回理由不能为空!", false);
|
|
|
}
|
|
|
if (workAccptUrl == null || "".equals(workAccptUrl)) {
|
|
|
- return new Result(10001, "工作验收表不能为空!",false);
|
|
|
+ return new Result(10001, "工作验收表不能为空!", false);
|
|
|
}
|
|
|
billSubsidy.setSubsidySch(4);
|
|
|
billSubsidy.setRejectReason(rejectReason);
|
|
@@ -224,28 +224,28 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
String bankCardId = billSubsidy.getBankCardId();
|
|
|
Long id = TokenSign.getMemberIdByJwtToken(httpServletRequest);
|
|
|
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().eq("id", id));
|
|
|
- if (billSubsidy.getExistNum() < billSubsidy.getImportNum()){
|
|
|
- return new Result(10001,"引进数应小于或等于存栏数!",false);
|
|
|
+ if (billSubsidy.getExistNum() < billSubsidy.getImportNum()) {
|
|
|
+ return new Result(10001, "引进数应小于或等于存栏数!", false);
|
|
|
}
|
|
|
- if (billSubsidy.getImportNum() < billSubsidy.getRewardNum()){
|
|
|
- return new Result(10001,"奖补数应小于或等于引进数!",false);
|
|
|
+ if (billSubsidy.getImportNum() < billSubsidy.getRewardNum()) {
|
|
|
+ return new Result(10001, "奖补数应小于或等于引进数!", false);
|
|
|
}
|
|
|
- if(!(BankUtil.checkBankCard(bankCardId))){
|
|
|
- return new Result(10001,"银行卡号不符合标准!",false);
|
|
|
+ if (!(BankUtil.checkBankCard(bankCardId))) {
|
|
|
+ return new Result(10001, "银行卡号不符合标准!", false);
|
|
|
}
|
|
|
- if (ObjectUtil.isEmpty(BankUtil.getname(bankCardId))){
|
|
|
- return new Result(10001,"补贴账号有误,请检查!",false);
|
|
|
+ if (ObjectUtil.isEmpty(BankUtil.getname(bankCardId))) {
|
|
|
+ return new Result(10001, "补贴账号有误,请检查!", false);
|
|
|
}
|
|
|
for (String eartag : eartags) {
|
|
|
- if (!eartag.contains("-")){
|
|
|
+ if (!eartag.contains("-")) {
|
|
|
BaseAnimal animal = baseAnimalMapper.selectOne(new QueryWrapper<BaseAnimal>().eq("earatg_no", eartag));
|
|
|
animal.setIsLoated(1);
|
|
|
baseAnimalMapper.updateById(animal);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
String start = eartag.substring(0, eartag.indexOf("-"));
|
|
|
String end = eartag.substring(eartag.indexOf("-") + 1);
|
|
|
String substring = start.substring(0, start.length() - end.length());
|
|
|
- String finish = substring+end;
|
|
|
+ String finish = substring + end;
|
|
|
List<Integer> numbers = new ArrayList<>();
|
|
|
for (int i = Integer.parseInt(start); i <= Integer.parseInt(finish); i++) {
|
|
|
numbers.add(i);
|
|
@@ -259,7 +259,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
}
|
|
|
}
|
|
|
billSubsidy.setBankName(BankUtil.getname(bankCardId));
|
|
|
- billSubsidy.setSubsidyName(billSubsidy.getFarmerName()+"的补贴申请");
|
|
|
+ billSubsidy.setSubsidyName(billSubsidy.getFarmerName() + "的补贴申请");
|
|
|
billSubsidy.setDetailedAdress(sysUser.getDetailedAdress());
|
|
|
billSubsidy.setDetailedAdressCode(sysUser.getDetailedAdressCode());
|
|
|
billSubsidy.setBriefAddress(sysUser.getBriefAddress());
|
|
@@ -269,10 +269,10 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
billSubsidy.setSubsidySch(0);
|
|
|
Long userName = id;
|
|
|
BillSubsidy subsidy = this.getOne(new QueryWrapper<BillSubsidy>().eq("create_user", userName).eq("subsidy_sch", 7));
|
|
|
- if (ObjectUtil.isEmpty(subsidy)){
|
|
|
+ if (ObjectUtil.isEmpty(subsidy)) {
|
|
|
this.save(billSubsidy);
|
|
|
- }else {
|
|
|
- this.update(billSubsidy,new QueryWrapper<BillSubsidy>().eq("create_user",userName).eq("subsidy_sch",7));
|
|
|
+ } else {
|
|
|
+ this.update(billSubsidy, new QueryWrapper<BillSubsidy>().eq("create_user", userName).eq("subsidy_sch", 7));
|
|
|
}
|
|
|
return Result.SUCCESS();
|
|
|
}
|
|
@@ -283,10 +283,10 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
BillSubsidy subsidy = this.getOne(new QueryWrapper<BillSubsidy>().eq("create_user", userName).eq("subsidy_sch", 7));
|
|
|
billSubsidy.setSubsidySch(7);
|
|
|
billSubsidy.setCreateUser(userName);
|
|
|
- if (ObjectUtil.isEmpty(subsidy)){
|
|
|
+ if (ObjectUtil.isEmpty(subsidy)) {
|
|
|
this.save(billSubsidy);
|
|
|
- }else {
|
|
|
- this.update(billSubsidy,new QueryWrapper<BillSubsidy>().eq("create_user",userName).eq("subsidy_sch",7));
|
|
|
+ } else {
|
|
|
+ this.update(billSubsidy, new QueryWrapper<BillSubsidy>().eq("create_user", userName).eq("subsidy_sch", 7));
|
|
|
}
|
|
|
return Result.SUCCESS();
|
|
|
}
|
|
@@ -306,8 +306,8 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
}
|
|
|
|
|
|
QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.between(StringUtils.isNotBlank(date),"create_time", date+" 00:00:00",date+" 23:59:59")
|
|
|
- .like(StringUtils.isNotBlank(userName),"farmer_name", userName);
|
|
|
+ queryWrapper.between(StringUtils.isNotBlank(date), "create_time", date + " 00:00:00", date + " 23:59:59")
|
|
|
+ .like(StringUtils.isNotBlank(userName), "farmer_name", userName);
|
|
|
|
|
|
if (Integer.parseInt(type) == 7) {
|
|
|
queryWrapper.eq("is_pay", 1).orderByDesc("create_time");
|
|
@@ -320,11 +320,11 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, queryWrapper));
|
|
|
}
|
|
|
if (Integer.parseInt(type) == 3) {
|
|
|
- queryWrapper.in("is_pay", 0,1).eq("subsidy_sch",3).orderByDesc("create_time");
|
|
|
+ queryWrapper.in("is_pay", 0, 1).eq("subsidy_sch", 3).orderByDesc("create_time");
|
|
|
Page<BillSubsidy> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, queryWrapper));
|
|
|
}
|
|
|
- queryWrapper.eq(StringUtils.isNotBlank(type),"subsidy_sch",type).orderByDesc("create_time");
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(type), "subsidy_sch", type).orderByDesc("create_time");
|
|
|
Page<BillSubsidy> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, queryWrapper));
|
|
|
}
|
|
@@ -349,7 +349,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
if ("1".equals(type)) {
|
|
|
List<BaseAnimal> baseAnimals = baseAnimalMapper.selectList(new QueryWrapper<BaseAnimal>()
|
|
|
.eq("inspection_num", billSubsidy.getInspectionNum())
|
|
|
- .eq("belong_to_user",TokenSign.getMemberIdByJwtToken(httpServletRequest)));
|
|
|
+ .eq("belong_to_user", TokenSign.getMemberIdByJwtToken(httpServletRequest)));
|
|
|
for (BaseAnimal baseAnimal : baseAnimals) {
|
|
|
baseAnimal.setIsLoated(0);
|
|
|
baseAnimalMapper.updateById(baseAnimal);
|
|
@@ -385,32 +385,32 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
|
|
|
if (userType == 2 || userType == 3) {
|
|
|
subsidyQueryWrapper.eq("create_user", userName);
|
|
|
- if (ObjectUtil.isNotEmpty(subsidySch)){
|
|
|
- if (subsidySch.equals("1")){
|
|
|
- subsidyQueryWrapper.eq("subsidy_sch",0);
|
|
|
- }else if (subsidySch.equals("2")){
|
|
|
- subsidyQueryWrapper.in("subsidy_sch",1,5);
|
|
|
- }else if (subsidySch.equals("3")){
|
|
|
- subsidyQueryWrapper.in("subsidy_sch",2,3,4);
|
|
|
- }else if (subsidySch.equals("4")){
|
|
|
- subsidyQueryWrapper.eq("is_pay",2);
|
|
|
+ if (ObjectUtil.isNotEmpty(subsidySch)) {
|
|
|
+ if (subsidySch.equals("1")) {
|
|
|
+ subsidyQueryWrapper.eq("subsidy_sch", 0);
|
|
|
+ } else if (subsidySch.equals("2")) {
|
|
|
+ subsidyQueryWrapper.in("subsidy_sch", 1, 5);
|
|
|
+ } else if (subsidySch.equals("3")) {
|
|
|
+ subsidyQueryWrapper.in("subsidy_sch", 2, 3, 4);
|
|
|
+ } else if (subsidySch.equals("4")) {
|
|
|
+ subsidyQueryWrapper.eq("is_pay", 2);
|
|
|
}
|
|
|
- }else {
|
|
|
- subsidyQueryWrapper.ne("subsidy_sch",7);
|
|
|
+ } else {
|
|
|
+ subsidyQueryWrapper.ne("subsidy_sch", 7);
|
|
|
}
|
|
|
- }else {
|
|
|
- if (ObjectUtil.isNotEmpty(subsidySch)){
|
|
|
- if (subsidySch.equals("1")){
|
|
|
- subsidyQueryWrapper.eq("subsidy_sch",0);
|
|
|
- }else if (subsidySch.equals("2")){
|
|
|
- subsidyQueryWrapper.in("subsidy_sch",1,5);
|
|
|
- }else if (subsidySch.equals("3")){
|
|
|
- subsidyQueryWrapper.in("subsidy_sch",2,3,4);
|
|
|
- }else if (subsidySch.equals("4")){
|
|
|
- subsidyQueryWrapper.eq("is_pay",2);
|
|
|
+ } else {
|
|
|
+ if (ObjectUtil.isNotEmpty(subsidySch)) {
|
|
|
+ if (subsidySch.equals("1")) {
|
|
|
+ subsidyQueryWrapper.eq("subsidy_sch", 0);
|
|
|
+ } else if (subsidySch.equals("2")) {
|
|
|
+ subsidyQueryWrapper.in("subsidy_sch", 1, 5);
|
|
|
+ } else if (subsidySch.equals("3")) {
|
|
|
+ subsidyQueryWrapper.in("subsidy_sch", 2, 3, 4);
|
|
|
+ } else if (subsidySch.equals("4")) {
|
|
|
+ subsidyQueryWrapper.eq("is_pay", 2);
|
|
|
}
|
|
|
- }else {
|
|
|
- subsidyQueryWrapper.ne("subsidy_sch",7);
|
|
|
+ } else {
|
|
|
+ subsidyQueryWrapper.ne("subsidy_sch", 7);
|
|
|
}
|
|
|
}
|
|
|
// if (startTime != null) {
|
|
@@ -423,17 +423,17 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
// }
|
|
|
|
|
|
subsidyQueryWrapper.orderByDesc("create_time");
|
|
|
- Page<BillSubsidy> page = new Page(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
- return new Result(ResultCode.SUCCESS,subsidyMapper.selectPage(page,subsidyQueryWrapper));
|
|
|
+ Page<BillSubsidy> page = new Page(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
+ return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, subsidyQueryWrapper));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Result getLast(HttpServletRequest httpServletRequest, Map<String, String> parasMap) {
|
|
|
BillSubsidy billSubsidy = this.getOne(new QueryWrapper<BillSubsidy>().eq("create_user", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("subsidy_sch", 7));
|
|
|
- if (ObjectUtil.isEmpty(billSubsidy)){
|
|
|
- return new Result(ResultCode.SUCCESS,null);
|
|
|
- }else {
|
|
|
- return new Result(ResultCode.SUCCESS,billSubsidy);
|
|
|
+ if (ObjectUtil.isEmpty(billSubsidy)) {
|
|
|
+ return new Result(ResultCode.SUCCESS, null);
|
|
|
+ } else {
|
|
|
+ return new Result(ResultCode.SUCCESS, billSubsidy);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -442,7 +442,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
String id = parasMap.get("id");
|
|
|
BillSubsidy billSubsidy = this.getById(id);
|
|
|
List result = new ArrayList();
|
|
|
- if (billSubsidy.getSubsidySch() == 0){
|
|
|
+ if (billSubsidy.getSubsidySch() == 0) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setStatus(true);
|
|
@@ -454,7 +454,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
lastApplication.setStatus(true);
|
|
|
lastApplication.setTitle("待受理");
|
|
|
result.add(lastApplication);
|
|
|
- }else if (billSubsidy.getSubsidySch() == 1){
|
|
|
+ } else if (billSubsidy.getSubsidySch() == 1) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setStatus(true);
|
|
@@ -473,7 +473,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
lastApplication.setStatus(true);
|
|
|
lastApplication.setTitle("审核中");
|
|
|
result.add(lastApplication);
|
|
|
- }else if (billSubsidy.getSubsidySch() == 2){
|
|
|
+ } else if (billSubsidy.getSubsidySch() == 2) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setReason("");
|
|
@@ -484,7 +484,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
rejectApplication.setTitle("已拒绝");
|
|
|
rejectApplication.setStatus(false);
|
|
|
rejectApplication.setTime(billSubsidy.getAcceptTime());
|
|
|
- rejectApplication.setReason("拒绝理由:"+billSubsidy.getRefuseReason());
|
|
|
+ rejectApplication.setReason("拒绝理由:" + billSubsidy.getRefuseReason());
|
|
|
result.add(rejectApplication);
|
|
|
if (billSubsidy.getAppeal() != null) {
|
|
|
RejectApplication shensuApplication = new RejectApplication();
|
|
@@ -494,7 +494,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
shensuApplication.setReason("");
|
|
|
result.add(shensuApplication);
|
|
|
}
|
|
|
- }else if (billSubsidy.getSubsidySch() == 3){
|
|
|
+ } else if (billSubsidy.getSubsidySch() == 3) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setReason("");
|
|
@@ -525,25 +525,25 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
acceptApplication.setTime(billSubsidy.getAcceptTime());
|
|
|
result.add(acceptApplication);
|
|
|
|
|
|
- if (billSubsidy.getIsPay() == 2){
|
|
|
+ if (billSubsidy.getIsPay() == 2) {
|
|
|
RejectApplication payApplication = new RejectApplication();
|
|
|
payApplication.setTitle("已支付");
|
|
|
payApplication.setStatus(true);
|
|
|
payApplication.setTime(billSubsidy.getPayTime());
|
|
|
- if (ObjectUtil.isEmpty(billSubsidy.getPayMoney())){
|
|
|
- payApplication.setReason("支付金额: ¥"+"");
|
|
|
- }else {
|
|
|
- payApplication.setReason("支付金额: ¥"+billSubsidy.getPayMoney().toString());
|
|
|
+ if (ObjectUtil.isEmpty(billSubsidy.getPayMoney())) {
|
|
|
+ payApplication.setReason("支付金额: ¥" + "");
|
|
|
+ } else {
|
|
|
+ payApplication.setReason("支付金额: ¥" + billSubsidy.getPayMoney().toString());
|
|
|
}
|
|
|
result.add(payApplication);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
RejectApplication lastApplication = new RejectApplication();
|
|
|
lastApplication.setTitle("待支付");
|
|
|
lastApplication.setReason("");
|
|
|
lastApplication.setStatus(true);
|
|
|
result.add(lastApplication);
|
|
|
}
|
|
|
- }else if (billSubsidy.getSubsidySch() == 4){
|
|
|
+ } else if (billSubsidy.getSubsidySch() == 4) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setReason("");
|
|
@@ -577,10 +577,10 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
rejectApplication.setTitle("审核不通过");
|
|
|
rejectApplication.setStatus(false);
|
|
|
rejectApplication.setTime(billSubsidy.getReviewedTime());
|
|
|
- rejectApplication.setReason("驳回理由: "+billSubsidy.getRejectReason());
|
|
|
+ rejectApplication.setReason("驳回理由: " + billSubsidy.getRejectReason());
|
|
|
result.add(rejectApplication);
|
|
|
|
|
|
- }else if (billSubsidy.getSubsidySch() == 5){
|
|
|
+ } else if (billSubsidy.getSubsidySch() == 5) {
|
|
|
RejectApplication addApplication = new RejectApplication();
|
|
|
addApplication.setTitle("提交申请");
|
|
|
addApplication.setReason("");
|
|
@@ -600,14 +600,14 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
rejectApplication.setTitle("审核不通过");
|
|
|
rejectApplication.setStatus(false);
|
|
|
rejectApplication.setTime(billSubsidy.getReviewedTime());
|
|
|
- rejectApplication.setReason("驳回理由: "+billSubsidy.getRejectReason());
|
|
|
+ rejectApplication.setReason("驳回理由: " + billSubsidy.getRejectReason());
|
|
|
result.add(rejectApplication);
|
|
|
|
|
|
RejectApplication appealApplication = new RejectApplication();
|
|
|
appealApplication.setTitle("已申诉");
|
|
|
appealApplication.setStatus(true);
|
|
|
appealApplication.setTime(billSubsidy.getAppealTime());
|
|
|
- appealApplication.setReason("申诉内容描述: "+billSubsidy.getAppeal());
|
|
|
+ appealApplication.setReason("申诉内容描述: " + billSubsidy.getAppeal());
|
|
|
result.add(appealApplication);
|
|
|
|
|
|
RejectApplication lastApplication = new RejectApplication();
|
|
@@ -616,7 +616,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
lastApplication.setReason("");
|
|
|
result.add(lastApplication);
|
|
|
}
|
|
|
- return new Result(ResultCode.SUCCESS,result);
|
|
|
+ return new Result(ResultCode.SUCCESS, result);
|
|
|
}
|
|
|
|
|
|
//打印待支付的
|
|
@@ -628,79 +628,80 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
String address = paramsMap.get("address");
|
|
|
|
|
|
QueryWrapper<BillSubsidy> wrapper = new QueryWrapper<>();
|
|
|
- if (StringUtils.isBlank(startDate)){
|
|
|
+ if (StringUtils.isBlank(startDate)) {
|
|
|
Date date = new Date();
|
|
|
- startDate = DateUtil.format(date, "yyyy-MM-dd");
|
|
|
- wrapper.ge("create_time",startDate);
|
|
|
+ startDate = DateUtil.format(date, "yyyy-MM-dd");
|
|
|
+ wrapper.ge("create_time", startDate);
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(endDate)){
|
|
|
- String endTime = endDate +" 23:59:59";
|
|
|
- wrapper.le("create_time",endTime);
|
|
|
+ if (StringUtils.isNotBlank(endDate)) {
|
|
|
+ String endTime = endDate + " 23:59:59";
|
|
|
+ wrapper.le("create_time", endTime);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (StringUtils.isNotBlank(ids)){
|
|
|
+ if (StringUtils.isNotBlank(ids)) {
|
|
|
List<String> list = Arrays.asList(ids.split(","));
|
|
|
- wrapper.in("id",list);
|
|
|
+ wrapper.in("id", list);
|
|
|
}
|
|
|
- wrapper.eq("is_pay",1);
|
|
|
- wrapper.eq("subsidy_sch",3);
|
|
|
+ wrapper.eq("is_pay", 1);
|
|
|
+ wrapper.eq("subsidy_sch", 3);
|
|
|
List<BillSubsidy> billSubsidies = subsidyMapper.selectList(wrapper);
|
|
|
- if (ObjectUtil.isEmpty(billSubsidies)){
|
|
|
- return new Result(10001,"当前无待支付名单",true);
|
|
|
+ if (ObjectUtil.isEmpty(billSubsidies)) {
|
|
|
+ return new Result(10001, "当前无待支付名单", true);
|
|
|
}
|
|
|
ExcelWriter writer = ExcelUtil.getWriter();
|
|
|
ServletOutputStream outputStream = null;
|
|
|
try {
|
|
|
outputStream = response.getOutputStream();
|
|
|
|
|
|
- writer.merge(5,startDate +"-"+endDate +" 待支付名单");
|
|
|
- writer.write(billSubsidies,true);
|
|
|
- writer.addHeaderAlias("farmerName","姓名");
|
|
|
- writer.addHeaderAlias("bankCardId","卡号");
|
|
|
- writer.addHeaderAlias("idCard","身份证");
|
|
|
- writer.addHeaderAlias("bankName","开户行");
|
|
|
- writer.addHeaderAlias("phone","手机号");
|
|
|
- writer.addHeaderAlias("createTime","提交时间");
|
|
|
- writer.addHeaderAlias("applyMoney","申报金额");
|
|
|
+ writer.merge(5, startDate + "-" + endDate + " 待支付名单");
|
|
|
+ writer.write(billSubsidies, true);
|
|
|
+ writer.addHeaderAlias("farmerName", "姓名");
|
|
|
+ writer.addHeaderAlias("bankCardId", "卡号");
|
|
|
+ writer.addHeaderAlias("idCard", "身份证");
|
|
|
+ writer.addHeaderAlias("bankName", "开户行");
|
|
|
+ writer.addHeaderAlias("phone", "手机号");
|
|
|
+ writer.addHeaderAlias("createTime", "提交时间");
|
|
|
+ writer.addHeaderAlias("applyMoney", "申报金额");
|
|
|
|
|
|
writer.flush(outputStream);
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
writer.close();
|
|
|
outputStream.close();
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public void printPay2(HttpServletResponse response, String startDate,String endDate) throws IOException {
|
|
|
+ public void printPay2(HttpServletResponse response, String startDate, String endDate) throws IOException {
|
|
|
|
|
|
QueryWrapper<BillSubsidy> wrapper = new QueryWrapper<>();
|
|
|
- if (StringUtils.isBlank(startDate)){
|
|
|
+ if (StringUtils.isBlank(startDate)) {
|
|
|
Date date = new Date();
|
|
|
startDate = DateUtil.format(date, "yyyy-MM-dd");
|
|
|
- wrapper.ge("create_time",startDate);
|
|
|
+ wrapper.ge("create_time", startDate);
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(endDate)){
|
|
|
- String endTime = endDate +" 23:59:59";
|
|
|
- wrapper.le("create_time",endTime);
|
|
|
+ if (StringUtils.isNotBlank(endDate)) {
|
|
|
+ String endTime = endDate + " 23:59:59";
|
|
|
+ wrapper.le("create_time", endTime);
|
|
|
}
|
|
|
|
|
|
- wrapper.eq("is_pay",1);
|
|
|
- wrapper.eq("subsidy_sch",3);
|
|
|
+ wrapper.eq("is_pay", 1);
|
|
|
+ wrapper.eq("subsidy_sch", 3);
|
|
|
List<BillSubsidy> billSubsidies = subsidyMapper.selectList(wrapper);
|
|
|
- List list = new ArrayList();
|
|
|
+ List list = new ArrayList();
|
|
|
for (BillSubsidy billSubsidy : billSubsidies) {
|
|
|
- Map<String,Object> map = new HashMap();
|
|
|
- map.put("姓名",billSubsidy.getFarmerName());
|
|
|
- map.put("卡号",billSubsidy.getBankCardId());
|
|
|
- map.put("身份证",billSubsidy.getIdCard());
|
|
|
- map.put("开户行",billSubsidy.getBankName());
|
|
|
- map.put("手机号",billSubsidy.getPhone());
|
|
|
- map.put("提交时间",billSubsidy.getCreateTime());
|
|
|
- map.put("申报金额",billSubsidy.getApplyMoney());
|
|
|
+ Map<String, Object> map = new HashMap();
|
|
|
+ map.put("姓名", billSubsidy.getFarmerName());
|
|
|
+ map.put("卡号", billSubsidy.getBankCardId());
|
|
|
+ map.put("身份证", billSubsidy.getIdCard());
|
|
|
+ map.put("开户行", billSubsidy.getBankName());
|
|
|
+ map.put("手机号", billSubsidy.getPhone());
|
|
|
+ map.put("提交时间", billSubsidy.getCreateTime());
|
|
|
+ map.put("申报金额", billSubsidy.getApplyMoney());
|
|
|
list.add(map);
|
|
|
}
|
|
|
|
|
@@ -708,38 +709,38 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
ServletOutputStream outputStream = null;
|
|
|
try {
|
|
|
outputStream = response.getOutputStream();
|
|
|
- StringBuffer fileName = new StringBuffer();
|
|
|
- if (StringUtils.isNotBlank(endDate)){
|
|
|
+ StringBuffer fileName = new StringBuffer();
|
|
|
+ if (StringUtils.isNotBlank(endDate)) {
|
|
|
fileName.append(startDate);
|
|
|
fileName.append(" 至 ");
|
|
|
fileName.append(endDate);
|
|
|
- fileName.append( " 待支付名单");
|
|
|
- }else {
|
|
|
+ fileName.append(" 待支付名单");
|
|
|
+ } else {
|
|
|
fileName.append(startDate);
|
|
|
fileName.append(" 至 待支付名单");
|
|
|
}
|
|
|
- writer.merge(6,fileName.toString());
|
|
|
+ writer.merge(6, fileName.toString());
|
|
|
|
|
|
System.out.println(fileName);
|
|
|
fileName.append(".xls");
|
|
|
- response.setHeader("content-disposition", "attachment;fileName="+ URLEncoder.encode(fileName.toString(), "UTF-8"));
|
|
|
-
|
|
|
- writer.write(list,true);
|
|
|
- writer.setRowHeight(0,25);
|
|
|
- writer.setRowHeight(1,15);
|
|
|
- writer.setColumnWidth(0,10);
|
|
|
- writer.setColumnWidth(1,20);
|
|
|
- writer.setColumnWidth(2,20);
|
|
|
- writer.setColumnWidth(3,25);
|
|
|
- writer.setColumnWidth(4,25);
|
|
|
- writer.setColumnWidth(5,30);
|
|
|
- writer.setColumnWidth(6,30);
|
|
|
+ response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode(fileName.toString(), "UTF-8"));
|
|
|
+
|
|
|
+ writer.write(list, true);
|
|
|
+ writer.setRowHeight(0, 25);
|
|
|
+ writer.setRowHeight(1, 15);
|
|
|
+ writer.setColumnWidth(0, 10);
|
|
|
+ writer.setColumnWidth(1, 20);
|
|
|
+ writer.setColumnWidth(2, 20);
|
|
|
+ writer.setColumnWidth(3, 25);
|
|
|
+ writer.setColumnWidth(4, 25);
|
|
|
+ writer.setColumnWidth(5, 30);
|
|
|
+ writer.setColumnWidth(6, 30);
|
|
|
|
|
|
writer.flush(outputStream);
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
writer.close();
|
|
|
outputStream.close();
|
|
|
}
|
|
@@ -751,13 +752,24 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
String start = paramsMap.get("start");
|
|
|
String end = paramsMap.get("end");
|
|
|
QueryWrapper<AreaAll> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("id",code);
|
|
|
+ queryWrapper.eq("id", code);
|
|
|
AreaAll areaAll = areaAllMapper.selectOne(queryWrapper);//得到乡镇地址
|
|
|
- List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.listReport(code, start, end);
|
|
|
- try {
|
|
|
- Print2.print(billSubsidyReportVos,areaAll.getName(),end);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ if ("1".equals(code)) {
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.lisTowntReport("621121", start, end);
|
|
|
+ try {
|
|
|
+ Print2.print2(billSubsidyReportVos, areaAll.getName(), end);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("打印县阶段统计表出异常!!!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.listReport(code, start, end);
|
|
|
+ try {
|
|
|
+ Print2.print(billSubsidyReportVos, areaAll.getName(), end);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("打印镇阶段统计表出异常!!!");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -771,18 +783,58 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
|
|
|
queryWrapper.eq("id", code);
|
|
|
AreaAll all = areaAllMapper.selectOne(queryWrapper);
|
|
|
QueryWrapper<BillSubsidy> subsidyQueryWrapper = new QueryWrapper<>();
|
|
|
- //.select("farmer_name,farmer_type, id_card," +
|
|
|
- // "phone,reward_num,bank_card_id,bank_name,brief_address,sale_name,apply_money")
|
|
|
subsidyQueryWrapper.like("detailed_adress_code", code)
|
|
|
.between("create_time", start, end).eq("subsidy_sch", 3).eq("is_pay", 1)
|
|
|
.groupBy("id_card");
|
|
|
List<BillSubsidy> subsidyList = subsidyMapper.selectList(subsidyQueryWrapper);
|
|
|
try {
|
|
|
- Print3.print(subsidyList,all.getName(),end);
|
|
|
+ Print3.print(subsidyList, all.getName(), end);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result countState(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String code = paramsMap.get("country");
|
|
|
+ String start = paramsMap.get("startDate");
|
|
|
+ String end = paramsMap.get("endDate");
|
|
|
+ Integer userType = TokenSign.getUserType(httpServletRequest);
|
|
|
+ if (userType == 0) {
|
|
|
+ if (code == null || "".equals(code)) {
|
|
|
+ code = "621121";
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.lisTowntReport(code, start, end);//县
|
|
|
+ return new Result(ResultCode.SUCCESS, billSubsidyReportVos);
|
|
|
+ } else {
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.listReport(code, start, end);//镇
|
|
|
+ return new Result(ResultCode.SUCCESS, billSubsidyReportVos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (userType == 4) {
|
|
|
+ code = TokenSign.getAddressCode(httpServletRequest);
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.listReport(code, start, end);//县
|
|
|
+ return new Result(ResultCode.SUCCESS, billSubsidyReportVos);
|
|
|
+ }
|
|
|
+ List<BillSubsidyReportVo> billSubsidyReportVos = subsidyMapper.listReport(code, start, end);
|
|
|
+ return new Result(ResultCode.SUCCESS, billSubsidyReportVos);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result countPay(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
+ String code = paramsMap.get("country");
|
|
|
+ if (code == null || "".equals(code)) {
|
|
|
+ code = TokenSign.getAddressCode(httpServletRequest);//镇的编码
|
|
|
+ }
|
|
|
+ String start = paramsMap.get("startDate");
|
|
|
+ String end = paramsMap.get("endDate");
|
|
|
+
|
|
|
+ QueryWrapper<BillSubsidy> subsidyQueryWrapper = new QueryWrapper<>();
|
|
|
+ subsidyQueryWrapper.like("detailed_adress_code", code)
|
|
|
+ .between("create_time", start, end).eq("subsidy_sch", 3).eq("is_pay", 1)
|
|
|
+ .groupBy("id_card");
|
|
|
+ List<BillSubsidy> subsidyList = subsidyMapper.selectList(subsidyQueryWrapper);
|
|
|
+ return new Result(ResultCode.SUCCESS, subsidyList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|