Browse Source

修改

master
dimengzhe 4 days ago
parent
commit
fbbe5be935
  1. 11
      ksafepack-admin/src/main/java/com/kelp/business/BuyController.java

11
ksafepack-admin/src/main/java/com/kelp/business/BuyController.java

@ -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);

Loading…
Cancel
Save