|
@@ -0,0 +1,72 @@
|
|
|
|
+package com.iamberry.rst.controllers.approval;
|
|
|
|
+
|
|
|
|
+import com.iamberry.rst.core.address.Province;
|
|
|
|
+import com.iamberry.rst.core.approval.ApplyPick;
|
|
|
|
+import com.iamberry.rst.core.page.PageRequest;
|
|
|
|
+import com.iamberry.rst.core.page.PagedResult;
|
|
|
|
+import com.iamberry.rst.core.pts.PtsMachine;
|
|
|
|
+import com.iamberry.rst.faces.approval.ApplyPickItemService;
|
|
|
|
+import com.iamberry.rst.faces.approval.ApplyPickService;
|
|
|
|
+import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
|
+import com.iamberry.wechat.tools.ResponseJson;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@Controller
|
|
|
|
+@RequestMapping("/admin/applyPick")
|
|
|
|
+public class ApplyPickController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ApplyPickService applyPickService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ApplyPickItemService applyPickItemService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param applyPick
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @param pageNO
|
|
|
|
+ * @param totalNum
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping(value = "/applyPickList")
|
|
|
|
+ public ResponseJson listApplyPickPage(
|
|
|
|
+ ApplyPick applyPick,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
|
|
|
|
+ @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
|
|
|
|
+ @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) throws Exception {
|
|
|
|
+ ResponseJson rj =new ResponseJson(200, "查询成功", 200);
|
|
|
|
+
|
|
|
|
+ PagedResult<ApplyPick> pagedResult = applyPickService.listApplyPickPage(new PageRequest<ApplyPick>(applyPick, pageNO, pageSize, totalNum == null));
|
|
|
|
+ if (totalNum != 0) {
|
|
|
|
+ pagedResult.setTotal(totalNum);
|
|
|
|
+ }
|
|
|
|
+ List<ApplyPick> applyPickList = pagedResult.getDataList();
|
|
|
|
+ rj.addResponseKeyValue("applyPickList",applyPickList);
|
|
|
|
+ return rj;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping(value = "/addApplyPick")
|
|
|
|
+ public ResponseJson addApplyPick(
|
|
|
|
+ ApplyPick applyPick) throws Exception {
|
|
|
|
+ ResponseJson rj =new ResponseJson(200, "修改成功", 200);
|
|
|
|
+ Integer flag = applyPickService.save(applyPick);
|
|
|
|
+ if (flag < 1) {
|
|
|
|
+ return ResponseJson.getFAILURE();
|
|
|
|
+ }
|
|
|
|
+ return rj;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|