| | |
| | | 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(); |
| | | } |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderProductTypeSQuery/auth") |
| | | @ManagerAuth |
| | | public R queryS(String condition) { |
| | | EntityWrapper<OrderProductType> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<OrderProductType> page = orderProductTypeService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (OrderProductType orderProductType : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", orderProductType.getName()); |
| | | map.put("value", orderProductType.getName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderProductType/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |