|
|
|
@ -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查询 |
|
|
|
|
* |
|
|
|
|