customer impression

master
wangning 7 years ago
parent 993fe26a1e
commit 3738ebb1c4

@ -7,7 +7,7 @@ import com.alibaba.fastjson.JSONObject;
/** /**
* Created by wangning on 2017/12/28. * Created by wangning on 2017/12/28.
*/ */
public interface CustomerImpression { public interface CustomerImpressionService {
JSONObject listPageble(CustomerImpressionQuery customerImpressionQuery); JSONObject listPageble(CustomerImpressionQuery customerImpressionQuery);

@ -21,7 +21,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.maxmind.geoip.LookupService; import com.maxmind.geoip.LookupService;
import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery;
import au.com.royalpay.payment.manage.apps.core.CustomerImpression; import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -32,7 +32,7 @@ import au.com.royalpay.payment.tools.utils.PageListUtils;
* Created by wangning on 2017/12/28. * Created by wangning on 2017/12/28.
*/ */
@Service @Service
public class CustomerImpressionImpl implements CustomerImpression { public class CustomerImpressionServiceImpl implements CustomerImpressionService {
@Resource @Resource
private ClientCustomersMapper clientCustomersMapper; private ClientCustomersMapper clientCustomersMapper;
@Resource @Resource
@ -90,7 +90,7 @@ public class CustomerImpressionImpl implements CustomerImpression {
public void generate(int client_id) { public void generate(int client_id) {
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
params.put("client_id", client_id); params.put("client_id", client_id);
params.put("include_success_status",4); params.put("include_success_status",3);
PageList<JSONObject> lastRecord = clientCustomersMapper.listCustomerInfo(params, new PageBounds(1, 1, Order.formString("update_time.desc"))); PageList<JSONObject> lastRecord = clientCustomersMapper.listCustomerInfo(params, new PageBounds(1, 1, Order.formString("update_time.desc")));
if (!CollectionUtils.isEmpty(lastRecord)) { if (!CollectionUtils.isEmpty(lastRecord)) {
params.put("confirm_time", lastRecord.get(0).getDate("update_time")); params.put("confirm_time", lastRecord.get(0).getDate("update_time"));

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.apps.web; package au.com.royalpay.payment.manage.apps.web;
import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery;
import au.com.royalpay.payment.manage.apps.core.CustomerImpression; import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.advise.AppClientController; import au.com.royalpay.payment.tools.device.advise.AppClientController;
@ -20,25 +20,31 @@ import javax.annotation.Resource;
@RequestMapping(value = "/customers/impression") @RequestMapping(value = "/customers/impression")
public class CustomerImpressionController { public class CustomerImpressionController {
@Resource @Resource
private CustomerImpression customerImpression; private CustomerImpressionService customerImpressionService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public JSONObject list(CustomerImpressionQuery customerImpressionQuery,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { public JSONObject list(CustomerImpressionQuery customerImpressionQuery, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) {
customerImpressionQuery.setClient_id(app.getInteger("client_id")); customerImpressionQuery.setClient_id(app.getInteger("client_id"));
return customerImpression.listPageble(customerImpressionQuery); return customerImpressionService.listPageble(customerImpressionQuery);
} }
@RequestMapping(value = "/{customer_id}", method = RequestMethod.GET) @RequestMapping(value = "/{customer_id}", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public JSONObject find(@PathVariable String customer_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { public JSONObject find(@PathVariable String customer_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) {
return customerImpression.findOne(app.getIntValue("client_id"),customer_id); return customerImpressionService.findOne(app.getIntValue("client_id"), customer_id);
} }
@RequestMapping(value = "/{customer_id}", method = RequestMethod.PUT) @RequestMapping(value = "/{customer_id}", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public void modifyNameRemark(@PathVariable String customer_id, @RequestBody JSONObject customerInfo,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) { public void modifyNameRemark(@PathVariable String customer_id, @RequestBody JSONObject customerInfo,
customerImpression.modifyNameRemark(app.getIntValue("client_id"),customer_id,customerInfo.getString("name_remark")); @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) {
customerImpressionService.modifyNameRemark(app.getIntValue("client_id"), customer_id, customerInfo.getString("name_remark"));
}
@RequestMapping(value = "/gengrate", method = RequestMethod.PUT)
@ResponseBody
public void generate(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject app) {
customerImpressionService.generate(app.getIntValue("client_id"));
} }
} }

@ -552,7 +552,7 @@
from pmt_orders o from pmt_orders o
left join sys_customer_relation cr on cr.wepay_openid = o.customer_id left join sys_customer_relation cr on cr.wepay_openid = o.customer_id
left join sys_customer_relation_alipay cra on cra.alipay_uid = o.customer_id left join sys_customer_relation_alipay cra on cra.alipay_uid = o.customer_id
where o.customer_id is not null and (o.channel = 'Alipay' or o.channel = 'Wechat') where o.customer_id is not null and o.channel is not null
and client_id = #{client_id} and client_id = #{client_id}
<if test="confirm_time"> <if test="confirm_time">
and o.confirm_time > #{confirm_time} and o.confirm_time > #{confirm_time}

@ -0,0 +1,27 @@
package au.com.royalpay.payment.manage.apps.core.impls;
import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
/**
* Created by wangning on 08/01/2018.
*/
@SpringBootTest
@ActiveProfiles({"local","alipay","wechat","jd","bestpay"})
@RunWith(SpringRunner.class)
public class CustomerImpressionServiceImplTest {
@Resource
private CustomerImpressionService customerImpressionService;
@Test
public void generate() throws Exception {
customerImpressionService.generate(9);
}
}
Loading…
Cancel
Save