diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue index 87572524..f1199cec 100644 --- a/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue @@ -203,8 +203,7 @@ } ], url: { - up: "/customerpayment/customerPayment/up", - down: "/customerpayment/customerPayment/down", + list: "/customerpayment/customerPayment/list", delete: "/customerpayment/customerPayment/delete", deleteBatch: "/customerpayment/customerPayment/deleteBatch", diff --git a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue index 738d4944..a969c57a 100644 --- a/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue +++ b/ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue @@ -194,6 +194,8 @@ } ], url: { + up: "/customerpayment/customerPayment/up", + down: "/customerpayment/customerPayment/down", list: "/customerpayment/customerPayment/list1", delete: "/customerpayment/customerPayment/delete", deleteBatch: "/customerpayment/customerPayment/deleteBatch", diff --git a/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue b/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue index 81a099c0..7d097d5f 100644 --- a/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue +++ b/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue @@ -98,6 +98,8 @@ + 排序 + 编辑 @@ -119,7 +121,7 @@ - + @@ -130,6 +132,7 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import CustomerReceivingAddressModal from './modules/CustomerReceivingAddressModal' + import CustomerReceivingAddressModal1 from './modules/CustomerReceivingAddressModal1' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import Area from '@/components/_util/Area' @@ -137,7 +140,8 @@ name: 'CustomerReceivingAddressList', mixins:[JeecgListMixin, mixinDevice], components: { - CustomerReceivingAddressModal + CustomerReceivingAddressModal, + CustomerReceivingAddressModal1 }, data () { return { @@ -227,6 +231,11 @@ }, }, methods: { + paixu: function (record) { + this.$refs.modalFormpaixu.edit(record.userId); + this.$refs.modalFormpaixu.title = record.userId_dictText+"测体管理"; + this.$refs.modalFormpaixu.disableSubmit = false; + }, getPcaText(code){ return this.pcaData.getText(code); }, diff --git a/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue b/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue index e3fbe59b..370a9d1e 100644 --- a/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue +++ b/ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue @@ -121,10 +121,7 @@ { required: false}, { validator: (rule, value, callback) => validateDuplicateValue('customer_receiving_address', 'sort', value, this.model.id, callback)}, ], - labelcl: [ - { required: false}, - { validator: (rule, value, callback) => validateDuplicateValue('customer_receiving_address', 'labelcl', value, this.model.id, callback)}, - ], + }, url: { add: "/customerreceivingaddress/customerReceivingAddress/add", diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java index 50a0198e..9baa9022 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java @@ -49,7 +49,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class CustomerReceivingAddressController extends JeecgController { @Autowired private ICustomerReceivingAddressService customerReceivingAddressService; - + /** * 分页列表查询 * @@ -71,7 +71,33 @@ public class CustomerReceivingAddressController extends JeecgController 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 = "/list1") + public Result queryPageList1(CustomerReceivingAddress customerReceivingAddress, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(customerReceivingAddress, req.getParameterMap()); + System.out.println(customerReceivingAddress.getUserId()); + queryWrapper.eq("user_id",customerReceivingAddress.getUserId()); + Page page = new Page(pageNo, pageSize); + IPage pageList = customerReceivingAddressService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** * 添加 * @@ -89,7 +115,7 @@ public class CustomerReceivingAddressController extends JeecgController shang(@RequestParam(name="id",required=true) String id) { + customerReceivingAddressService.up(id); + return Result.ok("升序成功"); + } + + + @AutoLog(value = "排序") + @ApiOperation(value="排序", notes="排序") + @GetMapping(value = "/down") + public Result xia(@RequestParam(name="id",required=true) String id) { + int a=customerReceivingAddressService.findSort(id); + if(a==0){ + return Result.error("当前已经是最低级别!!!");}else { + customerReceivingAddressService.down(id); + return Result.ok("降序成功"); + } + } + + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java index 7445d1ab..27ef59ec 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.customerreceivingaddress.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -14,4 +16,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface CustomerReceivingAddressMapper extends BaseMapper { + @Select("select sort from customer_receiving_address where id=#{id} ") + Integer upfindsort(String id); + + @Select("select id from customer_receiving_address where sort=#{i} ") + String findproid(int i); + + @Update("update customer_receiving_address set sort =#{i} where id = #{id} ") + void innew(String id, int i); + + @Update("update customer_receiving_address set sort =#{sort} where id = #{proid} ") + void innewpro(String proid, Integer sort); + + @Select("select sort from customer_receiving_address where id=#{id} ") + int findSort(String id); + + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java index 1047e84a..c052b63b 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java @@ -11,4 +11,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ICustomerReceivingAddressService extends IService { + void up(String id); + + int findSort(String id); + + void down(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java index 4b7e966f..05d7ca61 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.customerreceivingaddress.service.impl; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +17,38 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class CustomerReceivingAddressServiceImpl extends ServiceImpl implements ICustomerReceivingAddressService { + + @Autowired + CustomerReceivingAddressMapper customerReceivingAddressMapper; + + @Override + public void up(String id) { + Integer sort = customerReceivingAddressMapper.upfindsort(id); + if (sort>0) { + //升序前找到后一个排序 + String proid = customerReceivingAddressMapper.findproid(sort + 1); + if (proid!="") { + //调换排序 + customerReceivingAddressMapper.innew(id,sort+1); + customerReceivingAddressMapper.innewpro(proid,sort); + } + } + } + + @Override + public int findSort(String id) { + return customerReceivingAddressMapper.findSort(id); + } + + @Override + public void down(String id) { + Integer sort = customerReceivingAddressMapper.upfindsort(id); + if (sort>0) { + String proid = customerReceivingAddressMapper.findproid(sort - 1); + if (proid!="") { + customerReceivingAddressMapper.innew(id,sort-1); + customerReceivingAddressMapper.innewpro(proid,sort); + } + } + } }