Commit b03ebdc3 authored by 周毅's avatar 周毅

删除无用代码

parent 339d24bc
package com.gavel.hzgd.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.hzgd.utils.AoiDStateEnum;
import com.gavel.hzgd.utils.AoiStateEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.Bm7dataService;
import com.gavel.hzgd.vo.Bm7dataCondition;
import com.gavel.hzgd.vo.Bm7dataVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/bm7data")
public class Bm7dataController extends BaseController {
@Autowired
private Bm7dataService bm7dataService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/bm7data/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/bm7data/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/bm7data/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
Bm7dataCondition condition = DataConvert.getCondition(param, Bm7dataCondition.class);
RecordSet<Bm7dataVO> records = bm7dataService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(Bm7dataVO.class, records.getRecords().get(0));
}
return buildReturnData(Bm7dataVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
Bm7dataCondition condition = DataConvert.getCondition(param, Bm7dataCondition.class);
RecordSet<Bm7dataVO> records = bm7dataService.query(condition);
return buildReturnData(records, Bm7dataVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bm7dataService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value ="syncdata", method = RequestMethod.POST)
@ResponseBody
public Object syncdata(@RequestBody JSONObject param) {
Bm7dataCondition condition = DataConvert.getCondition(param, Bm7dataCondition.class);
bm7dataService.syncdata(condition);
return ThreadContext.getReturnData();
}
@RequestMapping(value ="syncdata2", method = RequestMethod.POST)
@ResponseBody
public Object syncdata2(@RequestBody JSONObject param) {
Bm7dataCondition condition = DataConvert.getCondition(param, Bm7dataCondition.class);
bm7dataService.syncdata2(condition);
return ThreadContext.getReturnData();
}
//查看附件
@RequestMapping(value = "/preview/{barcode}")
@ResponseBody
public Object attachmentPreview(@PathVariable String barcode) {
try{
if(StringUtils.isEmpty(barcode)){
setReturnMessage("条码不能为空!");
}
Bm7dataVO bm7dataVO = bm7dataService.preveiw(barcode);
buildReturnData(bm7dataVO);
}catch (Exception e){
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
return ThreadContext.getReturnData();
}
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bm7dataService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bm7dataService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
Bm7dataCondition condition = DataConvert.getCondition(param, Bm7dataCondition.class);
RecordSet<Bm7dataVO> records = bm7dataService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "init/judge", method = RequestMethod.POST)
@ResponseBody
public Object initJudge() {
return buildReturnData(AoiStateEnum.toList());
}
@RequestMapping(value = "init/defectjudg", method = RequestMethod.POST)
@ResponseBody
public Object initDefectjudg() {
return buildReturnData(AoiDStateEnum.toList());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.NoRepeatSubmit;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzCkdjService;
import com.gavel.hzgd.vo.HzQtckCondition;
import com.gavel.hzgd.vo.HzQtckmxVO;
import com.gavel.hzgd.vo.HzWoVO;
import com.gavel.kc.controller.QtckController;
import com.gavel.kc.vo.QtckVO;
import com.gavel.kc.vo.QtckmxCondition;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("hzmes/ckdj")
public class CkdjController extends QtckController {
@Autowired
private HzCkdjService hzCkdjService;
@Override
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/ckdj/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/ckdj/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/ckdj/edit";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzQtckCondition condition = DataConvert.getCondition(param, HzQtckCondition.class);
RecordSet<QtckVO> records = hzCkdjService.queryHz(condition);
return buildReturnData(records, QtckVO.class);
}
@Override
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
QtckmxCondition condition = DataConvert.getCondition(param, QtckmxCondition.class);
RecordSet<HzQtckmxVO> records = hzCkdjService.queryHzDetail(condition);
return buildReturnData(records, HzQtckmxVO.class);
}
@ApiOperation(value = "查询箱/托码对应物料信息,传入snid")
@RequestMapping(value = "/getCkwlxx", method = RequestMethod.POST)
@ResponseBody
public Object getGpwxmxVOByGpid(@RequestBody JSONObject param) {
String snid = param.getString("snid");
if(StringUtils.isEmpty(snid)){
setReturnMessage("条码信息不允许为空!");
return returnData();
}
List<HzWoVO> hzWoVOList = hzCkdjService.queryZxwlBySnid(snid);
if(hzWoVOList != null && hzWoVOList.size() > 0){
return buildReturnData(hzWoVOList);
}else{
return ThreadContext.getReturnData();
}
}
@NoRepeatSubmit(lockTime = 40000)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzCkdjService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzCkdjService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzCkdjService.delete(editJson);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.NumberUtils;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.U_coderuleService;
import com.gavel.hzgd.service.WlsnService;
import com.gavel.hzgd.utils.WlsnLxEnum;
import com.gavel.hzgd.utils.WlsnStateEnum;
import com.gavel.hzgd.vo.CodeValueVO;
import com.gavel.hzgd.vo.WlsnCondition;
import com.gavel.hzgd.vo.WlsnVO;
import com.gavel.hzgd.vo.WoCodeValueVO;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gjwlsn")
public class GjWlsnController extends BaseController {
@Autowired
private U_coderuleService u_coderuleService;
@Autowired
private WlsnService wlsnService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gjwlsn/index";
}
@RequestMapping("/auto/add/index")
public String autoAddIndex() {
return "hzmes/gjwlsn/autoadd";
}
@ApiOperation(value = "获取当前物料的治工具条码数据,传入wlid")
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
String wlid = param.getString("wlid");
if(StringUtils.isEmpty(wlid)){
setReturnMessage("物料信息不允许为空!");
return returnData();
}
WlsnCondition condition = DataConvert.getCondition(param, WlsnCondition.class);
condition.setLx(WlsnLxEnum.GJ.getId());
RecordSet<WlsnVO> records = wlsnService.query(condition);
return buildReturnData(records, WlsnVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
WlsnCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), WlsnCondition.class);
String wlid = condition.getWlid();
if(StringUtils.isEmpty(wlid)){
setReturnMessage("物料信息不允许为空!");
return ;
}
condition.setLx(WlsnLxEnum.GJ.getId());
RecordSet<WlsnVO> records = wlsnService.query(condition);
doExport(request, response, param, records.getRecords());
}
@ApiOperation(value = "获取当前任务单条码规则数据,传入wlid")
@RequestMapping(value = "/getGjWlsnCR", method = RequestMethod.POST)
@ResponseBody
public Object getGjWlsnCR(@RequestBody JSONObject param) {
String wlid = param.getString("wlid");
if(StringUtils.isEmpty(wlid)){
setReturnMessage("物料信息不允许为空!");
return returnData();
}
WoCodeValueVO woCodeValueVO = u_coderuleService.getGjCodeValueList(wlid);
if(woCodeValueVO != null){
return buildReturnData(woCodeValueVO);
}else{
return ThreadContext.getReturnData();
}
}
@ApiOperation(value = "生成条码")
@RequestMapping(value = "/createGjWlsn", method = RequestMethod.POST)
@ResponseBody
public Object createGjWlsn(@RequestBody JSONObject param) {
String wlid = param.getString("wlid");
List<CodeValueVO> codeValueVOList = DataConvert.getData2List(param.getJSONArray("codeValueList"), CodeValueVO.class);
Integer count = param.getInteger("count");
if(StringUtils.isEmpty(wlid)){
setReturnMessage("物料信息不允许为空!");
return returnData();
}
if(!NumberUtils.Greater(count,0)){
setReturnMessage("生成条码数量必须大于0!");
return returnData();
}
if(codeValueVOList == null || codeValueVOList.size() == 0){
setReturnMessage("条码信息异常,请检查!");
return returnData();
}
u_coderuleService.createGjWlsn(wlid,codeValueVOList,count);
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/init/zt", method = RequestMethod.POST)
@ResponseBody
public Object intxjfs(@RequestBody JSONObject param) {
return buildReturnData(WlsnStateEnum.toList());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.GpfkService;
import com.gavel.hzgd.service.GphyService;
import com.gavel.hzgd.vo.*;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.zlgl.vo.JydmxVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping("hzmes/gpfkaoi")
public class GpaoiwxController extends BaseController {
@Autowired
private GpfkService gpfkService;
@Autowired
private GphyService gphyService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gpfkaoi/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gpfkaoi/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gpfkaoi/edit";
}
@RequestMapping("/gx")
public String gx() {
return "hzmes/gpfkaoi/gx";
}
@RequestMapping("/split")
public String split() {
return "hzmes/gpwx/split";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
RecordSet<GpfkVO> records = gpfkService.query(condition);
return buildReturnData(records, GpfkVO.class);
}
@ApiOperation(value = "扫描生产主产品条码,{\"wosnid\":111}传入条码,返回任务单信息及历史不合格信息")
@RequestMapping(value = "/queryWxinfo", method = RequestMethod.POST)
@ResponseBody
public Object queryWxinfo(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
String gxid = param.getString("gxid");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
GpWxInfoVO gpWxInfoVO = gpfkService.getGpwxinfo(wosnid,gxid);
return buildReturnData(gpWxInfoVO);
}
@ApiOperation(value = "查询条码对应的不合格检验信息,传入wosnid")
@RequestMapping(value = "/getBhgJymx", method = RequestMethod.POST)
@ResponseBody
public Object getGphymx(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码信息不允许为空!");
return returnData();
}
List<JydmxVO> jydmxVOList = gpfkService.queryBhgJydmxBySnid(wosnid);
return buildReturnData(jydmxVOList, JydmxVO.class);
}
@ApiOperation(value = "查询条码对应的可拆卸装配信息,传入wosnid")
@RequestMapping(value = "/getZpxx", method = RequestMethod.POST)
@ResponseBody
public Object getZpxx(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码信息不允许为空!");
return returnData();
}
List<GphyVO> gphyVOList = gphyService.queryWxZpInfo(wosnid);
return buildReturnData(gphyVOList, GphyVO.class);
}
@ApiOperation(value = "扫码进行维修反馈")
@RequestMapping(value = "/doGpwxfk", method = RequestMethod.POST)
@ResponseBody
public Object doGpjyfk(@RequestBody GpWxInfoVO param){
GpwxResVO gpwxResVO = gpfkService.doGpwxfk(param);
return buildReturnData(gpwxResVO);
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/delGpwx", method = RequestMethod.POST)
@ResponseBody
public Object delGpwx(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.delGpwxById(gpfkid);
return ThreadContext.getReturnData();
}
//查看附件
@RequestMapping(value = "/preview/{id}")
@ResponseBody
public Object attachmentPreview(@PathVariable String id) {
try{
if(StringUtils.isEmpty(id)){
setReturnMessage("条码不能为空!");
}
AoiWxinfoVO aoiWxinfoVO = gpfkService.preveiw(id);
buildReturnData(aoiWxinfoVO);
}catch (Exception e){
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage(e.getMessage());
return ThreadContext.getReturnData();
}
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.GpbhgcxService;
import com.gavel.hzgd.vo.GpbhgcxVO;
import com.gavel.hzgd.vo.GpbhgmxCondition;
import com.gavel.hzgd.vo.GpbhgmxVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/gpbhgcx")
public class GpbhgcxController extends BaseController {
@Autowired
private GpbhgcxService gpbhgcxService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gpbhgcx/index";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
GpbhgmxCondition condition = DataConvert.getCondition(param, GpbhgmxCondition.class);
RecordSet<GpbhgcxVO> records = gpbhgcxService.queryCx(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(GpbhgcxVO.class, records.getRecords().get(0));
}
return buildReturnData(GpbhgmxVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GpbhgmxCondition condition = DataConvert.getCondition(param, GpbhgmxCondition.class);
RecordSet<GpbhgcxVO> records = gpbhgcxService.queryCx(condition);
return buildReturnData(records, GpbhgcxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpbhgmxCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpbhgmxCondition.class);
RecordSet<GpbhgcxVO> records = gpbhgcxService.queryCx(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.gavel.common.BaseURL;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.SystemOperation;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.GpbhgmxService;
import com.gavel.hzgd.vo.GpbhgmxCondition;
import com.gavel.hzgd.vo.GpbhgmxVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/gpbhgmx")
public class GpbhgmxController extends BaseController {
@Autowired
private GpbhgmxService gpbhgmxService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gpbhgmx/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gpbhgmx/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gpbhgmx/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
GpbhgmxCondition condition = DataConvert.getCondition(param, GpbhgmxCondition.class);
RecordSet<GpbhgmxVO> records = gpbhgmxService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(GpbhgmxVO.class, records.getRecords().get(0));
}
return buildReturnData(GpbhgmxVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GpbhgmxCondition condition = DataConvert.getCondition(param, GpbhgmxCondition.class);
RecordSet<GpbhgmxVO> records = gpbhgmxService.query(condition);
return buildReturnData(records, GpbhgmxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpbhgmxService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpbhgmxService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpbhgmxService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpbhgmxCondition condition = DataConvert.getCondition(param, GpbhgmxCondition.class);
RecordSet<GpbhgmxVO> records = gpbhgmxService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.GpfkbgzlhzService;
import com.gavel.hzgd.vo.GpfkQCVO;
import com.gavel.hzgd.vo.GpfkhzCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gpfkbgzlfx")
public class GpfkbgzlfxController extends BaseController {
@Autowired
private GpfkbgzlhzService gpfkbgzlhzService;
@RequestMapping("/index")
public String index() {
return "hzmes/gpfkbgzlfx/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkhzCondition condition) {
List<GpfkQCVO> gpfkQCVOList = gpfkbgzlhzService.queryQcInfo(condition);
return buildReturnData(gpfkQCVOList,GpfkQCVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkhzCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkhzCondition.class);
List<GpfkQCVO> records = gpfkbgzlhzService.queryQcInfo(condition);
doExport(request, response, param, records);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.Constants;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.hzgd.service.GpfkbgzlhzService;
import com.gavel.hzgd.utils.GpfkbgzlhzEnum;
import com.gavel.hzgd.utils.GpfkllhzEnum;
import com.gavel.hzgd.vo.GpfkQCVO;
import com.gavel.hzgd.vo.GpfkhzCondition;
import com.gavel.hzgd.vo.GpfkhzVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gpfkbgzlhz")
public class GpfkbgzlhzController extends BaseController {
@Autowired
private GpfkbgzlhzService gpfkbgzlhzService;
@RequestMapping("/index")
public String index() {
return "hzmes/gpfkbgzlhz/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkhzCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
condition.setHzfs(GpfkbgzlhzEnum.GZZX.getId() + Constants.StringSplit.IDSPLIT + GpfkbgzlhzEnum.WL.getId());
}
List<GpfkhzVO> records = gpfkbgzlhzService.queryGpfkbgzlhz(condition);
return buildReturnData(records, GpfkhzVO.class);
}
@RequestMapping(value = "queryFkrhz", method = RequestMethod.POST)
@ResponseBody
public Object queryFkrhz(@RequestBody GpfkhzCondition condition) {
if(StringUtils.isEmpty(condition.getGzzxid())){
setReturnMessage("工作中心不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getGxid())){
setReturnMessage("检验工序不允许为空!");
return returnData();
}
List<GpfkhzVO> records = gpfkbgzlhzService.queryGpfkbgzlFkrhz(condition);
return buildReturnData(records, GpfkhzVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkhzCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkhzCondition.class);
if(StringUtils.isEmpty(condition.getHzfs())){
condition.setHzfs(GpfkbgzlhzEnum.GZZX.getId() + Constants.StringSplit.IDSPLIT + GpfkbgzlhzEnum.WL.getId());
}
List<GpfkhzVO> records = gpfkbgzlhzService.queryGpfkbgzlhz(condition);
doExport(request, response, param, records);
}
@RequestMapping(value = "init/hzfs", method = RequestMethod.POST)
@ResponseBody
public Object initHzfs() {
return buildReturnData(GpfkllhzEnum.toList());
}
@RequestMapping(value = "queryQcinfo", method = RequestMethod.POST)
@ResponseBody
public Object queryQcinfo(@RequestBody GpfkhzCondition condition) {
List<GpfkQCVO> gpfkQCVOList = gpfkbgzlhzService.queryQcInfo(condition);
return buildReturnData(gpfkQCVOList,GpfkQCVO.class);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.gygl.vo.BzgxCondition;
import com.gavel.gygl.vo.BzgxVO;
import com.gavel.gygl.vo.GzzxCondition;
import com.gavel.gygl.vo.GzzxVO;
import com.gavel.hzgd.service.GpfkcxService;
import com.gavel.hzgd.vo.GpfkCondition;
import com.gavel.hzgd.vo.GpfkcxVO;
import com.gavel.hzgd.vo.GphyCondition;
import com.gavel.hzgd.vo.GphycxVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/")
public class GpfkcxController extends BaseController {
@Autowired
private GpfkcxService gpfkcxService;
@RequestMapping("gpfkcx/index")
public String index() {
return "hzmes/gpfkcx/index";
}
@RequestMapping("gpfkcx/gpfkmxcx")
public String gpfkmxcx() {
return "hzmes/gpfkcx/gpfkmxcx";
}
@RequestMapping("gpfkcx/gpfkyy")
public String gpfkyy() {
return "hzmes/gpfkcx/gpfkyy";
}
@RequestMapping("tgpfkcx/index")
public String tsjindex() {
return "hzmes/tgpfkcx/index";
}
@RequestMapping(value = "gpfkcx/query", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
RecordSet<GpfkcxVO> records = gpfkcxService.queryCx(condition);
return buildReturnData(records, GpfkcxVO.class);
}
@RequestMapping(value = "gpfkcx/query/detail", method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody GphyCondition condition) {
RecordSet<GphycxVO> records = gpfkcxService.queryDetail(condition);
return buildReturnData(records, GphycxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = "gpfkcx/export", method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<GpfkcxVO> records = gpfkcxService.queryCx(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value ="gpfkcx/queryGzzx", method = RequestMethod.POST)
@ResponseBody
public Object queryGzzx(@RequestBody JSONObject param) {
GzzxCondition condition = DataConvert.getCondition(param, GzzxCondition.class);
List<GzzxVO> records = gpfkcxService.queryGzzx(condition);
return buildReturnData(records, GzzxVO.class);
}
@RequestMapping(value ="gpfkcx/queryBzgx", method = RequestMethod.POST)
@ResponseBody
public Object queryBzgx(@RequestBody JSONObject param) {
BzgxCondition condition = DataConvert.getCondition(param, BzgxCondition.class);
List<BzgxVO> records = gpfkcxService.queryBzgx(condition);
return buildReturnData(records, BzgxVO.class);
}
//通升捷工票记录查询
@RequestMapping(value = "tgpfkcx/query", method = RequestMethod.POST)
@ResponseBody
public Object tsjquery(@RequestBody GpfkCondition condition) {
RecordSet<GpfkcxVO> records = gpfkcxService.queryTcx(condition);
return buildReturnData(records, GpfkcxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = "tgpfkcx/export", method = RequestMethod.POST)
@ResponseBody
public void tsjexport(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<GpfkcxVO> records = gpfkcxService.queryTcx(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.hzgd.service.GpfkllhzService;
import com.gavel.hzgd.utils.GpfkllhzEnum;
import com.gavel.hzgd.vo.GpfkhzCondition;
import com.gavel.hzgd.vo.GpfkhzVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gpfkllhz")
public class GpfkllhzController extends BaseController {
@Autowired
private GpfkllhzService gpfkllhzService;
@RequestMapping("/index")
public String index() {
return "hzmes/gpfkllhz/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkhzCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
setReturnMessage("汇总方式不允许为空,请重新选择!");
return returnData();
}
List<GpfkhzVO> records = gpfkllhzService.queryGpfkllhz(condition);
return buildReturnData(records, GpfkhzVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkhzCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkhzCondition.class);
List<GpfkhzVO> records = gpfkllhzService.queryGpfkllhz(condition);
doExport(request, response, param, records);
}
@RequestMapping(value = "init/hzfs", method = RequestMethod.POST)
@ResponseBody
public Object initHzfs() {
return buildReturnData(GpfkllhzEnum.toList());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.gygl.vo.GzzxVO;
import com.gavel.hzgd.service.GpfkschzService;
import com.gavel.hzgd.utils.GpfkschzEnum;
import com.gavel.hzgd.vo.GpfkhzCondition;
import com.gavel.hzgd.vo.GpfkhzVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gpfkschz")
public class GpfkschzController extends BaseController {
@Autowired
private GpfkschzService gpfkschzService;
@RequestMapping("/index")
public String index() {
return "hzmes/gpfkschz/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkhzCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
setReturnMessage("汇总方式不允许为空,请重新选择!");
return returnData();
}
List<GpfkhzVO> records = gpfkschzService.queryGpfkschz(condition);
return buildReturnData(records, GpfkhzVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkhzCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkhzCondition.class);
List<GpfkhzVO> records = gpfkschzService.queryGpfkschz(condition);
doExport(request, response, param, records);
}
@RequestMapping(value = "init/hzfs", method = RequestMethod.POST)
@ResponseBody
public Object initHzfs() {
return buildReturnData(GpfkschzEnum.toList());
}
@RequestMapping(value = "listScGzzx", method = RequestMethod.POST)
@ResponseBody
public Object listBgGzzx() {
List<GzzxVO> gzzxVOList = gpfkschzService.listScGzzx();
return buildReturnData(gzzxVOList, GzzxVO.class);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.hzgd.service.GpfkService;
import com.gavel.hzgd.service.GphyService;
import com.gavel.hzgd.vo.*;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Api(description = "装配反馈")
@Controller
@RequestMapping("hzmes/gphy")
public class GphyController extends BaseController {
@Autowired
private GphyService gphyService;
@Autowired
private GpfkService gpfkService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gphy/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gphy/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gphy/edit";
}
@RequestMapping("/gx")
public String gx() {
return "hzmes/gphy/gx";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
RecordSet<GpfkVO> records = gpfkService.query(condition);
return buildReturnData(records, GpfkVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gphyService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gphyService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gphyService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.query(condition);
doExport(request, response, param, records.getRecords());
}
@ApiOperation(value = "扫描生产主产品条码,{\"wosnid\":111,gxid:222}传入条码,返回任务单信息及bom信息")
@RequestMapping(value = "/queryWoinfo", method = RequestMethod.POST)
@ResponseBody
public Object getSninfo(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
String gxid = param.getString("gxid");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(gxid)){
setReturnMessage("工序不允许为空!");
return returnData();
}
GpfkWoInfoVO gpfkWoInfoVO = gphyService.getZpinfoBySnid(wosnid,gxid);
if(gpfkWoInfoVO != null){
return buildReturnData(gpfkWoInfoVO);
}else {
return returnData();
}
}
@ApiOperation(value = "扫描装配零件条码,{\"wlsnid\":111}传入条码,返回物料信息")
@RequestMapping(value = "/queryWlxx", method = RequestMethod.POST)
@ResponseBody
public Object queryWlxx(@RequestBody JSONObject param) {
String wlsnid = param.getString("wlsnid");
String gxid = param.getString("gxid");
String woid = param.getString("woid");
if(StringUtils.isEmpty(wlsnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(gxid)){
setReturnMessage("工序不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(woid)){
setReturnMessage("任务单不允许为空!");
return returnData();
}
HzWlsnVO wlsnVO = gphyService.getWLxxBySnid(wlsnid,gxid,woid);
if(wlsnVO != null){
return buildReturnData(wlsnVO);
}else{
return ThreadContext.getReturnData();
}
}
@ApiOperation(value = "装配完成点击完成按钮调用")
@RequestMapping(value = "/doZpGpfk", method = RequestMethod.POST)
@ResponseBody
public Object doZpGpfk(@RequestBody GphyfkCondition param){
gpfkService.doGpzpfk(param);
return returnData();
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/delGpzp", method = RequestMethod.POST)
@ResponseBody
public Object delGpzp(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.delGpzpById(gpfkid);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.GpfkService;
import com.gavel.hzgd.vo.*;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/gpjy")
public class GpjyController extends BaseController {
@Autowired
private GpfkService gpfkService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gpjy/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gpjy/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gpjy/edit";
}
@RequestMapping("/gx")
public String gx() {
return "hzmes/gpjy/gx";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
RecordSet<GpfkVO> records = gpfkService.query(condition);
return buildReturnData(records, GpfkVO.class);
}
@ApiOperation(value = "扫描生产主产品条码,{\"wosnid\":111,\"gxid\":222}传入条码,返回检验标准信息")
@RequestMapping(value = "/queryJyinfo", method = RequestMethod.POST)
@ResponseBody
public Object queryJyinfo(@RequestBody JSONObject param) {
String wosnid = param.getString("wosnid");
String gxid = param.getString("gxid");
if(StringUtils.isEmpty(wosnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(gxid)){
setReturnMessage("工序不允许为空!");
return returnData();
}
GpfkJybzinfoVO gpfkJybzinfoVO = gpfkService.getJyInfoBySnid(wosnid,gxid);
return buildReturnData(gpfkJybzinfoVO);
}
@ApiOperation(value = "扫码进行检验反馈")
@RequestMapping(value = "/doGpjyfk", method = RequestMethod.POST)
@ResponseBody
public Object doGpjyfk(@RequestBody GpfkJyjgVO param){
GpJyResVO gpJyResVO = gpfkService.doGpjyfk(param);
if(gpJyResVO != null){
return buildReturnData(gpJyResVO);
}else{
return ThreadContext.getReturnData();
}
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/delGpjy", method = RequestMethod.POST)
@ResponseBody
public Object delGpjy(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.delGpjyById(gpfkid);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.GpfkService;
import com.gavel.hzgd.vo.GpResVO;
import com.gavel.hzgd.vo.GpbhgfkCondition;
import com.gavel.hzgd.vo.GpfkCondition;
import com.gavel.hzgd.vo.GpfkVO;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/gplhend")
public class GplhEndController extends BaseController {
@Autowired
private GpfkService gpfkService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gplhend/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gplhend/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gplhend/edit";
}
@RequestMapping("/gx")
public String gx() {
return "hzmes/gplhend/gx";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(GpfkVO.class, records.getRecords().get(0));
}
return buildReturnData(GpfkVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
return buildReturnData(records, GpfkVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
doExport(request, response, param, records.getRecords());
}
@ApiOperation(value = "扫码进行老化反馈")
@RequestMapping(value = "/doGplhfk", method = RequestMethod.POST)
@ResponseBody
public Object doGplhfk(@RequestBody GpbhgfkCondition param){
GpResVO gpResVO = gpfkService.doGplhfk(param);
return buildReturnData(gpResVO);
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/cancelGplh", method = RequestMethod.POST)
@ResponseBody
public Object cancelGplh(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.cancelGplh(gpfkid);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.gygl.utils.GxlxEnum;
import com.gavel.gygl.vo.BzgxCondition;
import com.gavel.gygl.vo.BzgxVO;
import com.gavel.hzgd.service.GpfkService;
import com.gavel.hzgd.vo.GpfkCondition;
import com.gavel.hzgd.vo.GpfkVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/gplhstart")
public class GplhStartController extends BaseController {
@Autowired
private GpfkService gpfkService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/gplhstart/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/gplhstart/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/gplhstart/edit";
}
@RequestMapping("/gx")
public String gx() {
return "hzmes/gplhstart/gx";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(GpfkVO.class, records.getRecords().get(0));
}
return buildReturnData(GpfkVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
return buildReturnData(records, GpfkVO.class);
}
//老化的工序类型
@RequestMapping(value = "queryLhBzgx", method = RequestMethod.POST)
@ResponseBody
public Object queryLhBzgx(@RequestBody JSONObject param) {
BzgxCondition condition = DataConvert.getCondition(param, BzgxCondition.class);
condition.setGxlx(GxlxEnum.JG.getId());
List<BzgxVO> records = gpfkService.queryLhBzgx(condition);
return buildReturnData(records, BzgxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
gpfkService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param, GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.queryLh(condition);
doExport(request, response, param, records.getRecords());
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/delGpfk", method = RequestMethod.POST)
@ResponseBody
public Object delGpfk(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.delGpfkById(gpfkid);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.Constants;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.GpsmrkService;
import com.gavel.wo.persistent.Work;
import com.gavel.wo.persistent.Workmx;
@Controller
@RequestMapping("hzgd/gpsmrk")
public class GpsmrkController extends BaseController{
@Autowired
private GpsmrkService gpsmrkService;
@RequestMapping("/index")
public String index() {
return "hzmes/gpsmrk/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
/*WoCondition condition = DataConvert.getCondition(param, WoCondition.class);
RecordSet<WoVO> records = gpsmrkService.query(condition);
return buildReturnData(records, WoVO.class);*/
return returnData();
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public Object save(@RequestBody JSONObject param) {
Work work = param.getJSONObject(Constants.MASTER).toJavaObject(Work.class);
List<Workmx> workmxList = DataConvert.getData2List(param.getJSONArray(Constants.DETAIL), Workmx.class);
gpsmrkService.save(work, workmxList);
return returnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzBfckService;
import com.gavel.hzgd.vo.*;
import com.gavel.kc.controller.BfckController;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/bfck")
public class HzBfckController extends BfckController {
@Autowired
private HzBfckService hzbfckService;
@RequestMapping("/index")
public String index() {
return "hzmes/bfck/index";
}
@RequestMapping("/add")
public String add() {
return "hzmes/bfck/edit";
}
@RequestMapping("/edit")
public String edit() {
return "hzmes/bfck/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
HzBfckCondition condition = DataConvert.getCondition(param, HzBfckCondition.class);
RecordSet<HzBfckVO> records = hzbfckService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(HzBfckVO.class, records.getRecords().get(0));
}
return buildReturnData(HzBfckVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzBfckCondition condition = DataConvert.getCondition(param, HzBfckCondition.class);
RecordSet<HzBfckVO> records = hzbfckService.query(condition);
return buildReturnData(records, HzBfckVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
HzBfckmxCondition condition = DataConvert.getCondition(param, HzBfckmxCondition.class);
RecordSet<HzBfckmxVO> records = hzbfckService.queryDetail(condition);
return buildReturnData(records, HzBfckmxVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzBfckCondition condition = DataConvert.getCondition(param, HzBfckCondition.class);
RecordSet<HzBfckVO> records = hzbfckService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzbfckService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzbfckService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzbfckService.delete(editJson);
return ThreadContext.getReturnData();
}
@ApiOperation(value = "扫描条码报废,{\"wlsnid\":111}传入条码,返回条码信息")
@RequestMapping(value = "/querySnBF", method = RequestMethod.POST)
@ResponseBody
public Object getSninfo(@RequestBody JSONObject param) {
String wlsnid = param.getString("wlsnid");
if(StringUtils.isEmpty(wlsnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
WlsnVO wlsnVO = hzbfckService.queryWLsnVOForBF(wlsnid);
if(wlsnVO != null){
return buildReturnData(wlsnVO);
}else{
return ThreadContext.getReturnData();
}
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.utils.HzBhgflEnum;
import com.gavel.kzzx.utils.TybzEnum;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.zlgl.persistent.Bhgxx;
import com.gavel.zlgl.service.BhgxxService;
import com.gavel.zlgl.utils.GradeEnum;
import com.gavel.zlgl.vo.BhgxxCondition;
import com.gavel.zlgl.vo.BhgxxVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/bhgxx")
public class HzBhgxxController extends BaseController {
@Autowired
private BhgxxService bhgxxService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "zlgl/bhgxx/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "zlgl/bhgxx/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "zlgl/bhgxx/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
BhgxxCondition condition = DataConvert.getCondition(param, BhgxxCondition.class);
RecordSet<BhgxxVO> records = bhgxxService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(BhgxxVO.class, records.getRecords().get(0));
}
return buildReturnData(BhgxxVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
BhgxxCondition condition = DataConvert.getCondition(param, BhgxxCondition.class);
RecordSet<BhgxxVO> records = bhgxxService.query(condition);
return buildReturnData(records, BhgxxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bhgxxService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bhgxxService.update(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
bhgxxService.delete(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.SETQT, method = RequestMethod.POST)
@ResponseBody
public Object recordSetQT(@RequestBody JSONObject param) {
bhgxxService.recordSetQT(DataConvert.getData(param, Bhgxx.class));
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
BhgxxCondition condition = DataConvert.getCondition(param, BhgxxCondition.class);
RecordSet<BhgxxVO> records = bhgxxService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "init/bhgfl", method = RequestMethod.POST)
@ResponseBody
public Object initBhgfl() {
return buildReturnData(HzBhgflEnum.toList());
}
@RequestMapping(value = "init/grade", method = RequestMethod.POST)
@ResponseBody
public Object initGrade() {
return buildReturnData(GradeEnum.toList());
}
/**
* 查询所有未停用不合格现象
* @return
*/
@RequestMapping(value ="init/usedBhgxx", method = RequestMethod.POST)
@ResponseBody
public Object queryUsedBhgxx(@RequestBody BhgxxCondition bhgxxCondition) {
bhgxxCondition.setTybz(TybzEnum.NORMAL.getId());
RecordSet<BhgxxVO> records = bhgxxService.query(bhgxxCondition);
return buildReturnData(records, BhgxxVO.class);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzCskcService;
import com.gavel.hzgd.vo.*;
import com.gavel.kc.controller.CskcController;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@RequestMapping("hzmes/cskc")
public class HzCskcController extends CskcController {
@Autowired
private HzCskcService hzcskcService;
@RequestMapping("/index")
public String index() {
return "hzmes/cskc/index";
}
@RequestMapping("/add")
public String add() {
return "hzmes/cskc/edit";
}
@RequestMapping("/edit")
public String edit() {
return "hzmes/cskc/edit";
}
@RequestMapping("/auto")
public String auto() {
return "hzmes/cskc/auto";
}
@RequestMapping("/info/index")
public String infoIndex() {
return "hzmes/info/gjwlxx/index";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
HzCskcCondition condition = DataConvert.getCondition(param, HzCskcCondition.class);
RecordSet<HzCskcVO> records = hzcskcService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(HzCskcVO.class, records.getRecords().get(0));
}
return buildReturnData(HzCskcVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzCskcCondition condition = DataConvert.getCondition(param, HzCskcCondition.class);
RecordSet<HzCskcVO> records = hzcskcService.query(condition);
return buildReturnData(records, HzCskcVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
HzCskcmxCondition condition = DataConvert.getCondition(param, HzCskcmxCondition.class);
RecordSet<HzCskcmxVO> records = hzcskcService.queryDetail(condition);
return buildReturnData(records, HzCskcmxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzCskcCondition condition = DataConvert.getCondition(param, HzCskcCondition.class);
RecordSet<HzCskcVO> records = hzcskcService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzcskcService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzcskcService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzcskcService.delete(editJson);
return ThreadContext.getReturnData();
}
@ApiOperation(value = "可传入wlid")
@RequestMapping(value = "/getWlsnForImp", method = RequestMethod.POST)
@ResponseBody
public Object getWlsnForImp(@RequestBody JSONObject param) {
WlsnCondition condition = DataConvert.getCondition(param, WlsnCondition.class);
List<WlsnVO> wlsnVOList = hzcskcService.queryGjWlsnForImp(condition);
return buildReturnData(wlsnVOList, WlsnVO.class);
}
@RequestMapping(value = "/queryExistSnGj", method = RequestMethod.POST)
@ResponseBody
public Object queryExistSnGj(@RequestBody JSONObject param) {
HzWlxxCondition condition = DataConvert.getCondition(param, HzWlxxCondition.class);
RecordSet<HzWlxxVO> records = hzcskcService.queryExistSnGj(condition);
return buildReturnData(records, HzWlxxVO.class);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzGhrkService;
import com.gavel.hzgd.vo.*;
import com.gavel.kc.controller.GhrkController;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/ghrk")
public class HzGhrkController extends GhrkController {
@Autowired
private HzGhrkService hzGhrkService;
@RequestMapping("/index")
public String index() {
return "hzmes/ghrk/index";
}
@RequestMapping("/add")
public String add() {
return "hzmes/ghrk/edit";
}
@RequestMapping("/edit")
public String edit() {
return "hzmes/ghrk/edit";
}
@RequestMapping("/hzghrksearch")
public String search() {
return "hzmes/ghrk/hzghrksearch";
}
@RequestMapping("/hzarrange")
public String arrange() {
return "hzmes/ghrk/hzarrange";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
HzGhrkCondition condition = DataConvert.getCondition(param, HzGhrkCondition.class);
RecordSet<HzGhrkVO> records = hzGhrkService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(HzGhrkVO.class, records.getRecords().get(0));
}
return buildReturnData(HzGhrkVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzGhrkCondition condition = DataConvert.getCondition(param, HzGhrkCondition.class);
RecordSet<HzGhrkVO> records = hzGhrkService.query(condition);
return buildReturnData(records, HzGhrkVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
HzGhrkmxCondition condition = DataConvert.getCondition(param, HzGhrkmxCondition.class);
RecordSet<HzGhrkmxVO> records = hzGhrkService.queryDetail(condition);
return buildReturnData(records, HzGhrkmxVO.class);
}
@RequestMapping(value = "returnable/hzdetail", method = RequestMethod.POST)
@ResponseBody
public Object queryGhrkmxForJyck(@RequestBody JSONObject param) {
HzGhrkmxCondition condition = DataConvert.getCondition(param, HzGhrkmxCondition.class);
RecordSet<HzGhrkJyckmxVO> records = hzGhrkService.queryGhrkmxForJyck(condition);
return buildReturnData(records, HzGhrkJyckmxVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzGhrkCondition condition = DataConvert.getCondition(param, HzGhrkCondition.class);
RecordSet<HzGhrkVO> records = hzGhrkService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzGhrkService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzGhrkService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzGhrkService.delete(editJson);
return ThreadContext.getReturnData();
}
@ApiOperation(value = "扫描条码归还,{\"wlsnid\":111}传入条码,返回条码信息")
@RequestMapping(value = "/querySnGH", method = RequestMethod.POST)
@ResponseBody
public Object getSninfo(@RequestBody JSONObject param) {
String wlsnid = param.getString("wlsnid");
if(StringUtils.isEmpty(wlsnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
WlsnVO wlsnVO = hzGhrkService.queryWLsnVOForGH(wlsnid);
if(wlsnVO != null){
return buildReturnData(wlsnVO);
}else{
return ThreadContext.getReturnData();
}
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.HzGjsftzService;
import com.gavel.hzgd.utils.HzWlsftzXsfsEnum;
import com.gavel.hzgd.vo.HzKcswVO;
import com.gavel.kc.vo.KcswCondition;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/hzgjsftz")
public class HzGjsftzController extends BaseController {
@Autowired
private HzGjsftzService gjsftzService;
@RequestMapping("/index")
public String index() {
return "hzmes/hzgjsftz/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
KcswCondition condition = DataConvert.getCondition(param, KcswCondition.class);
RecordSet<HzKcswVO> records = gjsftzService.query(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
KcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), KcswCondition.class);
RecordSet<HzKcswVO> records = gjsftzService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "/init/xsfs", method = RequestMethod.POST)
@ResponseBody
public Object intxsfs(@RequestBody JSONObject param) {
return buildReturnData(HzWlsftzXsfsEnum.toList());
}
@RequestMapping(value = "/init/swlx", method = RequestMethod.POST)
@ResponseBody
public Object initSwlx(@RequestBody JSONObject param){
return buildReturnData(gjsftzService.querGjswlx());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.base.controller.BaseController;
import com.gavel.hzgd.service.HzJcsjService;
import com.gavel.kzzx.vo.BmVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("hzmes/common")
public class HzJcsjController extends BaseController {
@Autowired
private HzJcsjService hzJcsjService;
/**
* 用户可操作的检验部门
* @param param
* @return
*/
@RequestMapping(value ="bm/queryJybm", method = RequestMethod.POST)
@ResponseBody
public Object queryJybm(@RequestBody JSONObject param) {
List<BmVO> bmVOList = hzJcsjService.queryJybm();
return buildReturnData(bmVOList, BmVO.class);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzJyckService;
import com.gavel.hzgd.vo.*;
import com.gavel.kc.controller.JyckController;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/jyck")
public class HzJyckController extends JyckController {
@Autowired
private HzJyckService hzjyckService;
@RequestMapping("/index")
public String index() {
return "hzmes/jyck/index";
}
@RequestMapping("/add")
public String add() {
return "hzmes/jyck/edit";
}
@RequestMapping("/edit")
public String edit() {
return "hzmes/jyck/edit";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
HzJyckCondition condition = DataConvert.getCondition(param, HzJyckCondition.class);
RecordSet<HzJyckVO> records = hzjyckService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(HzJyckVO.class, records.getRecords().get(0));
}
return buildReturnData(HzJyckVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzJyckCondition condition = DataConvert.getCondition(param, HzJyckCondition.class);
RecordSet<HzJyckVO> records = hzjyckService.query(condition);
return buildReturnData(records, HzJyckVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
HzJyckmxCondition condition = DataConvert.getCondition(param, HzJyckmxCondition.class);
RecordSet<HzJyckmxVO> records = hzjyckService.queryDetail(condition);
return buildReturnData(records, HzJyckmxVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzJyckCondition condition = DataConvert.getCondition(param, HzJyckCondition.class);
RecordSet<HzJyckVO> records = hzjyckService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzjyckService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzjyckService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzjyckService.delete(editJson);
return ThreadContext.getReturnData();
}
@ApiOperation(value = "扫描条码领用,{\"wlsnid\":111}传入条码,返回条码信息")
@RequestMapping(value = "/querySnJY", method = RequestMethod.POST)
@ResponseBody
public Object getSninfo(@RequestBody JSONObject param) {
String wlsnid = param.getString("wlsnid");
if(StringUtils.isEmpty(wlsnid)){
setReturnMessage("条码不允许为空!");
return returnData();
}
WlsnVO wlsnVO = hzjyckService.queryWLsnVOForJY(wlsnid);
if(wlsnVO != null){
return buildReturnData(wlsnVO);
}else{
return ThreadContext.getReturnData();
}
}
}
package com.gavel.hzgd.controller;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.utils.BooleanEnum;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzReportService;
import com.gavel.hzgd.vo.HzBgClRepVO;
import com.gavel.hzgd.vo.HzReportCondition;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("hzmes/hzclreport")
public class HzMesBgClReportController extends BaseController {
@Autowired
private HzReportService reportService;
@RequestMapping("/clindex")
public String dpindex() {
return "hzmes/hzreport/clindex";
}
@ApiOperation(value = "产量日报")
@RequestMapping(value = "bgclReport", method = RequestMethod.POST)
@ResponseBody
public Object bgclReport(@RequestBody HzReportCondition condition) {
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return returnData();
}
List<HzBgClRepVO> hzBgClRepVOList = reportService.queryDailyCl(condition);
if(hzBgClRepVOList != null && hzBgClRepVOList.size() > 0){
return buildReturnData(hzBgClRepVOList,HzBgClRepVO.class);
}else{
return ThreadContext.getReturnData();
}
}
@RequestMapping(value = "exportClRep", method = RequestMethod.POST)
@ResponseBody
public void ExportClExcel(HttpServletResponse response, @RequestBody HzReportCondition condition) {
try{
// condition.setBx("40289E7E72E655440172E682198906E2");
// condition.setGxCode("DD02");
// condition.setGzzxId("40289E7E72CB38840172CB614943047E");
// condition.setWlid("40289E7E72DB169B0172DB356C5102A6");
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return;
}
HSSFWorkbook hssfWorkbook = reportService.ExportBgClExcel(condition);
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String fieldName = "6号厂时段产量报表" + format.format(new Date()) + (BooleanEnum.equalsYes(condition.getIsBb())?"白班":"夜班");
HzMesReportController.writeWorkbook(response, hssfWorkbook, fieldName);
}
catch (Exception e){
}
}
}
package com.gavel.hzgd.controller;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.utils.BooleanEnum;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzReportService;
import com.gavel.hzgd.vo.HzBgZlRepQueryVO;
import com.gavel.hzgd.vo.HzReportCondition;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
@Controller
@RequestMapping("hzmes/hzhzreport")
public class HzMesZlHzReportController extends BaseController {
@Autowired
private HzReportService reportService;
@RequestMapping("/zlhzindex")
public String index() {
return "hzmes/hzreport/zlhzindex";
}
@RequestMapping("/dpzlhzindex")
public String dpzlhzindex() {
return "hzmes/hzreport/dpzlhzindex";
}
@RequestMapping("/oqczlhzindex")
public String oqczlhzindex() {
return "hzmes/hzreport/oqczlhzindex";
}
@ApiOperation(value = "质量日报")
@RequestMapping(value = "bgzlHzReport", method = RequestMethod.POST)
@ResponseBody
public Object bgzlHzReport(@RequestBody HzReportCondition condition) {
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return returnData();
}
HzBgZlRepQueryVO hzBgZlRepQueryVO = reportService.queryZlHzRepVOList(condition);
if(hzBgZlRepQueryVO != null){
return buildReturnData(hzBgZlRepQueryVO);
}else{
return ThreadContext.getReturnData();
}
}
@RequestMapping(value = "exportZlHzRep", method = RequestMethod.POST)
@ResponseBody
public void ExportExcel(HttpServletResponse response, @RequestBody HzReportCondition condition) {
try{
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return;
}
HSSFWorkbook hssfWorkbook = reportService.ExportBgZlHzExcel(condition);
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String fieldName = "6号厂汇总报表" + format.format(new Date()) + (BooleanEnum.equalsYes(condition.getIsBb())?"白班":"夜班");
writeWorkbook(response, hssfWorkbook, fieldName);
}
catch (Exception e){
}
}
@ApiOperation(value = "大屏质量日报")
@RequestMapping(value = "dpzlHzReport", method = RequestMethod.POST)
@ResponseBody
public Object dpzlHzReport(@RequestBody HzReportCondition condition) {
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return returnData();
}
HzBgZlRepQueryVO hzBgZlRepQueryVO = reportService.queryDpZlHzRepVOList(condition);
if(hzBgZlRepQueryVO != null){
return buildReturnData(hzBgZlRepQueryVO);
}else{
return ThreadContext.getReturnData();
}
}
@ApiOperation(value = "大屏OQC质量日报")
@RequestMapping(value = "dpoqczlHzReport", method = RequestMethod.POST)
@ResponseBody
public Object dpoqczlHzReport(@RequestBody HzReportCondition condition) {
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return returnData();
}
HzBgZlRepQueryVO hzBgZlRepQueryVO = reportService.queryDpOQCZlHzRepVOList(condition);
if(hzBgZlRepQueryVO != null){
return buildReturnData(hzBgZlRepQueryVO);
}else{
return ThreadContext.getReturnData();
}
}
@RequestMapping(value = "exportDpZlHzRep", method = RequestMethod.POST)
@ResponseBody
public void exportDpZlHzRep(HttpServletResponse response, @RequestBody HzReportCondition condition) {
try{
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return;
}
HSSFWorkbook hssfWorkbook = reportService.ExportDpZlHzExcel(condition);
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String fieldName = "大屏质量汇总报表" + format.format(new Date()) + (BooleanEnum.equalsYes(condition.getIsBb())?"白班":"夜班");
writeWorkbook(response, hssfWorkbook, fieldName);
}
catch (Exception e){
}
}
@RequestMapping(value = "exportDpOQCZlHzRep", method = RequestMethod.POST)
@ResponseBody
public void exportDpOQCZlHzRep(HttpServletResponse response, @RequestBody HzReportCondition condition) {
try{
if(StringUtils.isEmpty(condition.getBx())){
setReturnMessage("查询班型不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("查询物料不允许为空!");
return;
}
if(StringUtils.isEmpty(condition.getGzzxIdList())){
setReturnMessage("查询线别不允许为空!");
return;
}
HSSFWorkbook hssfWorkbook = reportService.ExportDpOQCZlHzExcel(condition);
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String fieldName = "OQC质量汇总报表" + format.format(new Date()) + (BooleanEnum.equalsYes(condition.getIsBb())?"白班":"夜班");
writeWorkbook(response, hssfWorkbook, fieldName);
}
catch (Exception e){
}
}
public static void writeWorkbook(HttpServletResponse response, HSSFWorkbook workbook, String sTitle) throws Exception
{
response.reset();
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
String fileName = sTitle + ".xls";
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes(), "iso-8859-1"));
try(OutputStream out = response.getOutputStream()){
workbook.write(out);
workbook.close();
}catch(Exception e){
}
}
}
package com.gavel.hzgd.controller;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.utils.BooleanEnum;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzReportService;
import com.gavel.hzgd.vo.HzBgZlDateRepVO;
import com.gavel.hzgd.vo.HzReportCondition;
import com.gavel.zlgl.vo.BhgxxVO;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("hzmes/hztrendrep")
public class HzMesZlTrendRepCtrl extends BaseController {
@Autowired
private HzReportService reportService;
@RequestMapping("/trendindex")
public String index() {
return "hzmes/hzreport/trendindex";
}
@RequestMapping("/trendchart")
public String trendchart() {
return "hzmes/hzreport/trendchart";
}
@ApiOperation(value = "质量趋势报表")
@RequestMapping(value = "bgzlTrendReport", method = RequestMethod.POST)
@ResponseBody
public Object bgzlTrendReport(@RequestBody HzReportCondition condition) {
if(condition.getStart() == null || condition.getEnd() == null){
setReturnMessage("查询日期范围不允许为空!");
return returnData();
}
List<HzBgZlDateRepVO> hzBgZlDateRepVOList = reportService.queryZlTrendReport(condition);
if(hzBgZlDateRepVOList != null){
return buildReturnData(hzBgZlDateRepVOList);
}else{
return ThreadContext.getReturnData();
}
}
@ApiOperation(value = "质量趋势报表表头")
@RequestMapping(value = "bgzlTrendReportHead", method = RequestMethod.POST)
@ResponseBody
public Object bgzlTrendReportHead() {
List<BhgxxVO> hzBgZlDateRepVOList = reportService.queryBgTrendHead();
if(hzBgZlDateRepVOList != null){
return buildReturnData(hzBgZlDateRepVOList);
}else{
return ThreadContext.getReturnData();
}
}
@RequestMapping(value = "exportTrendRep", method = RequestMethod.POST)
@ResponseBody
public void ExportExcel(HttpServletResponse response, @RequestBody HzReportCondition condition) {
try{
if(condition.getStart() == null || condition.getEnd() == null){
setReturnMessage("查询日期范围不允许为空!");
return;
}
HSSFWorkbook hssfWorkbook = reportService.ExportTrendExcel(condition);
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String fieldName = "质量趋势分析报表" + format.format(new Date()) + (BooleanEnum.equalsYes(condition.getIsBb())?"白班":"夜班");
writeWorkbook(response, hssfWorkbook, fieldName);
}
catch (Exception e){
}
}
public static void writeWorkbook(HttpServletResponse response, HSSFWorkbook workbook, String sTitle) throws Exception
{
response.reset();
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
String fileName = sTitle + ".xls";
response.setHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes(), "iso-8859-1"));
try(OutputStream out = response.getOutputStream()){
workbook.write(out);
workbook.close();
}catch(Exception e){
}
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.hzgd.service.HzwlsfhzService;
import com.gavel.hzgd.utils.HzwlsfhzhzEnum;
import com.gavel.hzgd.utils.TsjwlsfhzhzEnum;
import com.gavel.hzgd.vo.HzKcswCondition;
import com.gavel.hzgd.vo.HzKcswVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/")
public class HzWlsfhzController extends BaseController {
@Autowired
private HzwlsfhzService hzwlsfhzService;
//合纵物料收发汇总
@RequestMapping("hzwlsfhz/index")
public String index() {
return "hzmes/hzwlsfhz/index";
}
//合纵治工具收发汇总
@RequestMapping("hzzgjsfhz/index")
public String zgjindex() {
return "hzmes/hzzgjsfhz/index";
}
//通升捷收发汇总
@RequestMapping("tsjwlsfhz/index")
public String tsjindex() {
return "hzmes/tsjwlsfhz/index";
}
@RequestMapping(value ="hzwlsfhz/query", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody HzKcswCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
setReturnMessage("汇总方式不允许为空,请重新选择!");
return returnData();
}
RecordSet<HzKcswVO> records = hzwlsfhzService.queryWlsfhz(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = "hzwlsfhz/export", method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzKcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzKcswCondition.class);
RecordSet<HzKcswVO> records = hzwlsfhzService.queryWlsfhz(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "hzwlsfhz/init/hzfs", method = RequestMethod.POST)
@ResponseBody
public Object initHzfs() {
return buildReturnData(HzwlsfhzhzEnum.toList());
}
@RequestMapping(value = "hzzgjsfhz/query", method = RequestMethod.POST)
@ResponseBody
public Object queryZgj(@RequestBody HzKcswCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
setReturnMessage("汇总方式不允许为空,请重新选择!");
return returnData();
}
RecordSet<HzKcswVO> records = hzwlsfhzService.queryZgjsfhz(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value ="hzzgjsfhz/export", method = RequestMethod.POST)
@ResponseBody
public void exportZgj(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzKcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzKcswCondition.class);
RecordSet<HzKcswVO> records = hzwlsfhzService.queryZgjsfhz(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "tsjwlsfhz/init/hzfs", method = RequestMethod.POST)
@ResponseBody
public Object tsjHzfs() {
return buildReturnData(TsjwlsfhzhzEnum.toList());
}
@RequestMapping(value = "tsjwlsfhz/query", method = RequestMethod.POST)
@ResponseBody
public Object queryTsj(@RequestBody HzKcswCondition condition) {
if(StringUtils.isEmpty(condition.getHzfs())){
setReturnMessage("汇总方式不允许为空,请重新选择!");
return returnData();
}
RecordSet<HzKcswVO> records = hzwlsfhzService.queryTsjsfhz(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value ="tsjwlsfhz/export", method = RequestMethod.POST)
@ResponseBody
public void exportTsj(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzKcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzKcswCondition.class);
RecordSet<HzKcswVO> records = hzwlsfhzService.queryTsjsfhz(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.HzWlsftzService;
import com.gavel.hzgd.utils.HzWlsftzXsfsEnum;
import com.gavel.hzgd.vo.HzKcswCondition;
import com.gavel.hzgd.vo.HzKcswVO;
import com.gavel.kc.vo.KcswCondition;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/")
public class HzWlsftzController extends BaseController {
@Autowired
private HzWlsftzService wlsftzService;
@RequestMapping("hzwlsftz/index")
public String index() {
return "hzmes/hzwlsftz/index";
}
@RequestMapping("tsjwlsftz/index")
public String tsjindex() {
return "hzmes/tsjwlsftz/index";
}
@RequestMapping(value = "hzwlsftz/query", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzKcswCondition condition = DataConvert.getCondition(param, HzKcswCondition.class);
RecordSet<HzKcswVO> records = wlsftzService.query(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = "hzwlsftz/export", method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzKcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzKcswCondition.class);
RecordSet<HzKcswVO> records = wlsftzService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "hzwlsftz/init/xsfs", method = RequestMethod.POST)
@ResponseBody
public Object intxsfs(@RequestBody JSONObject param) {
return buildReturnData(HzWlsftzXsfsEnum.toList());
}
@RequestMapping(value = "tsjwlsftz/query", method = RequestMethod.POST)
@ResponseBody
public Object tsjquery(@RequestBody JSONObject param) {
HzKcswCondition condition = DataConvert.getCondition(param, HzKcswCondition.class);
RecordSet<HzKcswVO> records = wlsftzService.queryTsjhz(condition);
return buildReturnData(records, HzKcswVO.class);
}
@ResourcePermissions({SystemOperation.BottonResource.EXPORT})
@RequestMapping(value = "tsjwlsftz/export", method = RequestMethod.POST)
@ResponseBody
public void tsjexport(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzKcswCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzKcswCondition.class);
RecordSet<HzKcswVO> records = wlsftzService.queryTsjhz(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzWlxxService;
import com.gavel.hzgd.vo.HzWlxxCondition;
import com.gavel.hzgd.vo.HzWlxxVO;
import com.gavel.jcsj.persistent.Wlxx;
import com.gavel.jcsj.service.WlflService;
import com.gavel.jcsj.utils.WlxxWlxtEnum;
import com.gavel.jcsj.utils.WlxxXjfsEnum;
import com.gavel.jcsj.vo.WlxxCondition;
import com.gavel.jcsj.vo.WlxxVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/hzwlxx")
public class HzWlxxController extends BaseController {
@Autowired
private HzWlxxService wlxxService;
@Autowired
private WlflService wlflService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "jcsj/wlxx/index";
}
@RequestMapping("/add")
public String add() {
return "jcsj/wlxx/edit";
}
@RequestMapping("/edit")
public String edit() {
return "jcsj/wlxx/edit";
}
@RequestMapping("/info/index")
public String infoIndex() {
return "hzmes/info/wlxx/index";
}
@RequestMapping("/info/wowlindex")
public String wowlindex() {
return "hzmes/info/wowlxx/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzWlxxCondition condition = DataConvert.getCondition(param, HzWlxxCondition.class);
RecordSet<HzWlxxVO> records = wlxxService.query(condition);
return buildReturnData(records, HzWlxxVO.class);
}
@RequestMapping(value = "/queryWowl", method = RequestMethod.POST)
@ResponseBody
public Object queryWowl(@RequestBody JSONObject param) {
HzWlxxCondition condition = DataConvert.getCondition(param, HzWlxxCondition.class);
RecordSet<HzWlxxVO> records = wlxxService.queryWowl(condition);
return buildReturnData(records, HzWlxxVO.class);
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
wlxxService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
wlxxService.update(editJson);
return ThreadContext.getReturnData();
}
// @ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
wlxxService.delete(editJson);
return ThreadContext.getReturnData();
}
// @ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.SETQT, method = RequestMethod.POST)
@ResponseBody
public Object recordSetQT(@RequestBody JSONObject param) {
wlxxService.recordSetQT(DataConvert.getData(param, Wlxx.class));
return ThreadContext.getReturnData();
}
@RequestMapping(value = "changeJldw", method = RequestMethod.POST)
@ResponseBody
public Object changeJldw(@RequestBody JSONObject param) {
WlxxVO con= DataConvert.getData(param, WlxxVO.class);
WlxxVO record= wlxxService.changeJldw(con);
return buildReturnData( WlxxVO.class,record);
}
// @ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
WlxxCondition condition = DataConvert.getCondition(param, WlxxCondition.class);
RecordSet<WlxxVO> records = wlxxService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "changeFjldw", method = RequestMethod.POST)
@ResponseBody
public Object changeFjldw(@RequestBody JSONObject param) {
WlxxVO con= DataConvert.getData(param, WlxxVO.class);
WlxxVO record= wlxxService.changeFjldw(con);
return buildReturnData( WlxxVO.class,record);
}
@RequestMapping(value = "queryWlxxForCg", method = RequestMethod.POST)
@ResponseBody
public Object queryWlxxForCg(@RequestBody JSONObject param) {
WlxxVO wlxxVO = DataConvert.getData(param, WlxxVO.class);
WlxxVO record = wlxxService.queryWlxxForCg(wlxxVO);
return buildReturnData(WlxxVO.class,record);
}
@RequestMapping(value = "queryWlxxForXs", method = RequestMethod.POST)
@ResponseBody
public Object queryWlxxForXs(@RequestBody JSONObject param) {
WlxxVO wlxxVO = DataConvert.getData(param, WlxxVO.class);
WlxxVO record = wlxxService.queryWlxxForXs(wlxxVO);
return buildReturnData(WlxxVO.class,record);
}
@RequestMapping(value = "queryWlxxForKc", method = RequestMethod.POST)
@ResponseBody
public Object queryWlxxForKc(@RequestBody JSONObject param) {
WlxxVO wlxxVO = DataConvert.getData(param, WlxxVO.class);
WlxxVO record = wlxxService.queryWlxxForKc(wlxxVO);
return buildReturnData(WlxxVO.class,record);
}
@RequestMapping(value = "queryWlxxCskc", method = RequestMethod.POST)
@ResponseBody
public Object queryWlxxCskc(@RequestBody JSONObject param) {
HzWlxxCondition condition = DataConvert.getCondition(param, HzWlxxCondition.class);
if(StringUtils.isEmpty(condition.getCkid())){
setReturnMessage("仓库信息不允许为空!");
return returnData();
}
RecordSet<HzWlxxVO> records = wlxxService.queryWlxxCskc(condition);
return buildReturnData(records, HzWlxxVO.class);
}
@RequestMapping(value = "/init/wlfl", method = RequestMethod.POST)
@ResponseBody
public Object initWlfl(@RequestBody JSONObject param) {
return buildReturnData(wlflService.queryAllLast());
}
@RequestMapping(value = "/init/xjfs", method = RequestMethod.POST)
@ResponseBody
public Object intxjfs(@RequestBody JSONObject param) {
return buildReturnData(WlxxXjfsEnum.toList());
}
@RequestMapping(value = "/init/wlxt", method = RequestMethod.POST)
@ResponseBody
public Object intwlxt(@RequestBody JSONObject param) {
return buildReturnData(WlxxWlxtEnum.toList());
}
@RequestMapping(value = "queryByCode", method = RequestMethod.POST)
@ResponseBody
public Object queryByCode(@RequestBody JSONObject param) {
WlxxVO wlxxVO = DataConvert.getData(param, WlxxVO.class);
WlxxVO record = wlxxService.queryByCode(wlxxVO);
return buildReturnData(WlxxVO.class,record);
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.cjzy.persistent.Zyjhmx;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.exception.ApplicationException;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzZyjhService;
import com.gavel.hzgd.vo.*;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("hzmes/zyjh")
public class HzZyjhController extends BaseController {
@Autowired
private HzZyjhService hzzyjhService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "cjzy/zyjh/index";
}
@RequestMapping("/add")
public String add() {
return "cjzy/zyjh/edit";
}
@RequestMapping("/edit")
public String edit(HttpServletRequest request) {
String id = request.getParameter("id");
if(StringUtils.isNotEmpty(id)){
if (hzzyjhService.isWoZyjhmx(id))
return "cjzy/zyjh/zyjhdetailsEdit";
else
return "cjzy/zyjh/edit";
}
return "cjzy/zyjh/edit";
}
@RequestMapping("/mxedit")
public String mxedit() {
return "cjzy/zyjh/zyjhmxedit";
}
@RequestMapping("/gbyy/index")
public String gbyyIndex() {
return "cjzy/zyjh/gbyy";
}
@RequestMapping("/arrange")
public String wogylxArrange() {
return "cjzy/zyjh/arrange";
}
@RequestMapping("wogylxSearch")
public String wogylxSearch() {
return "cjzy/zyjh/wogylxsearch";
}
@RequestMapping("/fgzyArrange")
public String fgzyArrange() {
return "cjzy/zyjh/fgzyarrange";
}
@RequestMapping("fgzyjhSearch")
public String fgzyjhSearch() {
return "cjzy/zyjh/fgzyjhsearch";
}
@RequestMapping("/jydArrange")
public String jydArrange() {
return "cjzy/zyjh/jydarrange";
}
@RequestMapping("jydjhSearch")
public String jydjhSearch() {
return "cjzy/zyjh/jydjhsearch";
}
@RequestMapping(value = BaseURL.GET, method = RequestMethod.POST)
@ResponseBody
public Object get(@RequestBody JSONObject param) {
HzZyjhCondition condition = DataConvert.getCondition(param, HzZyjhCondition.class);
RecordSet<HzZyjhVO> records = hzzyjhService.query(condition);
if ( records.getRecords()!=null && records.getRecords().size()>=1 ){
return buildReturnData(HzZyjhVO.class, records.getRecords().get(0));
}
return buildReturnData(HzZyjhVO.class, null);
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzZyjhCondition condition = DataConvert.getCondition(param, HzZyjhCondition.class);
RecordSet<HzZyjhVO> records = hzzyjhService.query(condition);
return buildReturnData(records, HzZyjhVO.class);
}
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
HzZyjhmxCondition condition = DataConvert.getCondition(param, HzZyjhmxCondition.class);
RecordSet<HzZyjhmxVO> list = hzzyjhService.queryHzDetail(condition.getMid());
return buildReturnData(list, HzZyjhmxVO.class);
}
@RequestMapping(value = "queryZyjhmxByid", method = RequestMethod.POST)
@ResponseBody
public Object queryZyjhmxByid(@RequestBody JSONObject param) {
HzZyjhmxCondition condition = DataConvert.getCondition(param, HzZyjhmxCondition.class);
if(StringUtils.isEmpty(condition.getId())){
throw new ApplicationException("作业计划明细ID不能为空!");
}
HzZyjhmxVO hzZyjhmxVO = hzzyjhService.queryZyjhmxByid(condition.getId());
return buildReturnData(HzZyjhmxVO.class,hzZyjhmxVO);
}
@ResourcePermissions(SystemOperation.BottonResource.ADD)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzzyjhService.insert(editJson);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EDIT)
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzzyjhService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/updZyjhmx", method = RequestMethod.POST)
@ResponseBody
public Object updZyjhmx(@RequestBody JSONObject param) {
Zyjhmx zyjhmx = DataConvert.getCondition(param, Zyjhmx.class);
hzzyjhService.updZyjhmx(zyjhmx);
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/delZyjhmx", method = RequestMethod.POST)
@ResponseBody
public Object delZyjhmx(@RequestBody JSONObject param) {
String id = param.getString("id");
hzzyjhService.delZyjhmx(id);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.DELETE)
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzzyjhService.delete(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/queryZyjhWogy", method = RequestMethod.POST)
@ResponseBody
public Object queryZyjhWogy(@RequestBody JSONObject param) {
HzWogylxCondition condition = DataConvert.getCondition(param, HzWogylxCondition.class);
RecordSet<HzZyjhWogyVO> records = hzzyjhService.queryZyjhWogy(condition);
return buildReturnData(records, HzZyjhWogyVO.class);
}
@RequestMapping(value = "/queryFgZyjh", method = RequestMethod.POST)
@ResponseBody
public Object queryFgZyjh(@RequestBody JSONObject param) {
HzZyjhmxCondition condition = DataConvert.getCondition(param, HzZyjhmxCondition.class);
RecordSet<HzZyjhmxVO> records = hzzyjhService.queryFgZyjh(condition);
return buildReturnData(records, HzZyjhmxVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzZyjhCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzZyjhCondition.class);
RecordSet<HzZyjhVO> records = hzzyjhService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
package com.gavel.hzgd.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.hzgd.service.HzlywghService;
import com.gavel.hzgd.vo.HzlywghCondition;
import com.gavel.hzgd.vo.HzlywghVO;
import com.gavel.jcsj.service.JcsjService;
import com.gavel.persistence.sql.RecordSet;
@Controller
@RequestMapping("hzmes/hzlywgh")
public class HzlywghController extends BaseController {
@Autowired
private HzlywghService hzlywghService;
@Autowired
private JcsjService jcsjService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/hzlywgh/index";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzlywghCondition condition = DataConvert.getCondition(param, HzlywghCondition.class);
RecordSet<HzlywghVO> records = hzlywghService.query(condition);
return buildReturnData(records, HzlywghVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
HzlywghCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), HzlywghCondition.class);
RecordSet<HzlywghVO> records = hzlywghService.query(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping(value = "/init/ck", method = RequestMethod.POST)
@ResponseBody
public Object intCk(@RequestBody JSONObject param) {
return buildReturnData(jcsjService.queryValidCk());
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzWollckService;
import com.gavel.hzgd.vo.HzQtckmxVO;
import com.gavel.kc.vo.KchzCondition;
import com.gavel.kc.vo.KchzVO;
import com.gavel.kc.vo.QtckmxCondition;
import com.gavel.persistence.sql.RecordSet;
import com.gavel.wo.controller.WolldjController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("hzmes/hzwollck")
public class HzwollckController extends WolldjController {
@Autowired
private HzWollckService hzWollckService;
@Override
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/wollck/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/wollck/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/wollck/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/show")
public String show() {
return "hzmes/wollck/show";
}
@Override
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
QtckmxCondition condition = DataConvert.getCondition(param, QtckmxCondition.class);
RecordSet<HzQtckmxVO> records = hzWollckService.queryHzDetail(condition);
return buildReturnData(records, HzQtckmxVO.class);
}
@ApiOperation(value = "获取待分配列表参数wlid,ckid")
@RequestMapping(value = "/queryKfpsl", method = RequestMethod.POST)
@ResponseBody
public Object getGpwxmxVOByGpid(@RequestBody JSONObject param) {
KchzCondition condition = DataConvert.getCondition(param, KchzCondition.class);
if(StringUtils.isEmpty(condition.getWlid())){
setReturnMessage("物料信息不允许为空!");
return returnData();
}
if(StringUtils.isEmpty(condition.getCkid())){
setReturnMessage("仓库信息不允许为空!");
return returnData();
}
List<KchzVO> kchzVOList = hzWollckService.queryKfpsl(condition);
if(kchzVOList != null && kchzVOList.size() > 0){
return buildReturnData(kchzVOList);
}else{
return ThreadContext.getReturnData();
}
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzWollckService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzWollckService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzWollckService.delete(editJson);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.cggl.controller.CgrkController;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzYlrkdjService;
import com.gavel.hzgd.vo.HzQtrkmxVO;
import com.gavel.kc.vo.QtrkmxCondition;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("hzmes/hzylrkdj")
public class HzylrkdjController extends CgrkController {
@Autowired
private HzYlrkdjService hzYlrkdjService;
@Override
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/ylrk/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/ylrk/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/ylrk/edit";
}
@Override
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
QtrkmxCondition condition = DataConvert.getCondition(param, QtrkmxCondition.class);
RecordSet<HzQtrkmxVO> records = hzYlrkdjService.queryHzDetail(condition);
return buildReturnData(records, HzQtrkmxVO.class);
}
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
/**
* 同其他入库登记,不走采购收货开采购入库的判断
*/
hzYlrkdjService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzYlrkdjService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzYlrkdjService.delete(editJson);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.NoRepeatSubmit;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.BaseEditJSON;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.HzRkdjService;
import com.gavel.hzgd.vo.HzQtrkmxVO;
import com.gavel.hzgd.vo.HzWoVO;
import com.gavel.hzgd.vo.HzmesQtrkCondition;
import com.gavel.kc.controller.QtrkController;
import com.gavel.kc.vo.QtrkVO;
import com.gavel.kc.vo.QtrkmxCondition;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("hzmes/rkdj")
public class RkdjController extends QtrkController {
@Autowired
private HzRkdjService hzRkdjService;
@Override
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/rkdj/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/rkdj/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/rkdj/edit";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody JSONObject param) {
HzmesQtrkCondition condition = DataConvert.getCondition(param, HzmesQtrkCondition.class);
RecordSet<QtrkVO> records = hzRkdjService.queryHz(condition);
return buildReturnData(records, QtrkVO.class);
}
@Override
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
QtrkmxCondition condition = DataConvert.getCondition(param, QtrkmxCondition.class);
RecordSet<HzQtrkmxVO> records = hzRkdjService.queryHzDetail(condition);
return buildReturnData(records, HzQtrkmxVO.class);
}
@ApiOperation(value = "查询箱/托码对应物料信息,传入snid")
@RequestMapping(value = "/getRkwlxx", method = RequestMethod.POST)
@ResponseBody
public Object getGpwxmxVOByGpid(@RequestBody JSONObject param) {
String snid = param.getString("snid");
if(StringUtils.isEmpty(snid)){
setReturnMessage("条码信息不允许为空!");
return returnData();
}
List<HzWoVO> hzWoVOList = hzRkdjService.queryZxwlBySnid(snid);
if(hzWoVOList != null && hzWoVOList.size() > 0){
return buildReturnData(hzWoVOList);
}else{
return ThreadContext.getReturnData();
}
}
@NoRepeatSubmit(lockTime = 40000)
@RequestMapping(value = BaseURL.ADD, method = RequestMethod.POST)
@ResponseBody
public Object insert(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzRkdjService.insert(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.UPDATE, method = RequestMethod.POST)
@ResponseBody
public Object update(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzRkdjService.update(editJson);
return ThreadContext.getReturnData();
}
@RequestMapping(value = BaseURL.DELETE, method = RequestMethod.POST)
@ResponseBody
public Object delete(@RequestBody JSONObject param) {
BaseEditJSON editJson = BaseEditJSON.parseJSON(param);
hzRkdjService.delete(editJson);
return ThreadContext.getReturnData();
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.SnwollcxcxService;
import com.gavel.hzgd.vo.GpfkCondition;
import com.gavel.hzgd.vo.WosnMultiVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
@Controller
@RequestMapping("hzmes/snmulti")
public class SnMultiController extends BaseController {
@Autowired
private SnwollcxcxService snwollcxcxService;
@RequestMapping("/index")
public String index() {
return "hzmes/dtmglcx/index";
}
@RequestMapping(value = "/query", method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
if(StringUtils.isEmpty(condition.getWosnids())){
setReturnMessage("序列号不允许为空!");
return returnData();
}
RecordSet<WosnMultiVO> records = snwollcxcxService.queryMultiWosn(condition);
return buildReturnData(records, WosnMultiVO.class);
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = "/export", method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request,HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<WosnMultiVO> records = snwollcxcxService.queryMultiWosn(condition);
doExport(request, response, param, records.getRecords());
}
@RequestMapping("/importpage")
public String importpage() {
return "hzmes/dtmglcx/importpage";
}
@RequestMapping(value = "/excel/import")
@ResponseBody
public Object excelImport(HttpServletRequest request) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultiValueMap<String, MultipartFile> multiValueMap = multipartRequest.getMultiFileMap();
for (MultipartFile multipartFile : multiValueMap.toSingleValueMap().values()) {
try {
InputStream ins = multipartFile.getInputStream();
try {
snwollcxcxService.impXls(ins);//xls
} finally {
ins.close();
}
} catch (Exception e) {
e.printStackTrace();
ThreadContext.getReturnData().setSuccess(false);
ThreadContext.getReturnData().setMessage("数据导入失败!");
}
}
return ThreadContext.getReturnData();
}
@RequestMapping(value = "/excel/model/export")
@ResponseBody
public void excelExport(HttpServletResponse response) throws Exception {
final String fileName = "条码导入模板.xls";
response.setContentType("application/octet-stream");
response.setHeader("Content-disposition", "attachment;filename=" + new String(fileName.getBytes(), "ISO-8859-1"));
Resource resource = new ClassPathResource("static/model/条码导入模板.xls");
File file = resource.getFile();
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
try {
BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
try {
byte[] buff = new byte[2048];
int bytesRead;
while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
}
} finally {
bos.close();
}
} finally {
bis.close();
}
}
}
package com.gavel.hzgd.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.hzgd.service.TsjCkdjService;
import com.gavel.hzgd.vo.HzQtckmxVO;
import com.gavel.hzgd.vo.TsjBzkcVO;
import com.gavel.kc.controller.QtckController;
import com.gavel.kc.vo.QtckmxCondition;
import com.gavel.persistence.sql.RecordSet;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("hzmes/tsjckdj")
public class TsjCkdjController extends QtckController {
@Autowired
private TsjCkdjService tsjCkdjService;
@Override
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "hzmes/tsjckdj/index";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "hzmes/tsjckdj/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "hzmes/tsjckdj/edit";
}
@Override
@RequestMapping(value = BaseURL.QUERY_DETAIL, method = RequestMethod.POST)
@ResponseBody
public Object queryDetail(@RequestBody JSONObject param) {
QtckmxCondition condition = DataConvert.getCondition(param, QtckmxCondition.class);
RecordSet<HzQtckmxVO> records = tsjCkdjService.queryTsjDetail(condition);
return buildReturnData(records, HzQtckmxVO.class);
}
@ApiOperation(value = "查询箱/托码对应物料信息,传入snid")
@RequestMapping(value = "/getCkwlxx", method = RequestMethod.POST)
@ResponseBody
public Object getGpwxmxVOByGpid(@RequestBody JSONObject param) {
String snid = param.getString("snid");
if(StringUtils.isEmpty(snid)){
setReturnMessage("条码信息不允许为空!");
return returnData();
}
List<TsjBzkcVO> hzWoVOList = tsjCkdjService.queryZxwlBySnid(snid);
if(hzWoVOList != null && hzWoVOList.size() > 0){
return buildReturnData(hzWoVOList);
}else{
return ThreadContext.getReturnData();
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment