|
|
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
+import org.joda.time.Days;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -69,6 +71,9 @@ public class CustomerInfoApiController {
|
|
|
@Autowired
|
|
|
private AboutUsService aboutUsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InstallationRequirementService installationRequirementService;
|
|
|
+
|
|
|
@ApiOperation(value = "个人中心")
|
|
|
@RequestMapping(value = "personalCenter", method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@@ -222,6 +227,7 @@ public class CustomerInfoApiController {
|
|
|
dto.setRegion(customerInfo.getRegion());
|
|
|
dto.setBusinessCode(customerInfo.getBusinessCode());
|
|
|
dto.setCompanyName(customerInfo.getCompanyName());
|
|
|
+ dto.setBusinessLicense(customerInfo.getBusinessLicense());
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(dto);
|
|
|
@@ -261,20 +267,39 @@ public class CustomerInfoApiController {
|
|
|
return messageResult;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "消息列表")
|
|
|
- @RequestMapping(value = "messageList", method = RequestMethod.POST)
|
|
|
- public MessageResult<List<MessageInfo>> messageTypeList(String type, String token, @RequestAttribute String subject) {
|
|
|
- MessageResult<List<MessageInfo>> messageResult = new MessageResult<>();
|
|
|
+ @RequestMapping(value = "messagePageList", method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> pageList(
|
|
|
+ String type,
|
|
|
+ @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
|
|
- CustomerInfo customerInfo = customerInfoService.get(subject);
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
|
|
|
- List<MessageInfo> messageInfoList = messageInfoService.findByRecipientIdAndType(customerInfo.getId(), type);
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
- messageResult.setData(messageInfoList);
|
|
|
- messageResult.setResult(true);
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
|
- return messageResult;
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time", "desc"));
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(subject)) {
|
|
|
+ searchParams.put("recipientId", subject);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(type)) {
|
|
|
+ searchParams.put("type", type);
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<MessageInfo> page = messageInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
+
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -395,45 +420,147 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@ApiOperation(value = "工单列表")
|
|
|
@RequestMapping(value = "workOrderPageList", method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "title", value = "工单标题", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "status", value = "工单状态(0:待确认,1:待接单,2:施工中,3:待验收,4:完结待结算,5:质保中,6:已出保,7:已取消)", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "date", value = "日期", paramType = "form"),
|
|
|
+ })
|
|
|
public MessageResult<Map> workOrderPageList(
|
|
|
- String status,
|
|
|
+ String title, String status, String date,String token,
|
|
|
@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
|
|
|
- HttpServletRequest request) {
|
|
|
- String subject = (String) request.getAttribute("subject");
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
- Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ try {
|
|
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("create_time", "desc"));
|
|
|
+ Map<String, Object> dataMap = new HashMap<>();
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(status)) {
|
|
|
- searchParams.put("status", status);
|
|
|
- }
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
- Page<WorkOrder> page = workOrderService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time", "desc"));
|
|
|
|
|
|
- for (WorkOrder workOrder : page) {
|
|
|
- CustomerInfo customerInfo = customerInfoService.get(workOrder.getCompanyId());
|
|
|
- if (customerInfo != null) {
|
|
|
- workOrder.setCompanyName(customerInfo.getRealName());
|
|
|
+ searchParams.put("companyId", subject);
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(title)) {
|
|
|
+ searchParams.put("title", "%" + title + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(status)) {
|
|
|
+ searchParams.put("status", status);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(date)) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(sdf.parse(date));
|
|
|
+ calendar.add(Calendar.DATE,1);
|
|
|
|
|
|
- msgResult.setResult(true);
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ String endDate = sdf.format(calendar.getTime());
|
|
|
+
|
|
|
+ searchParams.put("startDate", date);
|
|
|
+ searchParams.put("endDate", endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<WorkOrder> page = workOrderService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
+
|
|
|
+ List<WorkOrderListDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ for (WorkOrder workOrder : page) {
|
|
|
+ WorkOrderListDTO dto = new WorkOrderListDTO();
|
|
|
+ dto.setTitle(workOrder.getTitle());
|
|
|
+ dto.setDate(workOrder.getDate());
|
|
|
+ dto.setId(workOrder.getId());
|
|
|
+ String statusStr = workOrder.getStatus();
|
|
|
+ dto.setStatus(statusStr);
|
|
|
+ String statusN = dataDictionaryService.findNameByCatalogNameAndValue("工单状态", statusStr);
|
|
|
+ if (StringUtils.isNotEmpty(statusN)) {
|
|
|
+ dto.setStatusN(statusN);
|
|
|
+ }
|
|
|
+
|
|
|
+ String bak = "";
|
|
|
+ if ("0".equals(statusStr) || "1".equals(statusStr)) {
|
|
|
+ //待确认&待接单
|
|
|
+ int num = workOrder.getPeopleSeenNum();
|
|
|
+ bak = "共有" + String.valueOf(num) + "师傅看过";
|
|
|
+ } else if ("2".equals(statusStr)) {
|
|
|
+ //待入场
|
|
|
+ InstallationRequirement installationRequirement = installationRequirementService.findByWorkOrderId(workOrder.getId());
|
|
|
+ if (installationRequirement != null &&
|
|
|
+ installationRequirement.getLatestEntryDate() != null) {
|
|
|
+ bak = "最晚入场日期:" + sdf.format(installationRequirement.getLatestEntryDate());
|
|
|
+ }
|
|
|
+ } else if ("4".equals(statusStr)) {
|
|
|
+ //待验收
|
|
|
+ bak = "提交了验收申请";
|
|
|
+ } else if ("5".equals(statusStr)) {
|
|
|
+ //质保中
|
|
|
+ bak = "质保期至:";
|
|
|
+ } else if ("7".equals(statusStr)) {
|
|
|
+ //已取消
|
|
|
+ bak = "原因:" + workOrder.getCancelReasons();
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setBak(bak);
|
|
|
+
|
|
|
+ String technicianName = "";
|
|
|
+
|
|
|
+ String technicianImage = "";
|
|
|
+
|
|
|
+ Integer technicianLevel = null;
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(workOrder.getTechnicianId())) {
|
|
|
+ //待验收和质保中时候才查师傅的信息
|
|
|
+ if ("4".equals(statusStr) || "5".equals(statusStr)) {
|
|
|
+ TechnicianInfo technicianInfo = technicianInfoService.get(workOrder.getTechnicianId());
|
|
|
+ if (technicianInfo != null) {
|
|
|
+ technicianName = technicianInfo.getRealName();
|
|
|
+ technicianImage = technicianInfo.getImage();
|
|
|
+ technicianLevel = technicianInfo.getLevel();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setTechnicianName(technicianName);
|
|
|
+ dto.setTechnicianImage(technicianImage);
|
|
|
+ dto.setTechnicianLevel(technicianLevel);
|
|
|
+
|
|
|
+ List<String> tagList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(workOrder.getTag())) {
|
|
|
+ String[] tagArr = workOrder.getTag().split(",");
|
|
|
+ for (String tag : tagArr) {
|
|
|
+ tagList.add(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setTagList(tagList);
|
|
|
+
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ dataMap.put("recordsTotal", page.getTotal());
|
|
|
+ dataMap.put("totalPage", page.getPages());
|
|
|
+ dataMap.put("data", list);
|
|
|
+ dataMap.put("pageNumber", pageIndex);
|
|
|
+ dataMap.put("pageSize", pageSize);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(dataMap);
|
|
|
+ }
|
|
|
+ catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
@@ -441,7 +568,7 @@ public class CustomerInfoApiController {
|
|
|
|
|
|
@ApiOperation(value = "获取工单详情")
|
|
|
@GetMapping("workOrderEdit/{id}")
|
|
|
- public MessageResult<WorkOrderAllDataDTO> workOrderEdit(@PathVariable("id") String id) {
|
|
|
+ public MessageResult<WorkOrderAllDataDTO> workOrderEdit(String token,@PathVariable("id") String id) {
|
|
|
MessageResult<WorkOrderAllDataDTO> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
@@ -469,16 +596,16 @@ public class CustomerInfoApiController {
|
|
|
|
|
|
@ApiOperation(value = "工单提交")
|
|
|
@PostMapping("workOrderAdd")
|
|
|
- public MessageResult<Integer> workOrderAdd(@RequestBody WorkOrderSubDataDTO dto, String token, @RequestAttribute String subject) {
|
|
|
- MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+ public MessageResult<String> workOrderAdd(@RequestBody WorkOrderSubDataDTO dto, String token, @RequestAttribute String subject) {
|
|
|
+ MessageResult<String> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
|
|
|
- int affectCount = workOrderService.insertDTO(dto, subject);
|
|
|
+ String id = workOrderService.insertDTO(dto, subject);
|
|
|
|
|
|
- if (affectCount > 0) {
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(affectCount);
|
|
|
+ msgResult.setData(id);
|
|
|
} else {
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage("数据库添加失败");
|
|
|
@@ -497,7 +624,7 @@ public class CustomerInfoApiController {
|
|
|
@ApiOperation(value = "师傅列表")
|
|
|
@RequestMapping(value = "technicianPageList", method = RequestMethod.POST)
|
|
|
public MessageResult<Map> technicianPageList(
|
|
|
- String status,String token,
|
|
|
+ String name,String status, String token,
|
|
|
@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
|
|
|
HttpServletRequest request) {
|
|
|
@@ -517,9 +644,23 @@ public class CustomerInfoApiController {
|
|
|
searchParams.put("status", status);
|
|
|
}
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ searchParams.put("name", "%"+name+"%");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
Page<TechnicianInfo> page = technicianInfoService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
|
|
|
+ for (TechnicianInfo technicianInfo:page) {
|
|
|
+ Map<String, Object> searchParams1 = new HashMap<>();
|
|
|
+ searchParams.put("technicianId", technicianInfo.getId());
|
|
|
+ Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams1);
|
|
|
+ technicianInfo.setCompleteOrderNum(completeOrderNum);
|
|
|
+
|
|
|
+ //最近合作的单数
|
|
|
+ technicianInfo.setCooperationNum(0);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
@@ -528,10 +669,9 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "主页师傅详情")
|
|
|
@GetMapping("technicianDetail/{id}")
|
|
|
- public MessageResult<TechnicianDTO> technicianDetail(@PathVariable("id") String id) {
|
|
|
+ public MessageResult<TechnicianDTO> technicianDetail(String token,@PathVariable("id") String id) {
|
|
|
MessageResult<TechnicianDTO> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
@@ -545,11 +685,13 @@ public class CustomerInfoApiController {
|
|
|
dto.setRegion(technicianInfo.getRegion());
|
|
|
dto.setIsVerified(technicianInfo.getIsVerified());
|
|
|
dto.setServiceInfo(technicianInfo.getServiceInfo());
|
|
|
+ dto.setBusinessScope(technicianInfo.getBusinessScope());
|
|
|
+ dto.setImage(technicianInfo.getImage());
|
|
|
|
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
|
- searchParams.put("technicianId",id);
|
|
|
+ searchParams.put("technicianId", id);
|
|
|
|
|
|
- Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams);
|
|
|
+ Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams);
|
|
|
|
|
|
dto.setCompleteOrderNum(completeOrderNum);
|
|
|
|
|
|
@@ -570,30 +712,37 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value="师傅主页评价列表")
|
|
|
- @RequestMapping(value = "commentPageList",method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "师傅主页评价列表")
|
|
|
+ @RequestMapping(value = "commentPageList", method = RequestMethod.POST)
|
|
|
public MessageResult<Map> commentPageList(
|
|
|
- String technicianid,
|
|
|
- @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
- @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
- HttpServletRequest request){
|
|
|
- String subject = (String)request.getAttribute("subject");
|
|
|
+ String technicianid,String token,
|
|
|
+ @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
|
|
|
+ HttpServletRequest request) {
|
|
|
+ String subject = (String) request.getAttribute("subject");
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
+ sortList.add(new Sort("create_time", "desc"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(technicianid)) {
|
|
|
- searchParams.put("technicianid",technicianid);
|
|
|
+ searchParams.put("technicianid", technicianid);
|
|
|
}
|
|
|
|
|
|
- Page<CommentInfo> page = commentInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ Page<CommentInfo> page = commentInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
+
|
|
|
+ for (CommentInfo commentInfo:page) {
|
|
|
+ CustomerInfo customerInfo = customerInfoService.get(commentInfo.getCompanyId());
|
|
|
+ if(customerInfo!=null){
|
|
|
+ commentInfo.setCompanyName(customerInfo.getCompanyName());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
@@ -638,7 +787,7 @@ public class CustomerInfoApiController {
|
|
|
|
|
|
@ApiOperation(value = "水箱材质列表")
|
|
|
@RequestMapping(value = "materialList", method = RequestMethod.POST)
|
|
|
- public MessageResult<List<Map<String, String>>> materialList(String token,HttpServletRequest request) {
|
|
|
+ public MessageResult<List<Map<String, String>>> materialList(String token, HttpServletRequest request) {
|
|
|
String subject = (String) request.getAttribute("subject");
|
|
|
|
|
|
//当前用户ID
|
|
|
@@ -652,8 +801,8 @@ public class CustomerInfoApiController {
|
|
|
|
|
|
for (DataDictionary dataDictionary : dataDictionaryList) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
- map.put("value",dataDictionary.getValue());
|
|
|
- map.put("name",dataDictionary.getName());
|
|
|
+ map.put("value", dataDictionary.getValue());
|
|
|
+ map.put("name", dataDictionary.getName());
|
|
|
|
|
|
list.add(map);
|
|
|
}
|
|
|
@@ -665,14 +814,13 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "企业认证")
|
|
|
@PostMapping("enterCertification")
|
|
|
public MessageResult<CustomerInfo> enterCertification(@RequestBody EnterCertificationDTO dto, @RequestAttribute String subject) {
|
|
|
MessageResult<CustomerInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
- CustomerInfo customerInfo = customerInfoService.get(dto.getId());
|
|
|
+ CustomerInfo customerInfo = customerInfoService.get(subject);
|
|
|
customerInfo.setUpdateBy(subject);
|
|
|
customerInfo.setUpdateTime(new Date());
|
|
|
customerInfo.setCompanyName(dto.getCompanyName());
|
|
|
@@ -699,27 +847,26 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- @ApiOperation(value="问题反馈列表")
|
|
|
- @RequestMapping(value = "feedbackPageList",method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "问题反馈列表")
|
|
|
+ @RequestMapping(value = "feedbackPageList", method = RequestMethod.POST)
|
|
|
public MessageResult<Map> feedbackPageList(
|
|
|
- @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
- @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
- HttpServletRequest request){
|
|
|
- String subject = (String)request.getAttribute("subject");
|
|
|
+ @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
|
|
|
+ HttpServletRequest request) {
|
|
|
+ String subject = (String) request.getAttribute("subject");
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
+ sortList.add(new Sort("create_time", "desc"));
|
|
|
|
|
|
|
|
|
- Page<Feedback> page = feedbackService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ Page<Feedback> page = feedbackService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
@@ -729,9 +876,9 @@ public class CustomerInfoApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value="意见反馈提交")
|
|
|
+ @ApiOperation(value = "意见反馈提交")
|
|
|
@PostMapping("feedbackSubmit")
|
|
|
- public MessageResult<Feedback> feedbackSubmit(@RequestBody Feedback feedback,@RequestAttribute String subject){
|
|
|
+ public MessageResult<Feedback> feedbackSubmit(@RequestBody Feedback feedback, @RequestAttribute String subject) {
|
|
|
MessageResult<Feedback> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
@@ -749,9 +896,8 @@ public class CustomerInfoApiController {
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage("数据库添加失败");
|
|
|
}
|
|
|
- }
|
|
|
- catch(Exception ex){
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage(ex.getMessage());
|
|
|
@@ -766,7 +912,7 @@ public class CustomerInfoApiController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "type", value = "类型(1:用户协议,2:隐私协议,3:免责条款)", paramType = "form"),
|
|
|
})
|
|
|
- public MessageResult<Map> aboutUs(String token,String type,@RequestAttribute String subject) {
|
|
|
+ public MessageResult<Map> aboutUs(String token, String type, @RequestAttribute String subject) {
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
@@ -777,22 +923,20 @@ public class CustomerInfoApiController {
|
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
|
- String content="";
|
|
|
+ String content = "";
|
|
|
|
|
|
- if(aboutUsList!=null){
|
|
|
+ if (aboutUsList != null) {
|
|
|
AboutUs aboutUs = aboutUsList.get(0);
|
|
|
- if("1".equals(type)){
|
|
|
+ if ("1".equals(type)) {
|
|
|
content = aboutUs.getUserAgreement();
|
|
|
- }
|
|
|
- else if("2".equals(type)){
|
|
|
+ } else if ("2".equals(type)) {
|
|
|
content = aboutUs.getPrivacyPolicy();
|
|
|
- }
|
|
|
- else if("3".equals(type)){
|
|
|
+ } else if ("3".equals(type)) {
|
|
|
content = aboutUs.getDisclaimer();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- map.put("content",content);
|
|
|
+ map.put("content", content);
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(map);
|
|
|
@@ -800,4 +944,128 @@ public class CustomerInfoApiController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "支付提交")
|
|
|
+ @PostMapping("paySubmit")
|
|
|
+ public MessageResult<Integer> paySubmit(@RequestBody PayWorkOrderDTO dto, @RequestAttribute String subject) {
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ WorkOrder workOrder = workOrderService.get(dto.getId());
|
|
|
+ workOrder.setCertificate(dto.getCertificate());
|
|
|
+ workOrder.setPayStatus("1");
|
|
|
+ workOrder.setCreateBy(subject);
|
|
|
+ workOrder.setCreateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = workOrderService.update(workOrder);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库提交失败");
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "工单状态列表")
|
|
|
+ @RequestMapping(value = "statusList", method = RequestMethod.POST)
|
|
|
+ public MessageResult<List<Map>> statusList(String token, @RequestAttribute String subject) {
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<List<Map>> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("工单状态");
|
|
|
+
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (DataDictionary item : dataDictionaryList) {
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("name",item.getName());
|
|
|
+ map.put("value",item.getValue());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(mapList);
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "取消工单")
|
|
|
+ @GetMapping("cancelWorkOrder/{id}")
|
|
|
+ public MessageResult<Integer> cancelWorkOrder(String token,@PathVariable("id") String id,@RequestAttribute String subject) {
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ WorkOrder workOrder = workOrderService.get(id);
|
|
|
+
|
|
|
+ if (workOrder != null) {
|
|
|
+
|
|
|
+ int affectCount = workOrderService.cancelWorkOrder(workOrder,subject);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(affectCount);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库不存在该记录!");
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "邀请师傅")
|
|
|
+ @RequestMapping(value = "inviteTechnician", method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "workOrderId", value = "工单ID", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "technicianId", value = "师傅ID", paramType = "form"),
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> inviteTechnician(String workOrderId,String technicianId,String token, @RequestAttribute String subject) {
|
|
|
+ MessageResult<Integer> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ WorkOrder workOrder = workOrderService.get(workOrderId);
|
|
|
+
|
|
|
+ if(workOrder!=null){
|
|
|
+ workOrder.setUpdateBy(subject);
|
|
|
+ workOrder.setUpdateTime(new Date());
|
|
|
+ workOrder.setTechnicianId(technicianId);
|
|
|
+
|
|
|
+ int affectCount = workOrderService.update(workOrder);
|
|
|
+
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setData(affectCount);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage("数据库不存在该记录!");
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
+
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
}
|