顾客收货地址管理

zhc4dev
wangjiadong 2 years ago
parent 0034478570
commit eeab2f1c29
  1. 10
      ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue
  2. 50
      ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customermeasure/mapper/xml/CustomerMeasureMapper.xml
  4. 63
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java
  5. 41
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/entity/CustomerReceivingAddress.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java
  8. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.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">
@ -129,6 +129,7 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CustomerReceivingAddressModal from './modules/CustomerReceivingAddressModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import Area from '@/components/_util/Area'
export default {
@ -191,7 +192,7 @@
{
title:'标识',
align:"center",
dataIndex: 'labelcl'
dataIndex: 'labelcl_dictText'
},
{
title: '操作',
@ -232,14 +233,15 @@
},
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:'usernamme',text:'用户', popup:{code:'findcust',field:'id',orgFields:'id',destFields:'user_id'}})
fieldList.push({type:'pca',value:'cityId',text:'城市'})
fieldList.push({type:'string',value:'address',text:'地址',dictCode:''})
fieldList.push({type:'string',value:'zipCode',text:'邮编',dictCode:''})
fieldList.push({type:'string',value:'receiver',text:'收货人',dictCode:''})
fieldList.push({type:'string',value:'mobile',text:'联系电话',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
fieldList.push({type:'string',value:'labelcl',text:'标识',dictCode:''})
fieldList.push({type:'string',value:'labelcl',text:'标识',dictCode:'shdzbs'})
this.superFieldList = fieldList
}
}

@ -4,43 +4,66 @@
<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="usernamme">
<j-popup
style="max-width:none; width: 200%"
v-model="model.usernamme"
field="usernamme"
org-fields="id,realname"
dest-fields="userId,usernamme"
code="findcust"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cityId">
<j-area-linkage type="cascader" v-model="model.cityId" placeholder="请输入省市区" />
<j-area-linkage style="max-width:none; width: 200%" type="cascader" v-model="model.cityId" placeholder="请输入省市区" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
<a-input v-model="model.address" placeholder="请输入地址" ></a-input>
<a-textarea style="max-width:none; width: 200%" v-model="model.address" rows="4" placeholder="请输入地址" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zipCode">
<a-input v-model="model.zipCode" placeholder="请输入邮编" ></a-input>
<a-input style="max-width:none; width: 200%" v-model="model.zipCode" placeholder="请输入邮编" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="收货人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
<a-input v-model="model.receiver" placeholder="请输入收货人" ></a-input>
<a-input style="max-width:none; width: 200%" v-model="model.receiver" placeholder="请输入收货人" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mobile">
<a-input v-model="model.mobile" placeholder="请输入联系电话" ></a-input>
<a-input style="max-width:none; width: 200%" v-model="model.mobile" placeholder="请输入联系电话" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<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 style="max-width:none; width: 200%" v-model="model.sort" placeholder="请输入排序" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="labelcl">
<a-input v-model="model.labelcl" placeholder="请输入标识" ></a-input>
<j-dict-select-tag style="max-width:none; width: 200%" type="radio" v-model="model.labelcl" dictCode="shdzbs" placeholder="请选择标识" />
</a-form-model-item>
</a-col>
</a-row>
@ -80,8 +103,12 @@
},
confirmLoading: false,
validatorRules: {
zipCode: [
{ required: true, message: '请输入邮编!'},
{ pattern: /^[1-9]\d{5}$/, message: '请输入正确的邮政编码!'},
],
mobile: [
{ required: false},
{ required: true, message: '请输入联系电话!'},
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
],
},
@ -138,6 +165,9 @@
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</script>

@ -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=".customermeasure.mapper.CustomerMeasureMapper">
<mapper namespace="org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper">
</mapper>

