zhc4dev
wangjiadong 2 years ago
parent 89e874e959
commit df668f2f89
  1. 3
      ant-design-vue-jeecg/src/views/customerpayment/admin/CustomerPaymentList.vue
  2. 2
      ant-design-vue-jeecg/src/views/customerpayment/admin/modules/CustomerPaymentList1.vue
  3. 13
      ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/CustomerReceivingAddressList.vue
  4. 5
      ant-design-vue-jeecg/src/views/customerreceivingaddress/admin/modules/CustomerReceivingAddressForm.vue
  5. 49
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/controller/CustomerReceivingAddressController.java
  6. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/mapper/CustomerReceivingAddressMapper.java
  7. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/ICustomerReceivingAddressService.java
  8. 35
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerreceivingaddress/service/impl/CustomerReceivingAddressServiceImpl.java

@ -203,8 +203,7 @@
} }
], ],
url: { url: {
up: "/customerpayment/customerPayment/up",
down: "/customerpayment/customerPayment/down",
list: "/customerpayment/customerPayment/list", list: "/customerpayment/customerPayment/list",
delete: "/customerpayment/customerPayment/delete", delete: "/customerpayment/customerPayment/delete",
deleteBatch: "/customerpayment/customerPayment/deleteBatch", deleteBatch: "/customerpayment/customerPayment/deleteBatch",

@ -194,6 +194,8 @@
} }
], ],
url: { url: {
up: "/customerpayment/customerPayment/up",
down: "/customerpayment/customerPayment/down",
list: "/customerpayment/customerPayment/list1", list: "/customerpayment/customerPayment/list1",
delete: "/customerpayment/customerPayment/delete", delete: "/customerpayment/customerPayment/delete",
deleteBatch: "/customerpayment/customerPayment/deleteBatch", deleteBatch: "/customerpayment/customerPayment/deleteBatch",

@ -98,6 +98,8 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="paixu(record)">排序</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -119,7 +121,7 @@
</a-table> </a-table>
</div> </div>
<customer-receiving-address-modal1 ref="modalFormpaixu" @ok="modalFormOk"></customer-receiving-address-modal1>
<customer-receiving-address-modal ref="modalForm" @ok="modalFormOk"></customer-receiving-address-modal> <customer-receiving-address-modal ref="modalForm" @ok="modalFormOk"></customer-receiving-address-modal>
</a-card> </a-card>
</template> </template>
@ -130,6 +132,7 @@
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CustomerReceivingAddressModal from './modules/CustomerReceivingAddressModal' import CustomerReceivingAddressModal from './modules/CustomerReceivingAddressModal'
import CustomerReceivingAddressModal1 from './modules/CustomerReceivingAddressModal1'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import Area from '@/components/_util/Area' import Area from '@/components/_util/Area'
@ -137,7 +140,8 @@
name: 'CustomerReceivingAddressList', name: 'CustomerReceivingAddressList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
CustomerReceivingAddressModal CustomerReceivingAddressModal,
CustomerReceivingAddressModal1
}, },
data () { data () {
return { return {
@ -227,6 +231,11 @@
}, },
}, },
methods: { methods: {
paixu: function (record) {
this.$refs.modalFormpaixu.edit(record.userId);
this.$refs.modalFormpaixu.title = record.userId_dictText+"测体管理";
this.$refs.modalFormpaixu.disableSubmit = false;
},
getPcaText(code){ getPcaText(code){
return this.pcaData.getText(code); return this.pcaData.getText(code);
}, },

@ -121,10 +121,7 @@
{ required: false}, { required: false},
{ validator: (rule, value, callback) => validateDuplicateValue('customer_receiving_address', 'sort', value, this.model.id, callback)}, { 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: { url: {
add: "/customerreceivingaddress/customerReceivingAddress/add", add: "/customerreceivingaddress/customerReceivingAddress/add",

@ -72,6 +72,32 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
return Result.OK(pageList); 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<CustomerReceivingAddress> queryWrapper = QueryGenerator.initQueryWrapper(customerReceivingAddress, req.getParameterMap());
System.out.println(customerReceivingAddress.getUserId());
queryWrapper.eq("user_id",customerReceivingAddress.getUserId());
Page<CustomerReceivingAddress> page = new Page<CustomerReceivingAddress>(pageNo, pageSize);
IPage<CustomerReceivingAddress> pageList = customerReceivingAddressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/** /**
* 添加 * 添加
* *
@ -176,4 +202,27 @@ public class CustomerReceivingAddressController extends JeecgController<Customer
return super.importExcel(request, response, CustomerReceivingAddress.class); return super.importExcel(request, response, CustomerReceivingAddress.class);
} }
@AutoLog(value = "排序")
@ApiOperation(value="排序", notes="排序")
@GetMapping(value = "/up")
public Result<?> 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("降序成功");
}
}
} }

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.customerreceivingaddress.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; 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 org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +16,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface CustomerReceivingAddressMapper extends BaseMapper<CustomerReceivingAddress> { public interface CustomerReceivingAddressMapper extends BaseMapper<CustomerReceivingAddress> {
@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);
} }

@ -11,4 +11,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ICustomerReceivingAddressService extends IService<CustomerReceivingAddress> { public interface ICustomerReceivingAddressService extends IService<CustomerReceivingAddress> {
void up(String id);
int findSort(String id);
void down(String id);
} }

@ -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.entity.CustomerReceivingAddress;
import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper;
import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService; import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,4 +17,38 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class CustomerReceivingAddressServiceImpl extends ServiceImpl<CustomerReceivingAddressMapper, CustomerReceivingAddress> implements ICustomerReceivingAddressService { public class CustomerReceivingAddressServiceImpl extends ServiceImpl<CustomerReceivingAddressMapper, CustomerReceivingAddress> 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);
}
}
}
} }

Loading…
Cancel
Save