| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class CstmrController extends BaseController { |
| | |
| | | @RequestMapping(value = "/cstmr/add/auth") |
| | | @ManagerAuth |
| | | public R add(Cstmr cstmr) { |
| | | cstmr.setHostId(getHostId()); |
| | | cstmr.setUuid(cstmrService.getNextUuid()); // 客户代号 |
| | | cstmr.setDeptId(getDeptId()); // 所属部门 |
| | | cstmr.setUserId(getUserId()); // 所属人员 |
| | | |
| | | cstmr.setCreateBy(getUserId()); |
| | | cstmr.setCreateTime(new Date()); |
| | | cstmr.setUpdateBy(getUserId()); |
| | | cstmr.setUpdateTime(new Date()); |
| | | cstmr.setStatus(1); |
| | | cstmrService.insert(cstmr); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Cools.isEmpty(cstmr) || null==cstmr.getId()){ |
| | | return R.error(); |
| | | } |
| | | cstmr.setUpdateBy(getUserId()); |
| | | cstmr.setUpdateTime(new Date()); |
| | | cstmrService.updateById(cstmr); |
| | | return R.ok(); |
| | | } |