zhc4dev
wangjiadong 2 years ago
parent 1ca9dd35a7
commit 1fc9258938
  1. 50
      ant-design-vue-jeecg/src/views/shopping/components/billTitle.vue
  2. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/mapper/CustomerInvoiceMapper.java
  3. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/service/ICustomerInvoiceService.java
  4. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/service/impl/CustomerInvoiceServiceImpl.java
  5. 21
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java

@ -10,7 +10,8 @@
<div class="item" v-for="(item,index) in billTitle" :key="index"> <div class="item" v-for="(item,index) in billTitle" :key="index">
<p class="default" v-if="item.flag"><span class="f_12">默认抬头</span></p> <p class="default" v-if="item.flag"><span class="f_12">默认抬头</span></p>
<div class="d-flex"> <div class="d-flex">
<div><span v-if="item.type == 1">专用发票抬头</span><span v-if="item.type == 2">普通发票抬头</span></div>
<div><span v-if="item.invoiceType == 1">普通增值税发票</span><span v-if="item.invoiceType == 2">专用增值税发票</span></div>
<div class="btnDiv"> <div class="btnDiv">
<span class="btn" @click="handleEdit(item)">编辑</span> <span class="btn" @click="handleEdit(item)">编辑</span>
<a-popconfirm <a-popconfirm
@ -31,10 +32,11 @@
<!-- <span class="btn" v-if="!item.flag" @click="handleDefault(item.id)">将其设置为默认抬头</span>--> <!-- <span class="btn" v-if="!item.flag" @click="handleDefault(item.id)">将其设置为默认抬头</span>-->
</div> </div>
</div> </div>
<p><span v-if="item.customerType == 1">个人</span><span v-if="item.customerType == 2">企业</span></p>
<p> <p>
{{item.name}} {{item.username}}
</p> </p>
<p>{{item.dutyNum}}</p> <p>{{item.taxIdentificationNumber}}</p>
</div> </div>
</div> </div>
<a-modal <a-modal
@ -112,6 +114,10 @@
</div> </div>
</template> </template>
<script> <script>
import { httpAction, getAction } from '@/api/manage'
export default { export default {
name: "billTitle", name: "billTitle",
components: { }, components: { },
@ -122,7 +128,8 @@
copyItem:{},// copyItem:{},//
labelCol: { span: 5 }, labelCol: { span: 5 },
wrapperCol: { span: 19 }, wrapperCol: { span: 19 },
billTitle:[ billTitle:[],
/*billTitle:[
{ {
id:1, id:1,
type:'1',//12 type:'1',//12
@ -153,8 +160,8 @@
account:'6212261717000030000',// account:'6212261717000030000',//
addr:'河南省驻马店市驿城区黄淮学院北区' addr:'河南省驻马店市驿城区黄淮学院北区'
} }
],// ],*///
addrList:[ /* addrList:[
{ {
id:1, id:1,
name:'吴一', name:'吴一',
@ -182,7 +189,7 @@
detailed:'黄淮学院北区', detailed:'黄淮学院北区',
flag:false,// flag:false,//
},// },//
],// ],*///
addr1:'210521', addr1:'210521',
// //
form: { form: {
@ -195,6 +202,12 @@
phone: '', phone: '',
flag:false// flag:false//
}, },
url: {
findbill: "/getuserpersion/findbill"
},
rules: { rules: {
name: [{ required: true, message: '请输入发票抬头', trigger: 'blur' },], name: [{ required: true, message: '请输入发票抬头', trigger: 'blur' },],
dutyNum: [{ required: true, message: '请输入税号', trigger: 'blur' },], dutyNum: [{ required: true, message: '请输入税号', trigger: 'blur' },],
@ -206,9 +219,32 @@
phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' },], phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' },],
card: [{ required: true, message: '请输入银行账户', trigger: 'blur' },], card: [{ required: true, message: '请输入银行账户', trigger: 'blur' },],
}, },
}; };
}, },
created() {
this.findbill();
},
methods: { methods: {
findbill(){
getAction(this.url.findbill).then((res) => {
if(res.success) {
this.billTitle = res.result;
console.log(res.result)
this.visible = true;
} else {
}
});
},
addAddr(){ addAddr(){
this.visible = true this.visible = true
this.flag = 'add' this.flag = 'add'

@ -32,4 +32,6 @@ public interface CustomerInvoiceMapper extends BaseMapper<CustomerInvoice> {
@Select("select sort from customer_invoice where id=#{id} ") @Select("select sort from customer_invoice where id=#{id} ")
int findSort(String id); int findSort(String id);
@Select("select * from customer_invoice where create_by=#{username} ")
List<CustomerInvoice> getfapiao(String username);
} }

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.customerinvoice.service;
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @Description: 客户发票信息 * @Description: 客户发票信息
* @Author: jeecg-boot * @Author: jeecg-boot
@ -16,4 +18,6 @@ public interface ICustomerInvoiceService extends IService<CustomerInvoice> {
int findSort(String id); int findSort(String id);
void up(String id); void up(String id);
List<CustomerInvoice> getfapiao(String username);
} }

@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/** /**
* @Description: 客户发票信息 * @Description: 客户发票信息
* @Author: jeecg-boot * @Author: jeecg-boot
@ -34,6 +36,11 @@ public class CustomerInvoiceServiceImpl extends ServiceImpl<CustomerInvoiceMappe
} }
} }
@Override
public List<CustomerInvoice> getfapiao(String username) {
return customerInvoiceMapper.getfapiao(username);
}
@Override @Override
public int findSort(String id) { public int findSort(String id) {
return customerInvoiceMapper.findSort(id); return customerInvoiceMapper.findSort(id);

@ -16,6 +16,8 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.demo.customercollectgoods.entity.Customercollectgoods; import org.jeecg.modules.demo.customercollectgoods.entity.Customercollectgoods;
import org.jeecg.modules.demo.customercollectgoods.service.ICustomercollectgoodsService; import org.jeecg.modules.demo.customercollectgoods.service.ICustomercollectgoodsService;
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice;
import org.jeecg.modules.demo.customerinvoice.service.ICustomerInvoiceService;
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress;
import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService; import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService;
import org.jeecg.modules.demo.customershoppingcart.entity.CustomerShoppingCart; import org.jeecg.modules.demo.customershoppingcart.entity.CustomerShoppingCart;
@ -44,6 +46,9 @@ import java.util.stream.Collectors;
@RequestMapping("/getuserpersion") @RequestMapping("/getuserpersion")
public class ApeopersionController { public class ApeopersionController {
@Autowired
private ICustomerInvoiceService customerInvoiceService;
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@ -244,13 +249,15 @@ public class ApeopersionController {
if (flag.equals("false")){ if (flag.equals("false")){
//寻找之前的排序的最后一个 //寻找之前的排序的最后一个
CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username); CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username);
CustomerReceivingAddress cus2 =new CustomerReceivingAddress(); //开始组装数据
CustomerReceivingAddress cus2 =new CustomerReceivingAddress();
cus2.setUserId(loginUser.getId()); cus2.setUserId(loginUser.getId());
cus2.setCityId((String)map.get("addr")); cus2.setCityId((String)map.get("addr"));
cus2.setUsernamme((String)map.get("name")); cus2.setUsernamme((String)map.get("name"));
cus2.setAddress((String)map.get("detailed")); cus2.setAddress((String)map.get("detailed"));
cus2.setMobile((String)map.get("phone")); cus2.setMobile((String)map.get("phone"));
cus2.setSort(cus.getSort()+1); cus2.setSort(cus.getSort()+1);
//将组装好的数据以新增的形式添加数据库
customerReceivingAddressService.save(cus2); customerReceivingAddressService.save(cus2);
} else if (flag.equals("true")){ } else if (flag.equals("true")){
//寻找之前的排序的最后一个 //寻找之前的排序的最后一个
@ -294,6 +301,14 @@ public class ApeopersionController {
} }
//这个是获取个人中心的发票列表
@RequestMapping(value = "/findbill", method = RequestMethod.GET)
public Result<?> findbill() {
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//这里获取当前登陆的用户名
String username = loginUser.getUsername();
List<CustomerInvoice> fapiao= customerInvoiceService.getfapiao(username);
return Result.OK(fapiao);
}
} }

Loading…
Cancel
Save