PDA 改为UNIAPP
parent
82623ca1bb
commit
e3eb773c7a
|
@ -115,7 +115,7 @@ public class ApiController {
|
|||
@RequestMapping(value = "/wmToUpGoodsController/save", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> create2(@RequestParam String wmToUpGoodsstr, UriComponentsBuilder uriBuilder) {
|
||||
return wmToUpGoodsController.create(wmToUpGoodsstr, uriBuilder);
|
||||
return wmInQmIController.save(wmToUpGoodsstr, uriBuilder);
|
||||
}
|
||||
//上架相关接口end
|
||||
|
||||
|
|
|
@ -1147,4 +1147,63 @@ public class WmInQmIController extends BaseController {
|
|||
public void delete(@PathVariable("id") String id) {
|
||||
wmInQmIService.deleteEntityById(WmInQmIEntity.class, id);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/save",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> save(@RequestParam String wmToUpGoodsstr, UriComponentsBuilder uriBuilder) {
|
||||
ResultDO D0 = new ResultDO();
|
||||
WmToUpGoodsEntity wmToUpGoods = (WmToUpGoodsEntity) JSONHelper.json2Object(wmToUpGoodsstr,WmToUpGoodsEntity.class);
|
||||
//调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息.
|
||||
Set<ConstraintViolation<WmToUpGoodsEntity>> failures = validator.validate(wmToUpGoods);
|
||||
if (!failures.isEmpty()) {
|
||||
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
if(StringUtil.isEmpty(wmToUpGoods.getKuWeiBianMa())){
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不能为空");
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}else{
|
||||
if (!wmUtil.checkbin(wmToUpGoods.getKuWeiBianMa())) {
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不存在");
|
||||
return new ResponseEntity(D0, HttpStatus.OK); }
|
||||
}
|
||||
|
||||
|
||||
//保存
|
||||
try{
|
||||
D0.setOK(true);
|
||||
WmInQmIEntity wmInQmIEntity = systemService.get(WmInQmIEntity.class,wmToUpGoods.getWmToUpId());
|
||||
if(wmInQmIEntity!=null){
|
||||
if("Y".equals(wmInQmIEntity.getBinSta())){
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("已经上架,不能重复上架");
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
wmInQmIEntity.setBinSta("Y");
|
||||
systemService.updateEntitie(wmInQmIEntity);
|
||||
}else{
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("验收任务已经删除,不能上架");
|
||||
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TSBaseUser user = systemService.findUniqueByProperty(TSBaseUser.class,"userName",wmToUpGoods.getCreateBy());
|
||||
if (user != null ) {
|
||||
wmToUpGoods.setCreateName(user.getRealName());
|
||||
}
|
||||
toup(wmToUpGoods.getWmToUpId(),wmToUpGoods.getKuWeiBianMa(),wmToUpGoods.getCreateBy(),wmToUpGoods.getCreateName());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
D0.setOK(false);
|
||||
}
|
||||
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -82,8 +82,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
private SystemService systemService;
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
@Autowired
|
||||
private WmInQmIController wmInQmIController;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -102,7 +101,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
* @param request
|
||||
* @param response
|
||||
* @param dataGrid
|
||||
*/
|
||||
*/
|
||||
|
||||
@RequestMapping(params = "datagrid")
|
||||
public void datagrid(WmToUpGoodsEntity wmToUpGoods,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||
|
@ -110,7 +109,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
//查询条件组装器
|
||||
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmToUpGoods, request.getParameterMap());
|
||||
try{
|
||||
//自定义追加查询条件
|
||||
//自定义追加查询条件
|
||||
}catch (Exception e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
|
@ -171,7 +170,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "doBatchDel")
|
||||
@RequestMapping(params = "doBatchDel")
|
||||
@ResponseBody
|
||||
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
|
||||
String message = null;
|
||||
|
@ -180,7 +179,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
try{
|
||||
for(String id:ids.split(",")){
|
||||
WmToUpGoodsEntity wmToUpGoods = systemService.getEntity(WmToUpGoodsEntity.class,
|
||||
id
|
||||
id
|
||||
);
|
||||
wmToUpGoodsService.delete(wmToUpGoods);
|
||||
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
|
||||
|
@ -195,24 +194,24 @@ public class WmToUpGoodsController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
@RequestMapping(params = "doGettextzy",method ={RequestMethod.GET, RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public AjaxJson doGettextzy(HttpServletRequest request) {
|
||||
AjaxJson j = new AjaxJson();
|
||||
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(MvGoodsEntity.class, "goodsCode", oConvertUtils.getString(request.getParameter("goodsid"))) ;
|
||||
if(mvgoods==null){
|
||||
j.setSuccess(false);
|
||||
j.setMsg("不存在此商品");
|
||||
}
|
||||
j.setObj(mvgoods);
|
||||
return j;
|
||||
@RequestMapping(params = "doGettextzy",method ={RequestMethod.GET, RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public AjaxJson doGettextzy(HttpServletRequest request) {
|
||||
AjaxJson j = new AjaxJson();
|
||||
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(MvGoodsEntity.class, "goodsCode", oConvertUtils.getString(request.getParameter("goodsid"))) ;
|
||||
if(mvgoods==null){
|
||||
j.setSuccess(false);
|
||||
j.setMsg("不存在此商品");
|
||||
}
|
||||
j.setObj(mvgoods);
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加上架列表
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "doAdd")
|
||||
@ResponseBody
|
||||
|
@ -229,22 +228,22 @@ public class WmToUpGoodsController extends BaseController {
|
|||
if(mvgoods!=null){
|
||||
wmToUpGoods.setGoodsName(mvgoods.getGoodsName());
|
||||
wmToUpGoods.setBaseUnit(mvgoods.getBaseunit());
|
||||
wmToUpGoods.setGoodsUnit(mvgoods.getShlDanWei());
|
||||
if (!mvgoods.getBaseunit().equals(mvgoods.getShlDanWei())) {
|
||||
try {
|
||||
wmToUpGoods.setBaseGoodscount(String.valueOf(Double
|
||||
.parseDouble(mvgoods.getChlShl())
|
||||
* Double.parseDouble(wmToUpGoods.getGoodsQua())));
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
wmToUpGoods.setGoodsUnit(mvgoods.getShlDanWei());
|
||||
if (!mvgoods.getBaseunit().equals(mvgoods.getShlDanWei())) {
|
||||
try {
|
||||
wmToUpGoods.setBaseGoodscount(String.valueOf(Double
|
||||
.parseDouble(mvgoods.getChlShl())
|
||||
* Double.parseDouble(wmToUpGoods.getGoodsQua())));
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
|
||||
} else {
|
||||
wmToUpGoods.setBaseGoodscount(wmToUpGoods
|
||||
.getGoodsQua());
|
||||
}
|
||||
wmToUpGoodsService.save(wmToUpGoods);
|
||||
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
||||
} else {
|
||||
wmToUpGoods.setBaseGoodscount(wmToUpGoods
|
||||
.getGoodsQua());
|
||||
}
|
||||
wmToUpGoodsService.save(wmToUpGoods);
|
||||
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
|
@ -258,7 +257,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
/**
|
||||
* 更新上架列表
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "doUpdate")
|
||||
@ResponseBody
|
||||
|
@ -365,7 +364,7 @@ public class WmToUpGoodsController extends BaseController {
|
|||
modelMap.put(NormalExcelConstants.FILE_NAME,"上架列表");
|
||||
modelMap.put(NormalExcelConstants.CLASS,WmToUpGoodsEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("上架列表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,wmToUpGoodss);
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
}
|
||||
|
@ -378,12 +377,12 @@ public class WmToUpGoodsController extends BaseController {
|
|||
@RequestMapping(params = "exportXlsByT")
|
||||
public String exportXlsByT(WmToUpGoodsEntity wmToUpGoods,HttpServletRequest request,HttpServletResponse response
|
||||
, DataGrid dataGrid,ModelMap modelMap) {
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME,"上架列表");
|
||||
modelMap.put(NormalExcelConstants.CLASS,WmToUpGoodsEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("上架列表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME,"上架列表");
|
||||
modelMap.put(NormalExcelConstants.CLASS,WmToUpGoodsEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("上架列表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -453,16 +452,19 @@ public class WmToUpGoodsController extends BaseController {
|
|||
if (!failures.isEmpty()) {
|
||||
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
if(StringUtil.isEmpty(wmToUpGoods.getKuWeiBianMa())){
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不能为空");
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}else{
|
||||
if (!wmUtil.checkbin(wmToUpGoods.getKuWeiBianMa())) {
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不存在");
|
||||
return new ResponseEntity(D0, HttpStatus.OK); }
|
||||
}
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不能为空");
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}else{
|
||||
if (!wmUtil.checkbin(wmToUpGoods.getKuWeiBianMa())) {
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("储位不存在");
|
||||
return new ResponseEntity(D0, HttpStatus.OK); }
|
||||
}
|
||||
|
||||
|
||||
//保存
|
||||
try{
|
||||
D0.setOK(true);
|
||||
|
@ -481,18 +483,34 @@ public class WmToUpGoodsController extends BaseController {
|
|||
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
// wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName());
|
||||
// wmToUpGoods.setCreateDate(DateUtils.getDate());
|
||||
if(StringUtil.isNotEmpty(wmToUpGoods.getOrderIdI())){
|
||||
List<WmToUpGoodsEntity> wmToUpGoodsEntity = systemService.findByProperty(WmToUpGoodsEntity.class,"orderIdI",wmToUpGoods.getWmToUpId());
|
||||
if(wmToUpGoodsEntity!=null&&wmToUpGoodsEntity.size()>0){
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("已经上架,不能重复上架");
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
}else{
|
||||
D0.setOK(false);
|
||||
D0.setErrorMsg("验收记录为空,不能上架");
|
||||
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
|
||||
wmToUpGoods.setGoodsName(wmInQmIEntity.getGoodsName());
|
||||
wmToUpGoods.setCreateDate(DateUtils.getDate());
|
||||
|
||||
TSBaseUser user = systemService.findUniqueByProperty(TSBaseUser.class,"userName",wmToUpGoods.getCreateBy());
|
||||
if (user != null ) {
|
||||
wmToUpGoods.setCreateName(user.getRealName());
|
||||
}
|
||||
wmInQmIController.toup(wmToUpGoods.getWmToUpId(),wmToUpGoods.getKuWeiBianMa(),wmToUpGoods.getCreateBy(),user.getRealName());
|
||||
// wmToUpGoodsService.save(wmToUpGoods);
|
||||
|
||||
wmToUpGoodsService.save(wmToUpGoods);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
D0.setOK(false);
|
||||
}
|
||||
|
||||
return new ResponseEntity(D0, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue