|
@@ -41,37 +41,38 @@ import java.util.Map;
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("/api/userprofilemgt/daghlog")
|
|
|
-@Api(tags="客户档案-用户过户日志接口")
|
|
|
+@Api(tags = "客户档案-用户过户日志接口")
|
|
|
public class DaGhLogController {
|
|
|
|
|
|
- private final DaGhLogService daGhLogService;
|
|
|
+ private final DaGhLogService daGhLogService;
|
|
|
private final DaCustomerService daCustomerService;
|
|
|
|
|
|
private final SfRecMapper sfRecMapper;
|
|
|
|
|
|
- private final DaGhLogMapper daGhLogMapper;
|
|
|
+ private final DaGhLogMapper daGhLogMapper;
|
|
|
+
|
|
|
|
|
|
- * 分页查询daGhLog 用户过户日志
|
|
|
- */
|
|
|
- @GetMapping("/page" )
|
|
|
+ * 分页查询daGhLog 用户过户日志
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@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 = "maxLimit", value = "每页最大显示数据", dataType = "int"),
|
|
|
- @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "searchText", value = "模糊查询(用户编号、用户姓名、用户地址、联系电话)", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "companyBranch", value = "公司", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "searchText", 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")
|
|
|
})
|
|
|
- public ResultRespone getDaGhLogPage(Page page,String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End, String searchText) {
|
|
|
- IPage<DaGhLog> daGhLogIPage=daGhLogMapper.selectDaCustomerGhPage(page,companyBranch,mrArea,mrBook, operatorDate_Start,operatorDate_End,searchText);
|
|
|
- return ResultRespone.success(daGhLogIPage);
|
|
|
+ public ResultRespone getDaGhLogPage(Page page, String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End, String searchText) {
|
|
|
+ IPage<DaGhLog> daGhLogIPage = daGhLogMapper.selectDaCustomerGhPage(page, companyBranch, mrArea, mrBook, operatorDate_Start, operatorDate_End, searchText);
|
|
|
+ return ResultRespone.success(daGhLogIPage);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export")
|
|
@@ -79,138 +80,144 @@ public class DaGhLogController {
|
|
|
@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 = "maxLimit", value = "每页最大显示数据", dataType = "int"),
|
|
|
- @ApiImplicitParam(name = "orders[0].asc", value = "排序,bool类型", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "orders[0].column", value = "排序,字段名", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "searchText", value = "模糊查询(用户编号、用户姓名、用户地址、联系电话)", dataType = "String"),
|
|
|
+ @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 = "searchText", value = "模糊查询(用户编号、用户姓名、用户地址、联系电话)", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "companyBranch", value = "公司", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "mrArea", value = "片区", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "mrBook", 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")
|
|
|
})
|
|
|
- public void export(HttpServletResponse response,String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End, String searchText) throws IOException {
|
|
|
- List<DaGhLog> yhdaList = daGhLogMapper.selectDaCustomerGhPage(companyBranch,mrArea,mrBook, operatorDate_Start,operatorDate_End,searchText);
|
|
|
+ public void export(HttpServletResponse response, String companyBranch, String mrArea, String mrBook, String operatorDate_Start, String operatorDate_End, String searchText) throws IOException {
|
|
|
+ List<DaGhLog> yhdaList = daGhLogMapper.selectDaCustomerGhPage(companyBranch, mrArea, mrBook, operatorDate_Start, operatorDate_End, searchText);
|
|
|
|
|
|
ExcleFileUtil.exportExcel(response, yhdaList, DaGhLog.class, "用户过户记录.xlsx");
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
* 通过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) {
|
|
|
+ public ResultRespone getById(@PathVariable("id") String id) {
|
|
|
|
|
|
- return ResultRespone.success(daGhLogService.getById(id));
|
|
|
+ return ResultRespone.success(daGhLogService.getById(id));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 新增用户过户日志
|
|
|
+ *
|
|
|
* @param daGhLog 用户过户日志
|
|
|
* @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 DaGhLog daGhLog) {
|
|
|
+ public ResultRespone save(@RequestBody DaGhLog daGhLog, @RequestParam(required = false) String yzqf) {
|
|
|
ResultRespone<Object> rest = new ResultRespone<>();
|
|
|
- if(StringUtil.isNotBlank(daGhLog.getCustomerNo()))
|
|
|
- {
|
|
|
-
|
|
|
- Map<String,Object> map= sfRecMapper.SelectricCount(daGhLog.getCustomerNo());
|
|
|
- int count=Integer.parseInt(map.get("COUNT").toString());
|
|
|
- if(count>0)
|
|
|
- {
|
|
|
- rest.setCode(-1);
|
|
|
- rest.setMessage("操作失败,用户存在欠费:"+count+"笔");
|
|
|
+ if (StringUtil.isNotBlank(daGhLog.getCustomerNo())) {
|
|
|
+ if (yzqf.equals("1")) {
|
|
|
+
|
|
|
+ Map<String, Object> map = sfRecMapper.SelectricCount(daGhLog.getCustomerNo());
|
|
|
+ int count = Integer.parseInt(map.get("COUNT").toString());
|
|
|
+ if (count > 0) {
|
|
|
+ rest.setCode(-1);
|
|
|
+ rest.setMessage("操作失败,用户存在欠费:" + count + "笔");
|
|
|
+ return rest;
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
-
|
|
|
- daGhLog.setId(GuidGenerator.getGuid());
|
|
|
- daGhLog.setOperatorDate(new Date());
|
|
|
- if(daGhLogService.save(daGhLog))
|
|
|
- {
|
|
|
- DaCustomer daCustomer=new DaCustomer();
|
|
|
- daCustomer.setCustomerNo(daGhLog.getCustomerNo());
|
|
|
- daCustomer.setCustomerName(daGhLog.getNewCustomerName());
|
|
|
+
|
|
|
+ daGhLog.setId(GuidGenerator.getGuid());
|
|
|
+ daGhLog.setOperatorDate(new Date());
|
|
|
+ if (daGhLogService.save(daGhLog)) {
|
|
|
+ DaCustomer daCustomer = new DaCustomer();
|
|
|
+ daCustomer.setCustomerNo(daGhLog.getCustomerNo());
|
|
|
+ daCustomer.setCustomerName(daGhLog.getNewCustomerName());
|
|
|
+ daCustomer.setCustomerPhone(daGhLog.getOldPhone());
|
|
|
+ if (StringUtil.isNotBlank(daGhLog.getNewCustomerAddr())) {
|
|
|
daCustomer.setCustomerAddress(daGhLog.getNewCustomerAddr());
|
|
|
- daCustomer.setCustomerPhone(daGhLog.getOldPhone());
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(daGhLog.getNewCertType())) {
|
|
|
daCustomer.setCertType(daGhLog.getNewCertType());
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(daGhLog.getNewCertNo())) {
|
|
|
daCustomer.setCertNo(daGhLog.getNewCertNo());
|
|
|
- if(daCustomerService.updateById(daCustomer))
|
|
|
- {
|
|
|
- rest.setCode(1);
|
|
|
- rest.setMessage("操作成功");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- rest.setCode(-1);
|
|
|
- rest.setMessage("操作失败");
|
|
|
- }
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+
|
|
|
+ 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 daGhLog 用户过户日志
|
|
|
* @return ResultRespone
|
|
|
*/
|
|
|
- @ToFlyAppLog(title="修改用户过户日志" )
|
|
|
+ @ToFlyAppLog(title = "修改用户过户日志")
|
|
|
@ApiOperation(value = "修改用户过户日志")
|
|
|
@PutMapping
|
|
|
public ResultRespone updateById(@RequestBody DaGhLog daGhLog) {
|
|
|
- return ResultRespone.success(daGhLogService.updateById(daGhLog));
|
|
|
+ return ResultRespone.success(daGhLogService.updateById(daGhLog));
|
|
|
}
|
|
|
|
|
|
|
|
|
* 通过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(daGhLogService.removeById(id));
|
|
|
+ return ResultRespone.success(daGhLogService.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(daGhLogService.removeByIds(Arrays.asList(ids.split(","))));
|
|
|
}
|