zhc4dev
wangjiadong 2 years ago
parent ca2d314ce7
commit cd719eb31e
  1. 6
      ant-design-vue-jeecg/src/views/customermeasure/admin/CustomerMeasureList.vue
  2. 28
      ant-design-vue-jeecg/src/views/customermeasure/admin/modules/CustomerMeasureForm.vue
  3. 169
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/controller/CustomerMeasureController.java
  4. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/entity/CustomerMeasure.java
  5. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/CustomerMeasureMapper.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml
  7. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/ICustomerMeasureService.java
  8. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/service/impl/CustomerMeasureServiceImpl.java

@ -6,7 +6,7 @@
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="用户">
<j-select-user-by-dep placeholder="请选择用户" v-model="queryParam.userId"/>
<j-search-select-tag placeholder="请选择用户" v-model="queryParam.userId" dict="sys_user,realname,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -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:''})

@ -4,18 +4,26 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-select-user-by-dep v-model="model.userId" />
<a-form-model-item label="用户名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<j-popup
v-model="model.username"
field="username"
org-fields="id,realname"
dest-fields="userId,username"
code="findcust"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="身高(厘米)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="height">
<a-input-number v-model="model.height" placeholder="请输入身高(厘米)" style="width: 100%" />
<a-input-number v-model="model.height" placeholder="请输入身高(厘米)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -70,12 +78,12 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="衣长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="length">
<a-input-number v-model="model.length" placeholder="请输入衣长" style="width: 100%" />
<a-input-number v-model="model.length" placeholder="请输入衣长(厘米)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="胸距" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sternalDistance">
<a-input-number v-model="model.sternalDistance" placeholder="请输入胸距" style="width: 100%" />
<a-input-number v-model="model.sternalDistance" placeholder="请输入胸距(厘米)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -98,11 +106,6 @@
<j-select-user-by-dep v-model="model.measurerId" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="量体时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="measurementTime">
<j-date placeholder="请选择量体时间" v-model="model.measurementTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
@ -194,6 +197,9 @@
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</script>

@ -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<CustomerMeasure, ICustomerMeasureService> {
@Autowired
private ICustomerMeasureService customerMeasureService;
/**
* 分页列表查询
*
@ -74,36 +72,8 @@ public class CustomerMeasureController extends JeecgController<CustomerMeasure,
IPage<CustomerMeasure> 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<CustomerMeasure> queryWrapper = QueryGenerator.initQueryWrapper(customerMeasure, req.getParameterMap());
queryWrapper.eq("createBy",sysUser.getUsername());
Page<CustomerMeasure> page = new Page<CustomerMeasure>(pageNo, pageSize);
IPage<CustomerMeasure> pageList = customerMeasureService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
/**
* 添加
*
* @param customerMeasure
@ -113,10 +83,66 @@ public class CustomerMeasureController extends JeecgController<CustomerMeasure,
@ApiOperation(value="顾客测体管理-添加", notes="顾客测体管理-添加")
@PostMapping(value = "/add")
public Result<?> 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<CustomerMeasure,
@ApiOperation(value="顾客测体管理-编辑", notes="顾客测体管理-编辑")
@PutMapping(value = "/edit")
public Result<?> 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<CustomerMeasure,
customerMeasureService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
@ -158,7 +241,7 @@ public class CustomerMeasureController extends JeecgController<CustomerMeasure,
this.customerMeasureService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.customermeasure.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
@ -20,7 +21,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 顾客测体管理
* @Author: jeecg-boot
* @Date: 2022-12-03
* @Date: 2022-12-20
* @Version: V1.0
*/
@Data
@ -55,10 +56,14 @@ public class CustomerMeasure implements Serializable {
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**用户*/
@Excel(name = "用户", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Excel(name = "用户", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "用户")
private String userId;
/**用户名*/
@Excel(name = "用户名", width = 15)
@ApiModelProperty(value = "用户名")
private String username;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")

@ -1,15 +1,18 @@
package org.jeecg.modules.demo.customermeasure.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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 CustomerMeasureMapper extends BaseMapper<CustomerMeasure> {

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper">
<mapper namespace=".customermeasure.mapper.CustomerMeasureMapper">
</mapper>

@ -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<CustomerMeasure> {

@ -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

Loading…
Cancel
Save