|
|
@@ -1,7 +1,9 @@
|
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
|
+import com.jpsoft.employment.modules.base.entity.Deposit;
|
|
|
import com.jpsoft.employment.modules.base.entity.Feedback;
|
|
|
import com.jpsoft.employment.modules.base.entity.TechnicianInfo;
|
|
|
+import com.jpsoft.employment.modules.base.service.DepositService;
|
|
|
import com.jpsoft.employment.modules.base.service.FeedbackService;
|
|
|
import com.jpsoft.employment.modules.base.service.TechnicianInfoService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
@@ -37,6 +40,8 @@ public class TechnicianApiController {
|
|
|
private TechnicianInfoService technicianInfoService;
|
|
|
@Autowired
|
|
|
private FeedbackService feedbackService;
|
|
|
+ @Autowired
|
|
|
+ private DepositService depositService;
|
|
|
|
|
|
@ApiOperation(value="注册")
|
|
|
@PostMapping("register")
|
|
|
@@ -265,14 +270,16 @@ public class TechnicianApiController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "region", paramType = "query", required = true, value = "服务地区"),
|
|
|
@ApiImplicitParam(name = "businessScope", paramType = "query", required = true, value = "业务范围"),
|
|
|
+ @ApiImplicitParam(name = "serviceInfo", paramType = "query", required = true, value = "服务信息"),
|
|
|
})
|
|
|
- public MessageResult<Integer> checkedRegister(String region, String businessScope, @RequestAttribute String subject) {
|
|
|
+ public MessageResult<Integer> checkedRegister(String region, String businessScope, String serviceInfo, @RequestAttribute String subject) {
|
|
|
MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
TechnicianInfo technicianInfo = technicianInfoService.get(subject);
|
|
|
technicianInfo.setRegion(region);
|
|
|
technicianInfo.setBusinessScope(businessScope);
|
|
|
+ technicianInfo.setServiceInfo(serviceInfo);
|
|
|
technicianInfo.setUpdateBy(subject);
|
|
|
technicianInfo.setUpdateTime(new Date());
|
|
|
|
|
|
@@ -491,4 +498,47 @@ public class TechnicianApiController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="服务担保")
|
|
|
+ @PostMapping("deposit")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "amount", paramType = "query", required = true, value = "缴纳金额"),
|
|
|
+ @ApiImplicitParam(name = "payType", paramType = "query", required = true, value = "支付方式"),
|
|
|
+ @ApiImplicitParam(name = "payImages", paramType = "query", required = true, value = "支付图片"),
|
|
|
+ })
|
|
|
+ public MessageResult<Integer> deposit(String amount, String payType, String payImages, @RequestAttribute String subject) {
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ Deposit deposit = new Deposit();
|
|
|
+ deposit.setId(UUID.randomUUID().toString());
|
|
|
+ deposit.setAmount(new BigDecimal(amount));
|
|
|
+ deposit.setPayType(payType);
|
|
|
+ deposit.setPayStatus("1");
|
|
|
+ deposit.setPayTime(new Date());
|
|
|
+ deposit.setPayImages(payImages);
|
|
|
+ deposit.setTechnicianId(subject);
|
|
|
+ deposit.setDelFlag(false);
|
|
|
+ deposit.setCreateBy(subject);
|
|
|
+ deposit.setCreateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = depositService.insert(deposit);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setMessage("提交成功!");
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|