This commit is contained in:
dimengzhe
2025-04-22 17:13:27 +08:00
parent 66419b39a7
commit fbbe5be935

View File

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