Commit e9555c18 authored by tangfang's avatar tangfang

修改余额为0的处理,

添加银行卡空指针问题
parent 02cd75c5
package com.pangding.web.V2.dao;
import com.yanzuoguang.dao.BaseDao;
public interface SystemStopDao extends BaseDao {
}
package com.pangding.web.V2.dao.impl;
import com.pangding.web.V2.dao.SystemStopDao;
import com.pangding.web.vo.system.pd.SystemStopVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
@Component
public class SystemStopDaoImpl extends BaseDaoImpl implements SystemStopDao {
@Override
protected void init() {
register(SystemStopVo.class);
}
}
package com.pangding.web.V2.service;
import com.pangding.web.vo.system.pd.SystemStopVo;
import com.pangding.web.vo.system.req.SystemStopReqVo;
import java.util.List;
public interface SystemStopService {
SystemStopVo findSystemStop(SystemStopReqVo req);
List<SystemStopVo> findSystemStopList(SystemStopReqVo req);
void save(SystemStopReqVo req);
void del(SystemStopReqVo req);
}
package com.pangding.web.V2.service.impl;
import com.pangding.web.V2.dao.SystemStopDao;
import com.pangding.web.V2.service.SystemStopService;
import com.pangding.web.vo.system.pd.SystemStopVo;
import com.pangding.web.vo.system.req.SystemStopReqVo;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.StringHelper;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SystemStopServiceImpl implements SystemStopService {
private final SystemStopDao systemStopDao;
public SystemStopServiceImpl(SystemStopDao systemStopDao) {
this.systemStopDao = systemStopDao;
}
@Override
public SystemStopVo findSystemStop(SystemStopReqVo req){
SystemStopVo systemStopVo = systemStopDao.load(req, SystemStopVo.class);
return systemStopVo;
}
public List<SystemStopVo> findSystemStopList(SystemStopReqVo req){
List<SystemStopVo> systemStopList = systemStopDao.loadList(req, SystemStopVo.class);
return systemStopList;
}
public void save(SystemStopReqVo req){
if(StringHelper.isEmpty(req.getStopId())){
SystemStopVo systemStopVo = new SystemStopVo();
ObjectHelper.writeWithFromClass(systemStopVo, req);
systemStopVo.setStopId(StringHelper.getNewID());
systemStopVo.setCreateTime(DateHelper.getNow());
systemStopDao.create(systemStopVo);
}else{
SystemStopVo systemStopVo = systemStopDao.load(req.getStopId(), SystemStopVo.class);
if(StringHelper.isEmpty(systemStopVo)){
throw new CodeException("99", "未查询到修改的标识");
}else{
ObjectHelper.writeWithFromClass(systemStopVo, req);
systemStopVo.setCreateTime(DateHelper.getNow());
systemStopDao.update(systemStopVo);
}
}
}
public void del(SystemStopReqVo req){
systemStopDao.remove(req);
}
}
package com.pangding.web.V2.web;
import com.pangding.web.V2.service.SystemStopService;
import com.pangding.web.vo.system.pd.SystemStopVo;
import com.pangding.web.vo.system.req.SystemStopReqVo;
import com.yanzuoguang.util.vo.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "/systemStop", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "停止访问系统", description = "停止访问系统")
public class SystemStopController {
private final SystemStopService systemStopService;
public SystemStopController(SystemStopService systemStopService) {
this.systemStopService = systemStopService;
}
@RequestMapping(value = "/findSystemStop")
@ApiOperation(value = "查询系统停止标识", notes = "返回系统停止标识.")
public ResponseResult<SystemStopVo> findSystemStop(@RequestBody SystemStopReqVo req) {
// CheckerHelper.newInstance().notBlankCheck("companyId", req.getCompanyId())
// .notBlankCheck("codeType", req.getCodeType())
// .checkException();
return ResponseResult.result(systemStopService.findSystemStop(req));
}
@RequestMapping(value = "/findSystemStopList")
@ApiOperation(value = "查询系统停止标识列表", notes = "返回系统停止标识列表.")
public ResponseResult<List<SystemStopVo>> findSystemStopList(@RequestBody SystemStopReqVo req) {
return ResponseResult.result(systemStopService.findSystemStopList(req));
}
@RequestMapping(value = "/saveSystemStop")
@ApiOperation(value = "保存系统停止标识", notes = "返回成功.")
public ResponseResult saveSystemStop(@RequestBody SystemStopReqVo req) {
systemStopService.save(req);
return ResponseResult.resultAllowNull("");
}
@RequestMapping(value = "/delSystemStop")
@ApiOperation(value = "删除系统停止标识", notes = "返回成功.")
public ResponseResult delSystemStop(@RequestBody SystemStopReqVo req) {
systemStopService.del(req);
return ResponseResult.resultAllowNull("");
}
}
package com.pangding.web; package com.pangding.web;
import com.yanzuoguang.util.helper.SwaggerHelper;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
...@@ -21,7 +22,10 @@ public class swagger { ...@@ -21,7 +22,10 @@ public class swagger {
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//为当前包路径 //为当前包路径
.apis(RequestHandlerSelectors.basePackage("com.pangding.web.authority.controller")) .apis(SwaggerHelper.basePackage(
"com.pangding.web.authority.controller",
"com.pangding.web.V2.web"
))
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build(); .build();
// return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).build(); // return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment