修改
This commit is contained in:
@@ -3,6 +3,7 @@ package com.kelp.business;
|
|||||||
|
|
||||||
import com.kelp.business.dao.BuyDao;
|
import com.kelp.business.dao.BuyDao;
|
||||||
import com.kelp.business.entity.Buy;
|
import com.kelp.business.entity.Buy;
|
||||||
|
import com.kelp.common.utils.IdWorker;
|
||||||
import com.kelp.crm.entity.ECustomer;
|
import com.kelp.crm.entity.ECustomer;
|
||||||
import com.kelp.crm.service.ECustomerService;
|
import com.kelp.crm.service.ECustomerService;
|
||||||
import com.opensymphony.oscache.util.StringUtil;
|
import com.opensymphony.oscache.util.StringUtil;
|
||||||
@@ -14,6 +15,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class BuyController {
|
public class BuyController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IdWorker idWorker;
|
||||||
private final String prefix = "/business/buy";
|
private final String prefix = "/business/buy";
|
||||||
|
|
||||||
protected String RESULT = "result";
|
protected String RESULT = "result";
|
||||||
@@ -25,8 +29,8 @@ public class BuyController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ECustomerService customerService;
|
private ECustomerService customerService;
|
||||||
|
|
||||||
@PostMapping(path = {prefix + "/{id}"})
|
@PostMapping(path = {prefix + "/{type}"})
|
||||||
public ModelMap index(@PathVariable("id") String id, Buy buy) {
|
public ModelMap index(@PathVariable("type") String type, Buy buy) {
|
||||||
|
|
||||||
ModelMap modelMap = new ModelMap();
|
ModelMap modelMap = new ModelMap();
|
||||||
ECustomer eCustomer = new ECustomer();
|
ECustomer eCustomer = new ECustomer();
|
||||||
@@ -67,7 +71,8 @@ public class BuyController {
|
|||||||
} else {
|
} else {
|
||||||
buy.setCustomerId(customer.getId());
|
buy.setCustomerId(customer.getId());
|
||||||
}
|
}
|
||||||
buy.setType(id);
|
buy.setType(type);
|
||||||
|
buy.setId(idWorker.nextId());
|
||||||
buyDao.add(buy);
|
buyDao.add(buy);
|
||||||
|
|
||||||
modelMap.put(RESULT, true);
|
modelMap.put(RESULT, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user