From cd719eb31ee76fc4e28dee4f585eafd6cc674d03 Mon Sep 17 00:00:00 2001 From: wangjiadong Date: Wed, 21 Dec 2022 10:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/CustomerMeasureList.vue | 6 +- .../admin/modules/CustomerMeasureForm.vue | 28 +-- .../controller/CustomerMeasureController.java | 169 +++++++++++++----- .../entity/CustomerMeasure.java | 11 +- .../mapper/CustomerMeasureMapper.java | 5 +- .../mapper/xml/CustomerMeasureMapper.xml | 2 +- .../service/ICustomerMeasureService.java | 6 +- .../impl/CustomerMeasureServiceImpl.java | 5 +- 8 files changed, 168 insertions(+), 64 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue b/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue index aaec7697..f56e0e59 100644 --- a/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue +++ b/ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue @@ -6,7 +6,7 @@ - + @@ -162,6 +162,7 @@ { title:'排序', align:"center", + sorter: true, dataIndex: 'sort' }, { @@ -228,7 +229,8 @@ }, getSuperFieldList(){ let fieldList=[]; - fieldList.push({type:'sel_user',value:'userId',text:'用户'}) + fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:'sys_user', dictText:'realname', dictCode:'id'}) + fieldList.push({type:'popup',value:'username',text:'用户名', popup:{code:'findcust',field:'id',orgFields:'id',destFields:'user_id'}}) fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''}) fieldList.push({type:'double',value:'height',text:'身高(厘米)',dictCode:''}) fieldList.push({type:'double',value:'weight',text:'体重(千克)',dictCode:''}) diff --git a/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureForm.vue b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureForm.vue index c5d86e26..58945a91 100644 --- a/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureForm.vue +++ b/ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureForm.vue @@ -4,18 +4,26 @@ - - + + - + - + @@ -70,12 +78,12 @@ - + - + @@ -98,11 +106,6 @@ - - - - - @@ -194,6 +197,9 @@ }) }, + popupCallback(value,row){ + this.model = Object.assign(this.model, row); + }, } } \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java index 401ee8ae..619a9db9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.customermeasure.controller; + import java.util.Arrays; import java.util.List; import java.util.Map; @@ -9,11 +10,8 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService; @@ -42,7 +40,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 顾客测体管理 * @Author: jeecg-boot - * @Date: 2022-12-03 + * @Date: 2022-12-20 * @Version: V1.0 */ @Api(tags="顾客测体管理") @@ -52,7 +50,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class CustomerMeasureController extends JeecgController { @Autowired private ICustomerMeasureService customerMeasureService; - + /** * 分页列表查询 * @@ -74,36 +72,8 @@ public class CustomerMeasureController extends JeecgController pageList = customerMeasureService.page(page, queryWrapper); return Result.OK(pageList); } - - - - /** - * 分页列表查询 - * - * @param customerMeasure - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "顾客测体管理-分页列表查询") - @ApiOperation(value="顾客测体管理-分页列表查询", notes="顾客测体管理-分页列表查询") - @GetMapping(value = "/listcustom") - public Result listcustom(CustomerMeasure customerMeasure, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(customerMeasure, req.getParameterMap()); - queryWrapper.eq("createBy",sysUser.getUsername()); - Page page = new Page(pageNo, pageSize); - IPage pageList = customerMeasureService.page(page, queryWrapper); - return Result.OK(pageList); - } - - - - /** + + /** * 添加 * * @param customerMeasure @@ -113,10 +83,66 @@ public class CustomerMeasureController extends JeecgController add(@RequestBody CustomerMeasure customerMeasure) { - customerMeasureService.save(customerMeasure); - return Result.OK("添加成功!"); + int flag =0; + if (customerMeasure.getHeight()<0 ) { + flag =1; + return Result.error("身高请输入大于零的数字"); + } + if (customerMeasure.getWeight()<0){ + flag =1; + return Result.error("体重请输入大于零的数字"); + } + if(customerMeasure.getHem()<0){ + flag =1; + return Result.error("下摆请输入大于零的数字"); + } + if(customerMeasure.getCuff()<0){ + flag =1; + return Result.error("袖口请输入大于零的数字"); + } + if(customerMeasure.getSleeveLength()<0){ + flag =1; + return Result.error("袖长请输入大于零的数字"); + } + if(customerMeasure.getBust()<0){ + flag =1; + return Result.error("胸围请输入大于零的数字"); + } + if(customerMeasure.getTheWaist()<0){ + flag =1; + return Result.error("腰围请输入大于零的数字"); + } + if(customerMeasure.getShoulderWidth()<0){ + flag =1; + return Result.error("肩宽请输入大于零的数字"); + } + if(customerMeasure.getForebodyLength()<0){ + flag =1; + return Result.error("前身长请输入大于零的数字"); + } + if(customerMeasure.getNeck()<0){ + flag =1; + return Result.error("领围请输入大于零的数字"); + } + if(customerMeasure.getHipline()<0){ + flag =1; + return Result.error("臀围请输入大于零的数字"); + } + if(customerMeasure.getLength()<0){ + flag =1; + return Result.error("衣长请输入大于零的数字"); + } + if(customerMeasure.getSternalDistance()<0){ + flag =1; + return Result.error("胸距请输入大于零的数字"); + } + if (flag==0){ + customerMeasureService.save(customerMeasure); + return Result.OK("添加成功!"); + } + return Result.OK(""); } - + /** * 编辑 * @@ -127,10 +153,67 @@ public class CustomerMeasureController extends JeecgController edit(@RequestBody CustomerMeasure customerMeasure) { - customerMeasureService.updateById(customerMeasure); - return Result.OK("编辑成功!"); - } + int flag =0; + if (customerMeasure.getHeight()<0 ) { + flag =1; + return Result.error("身高请输入大于零的数字"); + } + if (customerMeasure.getWeight()<0){ + flag =1; + return Result.error("体重请输入大于零的数字"); + } + if(customerMeasure.getHem()<0){ + flag =1; + return Result.error("下摆请输入大于零的数字"); + } + if(customerMeasure.getCuff()<0){ + flag =1; + return Result.error("袖口请输入大于零的数字"); + } + if(customerMeasure.getSleeveLength()<0){ + flag =1; + return Result.error("袖长请输入大于零的数字"); + } + if(customerMeasure.getBust()<0){ + flag =1; + return Result.error("胸围请输入大于零的数字"); + } + if(customerMeasure.getTheWaist()<0){ + flag =1; + return Result.error("腰围请输入大于零的数字"); + } + if(customerMeasure.getShoulderWidth()<0){ + flag =1; + return Result.error("肩宽请输入大于零的数字"); + } + if(customerMeasure.getForebodyLength()<0){ + flag =1; + return Result.error("前身长请输入大于零的数字"); + } + if(customerMeasure.getNeck()<0){ + flag =1; + return Result.error("领围请输入大于零的数字"); + } + if(customerMeasure.getHipline()<0){ + flag =1; + return Result.error("臀围请输入大于零的数字"); + } + if(customerMeasure.getLength()<0){ + flag =1; + return Result.error("衣长请输入大于零的数字"); + } + if(customerMeasure.getSternalDistance()<0){ + flag =1; + return Result.error("胸距请输入大于零的数字"); + } + if (flag==0){ + customerMeasureService.updateById(customerMeasure); + return Result.OK("编辑成功!"); + } + return Result.OK(""); + } + /** * 通过id删除 * @@ -144,7 +227,7 @@ public class CustomerMeasureController extends JeecgController { diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml index 6932ede2..42d79bc6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java index 060333ab..8cd14d19 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java @@ -1,12 +1,14 @@ package org.jeecg.modules.demo.customermeasure.service; -import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; + + import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; /** * @Description: 顾客测体管理 * @Author: jeecg-boot - * @Date: 2022-12-03 + * @Date: 2022-12-20 * @Version: V1.0 */ public interface ICustomerMeasureService extends IService { diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java index 1949c77a..dbebfabd 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java @@ -1,5 +1,8 @@ package org.jeecg.modules.demo.customermeasure.service.impl; + + + import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService; @@ -10,7 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 顾客测体管理 * @Author: jeecg-boot - * @Date: 2022-12-03 + * @Date: 2022-12-20 * @Version: V1.0 */ @Service