From 2c63b8f4e63a0a4aff3ead9002af27fe15153f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sat, 5 Mar 2022 04:29:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8A=82=E7=82=B9=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E3=80=81=E6=A0=87=E7=AD=BE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xm/core/ctrl/XmProductController.java | 29 +++++++++++++++++-- .../com/xm/core/service/XmProductService.java | 1 + .../mapper/xm/core/dao/XmProductMapper.xml | 3 ++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java index afe74787..2f271e6a 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java @@ -318,8 +318,33 @@ public class XmProductController { m.put("tips", tips); return m; } - - + + /***/ + @ApiOperation( value = "创建产品代号",notes="createProductCode") + @ApiResponses({ + @ApiResponse(code = 200,response=XmProduct.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @HasQx(value = "xm_core_xmProduct_createProductCode",name = "创建产品代号",categoryId = "admin-xm",categoryName = "管理端-项目管理系统") + @RequestMapping(value="/createProductCode",method=RequestMethod.POST) + public Map createProductCode() { + Map m = new HashMap<>(); + Tips tips=new Tips("成功创建产品代号"); + try{ + User user=LoginUtils.getCurrentUserInfo(); + String data=this.xmProductService.createProductCode(user.getBranchId()); + m.put("data",data); + }catch (BizException e) { + tips=e.getTips(); + logger.error("",e); + }catch (Exception e) { + tips.setFailureMsg(e.getMessage()); + logger.error("",e); + } + m.put("tips", tips); + return m; + } + + /***/ @ApiOperation( value = "根据主键修改一条产品表信息",notes="editXmProduct") @ApiResponses({ diff --git a/xm-core/src/main/java/com/xm/core/service/XmProductService.java b/xm-core/src/main/java/com/xm/core/service/XmProductService.java index 5280bc29..620a0ebe 100644 --- a/xm-core/src/main/java/com/xm/core/service/XmProductService.java +++ b/xm-core/src/main/java/com/xm/core/service/XmProductService.java @@ -89,6 +89,7 @@ public class XmProductService extends BaseService { @Transactional public XmProduct copyTo(User user, XmProductCopyVo xmProduct) { XmProduct pq=new XmProduct(); + pq.setId(xmProduct.getId()); XmProduct xmProductDb=this.selectOneObject(pq); if(xmProductDb==null){ throw new BizException("产品不存在"); diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml index c8c45580..f2527461 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml @@ -59,6 +59,9 @@ and (res.branch_id in( #{platformBranchId},#{myBranchId}) and res.is_tpl='1') + + and res.del!="1" +