|
@@ -9,6 +9,7 @@ import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import com.iamberry.wechat.tools.ResultInfo;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -328,4 +329,29 @@ public class MachineController {
|
|
|
String barcode = productModel + productFeatures + softwareVersion + String.valueOf(year).substring(2, 4) + months + num;
|
|
|
return barcode;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据barcode查询机器信息
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("/getMachineInfo")
|
|
|
+ public JSONObject getMachineInfo(HttpServletRequest request) {
|
|
|
+ String barCode = request.getParameter("barCode");
|
|
|
+ if (barCode == null || barCode.equals("")) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ PtsMachine ptsMachine = machineService.getMachineByBarCode(barCode);
|
|
|
+ if(ptsMachine != null){
|
|
|
+ json.put("isBeing",1);
|
|
|
+ json.put("productType",ptsMachine.getMachineProduceType() == 1?"净水机":"冲奶机");
|
|
|
+ json.put("productType",ptsMachine.getMachineProduceType() == 1?"净水机":"冲奶机");
|
|
|
+ }else{
|
|
|
+ json.put("producedTime",ptsMachine.getMachineProducedTime() == null?null:ptsMachine.getMachineProducedTime().getTime());
|
|
|
+ }
|
|
|
+ return json;
|
|
|
+ }
|
|
|
}
|