@ -9,11 +9,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.customerreceivingaddress.entity.CustomerReceivingAddress;
import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService;
@ -42,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 顾客地址表
* @Author: jeecg-boot
* @Date: 2022-12-05
* @Date: 2022-12-22
* @Version: V1.0
*/
@Api(tags="顾客地址表")
@ -52,7 +49,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class CustomerReceivingAddressController extends JeecgController<CustomerReceivingAddress, ICustomerReceivingAddressService> {
@Autowired
private ICustomerReceivingAddressService customerReceivingAddressService;
/**
* 分页列表查询
*
@ -74,35 +71,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
IPage<CustomerReceivingAddress> pageList = customerReceivingAddressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 分页列表查询
*
* @param customerReceivingAddress
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "顾客地址表-分页列表查询")
@ApiOperation(value="顾客地址表-分页列表查询", notes="顾客地址表-分页列表查询")
@GetMapping(value = "/listcustom")
public Result<?> listcustom(CustomerReceivingAddress customerReceivingAddress,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
QueryWrapper<CustomerReceivingAddress> queryWrapper = QueryGenerator.initQueryWrapper(customerReceivingAddress, req.getParameterMap());
queryWrapper.eq("createBy",sysUser.getUsername());
Page<CustomerReceivingAddress> page = new Page<CustomerReceivingAddress>(pageNo, pageSize);
IPage<CustomerReceivingAddress> pageList = customerReceivingAddressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@ -113,14 +82,14 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
@ApiOperation(value="顾客地址表-添加", notes="顾客地址表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody CustomerReceivingAddress customerReceivingAddress) {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(customerReceivingAddress.getReceiver()=="" || customerReceivingAddress.getReceiver()==null ){
customerReceivingAddress.setReceiver(loginUser.getUsername());
if(customerReceivingAddress.getSort()<0){
return Result.error("排序数字必须大于0!");
}else {
customerReceivingAddressService.save(customerReceivingAddress);
return Result.OK("添加成功!");
}
customerReceivingAddressService.save(customerReceivingAddress);
return Result.OK("添加成功!");
}
/**
* 编辑
*
@ -131,10 +100,14 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
@ApiOperation(value="顾客地址表-编辑", notes="顾客地址表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody CustomerReceivingAddress customerReceivingAddress) {
customerReceivingAddressService.updateById(customerReceivingAddress);
return Result.OK("编辑成功!");
if(customerReceivingAddress.getSort()<0){
return Result.error("排序数字必须大于0!");
}else {
customerReceivingAddressService.updateById(customerReceivingAddress);
return Result.OK("编辑成功!");
}
}
/**
* 通过id删除
*
@ -148,7 +121,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
customerReceivingAddressService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
@ -162,7 +135,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
this.customerReceivingAddressService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 顾客地址表
* @Author: jeecg-boot
* @Date: 2022-12-05
* @Date: 2022-12-22
* @Version: V1.0
*/
@Data
@ -34,57 +34,62 @@ public class CustomerReceivingAddress implements Serializable {
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
private java.lang.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;
private java.lang.String userId;
/**用户*/
@Excel(name = "用户", width = 15)
@ApiModelProperty(value = "用户")
private java.lang.String usernamme;
/**城市*/
@Excel(name = "城市", width = 15)
@ApiModelProperty(value = "城市")
private String cityId;
private java.lang.String cityId;
/**地址*/
@Excel(name = "地址", width = 15)
@ApiModelProperty(value = "地址")
private String address;
private java.lang.String address;
/**邮编*/
@Excel(name = "邮编", width = 15)
@ApiModelProperty(value = "邮编")
private String zipCode;
private java.lang.String zipCode;
/**收货人*/
@Excel(name = "收货人", width = 15)
@ApiModelProperty(value = "收货人")
private String receiver;
private java.lang.String receiver;
/**联系电话*/
@Excel(name = "联系电话", width = 15)
@ApiModelProperty(value = "联系电话")
private String mobile;
private java.lang.String mobile;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private Integer sort;
private java.lang.Integer sort;
/**标识*/
@Excel(name = "标识", width = 15)
@Excel(name = "标识", width = 15, dicCode = "shdzbs")
@Dict(dicCode = "shdzbs")
@ApiModelProperty(value = "标识")
private String labelcl;
private java.lang.String labelcl;
}

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 顾客地址表
* @Author: jeecg-boot
* @Date: 2022-12-05
* @Date: 2022-12-22
* @Version: V1.0
*/
public interface CustomerReceivingAddressMapper extends BaseMapper<CustomerReceivingAddress> {

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 顾客地址表
* @Author: jeecg-boot
* @Date: 2022-12-05
* @Date: 2022-12-22
* @Version: V1.0
*/
public interface ICustomerReceivingAddressService extends IService<CustomerReceivingAddress> {

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 顾客地址表
* @Author: jeecg-boot
* @Date: 2022-12-05
* @Date: 2022-12-22
* @Version: V1.0
*/
@Service

Loading…
Cancel
Save