喻忠伟 2 years ago
commit 2b0b234b88
  1. 43
      ant-design-vue-jeecg/src/views/shopping/components/billTitle.vue
  2. 4
      ant-design-vue-jeecg/src/views/shopping/pages/placeOrder.vue
  3. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/mapper/CustomerInvoiceMapper.java
  4. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/service/ICustomerInvoiceService.java
  5. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/customerinvoice/service/impl/CustomerInvoiceServiceImpl.java
  6. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
  8. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@ -8,7 +8,7 @@
</div>
<div class="addrList" v-if="billTitle.length != 0">
<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.sort==0"><span class="f_12">默认抬头</span></p>
<div class="d-flex">
<div><span v-if="item.invoiceType == 1">普通增值税发票</span><span v-if="item.invoiceType == 2">专用增值税发票</span></div>
@ -27,7 +27,7 @@
cancel-text="No"
@confirm="confirm2(item.id)"
@cancel="cancel"
v-if="!item.flag"
v-if="!item.sort==0"
><span class="btn">将其设置为默认抬头</span></a-popconfirm>
<!-- <span class="btn" v-if="!item.flag" @click="handleDefault(item.id)">将其设置为默认抬头</span>-->
</div>
@ -115,7 +115,7 @@
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { deleteAction } from '@/api/manage'
export default {
@ -204,7 +204,9 @@
},
url: {
findbill: "/getuserpersion/findbill"
findbill: "/getuserpersion/findbill",
szfpmr: "/getuserpersion/szfpmr",
deletefp: "/getuserpersion/deletefp"
},
@ -318,14 +320,35 @@
this.flag = 'edit'
this.form = item
},
confirm1(id) {
let itemIndex = this.billTitle.findIndex(item =>item.id == id)
this.billTitle.splice(itemIndex,1)
},
confirm2(id) {
this.changeDefault()
getAction(this.url.szfpmr,{id,id}).then((res) => {
if(res.success) {
this.loadData(1);
} else {
}
});
/* let itemIndex = this.billTitle.findIndex(item =>item.id == id)
this.billTitle.splice(itemIndex,1)*/
},
confirm1(id) {
deleteAction(this.url.deletefp,{id,id}).then((res) => {
if(res.success) {
this.loadData(1);
} else {
}
});
/*this.changeDefault()
let itemIndex2 = this.billTitle.findIndex(item =>item.id == id)
this.billTitle[itemIndex2].flag = true
this.billTitle[itemIndex2].flag = true*/
},
cancel(e) {
this.$message.warning('已取消');

@ -147,9 +147,9 @@
style="
width: 120px;
height: 120px;
background-color: grey;
margin-right: 20px;" @click="zhifu">
<img style="width: 120px;
height: 120px;" src="../assets/erweima.png"/>
</div>
<div class="r" style="width:290px">
<p class="f_16 c_4B">总计: {{this.dingdaninfo.all}}</p>

@ -32,6 +32,12 @@ public interface CustomerInvoiceMapper extends BaseMapper<CustomerInvoice> {
@Select("select sort from customer_invoice where id=#{id} ")
int findSort(String id);
@Select("select * from customer_invoice where create_by=#{username} ")
@Select("select * from customer_invoice where user_id=#{username} ")
List<CustomerInvoice> getfapiao(String username);
@Select("select * from customer_invoice where user_id=#{userId} and sort=0")
CustomerInvoice getmoren(String userId);
@Select("SELECT * FROM customer_invoice WHERE user_id=#{userId} ORDER BY sort DESC LIMIT 1")
CustomerInvoice getcmzuida(String userId);
}

@ -20,4 +20,8 @@ public interface ICustomerInvoiceService extends IService<CustomerInvoice> {
void up(String id);
List<CustomerInvoice> getfapiao(String username);
CustomerInvoice getmoren(String userId);
CustomerInvoice getcmzuida(String userId);
}

@ -41,6 +41,17 @@ public class CustomerInvoiceServiceImpl extends ServiceImpl<CustomerInvoiceMappe
return customerInvoiceMapper.getfapiao(username);
}
@Override
public CustomerInvoice getmoren(String userId) {
return customerInvoiceMapper.getmoren(userId);
}
@Override
public CustomerInvoice getcmzuida(String userId) {
return customerInvoiceMapper.getcmzuida(userId);
}
@Override
public int findSort(String id) {
return customerInvoiceMapper.findSort(id);

@ -307,8 +307,48 @@ public class ApeopersionController {
//这里方便获取当前登陆信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//这里获取当前登陆的用户名
String username = loginUser.getUsername();
String username = loginUser.getId();
List<CustomerInvoice> fapiao= customerInvoiceService.getfapiao(username);
return Result.OK(fapiao);
}
//这个是获取个人中心的发票列表的设置默认
@RequestMapping(value = "/szfpmr", method = RequestMethod.GET)
public Result<?> szfpmr(@RequestParam(name = "id", required = true) String id) {
//得到了发票抬头的id
String fpid = id;
//根据发票id获取发票的详细信息
CustomerInvoice cmi = customerInvoiceService.getById(id);
//查询是否有默认排序
CustomerInvoice cmimoren= customerInvoiceService.getmoren(cmi.getUserId());
if (cmimoren==null){
cmi.setSort(0);
customerInvoiceService.updateById(cmi);
}else{
cmimoren.setSort(cmi.getSort());
cmi.setSort(0);
customerInvoiceService.updateById(cmimoren);
customerInvoiceService.updateById(cmi);
}
return Result.OK("ok");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "顾客地址表-通过id删除")
@ApiOperation(value="顾客地址表-通过id删除", notes="顾客地址表-通过id删除")
@DeleteMapping(value = "/deletefp")
public Result<?> deletefp(@RequestParam(name="id",required=true) String id) {
customerInvoiceService.removeById(id);
return Result.OK("删除成功!");
}
}

@ -187,9 +187,9 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select("SELECT za.contents FROM customercollectgoods AS crg LEFT JOIN goods_accessories AS ga ON crg.goods_id = ga.goods_id LEFT JOIN zy_accessories AS za ON ga.accessories_id = za.id where crg.id=#{id}")
List<String> getscgoodfi(String id);
@Select("select id from customer_receiving_address where update_by =#{needuname}")
@Select("select id from customer_receiving_address where user_id =#{needuname}")
List<String> getuserdizhi(String needuname);
@Select("select id from customer_invoice where update_by =#{needuname}")
@Select("select id from customer_invoice where user_id =#{needuname}")
List<String> getuserfapiao(String needuname);
}

@ -577,13 +577,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
String needid = uids.get(n);
SysUser sysUser = new SysUser();
sysUser = userMapper.getneeduser(needid);
String needuname = sysUser.getUsername();
String needuname = sysUser.getId();
List<String> dizhi = userMapper.getuserdizhi(needuname);
List<String> fapiao = userMapper.getuserfapiao(needuname);
SysUserdfVO sdfvo = new SysUserdfVO();
sdfvo.setSysUser(sysUser);
sdfvo.setDizhi(dizhi);
sdfvo.setFapiao(fapiao);
System.out.println(sdfvo);
return sdfvo;
}

Loading…
Cancel
Save