| | |
| | | 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 OrderProductTypeController extends BaseController { |
| | |
| | | @RequestMapping(value = "/orderProductType/add/auth") |
| | | @ManagerAuth |
| | | public R add(OrderProductType orderProductType) { |
| | | Date now = new Date(); |
| | | orderProductType.setHostId(getHostId()); |
| | | orderProductType.setStatus(1); |
| | | orderProductType.setCreateBy(getUserId()); |
| | | orderProductType.setCreateTime(now); |
| | | orderProductType.setUpdateBy(getUserId()); |
| | | orderProductType.setUpdateTime(now); |
| | | orderProductTypeService.insert(orderProductType); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Cools.isEmpty(orderProductType) || null==orderProductType.getId()){ |
| | | return R.error(); |
| | | } |
| | | Date now = new Date(); |
| | | orderProductType.setUpdateBy(getUserId()); |
| | | orderProductType.setUpdateTime(now); |
| | | orderProductTypeService.updateById(orderProductType); |
| | | return R.ok(); |
| | | } |