Subversion Repositories SmartDukaan

Rev

Rev 32587 | Rev 32702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32587 Rev 32701
Line 15... Line 15...
15
import java.util.stream.Collectors;
15
import java.util.stream.Collectors;
16
 
16
 
17
import javax.servlet.http.HttpServletRequest;
17
import javax.servlet.http.HttpServletRequest;
18
 
18
 
19
import com.spice.profitmandi.common.enumuration.ActivationType;
19
import com.spice.profitmandi.common.enumuration.ActivationType;
-
 
20
import com.spice.profitmandi.common.web.client.RestClient;
-
 
21
import com.spice.profitmandi.service.FofoUser;
20
import org.apache.commons.csv.CSVRecord;
22
import org.apache.commons.csv.CSVRecord;
21
import org.apache.logging.log4j.LogManager;
23
import org.apache.logging.log4j.LogManager;
22
import org.apache.logging.log4j.Logger;
24
import org.apache.logging.log4j.Logger;
23
import org.springframework.beans.factory.annotation.Autowired;
25
import org.springframework.beans.factory.annotation.Autowired;
24
import org.springframework.format.annotation.DateTimeFormat;
26
import org.springframework.format.annotation.DateTimeFormat;
Line 27... Line 29...
27
import org.springframework.http.MediaType;
29
import org.springframework.http.MediaType;
28
import org.springframework.http.ResponseEntity;
30
import org.springframework.http.ResponseEntity;
29
import org.springframework.stereotype.Controller;
31
import org.springframework.stereotype.Controller;
30
import org.springframework.transaction.annotation.Transactional;
32
import org.springframework.transaction.annotation.Transactional;
31
import org.springframework.ui.Model;
33
import org.springframework.ui.Model;
32
import org.springframework.web.bind.annotation.RequestBody;
34
import org.springframework.web.bind.annotation.*;
33
import org.springframework.web.bind.annotation.RequestMapping;
-
 
34
import org.springframework.web.bind.annotation.RequestMethod;
-
 
35
import org.springframework.web.bind.annotation.RequestParam;
-
 
36
import org.springframework.web.bind.annotation.RequestPart;
-
 
37
import org.springframework.web.multipart.MultipartFile;
35
import org.springframework.web.multipart.MultipartFile;
38
 
36
 
39
import com.mongodb.DBObject;
37
import com.mongodb.DBObject;
40
import com.spice.profitmandi.common.enumuration.MessageType;
38
import com.spice.profitmandi.common.enumuration.MessageType;
41
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
39
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
Line 1300... Line 1298...
1300
        List<CollectionRemark> remarks = Arrays.asList(CollectionRemark.values()).stream()
1298
        List<CollectionRemark> remarks = Arrays.asList(CollectionRemark.values()).stream()
1301
                .filter(x -> !x.equals(CollectionRemark.COLLECTION_PLAN)).collect(Collectors.toList());
1299
                .filter(x -> !x.equals(CollectionRemark.COLLECTION_PLAN)).collect(Collectors.toList());
1302
        return responseSender.ok(remarks);
1300
        return responseSender.ok(remarks);
1303
    }
1301
    }
1304
 
1302
 
-
 
1303
    @Autowired
-
 
1304
    RestClient restClient;
-
 
1305
 
-
 
1306
    @RequestMapping(value = "/click2call/{fofoId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
1307
    public ResponseEntity<?> createPartnerCollectionRemark(HttpServletRequest request, @PathVariable int fofoId) throws Exception {
-
 
1308
        int id = (int) request.getAttribute("userId");
-
 
1309
        User user = userRepository.selectById(id);
-
 
1310
        AuthUser authUser = authRepository.selectByEmailOrMobile(user.getEmailId());
-
 
1311
        String fromMobile = authUser.getMobileNumber();
-
 
1312
 
-
 
1313
        com.spice.profitmandi.dao.entity.user.User fofoUser = userUserRepository.selectById(fofoId);
-
 
1314
        String toMobile = fofoUser.getMobileNumber();
-
 
1315
 
-
 
1316
        String url = String.format("https://ccs1.smartpingcc.io/v2/clickToCall/para?&user_id=71287091&token=InCfClzwFUtLUW610faI&from=%s&to=%s", fromMobile, toMobile);
-
 
1317
        restClient.get(url, null, null);
-
 
1318
 
-
 
1319
        return responseSender.ok(true);
-
 
1320
    }
-
 
1321
 
1305
    @RequestMapping(value = "/createPartnerColectionRemark", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
1322
    @RequestMapping(value = "/createPartnerColectionRemark", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
1306
    @ApiImplicitParams({
1323
    @ApiImplicitParams({
1307
 
1324
 
1308
            @ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
1325
            @ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
1309
    public ResponseEntity<?> createPartnerCollectionRemark(HttpServletRequest request,
1326
    public ResponseEntity<?> createPartnerCollectionRemark(HttpServletRequest request,