|
@@ -29,6 +29,7 @@ import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
|
|
|
import com.tofly.fees.common.Excel.*;
|
|
|
+
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
@@ -40,51 +41,49 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("/api/userprofilemgt/dabtlog")
|
|
|
-@Api(tags="客户档案-户报停记录接口")
|
|
|
+@Api(tags = "客户档案-户报停记录接口")
|
|
|
public class DaBtLogController {
|
|
|
|
|
|
- private final DaBtLogService daBtLogService;
|
|
|
+ private final DaBtLogService daBtLogService;
|
|
|
private final DaCustomerService daCustomerService;
|
|
|
|
|
|
private final SfRecMapper sfRecMapper;
|
|
|
|
|
|
- private final DaBtLogMapper daBtLogMapper;
|
|
|
+ private final DaBtLogMapper daBtLogMapper;
|
|
|
|
|
|
|
|
|
* 用户报停--分页
|
|
|
*/
|
|
|
|
|
|
- @GetMapping("/page" )
|
|
|
+ @GetMapping("/page")
|
|
|
@ApiOperation(value = "page分页查询")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "current", value = "当前页码", required = true, dataType = "int"),
|
|
|
@ApiImplicitParam(name = "size", value = "每页显示数据条数", required = true, dataType = "int"),
|
|
|
- @ApiImplicitParam(name = "pages", value = "共几页,输出参数", dataType = "int"),
|
|
|
+ @ApiImplicitParam(name = "pages", value = "共几页,输出参数", dataType = "int"),
|
|
|
@ApiImplicitParam(name = "maxLimit", value = "每页最大显示数据", dataType = "int"),
|
|
|
- @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "companyBranch", value = "公司", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "mrArea", value = "片区", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "mrBook", value = "抄表本", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "companyBranch", value = "公司", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "mrArea", value = "片区", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "mrBook", value = "抄表本", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "operatorDate_Start", value = "开始时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "operatorDate_End", value = "结束时间", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "operatorDate_End", value = "结束时间", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "searchText", value = "模糊查询(编号、姓名、电话、地址)", dataType = "String")
|
|
|
})
|
|
|
- public ResultRespone getDaBtLogPage(Page page,String searchText,String companyBranch,String mrArea,String mrBook,String operatorDate_Start,String operatorDate_End) {
|
|
|
+ public ResultRespone getDaBtLogPage(Page page, String searchText, String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End) {
|
|
|
|
|
|
- IPage<DaBtLog> yhdaPage = daBtLogMapper.selectDaCustomerBtPage(page,companyBranch, mrArea, mrBook, operatorDate_Start, operatorDate_End, searchText);
|
|
|
+ IPage<DaBtLog> yhdaPage = daBtLogMapper.selectDaCustomerBtPage(page, companyBranch, mrArea, mrBook, operatorDate_Start, operatorDate_End, searchText);
|
|
|
|
|
|
List<DaBtLog> yhbtList = yhdaPage.getRecords();
|
|
|
for (DaBtLog yhbt : yhbtList) {
|
|
|
- if(yhbt.getHfysFlag().equals("0"))
|
|
|
- {
|
|
|
- yhbt.setHfysFlag("未恢复");
|
|
|
- }
|
|
|
- else {
|
|
|
- yhbt.setHfysFlag("已恢复");
|
|
|
- }
|
|
|
+ if (yhbt.getHfysFlag().equals("0")) {
|
|
|
+ yhbt.setHfysFlag("未恢复");
|
|
|
+ } else {
|
|
|
+ yhbt.setHfysFlag("已恢复");
|
|
|
+ }
|
|
|
}
|
|
|
- return ResultRespone.success(yhdaPage);
|
|
|
+ return ResultRespone.success(yhdaPage);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -98,18 +97,16 @@ public class DaBtLogController {
|
|
|
@ApiImplicitParam(name = "mrArea", value = "片区", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "mrBook", value = "抄表本", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "operatorDate_Start", value = "开始时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "operatorDate_End", value = "结束时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "searchText", value = "模糊查询(编号、姓名、电话、地址)", dataType = "String")
|
|
|
+ @ApiImplicitParam(name = "operatorDate_End", value = "结束时间", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "searchText", value = "模糊查询(编号、姓名、电话、地址)", dataType = "String")
|
|
|
})
|
|
|
- public void export(HttpServletResponse response, String companyBranch,String mrArea,String mrBook,String operatorDate_Start,String operatorDate_End,String searchText) throws IOException {
|
|
|
+ public void export(HttpServletResponse response, String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End, String searchText) throws IOException {
|
|
|
|
|
|
List<DaBtLog> list = daBtLogMapper.selectDaCustomerBtPage(companyBranch, mrArea, mrBook, operatorDate_Start, operatorDate_End, searchText);
|
|
|
for (DaBtLog yhbt : list) {
|
|
|
- if(yhbt.getHfysFlag().equals("0"))
|
|
|
- {
|
|
|
+ if (yhbt.getHfysFlag().equals("0")) {
|
|
|
yhbt.setHfysFlag("未恢复");
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
yhbt.setHfysFlag("已恢复");
|
|
|
}
|
|
|
}
|
|
@@ -119,110 +116,111 @@ public class DaBtLogController {
|
|
|
|
|
|
|
|
|
* 通过id查询用户报停记录
|
|
|
+ *
|
|
|
* @param id id
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @GetMapping("/{id}" )
|
|
|
+ @GetMapping("/{id}")
|
|
|
@ApiOperation(value = "通过ID查询")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String")
|
|
|
})
|
|
|
- public ResultRespone getById(@PathVariable("id" ) String id) {
|
|
|
- return ResultRespone.success(daBtLogService.getById(id));
|
|
|
+ public ResultRespone getById(@PathVariable("id") String id) {
|
|
|
+ return ResultRespone.success(daBtLogService.getById(id));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 新增用户报停记录
|
|
|
+ *
|
|
|
* @param daBtLog 用户报停记录
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @ToFlyAppLog(title="新增用户报停记录" )
|
|
|
+ @ToFlyAppLog(title = "新增用户报停记录")
|
|
|
@ApiOperation(value = "新增用户报停记录")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "yzqf", value = "是否验证欠费(1:需验证;0:不验证)", required = false, dataType = "String")
|
|
|
+ })
|
|
|
@PostMapping
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public ResultRespone save(@RequestBody DaBtLog daBtLog) {
|
|
|
+ public ResultRespone save(@RequestBody DaBtLog daBtLog, @RequestParam(required = false) String yzqf) {
|
|
|
ResultRespone<Object> rest = new ResultRespone<>();
|
|
|
- if(StringUtils.isNotBlank(daBtLog.getCustomerNo()))
|
|
|
- {
|
|
|
-
|
|
|
- Map<String,Object> map= sfRecMapper.SelectricCount(daBtLog.getCustomerNo());
|
|
|
- int count=Integer.parseInt(map.get("COUNT").toString());
|
|
|
- if(count>0)
|
|
|
- {
|
|
|
- rest.setCode(-1);
|
|
|
- rest.setMessage("操作失败,用户存在欠费:"+count+"笔");
|
|
|
+ if (StringUtils.isNotBlank(daBtLog.getCustomerNo())) {
|
|
|
+ if (yzqf.equals("1")) {
|
|
|
+
|
|
|
+ Map<String, Object> map = sfRecMapper.SelectricCount(daBtLog.getCustomerNo());
|
|
|
+ int count = Integer.parseInt(map.get("COUNT").toString());
|
|
|
+ if (count > 0) {
|
|
|
+ rest.setCode(-1);
|
|
|
+ rest.setMessage("操作失败,用户存在欠费:" + count + "笔");
|
|
|
+ return rest;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+
|
|
|
+ daBtLog.setId(GuidGenerator.getGuid());
|
|
|
+ if (daBtLogService.save(daBtLog)) {
|
|
|
|
|
|
- daBtLog.setId(GuidGenerator.getGuid());
|
|
|
- if(daBtLogService.save(daBtLog))
|
|
|
- {
|
|
|
- DaCustomer daCustomer=new DaCustomer();
|
|
|
- daCustomer.setCustomerState(UserStatusEnum.StopUser.toString());
|
|
|
- if(daCustomerService.save(daCustomer))
|
|
|
- {
|
|
|
- rest.setCode(1);
|
|
|
- rest.setMessage("操作成功");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- rest.setCode(-1);
|
|
|
- rest.setMessage("操作失败");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ DaCustomer daCustomer = new DaCustomer();
|
|
|
+ daCustomer.setCustomerNo(daBtLog.getCustomerNo());
|
|
|
+ daCustomer.setCustomerState(UserStatusEnum.StopUser.getStatusUser().toString());
|
|
|
+ if (daCustomerService.updateById(daCustomer)) {
|
|
|
+ rest.setCode(1);
|
|
|
+ rest.setMessage("操作成功");
|
|
|
+ } else {
|
|
|
rest.setCode(-1);
|
|
|
rest.setMessage("操作失败");
|
|
|
}
|
|
|
+ } else {
|
|
|
+ rest.setCode(-1);
|
|
|
+ rest.setMessage("操作失败");
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
rest.setCode(-1);
|
|
|
rest.setMessage("操作失败,用户编号不存在");
|
|
|
}
|
|
|
- return rest;
|
|
|
+ return rest;
|
|
|
}
|
|
|
|
|
|
|
|
|
* 修改用户报停记录
|
|
|
+ *
|
|
|
* @param daBtLog 用户报停记录
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @ToFlyAppLog(title="修改用户报停记录" )
|
|
|
+ @ToFlyAppLog(title = "修改用户报停记录")
|
|
|
@ApiOperation(value = "修改用户报停记录")
|
|
|
@PutMapping
|
|
|
public ResultRespone updateById(@RequestBody DaBtLog daBtLog) {
|
|
|
- return ResultRespone.success(daBtLogService.updateById(daBtLog));
|
|
|
+ return ResultRespone.success(daBtLogService.updateById(daBtLog));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 通过id删除用户报停记录
|
|
|
+ *
|
|
|
* @param id id
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @ToFlyAppLog(title="通过id删除用户报停记录" )
|
|
|
+ @ToFlyAppLog(title = "通过id删除用户报停记录")
|
|
|
@ApiOperation(value = "通过ID删除用户报停记录")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String")
|
|
|
})
|
|
|
- @DeleteMapping("/{id}" )
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
public ResultRespone removeById(@PathVariable String id) {
|
|
|
- return ResultRespone.success(daBtLogService.removeById(id));
|
|
|
+ return ResultRespone.success(daBtLogService.removeById(id));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 通过id批量删除用户报停记录
|
|
|
+ *
|
|
|
* @param ids id
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @ToFlyAppLog(title="通过id批量删除用户报停记录" )
|
|
|
+ @ToFlyAppLog(title = "通过id批量删除用户报停记录")
|
|
|
@ApiOperation(value = "通过ID批量删除用户报停记录")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "ids", value = "批量删除,多个id以逗号隔开", required = true, dataType = "String")
|
|
|
})
|
|
|
- @DeleteMapping("/deleteByIds" )
|
|
|
+ @DeleteMapping("/deleteByIds")
|
|
|
public ResultRespone removeByIds(String ids) {
|
|
|
return ResultRespone.success(daBtLogService.removeByIds(Arrays.asList(ids.split(","))));
|
|
|
}
|