|
@@ -3,8 +3,10 @@ package com.jpsoft.smart.modules.business.controller;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.smart.config.RedisConfig;
|
|
|
+import com.jpsoft.smart.modules.base.entity.InformationInfo;
|
|
|
import com.jpsoft.smart.modules.base.entity.RechargeRecord;
|
|
|
import com.jpsoft.smart.modules.base.entity.RoomInfo;
|
|
|
+import com.jpsoft.smart.modules.base.service.InformationInfoService;
|
|
|
import com.jpsoft.smart.modules.base.service.RechargeRecordService;
|
|
|
import com.jpsoft.smart.modules.base.service.RoomInfoService;
|
|
|
import com.jpsoft.smart.modules.business.service.RechargeService;
|
|
@@ -47,6 +49,10 @@ public class MobileApiController {
|
|
|
@Autowired
|
|
|
private RechargeRecordService rechargeRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InformationInfoService informationInfoService;
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
ValueOperations<String, Object> valueOperations;
|
|
|
|
|
@@ -432,4 +438,48 @@ public class MobileApiController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value="addMobile")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="ownerId",value="户主ID",dataType="string",paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="content",value="内容",dataType="string",paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="type",value="类型/1投诉/2报修",dataType="string",paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<InformationInfo> addMobile(
|
|
|
+ String ownerId,
|
|
|
+ String content,
|
|
|
+ String type){
|
|
|
+ MessageResult<InformationInfo> msgResult = new MessageResult<>();
|
|
|
+ InformationInfo informationInfo = new InformationInfo();
|
|
|
+ try {
|
|
|
+ informationInfo.setId(UUID.randomUUID().toString());
|
|
|
+ informationInfo.setDelFlag(false);
|
|
|
+ informationInfo.setCreateBy(ownerId);
|
|
|
+ informationInfo.setCreateTime(new Date());
|
|
|
+ informationInfo.setStatus("0");
|
|
|
+ informationInfo.setContent(content);
|
|
|
+ informationInfo.setOwnerId(ownerId);
|
|
|
+ informationInfo.setType(type);
|
|
|
+ informationInfo.setOwnerId("1-2-1601");
|
|
|
+
|
|
|
+ int affectCount = informationInfoService.insert(informationInfo);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(informationInfo);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库添加失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ log.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|