Merge remote-tracking branch 'origin/master'

# Conflicts:
#	fuintBackend/fuint-application/src/main/resources/application.properties
This commit is contained in:
齐天大圣 2023-12-29 13:40:44 +08:00
commit 53a7cce4dc
107 changed files with 3355 additions and 1148 deletions

View File

@ -22,8 +22,14 @@
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable>
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<el-option
v-for="dict in dict.type.sys_normal_disable"
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -67,7 +73,8 @@
<el-table-column label="字典排序" align="center" prop="dictSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -135,8 +142,13 @@
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<el-radio
v-for="dict in dict.type.sys_normal_disable"
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
@ -160,7 +172,7 @@ import { listType, getType } from "@/api/system/dict/type";
export default {
name: "Data",
dicts: ['sys_normal_disable'],
dicts: ['sys_normal_disable','zhzt'],
props:{
id:{
type:String,

View File

@ -30,8 +30,14 @@
clearable
style="width: 240px"
>
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<el-option
v-for="dict in dict.type.sys_normal_disable"
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -86,7 +92,8 @@
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -137,8 +144,13 @@
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<el-radio
v-for="dict in dict.type.sys_normal_disable"
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
@ -161,7 +173,7 @@
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
dicts: ['sys_normal_disable','zhzt'],
data() {
return {
//

View File

@ -8,6 +8,17 @@ export function listMerchant() {
})
}
// 查询商户列表
export function listMerchant2(query) {
return request({
url: '/api/merchantConfig/list2',
method: 'get',
params: query,
})
}
// 修改商户使用状态
export function editMerchant(data) {
return request({

View File

@ -79,3 +79,25 @@ export function singleSignOnApi(data) {
data: data
})
}
// 查询会员人数
export function getUserNumApi(query) {
return request({
url: '/business/userManager/user/userNum',
method: 'get',
params: query
})
}
// 查询支付订单
export function getOrderNumApi(query) {
return request({
url: '/business/allOrderInfo/getOrderNum',
method: 'get',
params: query
})
}

View File

@ -11,10 +11,10 @@
<el-tab-pane label="支付配置" name="second">
<!-- <peizhi></peizhi>
-->
<payment></payment>
<payment :id="id"></payment>
</el-tab-pane>
<el-tab-pane label="员工管理" name="staff">
<staff></staff>
<staff :id="id"></staff>
</el-tab-pane>
</el-tabs>

View File

@ -62,44 +62,45 @@
</div>
<div class="box-wrap">
<div class="zong-box" v-for="(items,index) in item.storeList" :key="index" >
<div class="pur-box" @click="godetails(items.id)">
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
<div class="disper-box">
<div class="box-img">
<img :src="imagePath + items.logo" style="width: 96px;height: 96px">
</div>
<div >
<div class="title">{{items.name || ''}}</div>
<div class="box-hui">
<div>注册时间</div>
<div>{{ items.createTime.substring(0,10) || ''}}</div>
<div class="pur-box" @click="godetails(items.id)">
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
<div class="disper-box">
<div class="box-img">
<img :src="imagePath + items.logo" style="width: 96px;height: 96px">
</div>
<div class="box-hui">
<div>联系人</div>
<div>{{items.contact || '暂无'}}</div>
</div>
<div class="box-hui">
<div>联系电话</div>
<div>{{items.phone || '暂无'}}</div>
<div >
<div class="title">{{items.name || ''}}</div>
<div class="box-hui">
<div>注册时间</div>
<div>{{ items.createTime.substring(0,10) || ''}}</div>
</div>
<div class="box-hui">
<div>联系人</div>
<div>{{items.contact || '暂无'}}</div>
</div>
<div class="box-hui">
<div>联系电话</div>
<div>{{items.phone || '暂无'}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="hui-bottom">
</div>
<div class="hui-bottom">
<div>
<div class="shang-biao">{{item.storeList.length || 0}}</div>
<div class="xia-biao">创建门店数</div>
</div>
<div>
<div class="shang-biao">{{item.storeList.length || 0}}</div>
<div class="xia-biao">创建门店数</div>
<!-- <div class="shang-biao">{{ items.userNum}}</div> -->
<div class="shang-biao">{{ items.userNum}}</div>
<div class="xia-biao">会员数</div>
</div>
<div>
<div class="shang-biao">{{ items.orderNum}}</div>
<div class="xia-biao">支付订单</div>
</div>
<div>
<div class="shang-biao">12</div>
<div class="xia-biao">会员数</div>
</div>
<div>
<div class="shang-biao">0</div>
<div class="xia-biao">支付订单</div>
</div>
</div>
</div>
</div>
@ -108,7 +109,8 @@
</template>
<script>
import { Storelist, } from "@/api/service/service";
import { Storelist,getUserNumApi,
getOrderNumApi } from "@/api/service/service";
export default {
name: 'service',
dicts: ['zhzt'],
@ -137,16 +139,17 @@
},
}
},
mounted() {
this.getlist()
async mounted() {
await this.getlist()
},
methods:{
getlist(){
Storelist(this.queryParams).then(res=>{
async getlist(){
await Storelist(this.queryParams).then(res=>{
console.log(res)
this.arrlist = res.data.records
})
},
res() {
this.queryParams= {
storeName: '',

View File

@ -165,11 +165,11 @@
<el-form-item label="节点名称" prop="deptName">
<el-input v-model="ruleForm.deptName"></el-input>
</el-form-item>
<el-form-item label="负责人名称" prop="leader_name">
<el-input v-model="ruleForm.leader_name"></el-input>
<el-form-item label="负责人名称" prop="leaderName">
<el-input v-model="ruleForm.leaderName"></el-input>
</el-form-item>
<el-form-item label="负责人电话" prop="leader_phone">
<el-input v-model="ruleForm.leader_phone"></el-input>
<el-form-item label="负责人电话" prop="leaderPhone">
<el-input v-model="ruleForm.leaderPhone"></el-input>
</el-form-item>
<el-form-item label="类型" prop="deptType">
<el-radio-group v-model="ruleForm.deptType">
@ -180,6 +180,34 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-row v-if="ruleForm.deptType == 4">
<el-col :span="8">
<el-form-item label="额度设置方式" prop="">
<el-radio-group v-model="ruleForm.turnoverType">
<el-radio label="1">金额上限</el-radio>
<el-radio label="2">时间上限</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item v-if="ruleForm.turnoverType == 1" label="金额上限" prop="turnoverLimit" style="width:300px" >
<el-input v-model.number="ruleForm.turnoverLimit"></el-input>
</el-form-item>
<el-form-item v-if="ruleForm.turnoverType == 2" label="时间上限" prop="turnoverType" style="width:220px">
<el-date-picker
v-model="ruleForm.turnoverTime"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="状态" prop="name">
<el-switch v-model="value10" @change="getswitch" ></el-switch>
</el-form-item>
@ -349,10 +377,15 @@
parentId:'',
deptType:'1',
status:'qy',
leader_name:'',
leader_phone:'',
leaderName:'',
leaderPhone:'',
// parentName:'',
deptName: '',
turnoverLimit: '',
turnoverType: "1",
turnoverTime: '',
},
filterText:'',
xtitle:'',
@ -445,11 +478,11 @@
rolelist:'',
//
rules: {
leader_name: [
{ required: true, message: '不能为空', trigger: 'blur' },
leaderName: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
],
leader_phone: [
{ required: true, message: '不能为空', trigger: 'blur' },
leaderPhone: [
{ required: true, message: '电话不能为空', trigger: 'blur' },
],
deptName: [
@ -538,23 +571,31 @@
activecilck(data){
console.log('点树',data)
this.cleanUp()
//
this.queryParams.deptId = data.id
this.deptType = data.deptType
//
if(this.activeName == 'info'){
// if(this.activeName == 'info'){
this.appedit(data.id,data.label)
}
// }
//
if(this.activeName == 'list'){
// if(this.activeName == 'list'){
this.getList();
}
// }
},
cleanUp(){
this.ruleForm = {
parentId:'',
depId:'',
deptType:'1',
status:'qy',
leaderName:'',
leaderPhone:'',
// parentName:'',
deptName: '',
turnoverLimit: '',
turnoverType: "1",
turnoverTime: '',
}
},
handleChange(value) {
@ -588,8 +629,8 @@
},
//
submitFormseide(){
this.$refs[formName].validate((valid) => {
submitFormseide(ruleForm){
this.$refs[ruleForm].validate((valid) => {
if (valid) {
deptedit(this.ruleForm).then(res=>{
@ -663,8 +704,14 @@
let ancestors = res.data.ancestors.slice(2).toString();
console.log('Userlist:',res)
this.parentName = res.data.parentName
this.ruleForm.parentId = res.data.parentId
this.ruleForm.status = res.data.status
this.ruleForm = res.data
// this.ruleForm.parentId = res.data.parentId
// this.ruleForm.status = res.data.status
// this.ruleForm.leaderName = res.data.leaderName
// this.ruleForm.leaderPhone = res.data.leaderPhone
// this.ruleForm.turnoverType = res.data.turnoverType
// this.ruleForm.turnoverTime = res.data.turnoverTime
// this.ruleForm.turnoverType = res.data.turnoverType
if(res.data.status == 'qy'){
this.value10 = true
}else {

View File

@ -201,7 +201,6 @@
:action="uploadAction"
list-type="picture-card"
:class="{hide:hideUpload}"
:file-list="uploadImages"
:headers="uploadHeader"
:auto-upload="true"
@ -333,7 +332,7 @@
desc: ''
},
formLabelWidth: '120px',
rules: {
name: [
@ -354,10 +353,10 @@
},
computed: {
fullImagePath() {
return this.imagePath + this.from.logo;
}
},
fullImagePath() {
return this.imagePath + this.from.logo;
}
},
mounted() {
},
created() {
@ -395,21 +394,37 @@
getindex(){
if(this.id){
Storedetails(this.id).then(res=>{
// console.log("hello1",res.data)
if (res.code == 200) {
this.from = res.data
this.seeFrom = res.data
this.uploadImages = []
if (res.data.doorstepPhoto) {
this.from.doorstepPhoto = JSON.parse(res.data.doorstepPhoto);
this.from.doorstepPhoto.forEach(res=> {
let newImage = {
url: this.baseUrl+res,
fileName: res
// this.from = {}
// this.seeFrom = {}
// this.from = res.data
if(!res.data.doorstepPhoto){
res.data.doorstepPhoto=[]
}
console.log("this.from",this.from)
console.log("this.from",res.data.doorstepPhoto)
this.from = res.data
this.seeFrom = res.data
this.uploadImages = []
if (res.data.doorstepPhoto) {
if (res.data.doorstepPhoto.length>0) {
this.from.doorstepPhoto = JSON.parse(res.data.doorstepPhoto);
this.from.doorstepPhoto.forEach(res=> {
let newImage = {
url: this.baseUrl+res,
fileName: res
}
this.uploadImages.push(newImage);
})
}
this.uploadImages.push(newImage);
})
}
this.$forceUpdate();
}
this.$forceUpdate();
}
@ -421,14 +436,8 @@
enterThePetrolStation() {
let number = new BigNumber(this.id)
number = number.plus(1.4)
number = number.times(2.1);
// let id = (this.id + 1.4) * 2.1
singleSignOnApi(number.toString()).then(res=>{
window.open('http://localhost:82/index?entrance='+number.toString())
singleSignOnApi(this.id).then(res=>{
window.open('http://localhost:82/index?entrance='+this.id)
// '_blank');
})

View File

@ -149,7 +149,7 @@
</template>
<script>
import {editMerchant, listMerchant} from "@/api/payConfig/merchantconfig";
import {editMerchant, listMerchant2} from "@/api/payConfig/merchantconfig";
import {
addOilConfig,
delOilConfig,
@ -162,6 +162,8 @@ import {addUser, getUserMobile, updateUser} from "@/api/staff/user/user";
export default {
name: 'peizhi',
props: ["id"],
data(){
return{
//
@ -342,7 +344,7 @@ export default {
},
//
getList(){
listMerchant().then( response => {
listMerchant2({storeId : this.id}).then( response => {
this.merchantList = response.data;
this.merchantList.forEach(item => {
if (item.isOpenRule == "1"){

View File

@ -537,6 +537,8 @@
name: "StaffList",
dicts: ['ywqx','write_off','display','zhzt','transaction','time_frame','handover','handover_quit',
'jbjl','official','notice','special_prem','role'],
props: ["id"],
data() {
return {
drawer: false,
@ -678,6 +680,7 @@
//
getList() {
this.loading = true;
this.queryParams.storeId = this.id
listStaff(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.data.records;
this.total = response.data.total;

View File

@ -92,9 +92,12 @@ weixin.official.appSecret=1f55e8749332234d9a074873d8e6a3
# \u8D22\u5229\u5B9D
#wxpay.appId = wx033c30e366eff6ac
#wxpay.appSecret = e46a9a5947380fb70a1aa33a5b427ba4
#alipay.appid = 2021004128651378
# \u6765\u4E2A\u6CB9\u6167
wxpay.appId = wxd8014eaf9bd72e93
wxpay.appSecret = 0194125b13cece10d5f6cdd664847b55
alipay.appid = 2021004130635045
wxpay.mchId=1636980812
wxpay.apiV2=34354320201030y323e432342343
wxpay.certPath=/usr/local/fuint/cert/apiclient_cert.p12

View File

@ -5,6 +5,7 @@ import com.fuint.api.fuyou.entity.Const;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.util.Utils;
import com.fuint.business.integral.service.IntegralOrdersService;
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.service.AllOrderInfoService;
@ -31,7 +32,9 @@ public class FyPayController {
@Autowired
@Lazy
private IntegralOrdersService integralOrdersService;
@Autowired
@Lazy
private CardValueRecordService cardValueRecordService;
@Autowired
@Lazy
private AllOrderInfoService allOrderInfoService;
@ -62,7 +65,7 @@ public class FyPayController {
}
updateOrderStatus(orderNo,allOrderInfo.getType());
// 修改油品订单支付状态
// 修改订单支付状态
redisLock.unlock(orderLock);
}
// transaction_id 加锁
@ -72,12 +75,14 @@ public class FyPayController {
}
}
public void updateOrderStatus(String orderNo,String type){
if ("油品订单".equals(type)) {
if ("1".equals(type)) {
orderService.updateOrderStatus(orderNo,"paid");
}else if ("积分订单".equals(type)) {
integralOrdersService.editPayStatus(orderNo,"paid",-1);
integralOrdersService.checkTheStatusOfYourPaymentByIntegral(orderNo);
}else if ("3".equals(type)){
cardValueRecordService.rechargeFinallDeal(orderNo);
}
}
}

View File

@ -29,6 +29,12 @@ public class MerchantConfigController extends BaseController {
return getSuccessResult(list);
}
@GetMapping("/list2")
public ResponseObject list(Integer storeId){
List<MerchantConfig> list = merchantConfigService.selectMerchList(storeId);
return getSuccessResult(list);
}
/**
* 修改商户使用状态
* @param merchantConfig

View File

@ -14,7 +14,11 @@ public class ReturnParameter {
*/
private String orderNo;
/**
* 响应报文
* 调起微信支付所需参数json形式的字符串
*/
private String reservedPayInfo;
/**
* 调起支付宝支付所需参数
*/
private String reservedTransactionId;
}

View File

@ -35,6 +35,8 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
*/
public List<MerchantConfig> selectMerchList();
public List<MerchantConfig> selectMerchList(Integer storeId);
/**
* 根据id查询商户信息
* @param id

View File

@ -68,6 +68,14 @@ public class FyPayServiceImpl implements FyPayService {
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
map.put("goods_des", goodsDes);
// ReceiveParameter receiveParameter = new ReceiveParameter();
// receiveParameter.setOrderNo(orderNo);
// receiveParameter.setType("油品订单");
// receiveParameter.setContent(map1.get("goodsDes"));
// receiveParameter.setGoodsMoney(Double.valueOf(map1.get("allAmount")));
// receiveParameter.setStoreId(oilOrder.getStoreId());
// receiveParameter.setPayType(oilOrder.getPayType());
// receiveParameter.setUserId(oilOrder.getUserId());
// 请求报文
String reqBody = Message.requestMsg(map);
@ -79,6 +87,7 @@ public class FyPayServiceImpl implements FyPayService {
String str = resMap.get("sign");
if (Utils.verifySign(resMap, str)){
// this.insertAllOrderInfo(receiveParameter);
ThreadUtil.execAsync(() -> {
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@ -116,7 +125,7 @@ public class FyPayServiceImpl implements FyPayService {
@Override
public Map<String, String> queryOrder(Map<String, String> map1) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Map<String, String> resMap =new HashMap<>();
resMap.put("msg","error");
try {
@ -131,6 +140,7 @@ public class FyPayServiceImpl implements FyPayService {
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
Integer storeId1 = Integer.valueOf(map1.get("storeId"));
// 余额新增
String type = "";
String payStates="";
@ -151,7 +161,7 @@ public class FyPayServiceImpl implements FyPayService {
List<OilOrder> list = oilOrderService.selectOilOrder(orderNo);
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1);
List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo);
Date date = new Date();
if (reqMap.get("trans_stat").equals("SUCCESS")){
@ -375,6 +385,7 @@ public class FyPayServiceImpl implements FyPayService {
ReturnParameter returnParameter = new ReturnParameter();
returnParameter.setOrderNo(receiveParameter.getOrderNo());
returnParameter.setReservedPayInfo(resMap.get("reserved_pay_info"));
returnParameter.setReservedTransactionId(resMap.get("reserved_transaction_id"));
res.put("data",returnParameter);
return res;

View File

@ -51,6 +51,14 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
return list;
}
@Override
public List<MerchantConfig> selectMerchList(Integer storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
List list = baseMapper.selectList(queryWrapper);
return list;
}
@Override
public MerchantConfig selectMerchById(int id) {
MerchantConfig merchantConfig = baseMapper.selectById(id);

View File

@ -19,8 +19,10 @@ import com.fuint.business.petrolStationManagement.entity.OilNumber;
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import org.springframework.stereotype.Service;
@ -215,7 +217,8 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
}
}
@Resource
LJUserGradeService ljUserGradeService;
/**
* 签到功能
@ -230,11 +233,27 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
Integer integer = todayIsSignIn(integralSettings.getStoreId());
if (integer == 0) {
// 根据店铺id 查找连锁店id
// LJStore ljStore = iljStoreService.selectStoreByIdUni(integralSettings.getStoreId());
// 查询当前用户
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById4Chain(nowAccountInfo.getId(),integralSettings.getChainStoreId());
if (ObjectUtil.isEmpty(ljUserVos)) {
// 新增余额信息
UserBalance userBalanceAdd = new UserBalance();
userBalanceAdd.setMtUserId(nowAccountInfo.getId());
userBalanceAdd.setChainStoreId(integralSettings.getChainStoreId());
userBalanceAdd.setStoreId(integralSettings.getStoreId());
userBalanceAdd.setCardBalance(0.0);
userBalanceAdd.setPoints(0);
userBalanceAdd.setGrowthValue(0);
userBalanceAdd.setConsumeNum(0);
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByStoreId(integralSettings.getStoreId());
if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) {
userBalanceAdd.setGradeId(ljUserGrade.getId());
}
// 新增会员余额信息
userBalanceService.insertUserBalance(userBalanceAdd);
ljUserVos = ljUserMapper.selectAllInfoById4Chain(nowAccountInfo.getId(),integralSettings.getChainStoreId());
}
ljUserVos.setChainStoreId(integralSettings.getChainStoreId());
ljUserVos.setStoreId(integralSettings.getStoreId());
// 查询积分配置

View File

@ -218,6 +218,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
map.put("privateKey", merchantConfig.getPrivateKey());
map.put("type", "CFR");
map.put("orderId", cardFuelRecordDTO.getId().toString());
map.put("storeId", nowAccountInfo.getStoreId().toString());
// 调用支付接口
try {
fyPayService.pay(map);

View File

@ -58,4 +58,10 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
void export(HttpServletResponse response, CardValueRecord cardValueRecord);
void rechargeFinallDeal(String orderNo);
/**
* 根据用户id查询当前的储值卡信息
* @return
*/
CardValueRecord selectCardValueRecordByUserId();
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.cardValue.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -327,6 +328,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
map.put("privateKey",merchantConfig.getPrivateKey());
map.put("type","CVR");
map.put("orderId",cardValueRecordDTO.getId().toString());
map.put("storeId",nowAccountInfo.getStoreId().toString());
// 调用支付接口
try {
@ -678,5 +680,14 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueRecord.setChainStoreId(nowAccountInfo.getChainStoreId());
save(cardValueRecord);
}
}
@Override
public CardValueRecord selectCardValueRecordByUserId() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",nowAccountInfo.getId());
queryWrapper.last("LIMIT 1");
return baseMapper.selectOne(queryWrapper);
}
}

View File

@ -56,7 +56,7 @@ public class CardValudChildrensController extends BaseController {
/**
* 新增数据
*
* 新增子卡信息
* @param cardValudChildrens 实体对象
* @return 新增结果
*/
@ -65,6 +65,15 @@ public class CardValudChildrensController extends BaseController {
return getSuccessResult(this.cardValudChildrensService.add(cardValudChildrens));
}
/**
* 根据用户id查询子卡列表信息
* @return
*/
@GetMapping("/list")
public ResponseObject list(){
return getSuccessResult(cardValudChildrensService.selectCardValudChildrensByUserId());
}
/**
* 修改数据
*

View File

@ -3,6 +3,9 @@ package com.fuint.business.marketingActivity.cardValueChildrens.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardValueChildrens.entity.CardValudChildrens;
import java.util.List;
import java.util.Map;
/**
* 子卡表(CardValudChildrens)表服务接口
*
@ -16,6 +19,12 @@ public interface CardValudChildrensService extends IService<CardValudChildrens>
* @param cardValudChildrens
* @return
*/
boolean add(CardValudChildrens cardValudChildrens);
Map<String,String> add(CardValudChildrens cardValudChildrens);
/**
* 查询当前用户的子卡信息
* @return
*/
List<CardValudChildrens> selectCardValudChildrensByUserId();
}

View File

@ -1,14 +1,21 @@
package com.fuint.business.marketingActivity.cardValueChildrens.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
import com.fuint.business.marketingActivity.cardValueChildrens.mapper.CardValudChildrensMapper;
import com.fuint.business.marketingActivity.cardValueChildrens.entity.CardValudChildrens;
import com.fuint.business.marketingActivity.cardValueChildrens.service.CardValudChildrensService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 子卡表(CardValudChildrens)表服务实现类
@ -18,20 +25,63 @@ import javax.annotation.Resource;
*/
@Service("cardValudChildrensService")
public class CardValudChildrensServiceImpl extends ServiceImpl<CardValudChildrensMapper, CardValudChildrens> implements CardValudChildrensService {
@Autowired
private CardValueRecordService cardValueRecordService;
@Resource
private CardValueService cardValueService;
/**
* 新增数据
* @param cardValudChildrens
* @return
*/
@Override
public boolean add(CardValudChildrens cardValudChildrens) {
public Map<String,String> add(CardValudChildrens cardValudChildrens) {
Map<String,String> res = new HashMap<>();
if (ObjectUtils.isNotEmpty(cardValudChildrens)){
CardValueRecord cardValueRecord = cardValueRecordService.selectCardValueRecordByUserId();
if (ObjectUtils.isNotEmpty(cardValudChildrens)){
if (cardValueRecord.getMobile().equals(cardValudChildrens.getCardChildPhones())){
res.put("error","添加失败,子卡手机号不能与主卡手机号一样!");
return res;
}
cardValudChildrens.setCardValueId(cardValueRecord.getCardValueId());
List<CardValudChildrens> list = this.selectCardValudChildrensByUserId();
if (list.size()>=2){
res.put("error","添加失败,最多只能添加两张子卡!");
return res;
}else {
boolean flag = false;
if (list.size() > 0) {
for (CardValudChildrens childrens : list) {
if (childrens.getCardChildPhones().equals(cardValudChildrens)) {
flag = true;
}
}
}
if (flag) {
res.put("error", "添加失败,此手机号已存在!");
return res;
}
baseMapper.insert(cardValudChildrens);
res.put("success", "添加成功!");
}
}
}
return false;
return res;
}
@Override
public List<CardValudChildrens> selectCardValudChildrensByUserId() {
CardValueRecord cardValueRecord = cardValueRecordService.selectCardValueRecordByUserId();
List<CardValudChildrens> list = null;
if (ObjectUtils.isNotEmpty(cardValueRecord)){
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("card_value_id",cardValueRecord.getCardValueId());
list = baseMapper.selectList(queryWrapper);
}
return list;
}
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.member.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -41,6 +42,9 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
public IPage<LJStaff> selectStaffList(Page page, LJStaff staff) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {
storeId = staff.getStoreId();
}
staff.setStoreId(storeId);
return baseMapper.selectLJStaffList(page,staff);
}

View File

@ -4,10 +4,7 @@ import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@ -28,4 +25,10 @@ public class AllOrderInfoController extends BaseController {
String status = map.get("status");
return getSuccessResult(allOrderInfoService.updateAllOrderInfoByOrderNo(orderNo,status));
}
@GetMapping("/getOrderNum")
public ResponseObject getOrderNum(Integer storeId) {
return getSuccessResult(allOrderInfoService.getOrderNum(storeId));
}
}

View File

@ -7,9 +7,11 @@ import com.fuint.business.order.service.CashierOrderService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 收银员订单信息 controller层
@ -55,4 +57,10 @@ public class CashierOrderController extends BaseController {
CashierOrder cashierOrder = cashierOrderService.queryCashierOrder(id);
return getSuccessResult(cashierOrder);
}
@PostMapping("/orderNo")
public ResponseObject cashierOrderByOrderNo(@Validated @RequestBody Map<String,String> map){
String orderNo = map.get("orderNo");
return getSuccessResult(cashierOrderService.selectCashierOrder(orderNo));
}
}

View File

@ -11,6 +11,7 @@ import io.lettuce.core.dynamic.annotation.Param;
import javax.annotation.Resource;
import java.util.Map;
/**
* 交班记录表(HandoverRecord)表控制层
@ -102,5 +103,15 @@ public class HandoverRecordController extends BaseController {
return getSuccessResult(handoverRecordService.handover());
}
/**
* 本地打印
* @return
*/
@PostMapping("printLocally")
public ResponseObject printLocally(@RequestBody Map<String, Object> aa) {
handoverRecordService.printLocally(aa);
return getSuccessResult(true);
}
}

View File

@ -91,7 +91,7 @@ public class OilOrderController extends BaseController {
}
/**
* 批量添加订单信息
* 批量添加订单信息 并支付
* @param map
* @return
*/
@ -101,6 +101,17 @@ public class OilOrderController extends BaseController {
return getSuccessResult(order);
}
/**
* 批量添加订单信息 并支付
* @param map
* @return
*/
@PostMapping("/scanAppletQrCode")
public ResponseObject scanAppletQrCode(@Validated @RequestBody Map<String,String> map){
Map<String, String> order = orderService.scanAppletQrCode(map);
return getSuccessResult(order);
}
/**
* 小程序支付接口
* @param map

View File

@ -0,0 +1,17 @@
package com.fuint.business.order.entity;
import lombok.Data;
/**
* 囤油卡信息
*/
@Data
public class RefuelMoney {
private String type;
private String oilType;
private String refuelMoney;
// public String toString(){
// return "{'type':'"+type+"','oilType':'"+oilType+"','refuelMoney':'"+refuelMoney+"'}";
// }
}

View File

@ -272,13 +272,13 @@
<select id="salesByOilProduct" resultType="java.util.Map">
SELECT
<if test="type == 'week'">
CONCAT(YEAR(oo.create_time), '年第', WEEK(oo.create_time),'周') AS year_week,
CONCAT(YEAR(oo.create_time), '年第', WEEK(oo.create_time),'周') AS year_week
</if>
<if test="type == 'month'">
CONCAT(YEAR(oo.create_time), '年', MONTH(oo.create_time),'月') AS year_week,
CONCAT(YEAR(oo.create_time), '年', MONTH(oo.create_time),'月') AS year_week
</if>
<if test="type == 'year'">
CONCAT(YEAR(oo.create_time), '年') AS year_week,
CONCAT(YEAR(oo.create_time), '年') AS year_week
</if>
<foreach collection="list" item="list" separator=",">
@ -289,17 +289,17 @@
oil_order oo
left join oil_name onn on onn.id = oo.oils
WHERE
store_id = #{storeId}
<if test="type == 'week'">
oo.create_time >= CURDATE() - INTERVAL 6 WEEK
and oo.create_time >= CURDATE() - INTERVAL 6 WEEK
</if>
<if test="type == 'month'">
oo.create_time >= CURDATE() - INTERVAL 6 MONTH
and oo.create_time >= CURDATE() - INTERVAL 6 MONTH
</if>
<if test="type == 'year'">
oo.create_time >= CURDATE() - INTERVAL 6 YEAR
and oo.create_time >= CURDATE() - INTERVAL 6 YEAR
</if>
and store_id = #{storeId}
GROUP BY
YEAR(oo.create_time)
<if test="type == 'week'">

View File

@ -30,4 +30,9 @@ public interface AllOrderInfoService {
* @return
*/
public int updateAllOrderInfoByOrderNo(String orderNo,String status);
public int getOrderNum(Integer StoreId);
}

View File

@ -61,5 +61,7 @@ public interface HandoverRecordService {
public Map<String, Object> handover();
public void printLocally(Map<String, Object> aa);
}

View File

@ -73,6 +73,12 @@ public interface OilOrderService extends IService<OilOrder> {
*/
public Map<String,Object> insertOilOrder(Map<String ,String> map);
/**
* 扫描小程序中二维码所处理的逻辑
* @param map
*/
Map<String,String> scanAppletQrCode(Map<String,String> map);
/**
* 小程序添加油品订单信息
* @param oilOrder

View File

@ -44,4 +44,15 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
}
return 0;
}
@Override
public int getOrderNum(Integer StoreId) {
// 构建查询条件
QueryWrapper queryWrapper = new QueryWrapper<>();
// 添加其他条件
queryWrapper.eq("store_id", StoreId);
// 调用统计方法
return baseMapper.selectCount(queryWrapper);
}
}

View File

@ -13,11 +13,13 @@ import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.TscLibDll;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.system.dict.entity.SysDictData;
import com.fuint.system.dict.entity.SysDictType;
import com.fuint.system.dict.service.ISysDictDataService;
import com.fuint.system.dict.service.ISysDictTypeService;
import javafx.print.Printer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil;
@ -33,10 +35,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 交班记录表(HandoverRecord)表服务实现类
@ -197,6 +196,7 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
return handoverMap;
}
public Map<String, Object> orderSummary(String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 油品订单(订单) 油品订单(退款) 油品订单(实收) 油品优惠(实收) 油品交易(实收)
@ -249,6 +249,13 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
boolean flag = true;
for (Map<String, Object> stringObjectMap : mapList) {
if (ObjectUtil.isEmpty(map.get("payType"))) {
map.put("payType","other");
}
if (ObjectUtil.isEmpty(stringObjectMap.get("payType"))) {
map.put("payType","other");
}
if (map.get("payType").equals(stringObjectMap.get("payType"))) {
BigDecimal paidAmount = new BigDecimal(stringObjectMap.get("paidAmount").toString()).add(new BigDecimal(map.get("paidAmount").toString()));
BigDecimal refundAmount = new BigDecimal(stringObjectMap.get("refundAmount").toString()).add(new BigDecimal(map.get("refundAmount").toString()));
@ -381,4 +388,500 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
return map;
}
private static final String LOAD_LIBRARY = "TSCLIB";
//打印机
// private static final String print_model = "58130IVC";
@Override
public void printLocally(Map<String, Object> handover) {
Map<String, Object> baseInfo = (Map<String, Object>)handover.get("baseInfo");
Map<String, Object> orderSummary = (Map<String, Object>)handover.get("orderSummary");
// 支付方式汇总
List<Map<String, Object>> paymentAggregationMap = (List<Map<String, Object>>)handover.get("paymentAggregation");
// 油号统计
List<Map<String, Object>> oilNumberStatisticsMap = (List<Map<String, Object>>)handover.get("oilNumberStatistics");
// 油枪统计
List<Map<String, Object>> greaseGunStatisticsMap = (List<Map<String, Object>>)handover.get("greaseGunStatistics");
// 员工统计
List<Map<String, Object>> employeeStatisticsMap = (List<Map<String, Object>>)handover.get("employeeStatistics");
// 挂账详情
List<Map<String, Object>> billingDetailsMap = (List<Map<String, Object>>)handover.get("billingDetails");
// 挂账归还
List<Map<String, Object>> returnedToTheAccountMap = (List<Map<String, Object>>)handover.get("returnedToTheAccount");
// System.loadLibrary(LOAD_LIBRARY);
System.setProperty("jna.encoding", "GBK");
// 获取默认打印机
Printer printer = Printer.getDefaultPrinter();
// 获取打印机的名称
String printerName = printer.getName();
TscLibDll.INSTANCE.openport(printerName);
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("------------交班统计------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("油站名称:\t"+Optional.ofNullable(baseInfo.get("storeName")).orElse("未知油站"));
TscLibDll.INSTANCE.sendcommand("收银员:\t"+Optional.ofNullable(baseInfo.get("realName")).orElse("未知姓名"));
TscLibDll.INSTANCE.sendcommand("交班方式:\t"+Optional.ofNullable(baseInfo.get("handoverType")).orElse("未知"));
TscLibDll.INSTANCE.sendcommand("开始时间:\t"+Optional.ofNullable(baseInfo.get("startTime")).orElse("-"));
TscLibDll.INSTANCE.sendcommand("结束时间:\t"+Optional.ofNullable(baseInfo.get("endTime")).orElse("-"));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("当前版本:\t"+"V1.0.1");
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**订单汇总**");
TscLibDll.INSTANCE.sendcommand("类型\t金额");
TscLibDll.INSTANCE.sendcommand("油品订单(订单):\t¥"+Optional.ofNullable(orderSummary.get("oilOrder")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("油品订单(退款):\t¥"+Optional.ofNullable(orderSummary.get("oilRefund")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("油品订单(实收):\t¥"+Optional.ofNullable(orderSummary.get("oilPaid")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("油品优惠(实收):\t¥"+Optional.ofNullable(orderSummary.get("oilDiacount")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("会员储值(订单):\t¥"+Optional.ofNullable(orderSummary.get("cardOrder")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("会员储值(退款):\t¥"+Optional.ofNullable(orderSummary.get("cardRefund")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("会员储值(实收):\t¥"+Optional.ofNullable(orderSummary.get("cardPaid")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("储值赠送(订单):\t¥"+Optional.ofNullable(orderSummary.get("cardGiftOrder")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("储值赠送(退款):\t¥"+Optional.ofNullable(orderSummary.get("cardGiftRefund")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("储值赠送(实际):\t¥"+Optional.ofNullable(orderSummary.get("cardGiftPaid")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("存油储值(订单):\t¥"+Optional.ofNullable(orderSummary.get("fuelOrder")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("存油储值(退款):\t¥"+Optional.ofNullable(orderSummary.get("fuelRefund")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("存油储值(实收):\t¥"+Optional.ofNullable(orderSummary.get("fuelPaid")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("普通收款(订单):\t¥"+Optional.ofNullable(orderSummary.get("goodsOrder")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("普通收款(退款):\t¥"+Optional.ofNullable(orderSummary.get("goodsRefund")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("普通收款(实收):\t¥"+Optional.ofNullable(orderSummary.get("goodsPaid")).orElse("0"));
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**退款汇总**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
List<Map<String, Object>> paymentAggregationAll = paymentAggregation("all", paymentAggregationMap);
if (ObjectUtil.isNotEmpty(paymentAggregationAll)) {
for (Map<String, Object> stringObjectMap : paymentAggregationAll) {
if (Double.parseDouble(stringObjectMap.get("refundAmount").toString()) > 0) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("refundAmount")).orElse("0"));
}
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+refundAggregateTotal(paymentAggregationAll));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**实收汇总**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
if (ObjectUtil.isNotEmpty(paymentAggregationAll)) {
for (Map<String, Object> stringObjectMap : paymentAggregationAll) {
if (Double.parseDouble(stringObjectMap.get("paidAmount").toString()) > 0) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+totalTotalOfActualReceipts(paymentAggregationAll));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**油品订单**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
List<Map<String, Object>> paymentAggregationOil = paymentAggregation("oil", paymentAggregationMap);
if (ObjectUtil.isNotEmpty(paymentAggregationOil)) {
for (Map<String, Object> stringObjectMap : paymentAggregationOil) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+totalOilOrders(paymentAggregationOil));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**商品订单**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
List<Map<String, Object>> paymentAggregationGoods = paymentAggregation("goods", paymentAggregationMap);
if (ObjectUtil.isNotEmpty(paymentAggregationGoods)) {
for (Map<String, Object> stringObjectMap : paymentAggregationGoods) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+totalOfProductOrders(paymentAggregationGoods));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**会员储值**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
List<Map<String, Object>> paymentAggregationFg = paymentAggregation("fg", paymentAggregationMap);
if (ObjectUtil.isNotEmpty(paymentAggregationFg)) {
for (Map<String, Object> stringObjectMap : paymentAggregationFg) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+totalMemberStoredValue(paymentAggregationMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**积分商城**");
TscLibDll.INSTANCE.sendcommand("支付方式\t金额");
List<Map<String, Object>> paymentAggregationPoint = paymentAggregation("point", paymentAggregationMap);
if (ObjectUtil.isNotEmpty(paymentAggregationPoint)) {
for (Map<String, Object> stringObjectMap : paymentAggregationPoint) {
TscLibDll.INSTANCE.sendcommand(calculatePaymentMethod(stringObjectMap.get("payType").toString())+":\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+pointsMallStatistics(paymentAggregationPoint));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**油号统计**");
TscLibDll.INSTANCE.sendcommand("油号\t笔数\t升数\t金额");
if (ObjectUtil.isNotEmpty(oilNumberStatisticsMap)) {
for (Map<String, Object> stringObjectMap : oilNumberStatisticsMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("oilName")).orElse("未知")
+"\t"+Optional.ofNullable(stringObjectMap.get("numberOfDeals")).orElse("0")
+"\t"+Optional.ofNullable(stringObjectMap.get("oilNum")).orElse("0")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t"+totalOilNumberStatistics(oilNumberStatisticsMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("**优惠统计**");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("油品\t金额");
if (ObjectUtil.isNotEmpty(oilNumberStatisticsMap)) {
for (Map<String, Object> stringObjectMap : oilNumberStatisticsMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("oilName")).orElse("未知")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("paidDiscount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+discountStatisticsTotal(oilNumberStatisticsMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("**油枪统计**");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("油枪\t笔数\t升数\t金额");
if (ObjectUtil.isNotEmpty(greaseGunStatisticsMap)) {
for (Map<String, Object> stringObjectMap : greaseGunStatisticsMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("gunName")).orElse("未知")
+"\t"+Optional.ofNullable(stringObjectMap.get("numberOfDeals")).orElse("0")
+"\t"+Optional.ofNullable(stringObjectMap.get("oilNum")).orElse("0")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t"+totalOfOilGunStatistics(greaseGunStatisticsMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**员工统计**");
TscLibDll.INSTANCE.sendcommand("员工姓名\t笔数\t金额");
if (ObjectUtil.isNotEmpty(employeeStatisticsMap)) {
for (Map<String, Object> stringObjectMap : employeeStatisticsMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("name")).orElse("未知")
+"\t"+Optional.ofNullable(stringObjectMap.get("numberOfDeals")).orElse("0")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("paidAmount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t"+totalOfEmployeeStatistics(employeeStatisticsMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("**挂账统计**");
TscLibDll.INSTANCE.sendcommand("·····挂账详情·····");
TscLibDll.INSTANCE.sendcommand("挂账单位\t笔数\t金额");
if (ObjectUtil.isNotEmpty(billingDetailsMap)) {
for (Map<String, Object> stringObjectMap : billingDetailsMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("name")).orElse("未知")
+"\t"+Optional.ofNullable(stringObjectMap.get("numberOfDeals")).orElse("0")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("amount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+statisticsOfAccountDetails(billingDetailsMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("······归还详情······");
TscLibDll.INSTANCE.sendcommand("挂账单位\t笔数\t金额");
if (ObjectUtil.isNotEmpty(returnedToTheAccountMap)) {
for (Map<String, Object> stringObjectMap : returnedToTheAccountMap) {
TscLibDll.INSTANCE.sendcommand(
Optional.ofNullable(stringObjectMap.get("name")).orElse("未知")
+"\t"+Optional.ofNullable(stringObjectMap.get("numberOfDeals")).orElse("0")
+"\t¥"+Optional.ofNullable(stringObjectMap.get("amount")).orElse("0"));
}
}
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("合计:\t¥"+postedAccountReturnStatistics(returnedToTheAccountMap));
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("--------------------------------");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.sendcommand("");
TscLibDll.INSTANCE.closeport();
}
public List<Map<String, Object>> paymentAggregation(String flag, List<Map<String, Object>> paymentAggregation) {
List<Map<String, Object>> count = new ArrayList<>();
if (ObjectUtil.isNotEmpty(paymentAggregation)) {
for (Map<String, Object> res : paymentAggregation) {
if ("fg".equals(flag)) {
if ("card".equals(res.get("flag")) || "fuel".equals(res.get("flag"))) {
boolean flag2 = false;
for (Map<String, Object> coun : count) {
if (Objects.equals(res.get("payType"), coun.get("payType"))) {
coun.put("paidAmount", Double.valueOf(coun.get("paidAmount").toString()) + Double.valueOf(res.get("paidAmount").toString()));
flag2 = true;
}
}
if (!flag2) {
// 创建新的对象以防修改原始数据
Map<String, Object> newRes = new HashMap<>(res);
count.add(newRes);
}
}
} else if (Objects.equals(res.get("flag"), flag)) {
count.add(res);
}
}
}
return count;
}
private int findIndexByPayType(List<Map<String, Object>> list, String payType) {
for (int i = 0; i < list.size(); i++) {
if (payType.equals(list.get(i).get("payType").toString())) {
return i;
}
}
return -1;
}
public String calculatePaymentMethod(String payType) {
switch (payType) {
case "ALIPAY":
return "支付宝";
case "WECHAT":
return "微信";
case "UNIONPAY":
return "银联二维码";
case "CASH":
return "现金";
default:
return "其他";
}
}
//退款汇总合计
public BigDecimal refundAggregateTotal(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalRefundAmount = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("all".equals(payment.get("flag"))) {
BigDecimal refundAmount = new BigDecimal(String.valueOf(payment.get("refundAmount")));
totalRefundAmount = totalRefundAmount.add(refundAmount);
}
}
}
return totalRefundAmount;
}
//实收汇总合计
public BigDecimal totalTotalOfActualReceipts(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalPaidAmount = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("all".equals(payment.get("flag"))) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(payment.get("paidAmount")));
totalPaidAmount = totalPaidAmount.add(paidAmount);
}
}
}
return totalPaidAmount;
}
//油品订单合计
public BigDecimal totalOilOrders(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalOilAmount = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("oil".equals(payment.get("flag"))) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(payment.get("paidAmount")));
totalOilAmount = totalOilAmount.add(paidAmount);
}
}
}
return totalOilAmount;
}
// 商品订单合计
public BigDecimal totalOfProductOrders(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalProductAmount = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("goods".equals(payment.get("flag"))) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(payment.get("paidAmount")));
totalProductAmount = totalProductAmount.add(paidAmount);
}
}
}
return totalProductAmount;
}
// 会员储值合计
public BigDecimal totalMemberStoredValue(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalStoredValue = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("card".equals(payment.get("flag")) || "fuel".equals(payment.get("flag"))) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(payment.get("paidAmount")));
totalStoredValue = totalStoredValue.add(paidAmount);
}
}
}
return totalStoredValue;
}
// 积分商城统计
public BigDecimal pointsMallStatistics(List<Map<String, Object>> paymentAggregation) {
BigDecimal totalPointsMallAmount = BigDecimal.ZERO;
if (paymentAggregation != null && !paymentAggregation.isEmpty()) {
for (Map<String, Object> payment : paymentAggregation) {
if ("point".equals(payment.get("flag"))) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(payment.get("paidAmount")));
totalPointsMallAmount = totalPointsMallAmount.add(paidAmount);
}
}
}
return totalPointsMallAmount;
}
// 油号统计合计
public BigDecimal totalOilNumberStatistics(List<Map<String, Object>> oilNumberStatistics) {
BigDecimal totalOilNumberAmount = BigDecimal.ZERO;
if (oilNumberStatistics != null && !oilNumberStatistics.isEmpty()) {
for (Map<String, Object> statistics : oilNumberStatistics) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(statistics.get("paidAmount")));
totalOilNumberAmount = totalOilNumberAmount.add(paidAmount);
}
}
return totalOilNumberAmount;
}
// 优惠统计合计
public BigDecimal discountStatisticsTotal(List<Map<String, Object>> oilNumberStatistics) {
BigDecimal totalDiscountAmount = BigDecimal.ZERO;
if (oilNumberStatistics != null && !oilNumberStatistics.isEmpty()) {
for (Map<String, Object> statistics : oilNumberStatistics) {
BigDecimal paidDiscount = new BigDecimal(String.valueOf(statistics.get("paidDiscount")));
totalDiscountAmount = totalDiscountAmount.add(paidDiscount);
}
}
return totalDiscountAmount;
}
// 油枪统计合计
public BigDecimal totalOfOilGunStatistics(List<Map<String, Object>> greaseGunStatistics) {
BigDecimal totalOilGunAmount = BigDecimal.ZERO;
if (greaseGunStatistics != null && !greaseGunStatistics.isEmpty()) {
for (Map<String, Object> statistics : greaseGunStatistics) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(statistics.get("paidAmount")));
totalOilGunAmount = totalOilGunAmount.add(paidAmount);
}
}
return totalOilGunAmount;
}
// 员工统计合计
public BigDecimal totalOfEmployeeStatistics(List<Map<String, Object>> employeeStatistics) {
BigDecimal totalEmployeeAmount = BigDecimal.ZERO;
if (employeeStatistics != null && !employeeStatistics.isEmpty()) {
for (Map<String, Object> statistics : employeeStatistics) {
BigDecimal paidAmount = new BigDecimal(String.valueOf(statistics.get("paidAmount")));
totalEmployeeAmount = totalEmployeeAmount.add(paidAmount);
}
}
return totalEmployeeAmount;
}
// 挂账详情统计
public BigDecimal statisticsOfAccountDetails(List<Map<String, Object>> billingDetails) {
BigDecimal totalAccountDetailsAmount = BigDecimal.ZERO;
if (billingDetails != null && !billingDetails.isEmpty()) {
for (Map<String, Object> details : billingDetails) {
BigDecimal amount = new BigDecimal(String.valueOf(details.get("amount")));
totalAccountDetailsAmount = totalAccountDetailsAmount.add(amount);
}
}
return totalAccountDetailsAmount;
}
// 挂账归还统计
public BigDecimal postedAccountReturnStatistics(List<Map<String, Object>> returnedToTheAccount) {
BigDecimal totalReturnAmount = BigDecimal.ZERO;
if (returnedToTheAccount != null && !returnedToTheAccount.isEmpty()) {
for (Map<String, Object> returnDetails : returnedToTheAccount) {
BigDecimal amount = new BigDecimal(String.valueOf(returnDetails.get("amount")));
totalReturnAmount = totalReturnAmount.add(amount);
}
}
return totalReturnAmount;
}
}

View File

@ -234,7 +234,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
* 调用支付接口
* @param map
*/
private void pay(Map<String,String> map,String orderNo,int storeId){
private void pay(Map<String,String> map,String orderNo,Integer storeId){
// 先将支付状态改为未支付
String payType = map.get("payType");
if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
@ -257,6 +257,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
map1.put("goodsDes",merchantConfig.getMerchantName());
map1.put("publicKey",merchantConfig.getPublicKey());
map1.put("privateKey",merchantConfig.getPrivateKey());
map1.put("storeId",storeId.toString());
try {
fyPayService.pay(map1);
}catch (Exception e){

View File

@ -48,6 +48,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.config.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -358,7 +359,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilConfigService.oilRule();
}
// 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIsUse("1");
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
// 处理支付需要的数据
Map<String,String> map1 = new HashMap<>();
map1.put("authCode",map.get("authCode"));
@ -373,6 +374,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
map1.put("goodsOrder",map.get("goodsOrder"));
map1.put("oilOrder",map.get("oilOrder"));
map1.put("tankId",map.get("oilOrder"));
map1.put("storeId",storeId.toString());
// 调用支付接口
try {
@ -393,9 +395,261 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
}
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo,storeId,oilAmount,payType,userId,"PC");
return orders;
}
@Override
public Map<String,String> scanAppletQrCode(Map<String, String> map) {
Map<String,String> res = new HashMap<>();
String authCode = map.get("authCode");
// 油品订单金额
Double oilAmount = Double.valueOf(map.get("oilAmount"));
// 将油品订单信息的json数据转换为数组
List<JSONObject> oilOrders = null;
if (!map.get("oilOrder").equals("[]")) {
oilOrders = JSONArray.parseArray(map.get("oilOrder"), JSONObject.class);
// 条码支付
if (authCode.contains("19")) {
String[] split = authCode.split("19");
// 获取用户id
Integer userId = Integer.valueOf(split[1]);
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders);
}
// 二维码支付
if (authCode.contains("9E")) {
String[] split = authCode.split("9E");
// 获取用户id
Integer userId = Integer.valueOf(split[1]);
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders);
}
}
return res;
}
@Autowired
private LJUserService userService;
/**
* 修改用户储值卡信息并添加订单信息
* @param userId 用户id
* @param oilAmount 油品订单金额
* @param oilOrders 油品订单
* @return 是否成功
*/
private Map<String,String> updateUserBalanceAndInsetOrder(int userId,Map<String, String> map,Double oilAmount,List<JSONObject> oilOrders){
Map<String,String> res = new HashMap<>();
// 根据userId查询用户储值卡信息
UserBalance balance = userBalanceService.selectUserBalance(userId);
// 根据用户id查询用户信息
LJUserVo userVo1 = userService.selectUserById(userId);
// 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = dateFormat.format(new Date());
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
String orderNo = "2345"+timestamp+randomString;
AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
Double cardBalance = balance.getCardBalance();
JSONArray refuelMoneys = JSONArray.parseArray(balance.getRefuelMoney());
if (cardBalance >= oilAmount) {
// 添加油品订单信息
OilOrder order = new OilOrder();
for (int i = 0;i < oilOrders.size();i++) {
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
Double oilNum = amount / oilPrice;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
order.setPayAmount(0.0);
order.setOrderNo(orderNo);
} else {
order.setOrderType("子订单");
order.setOrderAmount(amount);
order.setPayAmount(0.0);
order.setOrderNo(orderNo + "1");
}
order.setStoreId(accountInfo.getStoreId());
order.setUserId(userId);
order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
order.setStaffId(Integer.valueOf(map.get("staffId")));
order.setTerminal(map.get("terminal"));
order.setOils((String) oilOrders.get(i).get("oilName"));
order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
order.setOilNum(oilNum);
// order.setDiscountAmount(Double.valueOf(map.get("oilDiscount")));
order.setPayUser(userVo1.getMobile());
order.setPayType(map.get("payType"));
order.setInvoicing("未开票");
order.setOrderStatus("paid");
order.setPayTime(new Date());
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
baseMapper.insert(order);
}
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
cashierOrder.setStaffId(Integer.valueOf(map.get("staffId")));
cashierOrder.setStoreId(accountInfo.getStoreId());
cashierOrder.setPayUser(userVo1.getMobile());
cashierOrder.setAmount(oilAmount);
cashierOrder.setPayAmount(oilAmount);
cashierOrder.setStatus("paid");
cashierOrder.setPayTime(new Date());
cashierOrder.setOrderNo(orderNo);
cashierOrder.setOilOrderAmount(oilAmount);
// cashierOrder.setOilDiscountAmount(Double.valueOf(map.get("oilDiscount")));
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
res.put("success","success");
} else {
if (ObjectUtil.isNotEmpty(refuelMoneys)){
for (Object refuelMoney : refuelMoneys) {
// System.out.println(refuelMoney);
String oilType = ((JSONObject) refuelMoney).get("oilType").toString();
Double refuelMoneyLiters = Double.valueOf(((JSONObject) refuelMoney).get("refuelMoney").toString());
// 根据油品名称查询油品id
OilName oilName = oilNameService.selectOilNameByOilName(oilType);
OilOrder order = new OilOrder();
OilOrder oilOrder = null;
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
for (int i = 0;i < oilOrders.size();i++) {
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())){
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
Double oilNum = amount / oilPrice;
if (i == 0) {
order.setOrderType("主订单");
order.setOrderAmount(amount);
order.setPayAmount(0.0);
order.setOrderNo(orderNo);
} else {
order.setOrderType("子订单");
order.setOrderAmount(amount);
order.setPayAmount(0.0);
order.setOrderNo(orderNo + "1");
}
order.setStoreId(accountInfo.getStoreId());
order.setUserId(userId);
order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
order.setStaffId(Integer.valueOf(map.get("staffId")));
order.setTerminal(map.get("terminal"));
order.setOils((String) oilOrders.get(i).get("oilName"));
order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
order.setOilNum(oilNum);
// order.setDiscountAmount(Double.valueOf(map.get("oilDiscount")));
order.setPayUser(userVo1.getMobile());
order.setPayType(map.get("payType"));
order.setInvoicing("未开票");
order.setOrderStatus("paid");
order.setPayTime(new Date());
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo);
cashierOrder.setStaffId(Integer.valueOf(map.get("staffId")));
cashierOrder.setStoreId(accountInfo.getStoreId());
cashierOrder.setPayUser(userVo1.getMobile());
cashierOrder.setAmount(oilAmount);
cashierOrder.setPayAmount(oilAmount);
cashierOrder.setStatus("paid");
cashierOrder.setPayTime(new Date());
cashierOrder.setOrderNo(orderNo);
cashierOrder.setOilOrderAmount(oilAmount);
// cashierOrder.setOilDiscountAmount(Double.valueOf(map.get("oilDiscount")));
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
this.updateGrowthValue1(0.0,userId, Integer.valueOf(oilOrder.getOils()),refuelMoneyLiters-Double.valueOf(oilOrders.get(i).get("liters").toString()));
}
}else {
res.put("error","囤油卡余额不足!");
}
}
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
res.put("success","success");
}
}else {
res.put("error","储值卡余额不足!");
}
}
return res;
}
@Autowired
@Lazy
private AllOrderInfoService allOrderInfoService;
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel){
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType("1");
allOrderInfo.setStoreId(storeId);
allOrderInfo.setGoodsMoney(goodsMoney);
allOrderInfo.setPayType(payType);
allOrderInfo.setUserId(userId);
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus("paid");
allOrderInfo.setContent("油品订单");
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
/**
* 修改用户成长储值卡信息
* @param oilActualPay 消费金额
* @param userid 用户id
* @param oilId 油号id
* @param refuelMoney 扣除的囤油卡升数
*/
private void updateGrowthValue1(Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney){
UserBalance balance = userBalanceService.selectUserBalance(userid);
JSONArray refuelMoneys = JSONArray.parseArray(balance.getRefuelMoney());
if (oilActualPay==0.0){
if (ObjectUtil.isNotEmpty(refuelMoneys)){
List<RefuelMoney> list = new ArrayList<>();
for (Object money : refuelMoneys) {
RefuelMoney refuelMoney1 = new RefuelMoney();
refuelMoney1.setType(((JSONObject) money).get("type").toString());
refuelMoney1.setOilType(((JSONObject) money).get("oilType").toString());
refuelMoney1.setRefuelMoney(((JSONObject) money).get("refuelMoney").toString());
Double refuelMoneyLiters = Double.valueOf(((JSONObject) money).get("refuelMoney").toString());
// 根据油品名称查询油品id
OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString());
if (oilName.getId().toString().equals(oilId.toString())){
refuelMoney1.setRefuelMoney(String.valueOf(refuelMoney));
}
list.add(refuelMoney1);
}
balance.setRefuelMoney(JSONObject.toJSONString(list));
}
}else {
balance.setCardBalance(balance.getCardBalance()-oilActualPay);
}
userBalanceService.updateUserBalance(balance);
}
@Override
public String addOilOrder(OilOrder oilOrder) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -493,14 +747,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (!map.get("payAmount").equals("0")) {
// 调用支付接口
// 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
if (list.size() > 0) {
oilConfigService.oilRule();
}
// List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
// if (list.size() > 0) {
// oilConfigService.oilRule();
// }
// 处理支付需要的数据
ReceiveParameter receiveParameter = new ReceiveParameter();
receiveParameter.setOrderNo(orderNo);
receiveParameter.setType("油品订单");
receiveParameter.setType("1");
receiveParameter.setContent("油品订单");
receiveParameter.setGoodsMoney(oilOrder.getOrderAmount());
receiveParameter.setStoreId(oilOrder.getStoreId());
@ -610,8 +864,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
@Autowired
private SysConfigService sysConfigService;
@Autowired
private LJUserService userService;
@Autowired
private LJUserGradeService userGradeService;
@Autowired
private ILJStoreService storeService;

View File

@ -1,6 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fuint.repository.model.base.BaseEntity;
@ -22,14 +23,19 @@ public class OilName extends BaseEntity {
public Long id; //id主键)
private String oilType; // 油品类型
private String oilName; //油品名称
@TableField(exist = false)
private Double oilPrice; //油品单价
private Double oilDensity; //油品密度
private String state; // 状态 启用或禁用0禁用1启用
private String sort; //排序
@TableField(exist = false)
private String remark; //
private String ifDelete; //
@TableField(exist = false)
private String receivingUnits; //
@TableField(exist = false)
private String unit; //
@TableField(exist = false)
private Integer storeId; //

View File

@ -32,6 +32,13 @@ public interface OilNameService extends IService<OilName> {
*/
public OilName selectOilNameById(int id);
/**
* 根据油品名称查询油号信息
* @param oilName
* @return
*/
public OilName selectOilNameByOilName(String oilName);
// /**
// * 根据条件分页查询员工信息
// * @param page

View File

@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -44,6 +45,13 @@ public class OilNameServiceImpl extends ServiceImpl<OilNameMapper, OilName> impl
return oilName;
}
@Override
public OilName selectOilNameByOilName(String oilName) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("oil_name",oilName);
return baseMapper.selectOne(queryWrapper);
}
// @Override
// public IPage<OilNumber> selectOilNumberList(Page page, OilNumber oilNumber) {

View File

@ -6,7 +6,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 定时任务调度测试
* 定时任务调度
*
* @author ruoyi
*/

View File

@ -1,6 +1,7 @@
package com.fuint.business.store.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
@ -86,4 +87,8 @@ public class MtStore extends BaseEntity implements Serializable {
@ApiModelProperty("服务到期时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date expirationTime;
@TableField(exist = false)
private Integer orderNum;
@TableField(exist = false)
private Integer userNum;
}

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.store.mapper.ChainStoreInfoMapper">
<select id="listVo" resultType="com.fuint.business.store.entity.ChainStoreInfo">
<select id="listVo" resultType="com.fuint.business.store.entity.ChainStoreInfo">
SELECT
csi.*,sd.leader_name,sd.leader_phone
FROM

View File

@ -2,14 +2,19 @@ package com.fuint.business.store.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.mapper.ChainStoreInfoMapper;
import com.fuint.business.store.entity.ChainStoreInfo;
import com.fuint.business.store.service.ChainStoreInfoService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.model.base.BaseEntity;
@ -19,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
@ -35,6 +41,10 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
private ISysDeptService deptService;
@Autowired
private StoreService storeService;
@Resource
AllOrderInfoMapper allOrderInfoMapper;
@Resource
LJUserMapper ljUserMapper;
@Override
public IPage<ChainStoreInfo> listVo(Page page, ChainStoreInfo chainStoreInfo) {
@ -48,6 +58,18 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
}
queryWrapper.eq(MtStore::getChainStoreId,it.getId()).orderByDesc(BaseEntity::getCreateTime);
List<MtStore> list = storeService.list(queryWrapper);
for (MtStore mtStore : list) {
QueryWrapper<AllOrderInfo> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("store_id", mtStore.getId());
QueryWrapper<LJUser> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("store_id", mtStore.getId());
Integer orderNum = allOrderInfoMapper.selectCount(queryWrapper1);
Integer userNum = ljUserMapper.selectCount(queryWrapper2);
mtStore.setOrderNum(orderNum);
mtStore.setUserNum(userNum);
}
it.setStoreList(list);
});
return res;

View File

@ -23,6 +23,8 @@ import com.fuint.repository.mapper.TAccountMapper;
import com.fuint.repository.model.MtMerchant;
import com.fuint.business.store.entity.MtStore;
import com.fuint.repository.model.TAccount;
import com.fuint.system.role.entity.TDuty;
import com.fuint.system.role.mapper.TDutyMapper;
import com.fuint.utils.StringUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -355,6 +357,9 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
public RedisTemplate redisTemplate;
@Autowired
TAccountMapper tAccountMapper;
@Resource
TDutyMapper tDutyMapper;
@Override
public Map<String,Object> loginVerification(String flag) {
Map<String,Object> res = new HashMap<>();
@ -364,17 +369,23 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
}
// if (redisTemplate.hasKey(flag)) {
if (true) {
// BigDecimal bigDecimal = new BigDecimal(flag);
// BigDecimal multiply = bigDecimal.divide(new BigDecimal("2.1")).multiply(new BigDecimal("1.4"));
// 使用 intValue() BigDecimal 转换为整数
// int i = multiply.intValue();
// 找到站长的
Map<String, Object> param = new HashMap();
param.put("role_ids", 12);
List<TAccount> accountList = tAccountMapper.selectByMap(param);
// 根据storeId查出店铺信息
MtStore mtStore = mtStoreMapper.selectById(Integer.parseInt(flag));
// 找到对应的站长deptId
LambdaQueryWrapper<TDuty> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(TDuty::getCode,"z001");
TDuty tDuty = tDutyMapper.selectOne(lambdaQueryWrapper);
// 查找对应的用户信息
TAccount tAccount = new TAccount();
tAccount.setDeptId(mtStore.getContractDeptId());
tAccount.setRoleIds(tDuty.getDutyId().toString());
List<TAccount> accountList = tAccountMapper.getStationmasterByStoreId(tAccount);
if (accountList != null && accountList.size() > 0) {
AccountInfo accountByName = getAccountByName(accountList.get(0));

View File

@ -28,6 +28,15 @@ public class LJStoreController extends BaseController {
return getSuccessResult(store);
}
/**
* 根据id查询门店信息
* @return
*/
@GetMapping("/{id}")
public ResponseObject queryStoreById(@PathVariable Integer id){
return getSuccessResult(storeService.queryStoreById(id));
}
@GetMapping("storeInfoUni")
public ResponseObject storeInfoUni(Integer storeId){
LJStore store = storeService.selectStoreByIdUni(storeId);

View File

@ -17,6 +17,12 @@ public interface ILJStoreService extends IService<LJStore> {
*/
public LJStore selectStoreById();
/**
* 根据id查询店铺信息
* @return
*/
public LJStore queryStoreById(int id);
public LJStore selectStoreByIdUni(Integer storeId);
/**

View File

@ -35,6 +35,11 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
return store;
}
@Override
public LJStore queryStoreById(int id) {
return baseMapper.selectById(id);
}
/**
* 根据id查询店铺信息(小程序)
* @return

View File

@ -0,0 +1,44 @@
package com.fuint.business.userManager.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.Feedback;
import com.fuint.business.userManager.entity.FixingLevel;
import com.fuint.business.userManager.service.FeedbackService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/business/userManager/feedback")
public class FeedbackController extends BaseController {
@Autowired
private FeedbackService feedbackService;
/**
* 根据条件分页查询意见反馈信息
* @param feedback
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list")
public ResponseObject list(Feedback feedback,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<Feedback> list = feedbackService.selectFeedbackList(page,feedback);
return getSuccessResult(list);
}
/**
* 添加意见反馈信息
* @param feedback
* @return
*/
@PostMapping
public ResponseObject add(@RequestBody Feedback feedback){
return getSuccessResult(feedbackService.insertFeedback(feedback));
}
}

View File

@ -46,6 +46,23 @@ public class LJUserController extends BaseController {
return getSuccessResult(list);
}
/**
* 获取当前登录用户信息
* @return
*/
@GetMapping("/getUser")
public ResponseObject getUser(){
return getSuccessResult(userService.selectUserByUserId());
}
/**
* 根据storeId查询会员人数
*/
@GetMapping("/userNum")
public ResponseObject userNum(Integer storeId){
return getSuccessResult(userService.userNum(storeId));
}
/**
* 查询所有会员信息
* @return
@ -181,4 +198,14 @@ public class LJUserController extends BaseController {
public ResponseObject edit(@Validated @RequestBody LJUserVo user){
return getSuccessResult(userService.updateUser(user));
}
/**
* 修改会员信息
* @param user
* @return
*/
@PutMapping("/edit")
public ResponseObject editUser(@Validated @RequestBody LJUser user){
return getSuccessResult(userService.editUser(user));
}
}

View File

@ -0,0 +1,138 @@
package com.fuint.business.userManager.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuint.framework.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* 意见反馈表(Feedback)实体类
*
* @author makejava
* @since 2023-12-26 11:57:22
*/
@Data
@TableName("feedback")
@ApiModel(value = "Feedback对象", description = "意见反馈表")
public class Feedback extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 店铺id
*/
private Integer storeId;
/**
* 用户id
*/
private Integer userId;
/**
* 截图路径
*/
private String screenshotUrl;
/**
* 反馈内容
*/
private String content;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新人
*/
private String updateBy;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getScreenshotUrl() {
return screenshotUrl;
}
public void setScreenshotUrl(String screenshotUrl) {
this.screenshotUrl = screenshotUrl;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
}

View File

@ -48,9 +48,12 @@ public class LJUser extends BaseEntity implements Serializable {
@ApiModelProperty("称呼")
private String name;
@ApiModelProperty("微信")
@ApiModelProperty("微信open_id")
private String openId;
@ApiModelProperty("支付宝user_id")
private String userId;
@ApiModelProperty("手机号码")
private String mobile;

View File

@ -0,0 +1,17 @@
package com.fuint.business.userManager.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.Feedback;
import org.apache.ibatis.annotations.Param;
public interface FeedbackMapper extends BaseMapper<Feedback> {
/**
* 根据条件查询意见反馈信息
* @param page
* @param feedback
* @return
*/
public IPage<Feedback> selectFeedbackList(Page page,@Param("feedback") Feedback feedback);
}

View File

@ -72,4 +72,10 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
LJUserVo selectAllInfoById4Chain(@Param("userId") Integer userId, @Param("chainStoreId") Integer chainStoreId);
/**
* 查询公司人数
*/
Integer userNum(Integer storeId);
}

View File

@ -0,0 +1,26 @@
<?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="com.fuint.business.userManager.mapper.FeedbackMapper">
<sql id="selectFeedback">
select * from feedback
</sql>
<select id="selectFeedbackList" resultType="com.fuint.business.userManager.entity.Feedback">
<include refid="selectFeedback"></include>
<where>
<if test="feedback.storeId != null and feedback.storeId != ''">
and store_id = #{feedback.storeId}
</if>
<if test="feedback.userId != null and feedback.userId != ''">
and user_id = #{feedback.userId}
</if>
<if test="feedback.params.beginTime != null and feedback.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{feedback.params.beginTime},'%y%m%d')
</if>
<if test="feedback.params.endTime != null and feedback.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{feedback.params.endTime},'%y%m%d')
</if>
order by create_time desc
</where>
</select>
</mapper>

View File

@ -134,4 +134,12 @@
mi.storeId = #{storeId}
</where>
</select>
<select id="userNum" resultType="java.lang.Integer">
select count(*)
from
mt_user
<where>
mi.storeId = #{storeId}
</where>
</select>
</mapper>

View File

@ -0,0 +1,26 @@
package com.fuint.business.userManager.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.Feedback;
/**
* 意见反馈信息 业务层
*/
public interface FeedbackService extends IService<Feedback> {
/**
* 根据条件分页查询意见反馈信息
* @param page
* @param feedback
* @return
*/
IPage<Feedback> selectFeedbackList(Page page, Feedback feedback);
/**
* 添加意见反馈信息
* @param feedback
* @return
*/
int insertFeedback(Feedback feedback);
}

View File

@ -20,6 +20,20 @@ public interface LJUserService extends IService<LJUser> {
*/
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user);
Integer userNum(Integer storeId);
/**
* 查询当前登录的用户信息
* @return
*/
LJUser selectUserByUserId();
/**
*
* @return
*/
LJUser queryUserByUserId();
/**
* 查询所有会员信息
* @return
@ -83,6 +97,13 @@ public interface LJUserService extends IService<LJUser> {
*/
public int updateUser(LJUserVo user);
/**
* 登录用户修改会员信息自己修改
* @param user
* @return
*/
int editUser(LJUser user);
/**
* 等级清算规则
*/

View File

@ -0,0 +1,26 @@
package com.fuint.business.userManager.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.userManager.entity.Feedback;
import com.fuint.business.userManager.mapper.FeedbackMapper;
import com.fuint.business.userManager.service.FeedbackService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper,Feedback> implements FeedbackService {
@Override
public IPage<Feedback> selectFeedbackList(Page page, Feedback feedback) {
return baseMapper.selectFeedbackList(page,feedback);
}
@Override
public int insertFeedback(Feedback feedback) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
feedback.setUserId(nowAccountInfo.getId());
return baseMapper.insert(feedback);
}
}

View File

@ -78,7 +78,12 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
return baseMapper.selectById(id);
LJUserGrade ljUserGrade = baseMapper.selectById(id);
if (ljUserGrade.getStatus().equals("qy")){
return baseMapper.selectById(id);
}else {
return null;
}
}
return null;
}

View File

@ -22,6 +22,7 @@ import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
/**
@ -51,6 +52,28 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return ljUserIPage;
}
@Override
public Integer userNum(Integer storeId) {
// 构建查询条件
QueryWrapper queryWrapper = new QueryWrapper<>();
// 添加其他条件
queryWrapper.eq("store_id", storeId);
// 调用统计方法
return baseMapper.selectCount(queryWrapper);
}
@Override
public LJUser selectUserByUserId() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.selectById(nowAccountInfo.getId());
}
@Override
public LJUser queryUserByUserId() {
return null;
}
/**
* 查询所有会员信息
* @return
@ -107,12 +130,13 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectUserById(id);
}
@Override
public LJUserVo getByUniApp(Integer chainStoreId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.selectUserByIdUni(nowAccountInfo.getId(),chainStoreId);
LJUserVo ljUserVo = baseMapper.selectUserByIdUni(nowAccountInfo.getId(), chainStoreId);
return ljUserVo;
}
/**
@ -298,6 +322,11 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return row;
}
@Override
public int editUser(LJUser user) {
return baseMapper.updateById(user);
}
@Override
public void clearRule() {
List<LJUserVo> list = this.selectUsersList();

View File

@ -1,5 +1,6 @@
package com.fuint.common.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serializable;
@ -10,6 +11,8 @@ import java.io.Serializable;
* CopyRight https://www.fuint.cn
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
//@JsonIgnoreProperties({ "accountKey","accountName" })
public class UserInfo implements Serializable {
private Integer id;
private String storeId;

View File

@ -200,13 +200,12 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
account.setAccountStatus(1);
account.setRealName(tAccount.getRealName());
account.setRoleIds(tAccount.getRoleIds());
account.setStaffId(tAccount.getStaffId());
account.setMerchantId(tAccount.getMerchantId());
account.setStoreId(tAccount.getStoreId());
account.setCreateTime(new Date());
account.setUpdateTime(new Date());
account.setStoreId(tAccount.getStoreId());
account.setStaffId(tAccount.getStaffId());
account.setDeptId(tAccount.getDeptId());
account.setPassword(tAccount.getPassword());
this.entryptPassword(account);
int id = tAccountMapper.insert(account);

View File

@ -75,7 +75,8 @@ public class TokenUtil {
if (token == null || StringUtil.isEmpty(token)) {
return null;
}
Object loginInfo = RedisUtil.get(Constants.SESSION_USER + token);
// Object loginInfo = RedisUtil.get(Constants.SESSION_USER + token);
Object loginInfo = RedisUtil.get(Constants.SESSION_ADMIN_USER + token);
ObjectMapper objectMapper = new ObjectMapper();
UserInfo userInfo = objectMapper.convertValue(loginInfo, UserInfo.class);
if (userInfo != null && userInfo.getToken().equals(token)) {

View File

@ -0,0 +1,40 @@
package com.fuint.common.util;
import com.sun.jna.Library;
import com.sun.jna.Native;
public interface TscLibDll extends Library {
// TscLibDll INSTANCE = (TscLibDll) Native.loadLibrary("TSCLIB", TscLibDll.class);
TscLibDll INSTANCE = Native.load("TSCLIB", TscLibDll.class);
int about();
int openport(String pirnterName);
int closeport();
int sendcommand(String printerCommand);
// int sendBinaryData(byte[] printerCommand, int CommandLength);
int setup(String width, String height, String speed, String density, String sensor, String vertical, String offset);
int downloadpcx(String filename, String image_name);
int barcode(String x, String y, String type, String height, String readable, String rotation, String narrow, String wide, String code);
int printerfont(String x, String y, String fonttype, String rotation, String xmul, String ymul, String text);
int clearbuffer();
int printlabel(String set, String copy);
int windowsfont(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, String content);
int windowsfontUnicode(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, byte[] content);
int windowsfontUnicodeLengh(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, byte[] content, int length);
byte usbportqueryprinter();
}

View File

@ -0,0 +1,67 @@
package com.fuint.module.AlipayApi.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.module.AlipayApi.service.AlipayService1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("/clientApi/sign/alipayLogin")
public class AlipayController extends BaseController {
private Logger logger = LoggerFactory.getLogger(AlipayController.class);
@Autowired
private AlipayService1 alipayService;
@Autowired
private LJUserService userService;
/**
* 获取支付宝userId
* @param map
* @return
*/
@PostMapping("/getUserid")
public ResponseObject getUserId(@Validated @RequestBody Map<String,String> map) throws AlipayApiException {
String authCode = map.get("authCode");
JSONObject paramsObj = new JSONObject(map.isEmpty());
logger.info("微信授权登录参数:{}", map);
JSONObject userInfo = paramsObj.getJSONObject("userInfo");
String storeId = ObjectUtil.isEmpty(userInfo.get("storeId"))? "" : userInfo.get("storeId").toString();
if ("".equals(storeId)) return getFailureResult(0, "微信登录失败");
// 获取支付宝userid
AlipaySystemOauthTokenResponse alipayProfile = alipayService.getAlipayProfile(authCode);
String userId = alipayProfile.getUserId();
// 根据手机号查询用户信息
LJUser user = userService.selectUserByMobile(userInfo.get("phone").toString());
if (ObjectUtil.isNotEmpty(user)){
// 添加用户的支付宝userid
user.setUserId(userId);
userService.updateById(user);
}else {
LJUserVo ljUser = new LJUserVo();
ljUser.setMobile(userInfo.get("phone").toString());
userService.insertUser(ljUser);
}
return getSuccessResult("");
}
}

View File

@ -0,0 +1,8 @@
package com.fuint.module.AlipayApi.service;
import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
public interface AlipayService1 {
public AlipaySystemOauthTokenResponse getAlipayProfile(String code) throws AlipayApiException;
}

View File

@ -0,0 +1,62 @@
package com.fuint.module.AlipayApi.service.impl;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.request.AlipayUserInfoShareRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.alipay.api.response.AlipayUserInfoShareResponse;
import com.fuint.module.AlipayApi.service.AlipayService1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
@Service
public class AlipayServiceImpl1 implements AlipayService1 {
private static final Logger logger = LoggerFactory.getLogger(AlipayServiceImpl1.class);
@Autowired
private Environment env;
@Override
public AlipaySystemOauthTokenResponse getAlipayProfile(String authCode){
String alipayAppId = env.getProperty("alipay.appid");
String alipayPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJJM2nlUCidns6anNtGUiCL+J83kNL1nrr6hNktHkrX9bhR8LiBU3qBX+MkGDY4snlbdz+anGWu8YkcMlfBlAr82AsdIS9UTHh3lgsIAZTBZHgzZrxn7vwHfHI6Kw7uGZJbZ320JEG3s0KyvGiW0eqGuWI4BW+sD7b6JoLtNfBq+yF9ObOcs76rNCWz+04BmhCH7i6d8arK8NKgEiI9EjBThGjLRDFK1ryacKpz4UVvIXgxEW5w0MTjo/Q7gp2VLpwE/4jc8QfDFwmGU75L+nhK0rr1l0wwSo7svWFAXvberzMCGyuuLomuh2ldDfERJbIjg/qU66gx0EML1tgpVtFAgMBAAECggEARTArDJuwswXBH3Rq7SRvPza3NbXQD6eR9gjuZcTiyG4ecyMH/40bhK/nbFu+cEzh/HxTnIrI6Xmr+eBoxybhNXsgDu1ttjELUF8i7oftiN7rfJVd0P58CySgQXKYybw65lqF8enA8M1gdkxyYS1Z10igelBKyBwUak9LwBIpM0wrPIFrLhoxIEJC6QJ8EDnm6lKbytvcCa2mMZmtWs8oFxNA/SLRWtdEgHk4hslQVqq4R8B/xUy9Cu4kjdnVMHG2MqFXOiTas3gyKZLGN1ACBfpxxtyw0RAfX294ChV4SIvp10s1VqBFudcQeXeV5ph0NXP1eNt/8o3HIu0vjc0jAQKBgQD5ZtOR19M5vAcxJykh5u01CPdfz2LztqdinCpkBIpFviceW/k1euQFaWbOKdYFUrPnuLgX7Ds6dhSrkoL1+1RiVKUR6AtqIMa4fZJIMJWEPNNYWl8s6u6j11Dkd0B10g5+KV/kKLSlwFuBQnDyHw1ND+WKHqj9vkkzimzfcwedBQKBgQCMxao2IKX8CNjXDuryGkmXac0wxql0nN8AFHjCQGm16GPwlp805nAwsHKfJK45ACeixnWH9Cn6sje3yOUpCw6KG4OougRkrQEkQpoPVrZuXEcZ4j4Wg64VgW9tUAVH/WOV0VDnOBpsM8mbKsLLglb1H9Bx7813IX1pmhm93a0ZQQKBgD6U48/75T/eg7t8xSCBrtIZDuHWy1C2a6gd4bE5Rm0buvsuPwmBbchB248uBktNpmEmA+PU3kPcL3GiEQSibVlDPiyRGpQl51eSAuvkbRBCpxHLk4hU507rj5vUpLMr44Ea5rn80N+qtgtoXakTy6WjsIiJCwSpA/tP5+PmHGn1AoGASY/VhZmEA3OAFMnX3pH8GOKR9kYqMST0p28LN78/Pm7lIskjAxrUT601CJK7dE/vZnE848Gk2judQC38CnmbrHH6WAZ020NI0HD5XsCabotMIGuItG01YEmWN9JUIC16h8Ss+Vbo/9gEJ1CuIHjJBikM3S1J+lIG3lNH1l7r4MECgYEA2eAV0x55cmjC6VIMk3EAVUFbJ1LY1U9irmI6B5e7k/OVcdRksJfMRJwcquYVSfAk4hDrl7x0Qy36XELGvMe/hx07HxeAOXON8gL1b3UHP1zxvXb90YLHseHn9lssABsXS6Enyv3nrzqUi/uzBvpdDE2SRVS6nUr7Yyui6Yl+UPA=";
String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnwDxxSNpBKL8xjtU3leNBy9mIOMYOr0WgxGbCxTMfhUPka9nr8Hbt0GN+7ylNBmxCYvW8kmge4dCOLUPqseM9+HyF9R1NrWBB3zQPVqnD0mKCYr9cEgtx6/eU7oIK1FqAl0G+jNIT3IKWMSXEX09yPKJWS6zk7+FRzOzn11vShTFjmrqWdrisJgRsQ54PHhPkQz7xFojDRqIunlpICWUVA8GwUg02hm5ZEhxpMHEWoJZ6Dj1wPH2Vh4CpIT/mjtD+SvssCpT0/XOEDPajcMRfgoV8fyyN0JNQDVZdMZgSO4aRHQqhC3X5CBXSuv40hHnwjcDjsPcbVav5BtaPp3wPQIDAQAB";
String alipayAccessUrl = "https://openapi.alipay.com/gateway.do";
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setAlipayPublicKey(alipayPublicKey);
alipayConfig.setServerUrl(alipayAccessUrl);
alipayConfig.setAppId(alipayAppId);
alipayConfig.setPrivateKey(alipayPrivateKey);
alipayConfig.setFormat("json");
alipayConfig.setCharset("UTF-8");
alipayConfig.setSignType("RSA2");
try {
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
request.setGrantType("authorization_code");
request.setCode(authCode);
AlipaySystemOauthTokenResponse response = alipayClient.execute(request);
AlipayUserInfoShareRequest request2 = new AlipayUserInfoShareRequest();
AlipayUserInfoShareResponse response2 = alipayClient.execute(request2,response.getAccessToken());
if(response.isSuccess()){
logger.error("调用成功:" + response.getBody());
return response;
} else {
logger.error("调用失败");
}
}catch (Exception e){
logger.error("获取支付宝getAlipayProfile异常" + e.getMessage());
}
return null;
}
}

View File

@ -13,6 +13,7 @@ import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -63,6 +64,7 @@ public class SysDept extends BaseEntity
/** 子部门 */
@TableField(exist = false)
private List<SysDept> children = new ArrayList<SysDept>();
private String turnoverType;
private BigDecimal turnoverLimit;
private Date turnoverTime;
}

View File

@ -3,6 +3,7 @@ package com.fuint.system.user.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.common.dto.AccountDto;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.RoleDto;
@ -174,6 +175,9 @@ public class BackendAccountController extends BaseController {
@Resource
TAccountDutyMapper tAccountDutyMapper;
@Resource
MtStoreMapper mtStoreMapper;
/**
* 新增账户
*
@ -212,6 +216,12 @@ public class BackendAccountController extends BaseController {
if (!"3".equals(deptType) && "z001".equals(code) ) {
return getFailureResult(201, "用户角色与组织架构不匹配");
}
MtStore mtStore = new MtStore();
if ("3".equals(deptType)) {
// 查出storeId
mtStore = mtStoreMapper.selectById(Integer.parseInt(deptId));
}
AccountInfo accountInfo = tAccountService.getAccountByName(accountName);
@ -254,9 +264,11 @@ public class BackendAccountController extends BaseController {
tAccount.setPassword(password);
tAccount.setIsActive(1);
tAccount.setLocked(0);
tAccount.setStoreId(Integer.parseInt(storeId));
tAccount.setStoreId(mtStore.getId());
tAccount.setMerchantId(Integer.parseInt(merchantId));
tAccount.setStaffId(Integer.parseInt(staffId));
tAccount.setDeptId(Long.parseLong(deptId));
tAccount.setRoleIds(roleId);
tAccountService.createAccountInfo(tAccount, duties);

View File

@ -1,7 +1,9 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8081
server.port=8080
env.profile=dev
env.properties.path=D:/office/proj/oilSystem/fuintBackend/configure/
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
# \u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
@ -20,7 +22,7 @@ spring.servlet.multipart.max-request-size=10MB
# mybatis\u914D\u7F6E
mybatis-plus.mapper-locations = classpath*:/mapper/*Mapper.xml,classpath*:com/fuint/**/xml/*Mapper.xml
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0536\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
mybatis-plus.configuration.intercepts=com.example.MyInterceptor
# \u9ED8\u8BA4\u65F6\u95F4\u683C\u5F0F
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
@ -69,4 +71,4 @@ rocketmq.consumer.tags=anran-sync-tags,anran-async-tags
#rocketmq.consumer.consumeThreadMin=20
#rocketmq.consumer.consumeThreadMax=64
##???????????????1?
#rocketmq.consumer.consumeMessageBatchMaxSize=1
#rocketmq.consumer.consumeMessageBatchMaxSize=1

View File

@ -0,0 +1,118 @@
import com.fuint.common.util.TscLibDll;
import com.fuint.fuintApplication;
import com.sun.jna.Library;
import com.sun.jna.Native;
import javafx.print.Printer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import java.nio.charset.StandardCharsets;
@RunWith(SpringJUnit4ClassRunner.class)
//@RunWith(SpringRunner.class)
@SpringBootTest(classes = fuintApplication.class)
@Transactional
public class dyj {
private static final String LOAD_LIBRARY = "TSCLIB";
public interface TscLibDll extends Library {
TscLibDll INSTANCE = (TscLibDll) Native.loadLibrary("TSCLIB", TscLibDll.class);
// 以下为dll函数库支持的方法方法的作用与参数说明见附件dll函数库api文档
int about ();
int openport (String pirnterName);
int closeport ();
int sendcommand (String printerCommand);
int setup (String width,String height,String speed,String density,String sensor,String vertical,String offset);
int downloadpcx (String filename,String image_name);
int barcode (String x,String y,String type,String height,String readable,String rotation,String narrow,String wide,String code);
int printerfont (String x,String y,String fonttype,String rotation,String xmul,String ymul,String text);
int clearbuffer ();
int printlabel (String set, String copy);
int formfeed ();
int nobackfeed ();
int windowsfont (int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, String content);
}
@Test
public void tt() {
// TscLibDll.INSTANCE.openport("GP-58MB Series");
// System.loadLibrary(LOAD_LIBRARY);
System.setProperty("jna.encoding", "GBK");
// TscLibDll.INSTANCE.about();
// TscLibDll.INSTANCE.openport("TSC TTP-2410M");
TscLibDll.INSTANCE.openport("GP-58MB Series");
TscLibDll.INSTANCE.sendcommand("------------交班统计------------");
// // 2.设置打印机纸张规格
// TscLibDll.INSTANCE.setup("100", "100", "5", "8", "0", "0", "0");
// // 3.清除上次打印后的缓存
// TscLibDll.INSTANCE.clearbuffer();
// // 4.将字体写入暂存区准备打印
// TscLibDll.INSTANCE.printerfont ("100", "10", "3", "0", "1", "1", "(JAVA) DLL Test!!");
// // 5.调用打印机打印
// TscLibDll.INSTANCE.printlabel("1", "1");
// 6.断开和打印机的连接
TscLibDll.INSTANCE.closeport();
// TscLibDll.INSTANCE.sendcommand("REM ***** This is a test by JAVA. *****");
// TscLibDll.INSTANCE.sendcommand("PUTPCX 550,10,\"UL.PCX\"");
// TscLibDll.INSTANCE.barcode("100", "40", "128", "50", "1", "0", "2", "2", "123456789");
// TscLibDll.INSTANCE.windowsfont(400, 200, 48, 0, 3, 1, "arial", "DEG 0");
// TscLibDll.INSTANCE.windowsfont(400, 200, 48, 90, 3, 1, "arial", "DEG 90");
}
/**
* 蜂鸣
*/
public static void buzzing(Printer printer) {
// System.loadLibrary(LOAD_LIBRARY);
//
//// TscLibDll.INSTANCE.openport(printer.getName());
// TscLibDll.INSTANCE.openport("GP-58MB Series");
//
//// TscLibDll.INSTANCE.sendBinaryData(Command.BUZZING.getCommandBytes(), Command.BUZZING.getCommandBytes().length);
// TscLibDll.INSTANCE.closeport();
}
}
enum Command {
/** 切纸 */
CUT_PAPER(new byte[]{0x1D, 0x56, 1}),
/** 蜂鸣 */
BUZZING(new byte[]{0x1B,0x42,2,6 }),
/** 水平居中 */
ALINE_CENTER(new byte[]{0x1B,0x61,1 }),
/** 左对齐 */
ALINE_LEFT(new byte[]{0x1B,0x61,0 }),
/** 右对齐 */
ALINE_RIGHT(new byte[]{0x1B,0x61,2 }),
/** 行间距 */
LINE_HEIGHT_DEFAULT(new byte[]{0x1B,0x32}),
/** 横向跳格 */
SKIP_SPACE(new byte[]{0x1B,0x44,16,20,24,28 });
Command(byte[] commandBytes) {
this.commandBytes = commandBytes;
}
private byte[] commandBytes;
public byte[] getCommandBytes() {
return commandBytes;
}
}

View File

@ -6,6 +6,8 @@ import com.fuint.repository.model.TAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 后台账号 Mapper 接口
*
@ -14,4 +16,11 @@ import org.apache.ibatis.annotations.Param;
*/
public interface TAccountMapper extends BaseMapper<TAccount> {
IPage<TAccount> listAccount(Page page, @Param("accountInfo") TAccount accountInfo,@Param("ancestors") String ancestors);
// 根据storeId查询对应的站长
List<TAccount> getStationmasterByStoreId(TAccount tAccount);
}

View File

@ -42,6 +42,9 @@ public class MtUser implements Serializable {
@ApiModelProperty("微信open_id")
private String openId;
@ApiModelProperty("支付宝user_id")
private String userId;
@ApiModelProperty("手机号码")
private String mobile;

View File

@ -24,4 +24,17 @@
order by create_time desc
</select>
<select id="getStationmasterByStoreId" resultType="com.fuint.repository.model.TAccount">
select
ta.*
from
`t_account` ta
left join t_account_duty td on ta.acct_id = td.acct_id
where
ta.dept_id = #{deptId}
and td.duty_id = #{roleIds}
</select>
</mapper>

View File

@ -35,6 +35,22 @@
</properties>
<dependencies>
<!--打印的依赖start-->
<!-- <dependency>-->
<!-- <groupId>net.java.dev.jna</groupId>-->
<!-- <artifactId>jna</artifactId>-->
<!-- <version>3.2.5</version>-->
<!-- </dependency>-->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.10.0</version> <!-- 请使用最新版本 -->
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>

View File

@ -16,3 +16,12 @@ export function cashierOrder(id) {
method: 'get',
})
}
// 根据订单号查询油品订单信息
export function cashierOrderByOrderNo(data) {
return request({
url: '/business/oilOrder/orderNo',
method: 'post',
data: data
})
}

View File

@ -23,3 +23,11 @@ export function addHandoverApi(data) {
data: data
})
}
export function printLocallyApi(data) {
return request({
url: '/business/handoverRecord/printLocally',
method: 'post',
data: data
})
}

View File

@ -26,6 +26,15 @@ export function addLJGoods(data) {
})
}
// 新增油品订单信息
export function scanAppletQrCode(data) {
return request({
url: '/business/oilOrder/scanAppletQrCode',
method: 'post',
data: data
})
}
// 根据订单号查询油品订单信息
export function oilOrder(data) {
return request({

View File

@ -288,7 +288,7 @@
<div class="box-ge">
<div class="boloicon">油枪统计</div>
<div class="input-hui-frou">
<div></div>
<div></div>
<div>笔数</div>
<div>升数</div>
<div style="text-align: right">金额</div>
@ -371,8 +371,8 @@
<el-card >
<div class="bottom-xz">
<div class="anniu" v-if="handoverList && handoverList.baseInfo && handoverList.baseInfo.handoverPrem == 'yqx'" @click="shift">交班</div>
<div class="anniu-lv">云打印</div>
<div class="anniu-lv">本地打印</div>
<!-- <div class="anniu-lv">云打印</div> -->
<div class="anniu-lv" @click="printLocally()">本地打印</div>
<div ><el-link type="primary" @click="recording">交班记录</el-link></div>
</div>
</el-card>
@ -382,7 +382,7 @@
</template>
<script>
import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
import {addHandoverApi, getHandoverApi, printLocallyApi} from "@/api/cashier/handover";
import BigNumber from "bignumber.js";
import {removeUserId} from "@/utils/auth";
@ -412,23 +412,21 @@ import {removeUserId} from "@/utils/auth";
if (this.handoverList && this.handoverList.paymentAggregation) {
this.handoverList.paymentAggregation.forEach(res=> {
if (flag == 'fg') {
if (res.flag == 'fuel' || res.flag == 'card') {
let existingElementIndex = count.findIndex(item => item.payType === res.payType);
if (existingElementIndex !== -1) {
// let existingElement = count[existingElementIndex];
// paidAmount refundAmount
// existingElement.paidAmount = (Number(existingElement.paidAmount) || 0) + (Number(res.paidAmount) || 0);
// existingElement.refundAmount = (Number(existingElement.refundAmount) || 0) + (Number(res.refundAmount) || 0);
//
// existingElement.paidAmount = existingElement.paidAmount.toString();
// existingElement.refundAmount = existingElement.refundAmount.toString();
}else {
count.push(res);
}
if (res.flag == "card" || res.flag == "fuel") {
let flag2 = false;
count.forEach(coun => {
if (res.payType === coun.payType) {
coun.paidAmount += res.paidAmount;
flag2 = true;
}
});
if (!flag2) {
//
let newRes = { ...res };
count.push(newRes);
}
}
}
else if (res.flag == flag) {
}else if (res.flag == flag) {
count.push(res)
}
})
@ -468,7 +466,6 @@ import {removeUserId} from "@/utils/auth";
return count;
},
employeeStatistics() {
console.log("this.employeeStatistics",this.handoverList.employeeStatistics)
let count = [];
if (this.handoverList && this.handoverList.employeeStatistics) {
return this.handoverList.employeeStatistics
@ -498,6 +495,11 @@ import {removeUserId} from "@/utils/auth";
}
});
},
printLocally() {
printLocallyApi(this.handoverList).then(res=>{
})
},
//
shift() {
let msg = '交班并退出系统, 是否继续?'
@ -600,6 +602,8 @@ import {removeUserId} from "@/utils/auth";
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "card" || res.flag == "fuel") {
// console.log("222",res)
num = num.plus(new BigNumber(res.paidAmount));
}
});

View File

@ -72,7 +72,7 @@
<el-button
size="mini"
type="text"
@click="handleDetail(scope.row)"
@click="printLocally(scope.row.recordData)"
>补打交班单</el-button>
</template>
</el-table-column>
@ -94,7 +94,7 @@
</template>
<script>
import {getHandoverListApi} from "@/api/cashier/handover";
import {getHandoverListApi,printLocallyApi} from "@/api/cashier/handover";
import {getOrderApi,getStatisticsApi } from "@/api/cashier/integralOrder/order";
import Detail from '@/views/cashier/NewComponents/integralOrder/detail'
@ -185,6 +185,11 @@ export default {
},
this.dateRange = []
},
printLocally(data) {
printLocallyApi(data).then(res=>{
})
},
handleDetail(data){
this.openDetail = true
this.recordData = data.recordData;

View File

@ -4,7 +4,7 @@
<div class="box-center">
<div class="box-title">
交班统计
<el-button style="float: right ;margin-left: 5px" size="mini" type="primary" plain>打印交班单</el-button>
<el-button style="float: right ;margin-left: 5px" size="mini" type="primary" @click="printLocally()" plain>打印交班单</el-button>
</div>
<div class="box-ge">
<div class="input-box">
@ -370,7 +370,7 @@
</template>
<script>
import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
import {printLocallyApi,addHandoverApis} from "@/api/cashier/handover";
import BigNumber from "bignumber.js";
export default {
@ -390,6 +390,13 @@ import BigNumber from "bignumber.js";
// this.getHandover();
},
methods: {
printLocally() {
console.log("12312312312312312313213122222")
printLocallyApi(this.recordData).then(res=>{
})
},
// getHandover() {
// getHandoverApi().then(res=>{
// this.handoverList = res.data;
@ -397,6 +404,14 @@ import BigNumber from "bignumber.js";
// })
// },
getList(){
getHandoverListApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.dataList = res.data.records
this.total = res.data.total
})
},
//
recording() {
this.$router.push({
@ -407,28 +422,27 @@ import BigNumber from "bignumber.js";
});
},
paymentAggregation(flag) {
let count = [];
if (this.handoverList && this.handoverList.paymentAggregation) {
this.handoverList.paymentAggregation.forEach(res=> {
if (flag == 'fg') {
if (res.flag == 'fuel' || res.flag == 'card') {
let existingElementIndex = count.findIndex(item => item.payType === res.payType);
if (existingElementIndex !== -1) {
// let existingElement = count[existingElementIndex];
// paidAmount refundAmount
// existingElement.paidAmount = (Number(existingElement.paidAmount) || 0) + (Number(res.paidAmount) || 0);
// existingElement.refundAmount = (Number(existingElement.refundAmount) || 0) + (Number(res.refundAmount) || 0);
//
// existingElement.paidAmount = existingElement.paidAmount.toString();
// existingElement.refundAmount = existingElement.refundAmount.toString();
}else {
count.push(res);
if (res.flag == "card" || res.flag == "fuel") {
let flag2 = false;
count.forEach(coun => {
if (res.payType === coun.payType) {
coun.paidAmount += res.paidAmount;
flag2 = true;
}
});
if (!flag2) {
//
let newRes = { ...res };
count.push(newRes);
}
}
}
else if (res.flag == flag) {
}else if (res.flag == flag) {
count.push(res)
}
})

View File

@ -451,6 +451,7 @@
<!-- </el-radio-group>-->
<el-radio v-model="payType" v-for="item in payList"
:key="item.dictValue" :value="item.dictValue"
v-if="item.dictValue!='APPLET_CODE'"
:label="item.dictValue"
@input="returnMethod"
border>{{ item.dictLabel }}</el-radio>

View File

@ -788,7 +788,7 @@
import {listgoods} from "@/api/cashier/ljgoods";
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
import {getOilGun, getOilTank} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
@ -797,6 +797,7 @@
import {addHangBill} from "@/api/cashier/hangbill";
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
import {getSysConfig} from "@/api/staff/user/sysconfig";
import {cashierOrderByOrderNo} from "@/api/cashier/cashierorder";
const cityOptions = ['上海', '北京'];
export default {
@ -1463,7 +1464,7 @@
_this.oilOrder.forEach(item => {
let discount = {type: "", full: 0, reduce: 0, liters: 0}
if (item.type == "汽油") {
let gasolineRule = JSON.parse(response.data.gasolineRule);
let gasolineRule = JSON.parse(response.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
@ -1534,7 +1535,7 @@
}
}
if (item.type == "柴油") {
let dieselRule = JSON.parse(response.data.dieselRule);
let dieselRule = JSON.parse(response.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
@ -1605,7 +1606,7 @@
}
}
if (item.type == "天然气") {
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
let naturalGasRule = JSON.parse(response.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
if (response.data.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
@ -2291,6 +2292,23 @@
this.map.couponId = this.useCouponIds
let _this = this;
if (this.payType=="APPLET_CODE"){
this.loading = true;
scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success!=undefined){
setTimeout(function (){
_this.isPaySuccess = true;
this.loading = false;
_this.isPay = false;
_this.resetting1();
},3000)
}else {
this.$modal.msgError(resp.data.error)
}
})
return;
}
addLJGoods(_this.map).then( response => {
if (response.data.oilOrder!=null){
_this.orderNo = response.data.oilOrder.orderNo;
@ -2314,6 +2332,7 @@
})
this.loading = true;
_this.queryPayStatus();
// console.log(_this.isQuery)
let timer = setInterval(function () {
if (_this.isQuery == false) {
_this.loading = false;
@ -2324,7 +2343,10 @@
setTimeout(function (){
clearInterval(timer);
},30000)
_this.resetting1();
},
resetting1(){
let _this = this;
this.authCode = "";
if (_this.isPaySuccess == true){
_this.oilAmount = 0;
@ -2341,42 +2363,42 @@
};
this.map = {
allAmount:0,
//
authCode:'',
//
oilOrder:"",
//
goodsOrder:"",
//
payType:"WECHAT",
//
oilAmount:0,
//
goodsAmount:0,
//
oilActualPay:0,
//
goodsActualPay:0,
//
payUser:"",
//
oilDiscount:0,
//
goodsDiscount:0,
// id
couponId:"",
//
commissionAmount:0,
// 使
usePoint:0,
//
pointAmount:0,
//
terminal:"PC",
//
goodsNum:0,
//
consumeAmount:0,
//
authCode:'',
//
oilOrder:"",
//
goodsOrder:"",
//
payType:"WECHAT",
//
oilAmount:0,
//
goodsAmount:0,
//
oilActualPay:0,
//
goodsActualPay:0,
//
payUser:"",
//
oilDiscount:0,
//
goodsDiscount:0,
// id
couponId:"",
//
commissionAmount:0,
// 使
usePoint:0,
//
pointAmount:0,
//
terminal:"PC",
//
goodsNum:0,
//
consumeAmount:0,
};
},
updateRefuelMoney(){
@ -2400,7 +2422,8 @@
queryPayStatus(){
let _this = this;
_this.timer = setInterval(function (){
oilOrder({orderNo:_this.orderNo}).then( response => {
// "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.orderStatus == "unpaid"){
_this.isQuery = true;
@ -2453,6 +2476,7 @@
//
payMethod(payType){
this.map.payType = payType;
this.payType = payType;
},
//
getPayList(){

View File

@ -3,6 +3,8 @@
onLaunch: function() {
console.log('App Launch')
// #ifdef MP-WEIXIN
uni.setStorageSync("appltType","WECHAT")
console.log("微信")
//
uni.getUpdateManager().onCheckForUpdate(function(res) {
//
@ -36,6 +38,11 @@
}
});
// #endif
// #ifdef MP-ALIPAY
uni.setStorageSync("appltType","ALIPAY")
console.log("支付宝")
// #endif
},
onShow: function() {
console.log('App Show')

View File

@ -2,7 +2,7 @@
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://192.168.0.196:8081/',
baseUrl: 'http://192.168.1.4:8080/',
baseUrl: 'http://192.168.0.121:8080/',
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
imagesUrl: 'http://www.nuoyunr.com/lananRsc',

View File

@ -66,7 +66,8 @@
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ]
},
"mp-alipay" : {
"usingComponents" : true
"usingComponents" : true,
"appid" : "2021004130635045"
},
"mp-baidu" : {
"usingComponents" : true

View File

@ -170,6 +170,13 @@
"navigationStyle": "custom"
}
},
{
"path": "editUser/index",
"style": {
"navigationBarTitleText": "修改用户信息",
"navigationStyle": "custom"
}
},
{
"path": "Coupons/Coupons",
"style": {

View File

@ -8,11 +8,12 @@
<view class="my-top">
<view class="dis-box">
<view class="dis">
<view class="touxiang" @click="gosetup">
<image src="../../static/imgs/myx.png" mode=""></image>
<view class="touxiang" @click="goSetup">
<image v-if="user.avatar!='' && user.avatar!=null && user.avatar!=undefined" :src="baseUrl + user.avatar" mode=""></image>
<image v-else src="../../static/imgs/myx.png" mode=""></image>
</view>
<view class="">
<view class="user-tel">135****7106</view>
<view class="user-tel" @click="goSetup">{{user.mobile}}</view>
<view class="user-name" @click="gorefuel">蓝鲸加油站总站<uni-icons type="right" color="#c1c1ff"
size="12"></uni-icons> </view>
</view>
@ -21,12 +22,12 @@
size="16"></uni-icons></view>
</view>
<view class="my-top-box">
<view class="jg-box" @click="gomony()">
<view class="jg-box" @click="goMony()">
<view class="jg-box-title">储值余额</view>
<view class="jg-box-nmb">{{cardBalance || 0 }}</view>
</view>
<text style="color: #999999;">|</text>
<view class="jg-box" @click="gooil()">
<view class="jg-box" @click="goOil()">
<view class="jg-box-title">囤油升数</view>
<view class="jg-box-nmb">{{refuelMoney[0].refuelMoney || 0 }}</view>
</view>
@ -37,14 +38,14 @@
<view class="jg-box-nmb">{{cardsList.length || 0 }}</view>
</view>
<text style="color: #999999;">|</text>
<view class="jg-box" style="border: none;" @click="gointegral()">
<view class="jg-box" style="border: none;" @click="goIntegral()">
<view class="jg-box-title">我的积分</view>
<view class="jg-box-nmb">{{myPoints || 0 }}</view>
</view>
</view>
</view>
<view class="my-top-box" style="margin-top: 45px;">
<view class="centenr-sx" @click="gomyorder(0)">
<view class="centenr-sx" @click="goMyOrder(0)">
<view class="centenr-img">
<image src="../../static/my/dingdan.png" mode=""></image>
</view>
@ -54,7 +55,7 @@
</view>
<view class="centenr-sx" @click="gomyorder(1)">
<view class="centenr-sx" @click="goMyOrder(1)">
<view class="centenr-img">
<image src="../../static/my/dsy.png" mode=""></image>
</view>
@ -63,7 +64,7 @@
</view>
</view>
<view class="centenr-sx" @click="gomyorder(2)">
<view class="centenr-sx" @click="goMyOrder(2)">
<view class="centenr-img">
<image src="../../static/my/ywc.png" mode=""></image>
</view>
@ -71,7 +72,7 @@
已完成
</view>
</view>
<view class="centenr-sx" @click="gomyorder(3)">
<view class="centenr-sx" @click="goMyOrder(3)">
<view class="centenr-img">
<image src="../../static/my/dpj.png" mode=""></image>
</view>
@ -91,7 +92,7 @@
礼品卡
</view>
</view>
<view class="centenr-sx" @click="gotodaby">
<view class="centenr-sx" @click="goToDaby">
<view class="centenr-img">
<image src="../../static/my/jryj.png" mode=""></image>
</view>
@ -101,7 +102,7 @@
</view>
<view class="centenr-sx" @click="gowriteoff()">
<view class="centenr-sx" @click="goWriteoff()">
<view class="centenr-img">
<image src="../../static/my/jl.png" mode=""></image>
</view>
@ -110,7 +111,7 @@
</view>
</view>
<view class="centenr-sx" @click="gorecharge()">
<view class="centenr-sx" @click="goRecharge()">
<view class="centenr-img">
<image src="../../static/my/chongzhi.png" style="width: 30px;height: 30px; "></image>
</view>
@ -118,7 +119,7 @@
充值记录
</view>
</view>
<view class="centenr-sx" @click="goinvte()">
<view class="centenr-sx" @click="goInvte()">
<view class="centenr-img">
<image src="../../static/my/lp.png" style="width: 30px;height: 30px; "></image>
</view>
@ -134,7 +135,7 @@
积分商城
</view>
</view>
<view class="centenr-sx" @click="gocard()">
<view class="centenr-sx" @click="goCard()">
<view class="centenr-img">
<image src="../../static/my/kb.png"></image>
</view>
@ -142,7 +143,7 @@
子卡管理
</view>
</view>
<view class="centenr-sx" @click="gofeedback()">
<view class="centenr-sx" @click="goFeedback()">
<view class="centenr-img">
<image src="../../static/my/yj.png"></image>
</view>
@ -170,7 +171,9 @@
cardBalance: 0.00,
title: '',
msg: "3",
// url
baseUrl: this.$baseUrl,
user:{},
}
},
@ -180,10 +183,23 @@
onShow() {
this.getUserBalance();
this.getGiftRecords();
this.getUserInfoList()
this.getUserInfoList();
this.getUser()
},
methods: {
gomyorder(id) {
//
getUser(){
request({
url: 'business/userManager/user/getUser',
method: 'get',
}).then(res => {
if (res.data != null && res.data != "" && res.data != undefined) {
this.user = res.data
this.user.mobile = res.data.mobile.slice(0,3) + "****" + res.data.mobile.slice(res.data.mobile.length-5,res.data.mobile.length-1)
}
})
},
goMyOrder(id) {
uni.navigateTo({
url: '/pagesMy/myorder/myorder?id=' + id
})
@ -193,27 +209,27 @@
url: '/pagesHome/RechargeRecords/RechargeRecords'
})
},
gotodaby() {
goToDaby() {
uni.navigateTo({
url: '/pagesMy/today/today'
})
},
gointegral() {
goIntegral() {
uni.navigateTo({
url: '/pagesMy/integral/integral'
})
},
gooil() {
goOil() {
uni.navigateTo({
url: '/pagesMy/oilBalance/oilBalance'
})
},
gomony() {
goMony() {
uni.navigateTo({
url: '/pagesMy/moneyBalance/moneyBalance'
})
},
gosetup() {
goSetup() {
uni.navigateTo({
url: '/pagesMy/setup/index'
})
@ -223,12 +239,12 @@
url: '/pagesRefuel/pagesRefuel/index'
})
},
gowriteoff() {
goWriteoff() {
uni.navigateTo({
url: '/pagesMy/writeOff/writeOff'
})
},
gorecharge() {
goRecharge() {
uni.navigateTo({
url: '/pagesMy/Recharge/Recharge'
})
@ -238,12 +254,12 @@
url: '/pagesHome/PointsMall/PointsMall'
})
},
goinvte() {
goInvte() {
uni.navigateTo({
url: '/pagesMy/invite/invite'
})
},
gocard() {
goCard() {
uni.navigateTo({
url: '/pagesMy/CardManagement/CardManagement'
})
@ -253,7 +269,7 @@
url: '/pagesMy/VIP/vip'
})
},
gofeedback() {
goFeedback() {
uni.navigateTo({
url: '/pagesMy/feedback/feedback'
})
@ -263,7 +279,6 @@
url: '/business/userManager/user/getUserBalance',
method: 'get',
}).then(res => {
// console.log(res,111222)
if (res.code == 200) {
this.cardBalance = res.data.cardBalance,
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
@ -279,7 +294,6 @@
method: 'get',
params: this.query
}).then(res => {
// console.log(res)
if (res.code == 200) {
this.cardsList = res.data.records
}

View File

@ -18,7 +18,7 @@
<view class="top-hong">{{oilPrice}}/{{oilUnit}}</view>
</view>
</view>
<view class="" @click="goRefuel" style="width: 46%;font-size: 14px;">
<view class="" @click="goRefuel" style="width: 80px;font-size: 14px;">
<view class="bulu">切换站点 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
</view>
@ -92,7 +92,7 @@
<view class="box-oil2" :class=" {'xz' :sindex == index }"
v-for="(item,index) in staffList" :key="index"
@click="getSIndex(index,item.id)">
<text>{{item.realName}}员工</text>
<text>{{item.realName}}</text>
</view>
</view>
<tabbar></tabbar>
@ -265,7 +265,7 @@
method: 'get',
}).then((res)=>{
_this.oilNumberList = res.data;
if (res.data != null){
if (res.data != null && res.data!=""){
_this.getOilGun(res.data[0].numberId);
_this.oilPrice = res.data[0].gbPrice
_this.oilUnit = res.data[0].unit
@ -555,6 +555,8 @@
}
.box-oil2 {
width: 28%;
height: 25px;
line-height: 25px;
display: flex;
align-items: center;
justify-content: center;

View File

@ -16,22 +16,27 @@
<w-barcode :options="option"></w-barcode>
</view>
<view class="hui-size">
<text>2023 **** **** 5523</text>
<text>查看数字</text>
<!-- <text>2023 **** **** 5523</text> -->
<text>{{barCode}}</text>
<text @click="lookNumber">查看数字</text>
</view>
<view class="code-box">
<w-qrcode :options="options"></w-qrcode>
</view>
<view class="dis-size">
<u-icon name="reload" color="#2979ff" size="18"></u-icon>
<text style="margin-left: 10px;">0秒后自动刷新</text>
<u-icon name="reload" @click="refresh" color="#2979ff" size="18"></u-icon>
<!-- <u-count-down :timestamp="timestamp"></u-count-down> -->
<text style="margin-left: 10px;">
{{timestamp}}秒后自动刷新
</text>
</view>
<view class="bottom-box" @click="bottomShow()">
<view style="display: flex;align-items: center;">
<uni-icons type="wallet-filled" color="#2979ff" size="30"></uni-icons>
<view style="margin-left: 10px;">
<view class="">自动识别</view>
<view style="font-size: 14px; color: #666666;">根据账户自动识别的付款方式</view>
<view class="">{{value}}</view>
<view style="font-size: 14px; color: #666666;">优先使用此付款方式</view>
<!-- <view style="font-size: 14px; color: #666666;">根据账户自动识别的付款方式</view> -->
</view>
</view>
@ -52,12 +57,12 @@
<view class="title">请选择用户类型</view>
<view class="hui-size">如果付款失败尝试使用其他方式完成付款</view>
</view>
<view class="bottom-box">
<view class="bottom-box" v-for="(item,index) in deduction" :key="index" @click="choosePayMethod(item.value)">
<view style="display: flex;align-items: center;">
<uni-icons type="wallet-filled" color="#2979ff" size="30"></uni-icons>
<view style="margin-left: 10px;">
<view class="">自动识别</view>
<view style="font-size: 14px; color: #666666;">根据账户自动识别的付款方式</view>
<view class="">{{item.value}}</view>
<!-- <view style="font-size: 14px; color: #666666;">根据账户自动识别的付款方式</view> -->
</view>
</view>
@ -65,18 +70,18 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="bottom-box">
<!-- <view class="bottom-box">
<view style="display: flex;align-items: center;">
<uni-icons type="wallet-filled" color="#2979ff" size="30"></uni-icons>
<view style="margin-left: 10px;">
<view class="">自动识别</view>
<view class="">囤油卡</view>
<view style="font-size: 14px; color: #666666;">根据账户自动识别的付款方式</view>
</view>
</view>
<view class="">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view> -->
</view>
</u-popup>
@ -88,6 +93,7 @@
export default {
data() {
return {
timestamp: 60,
title: '',
show: false,
option: {
@ -99,17 +105,60 @@
code: 'https://qm.qq.com/cgi-bin/qm/qr?k=LKqML292dD2WvwQfAJXBUmvgbiB_TZWF&noverify=0', //
size: 460, // 460460rpx
},
deduction:[
{key:"balance",value:"储值卡扣款"},
{key:"oilStorageCard",value:"囤油卡扣款"},
],
value:"储值卡扣款",
barCode:"",
isLook:false,
}
},
onLoad() {
this.getBarCode()
this.getQrCode()
this.countdown()
},
components: {
},
methods: {
//
lookNumber(){
if (this.isLook){
this.barCode = this.option.code.slice(0,4) + " **** **** " + this.option.code.slice(this.option.code.length-5,this.option.code.length-1)
this.isLook = false
}else{
this.barCode = this.option.code.replace(/(.{4})/g, '$1 ')
this.isLook = true
}
// console.log(this.barCode)
},
//
countdown(){
let _this = this
setInterval(() => {
// countdown1
_this.timestamp--;
// 0
if(_this.timestamp === 0) {
_this.getBarCode()
_this.getQrCode()
_this.timestamp = 60
}
}, 1000);
},
//
refresh(){
this.getBarCode()
this.getQrCode()
this.timestamp = 60
},
//
choosePayMethod(val){
this.value = val
this.show = false
},
//
getBarCode(){
request({
@ -118,6 +167,7 @@
}).then(res => {
// console.log(res,111)
this.option.code = res.data
this.barCode = res.data.slice(0,4) + " **** **** " + res.data.slice(res.data.length-5,res.data.length-1)
})
},
//

View File

@ -101,9 +101,38 @@
},
goorder() {
uni.navigateTo({
url: '/pagesHome/order/order'
//
request({
url: '/business/userManager/user/getByUniApp',
method: 'get',
params: {
chainStoreId: uni.getStorageSync('chainStoreId')
}
}).then((res) => {
if (res.code == 200 && res.data) {
this.myPoints = res.data.points
if (res.data.points) {
if (!this.goodsInfo.exchangePoints) {
uni.navigateTo({
url: '/pagesHome/order/order'
})
} else if (res.data.points >= this.goodsInfo.exchangePoints) {
uni.navigateTo({
url: '/pagesHome/order/order'
})
} else {
//
uni.showToast({
icon: 'none',
title: "积分不足"
})
}
}
}
})
},
goback() {
uni.navigateBack()

View File

@ -62,6 +62,7 @@
<span
v-if="goodsInfo.exchangeMethod == '积分' || goodsInfo.exchangeMethod == '积分+金额' || goodsInfo.exchangeMethod == '积分+加钱购'">{{goodsInfo.exchangePoints}}积分</span>
<span v-if="goodsInfo.exchangeMethod == '积分+金额'">+</span>
<span
v-if="goodsInfo.exchangeMethod == '金额' || goodsInfo.exchangeMethod == '积分+金额'">{{goodsInfo.exchangeAmount}}</span>
@ -76,10 +77,12 @@
</view>
<view class="endbox">
<view style="color: #666666;font-size: 14px;">{{value}}件商品合计:</view>
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
<view v-if="allPoints>0" style="color: red;"> <text
style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
</view>
<span v-if="allAmout>0 && allPoints>0">+</span>
<view v-if="allAmout>0" style="color: red;"> <text
style="font-weight: bold;font-size: 20px;">+{{allAmout}}</text>
style="font-weight: bold;font-size: 20px;">{{allAmout}}</text>
</view>
</view>
</view>
@ -92,13 +95,14 @@
<view class="bottom-box">
<view class="">
<view style="color: red;">
<text style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
<text v-if="allAmout>0" style="font-weight: bold;font-size: 20px;">+{{allAmout}}</text>
<text v-if="allPoints>0" style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
<span v-if="allAmout>0 && allPoints>0">+</span>
<text v-if="allAmout>0" style="font-weight: bold;font-size: 20px;">{{allAmout}}</text>
</view>
<view style="color: #9d9d9d; font-size: 12px; ">积分账户{{myPoints}}</view>
</view>
<view class="andeniu">
<text @click="choose()">选择</text>
<view @click="choose()" class="andeniu">
<text>选择</text>
</view>
</view>
@ -223,7 +227,7 @@
storeId: _this.storeId,
},
}).then(res => {
if (res.code === 200) {
if (res.data.code === "error") {
console.log(res)
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
@ -242,22 +246,28 @@
})
},
fail: function(err) {
// request({
// url: "business/oilOrder/orderStatus",
// method: 'post',
// data: {
// "orderNo": res.data.data.orderNo,
// "status": "payFail"
// },
// }).then((res) => {
// uni.showToast({
// title: "!",
// icon: "error"
// })
// })
// console.log('fail:', err);
request({
url: "business/integral/integralOrders/editPayStatus",
method: 'post',
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail",
"storeId": -1
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
})
console.log('fail:', err);
}
});
} else {
uni.showToast({
title: "支付失败!",
icon: "error"
})
}
})
@ -298,10 +308,25 @@
console.log("deliveryData", deliveryData)
if (deliveryData.length >= 2) {
this.qhindex = index
} else if (deliveryData[0] == '到店自提') {
} else if (deliveryData[0] == '门店自提') {
console.log("index", index)
if (index == 1) {
uni.showToast({
title: "该商品只支持到店自提!",
icon: "none"
})
}
this.qhindex = 0
} else if (deliveryData[0] == '物流配送') {
this.qhindex = 1
if (index == 0) {
uni.showToast({
title: "该商品只支持物流配送!",
icon: "none"
})
}
}
@ -318,7 +343,11 @@
allData() {
this.allPoints = 0
this.allAmout = 0
let allPoints = new BigNumber(this.goodsInfo.exchangePoints)
let allPoints = new BigNumber(0)
if (this.goodsInfo.exchangePoints) {
allPoints = new BigNumber(this.goodsInfo.exchangePoints)
}
//
// if (this.value < 1) {
@ -328,7 +357,7 @@
allPoints = allPoints.times(value)
console.log("allPoints", allPoints)
if (this.goodsInfo.exchangeMethod == '积分+金额') {
if (this.goodsInfo.exchangeMethod == '积分+金额' || this.goodsInfo.exchangeMethod == '金额') {
let allAmout = new BigNumber(this.goodsInfo.exchangeAmount)
allAmout = allAmout.times(value)

View File

@ -9,7 +9,12 @@
<view class="top-box"></view>
<!-- 顶部区域 -->
<!-- #ifdef MP-WEIXIN -->
<button class="dl-box" open-type='getPhoneNumber' @getphonenumber="getPhone">手机号快捷登录</button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<button class="dl-box" open-type="getPhoneNumber" @getphonenumber="getUserLogin">手机号快捷登录</button>
<!-- #endif -->
<button class="kk-box" @click="goback">我再看看</button>
<view class="dbottom">
<view class="quanzi" v-if="qindex == false " @click="qindex =! qindex"></view>
@ -25,12 +30,14 @@
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
title: '',
qindex: false,
baseUrl: this.$baseUrl,
appltType:uni.getStorageSync("appltType"),
}
},
onLoad() {
@ -39,6 +46,44 @@
},
components: {},
methods: {
// userid
getUserLogin(e) {
// if (this.qindex == false) {
// uni.showToast({
// icon: "none",
// title: "",
// duration: 2000
// })
// return;
// }
console.log(e)
let _this = this;
my.getAuthCode({
scopes: 'auth_base',
success: res => {
const authCode = res.authCode;
console.log(res)
request({
url: "clientApi/sign/alipayLogin/getUserid",
method: 'post',
data: {
authCode:authCode,
userInfo: {
storeId: 0,
staffId: "",
phone: '18457621459'
},
},
}).then((resp)=>{
console.log(resp)
// uni.setStorageSync("userId",resp.data)
})
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
}
});
},
wxlogin() {},
getPhone(e) {
let that = this
@ -50,6 +95,7 @@
// })
// return;
// }
console.log(e)
uni.login({
provider: 'weixin',
success(res) {
@ -60,7 +106,7 @@
console.log('登录失败!' + res.errMsg)
}
console.log(e);
// console.log(e);
uni.checkSession({
success: () => {
uni.request({
@ -184,6 +230,7 @@
background: #2F72F7;
color: white;
border-radius: 50px;
margin: 0 auto;
}
.kk-box {

View File

@ -14,12 +14,12 @@
<view class="gang" :class="{ 'lan' : tindex == index }"></view>
</view>
</view>
<view class="hong-card">
<!-- <view class="hong-card">
<view class="top-hang">
<view class="hgang"></view>
<view class="">加油站名称</view>
</view>
<view class="title-box">屯油</view>
<view class="title-box">储值</view>
<view class="red-bottom">
<view class="x-size">
<view class="">卡券卡密</view>
@ -29,20 +29,37 @@
<span>去完成</span>
</view>
</view>
</view> -->
<view class="hong-card" v-for="item in list" :key="item.id">
<view class="top-hang">
<view class="hgang"></view>
<view class="">{{store.name}}{{store.description ? "("+store.description+")" : ""}}</view>
</view>
<view class="title-box">储值卡</view>
<view class="red-bottom">
<view class="x-size">
<view class="">子卡手机号</view>
<view class="">{{item.cardChildPhones}}</view>
</view>
<view class="r-anniu">
<span>去完成</span>
</view>
</view>
</view>
<view class="x_anniu" @click="goDetail()">
<uni-icons type="plusempty" color="#fff" size="30"></uni-icons>
</view>
<!-- <u-empty v-if="list.length == 0 " mode="coupon" text="内容为空"
<u-empty v-if="list.length == 0" mode="coupon" text="内容为空"
icon="http://cdn.uviewui.com/uview/empty/coupon.png">
</u-empty> -->
</u-empty>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
@ -56,16 +73,40 @@
},
],
list: []
list: [],
storeId: uni.getStorageSync("storeId"),
//
store:{},
}
},
onShow() {
this.getCardValueChildren()
this.getStore()
},
components: {
},
methods: {
//
getStore(){
request({
url: "business/storeInformation/store/"+this.storeId,
method: 'get',
}).then((res) => {
// console.log(res)
this.store = res.data
})
},
//
getCardValueChildren(){
request({
url: "cardValudChildrens/list",
method: 'get',
}).then((res) => {
// console.log(res)
this.list = res.data
})
},
tapindex(index) {
this.tindex = index
},

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">添加子卡</view>
<view class="my-icons"></view>
</view>
@ -10,10 +10,10 @@
<view class="input_">
<view class="">请输入手机号</view>
<view class="">
<input type="text" placeholder="请输入手机号" />
<input type="text" v-model="cardValueChildrens.cardChildPhones" placeholder="请输入手机号" />
</view>
</view>
<view class="anniu">
<view class="anniu" @click="submitCardValChildren">
<text>提交</text>
</view>
@ -23,12 +23,14 @@
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
title: '',
cardValueChildrens:{
cardChildPhones:"",
},
}
},
@ -36,7 +38,43 @@
},
methods: {
goback() {
//
submitCardValChildren(){
if(this.cardValueChildrens.cardChildPhones==""){
uni.showToast({
title:"请填写子卡手机号",
icon:"none"
})
return;
}
if(this.cardValueChildrens.cardChildPhones.length!=11){
uni.showToast({
title:"请填写正确的手机号",
icon:"none"
})
return;
}
request({
url: "cardValudChildrens",
method: 'post',
data:this.cardValueChildrens,
}).then((res) => {
console.log(res)
if (res.data.error != null && res.data.error != undefined && res.data.error != ""){
uni.showToast({
title:res.data.error,
icon:"none"
})
}else{
uni.showToast({
title:"添加成功",
icon:"success"
})
this.goBack()
}
})
},
goBack() {
uni.navigateBack()
}
}

View File

@ -0,0 +1,282 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">{{title}}</view>
<view class="my-icons"></view>
</view>
<!-- 修改用户昵称 -->
<view v-if="editType == 0" class="pBox">
<u-form :model="form" ref="uForm">
<u-form-item label="昵称" prop="name">
<u-input v-model="form.name" clearable :border="false" placeholder="请填写昵称"/>
</u-form-item>
</u-form>
<view class="but-sub" @click="submit">提交保存</view>
</view>
<!-- 修改用户手机号 -->
<view v-if="editType == 1" class="pBox">
<u-form :model="form" ref="uForm">
<u-form-item label="手机号" prop="mobile" label-width="70px">
<u-input v-model="mobile" clearable :border="false" placeholder="请填写手机号"/>
</u-form-item>
<u-form-item label="验证码" prop="code" label-width="70px">
<u-input v-model="code" clearable :border="false" placeholder="请填写验证码"/>
<u-button slot="right" :disabled="isCode" size="mini" type="success" @click="getCode">{{codeText}}</u-button>
</u-form-item>
</u-form>
<view class="but-sub" @click="submit">保存变更</view>
</view>
<!-- 修改用户车牌号 -->
<view v-if="editType == 2" class="pBox">
<view></view>
<u-form :model="form" ref="uForm">
<u-form-item label="车牌号" prop="mobile" label-width="70px">
<u-input v-model="form.carNo" @focus="show = true" clearable :border="false" placeholder="请输入车牌号"/>
</u-form-item>
</u-form>
<view class="but-sub" @click="submit">保存</view>
</view>
<!-- <u-keyboard ref="uKeyboard" :tips="value" mode="number" @cancel="show = false" @confirm="submitAmount" -->
<!-- @change="valChange" @backspace="backspace" v-model="pic" :show="show" mode="car"></u-keyboard> -->
<u-keyboard ref="uKeyboard" mode="car" v-model="value" :show="show" @cancel="show = false"
@confirm="submitAmount" @change="valChange" @backspace="backspace" :tips="value"></u-keyboard>
</view>
</view>
</template>
<script>
import request from "../../utils/request";
export default {
data() {
return {
pic:0,
value:"",
show:false,
//
title: '修改昵称',
//
editType:2,
//
form:{},
//
mobile: "",
//
code:"",
codeText: '获取验证码',
//
isCode:false,
timestamp:60,
rules: {
name: [
{
required: true,message: '请填写昵称',
//
trigger: 'blur,change'
}
],
mobile: [
{ required: true, message: '请输入手机号', trigger: ['change','blur'], },
{
//
validator: (rule, value, callback) => {
// truefalse
// this.$u.test.mobile()truefalse
return this.$u.test.mobile(value);
},
message: '手机号码不正确',
// blurchange
trigger: ['change','blur'],
}
]
}
}
},
onLoad(e) {
this.editType = e.editType
if (this.editType == 0){
this.title = "修改昵称"
}else if(this.editType == 1){
this.title = "修改手机号"
}else if(this.editType == 2){
this.title = "我的车"
}else{
this.title = "支付密码"
}
},
// onReadyonLoad
onReady() {
// this.$refs.uForm.setRules(this.rules);
},
onShow() {
this.getUser()
},
components: {
},
methods: {
//
submitAmount(){
if (this.value!=""){
this.show = false
}else{
uni.showToast({
title:"请输入车牌号",
icon:"error"
})
}
},
valChange(val) {
//
uni.vibrateShort({
success: function () {}
});
// value+=
this.value += val;
this.form.carNo += val;
},
// 退
backspace() {
uni.vibrateShort({
success: function () {}
});
// value
if (this.value.length) {
this.value = this.value.substr(0, this.value.length - 1);
this.form.carNo = this.value
}
},
// 60s
countdown(){
let _this = this
setInterval(() => {
// countdown1
_this.timestamp--;
_this.codeText = _this.timestamp+"秒重新获取"
// 0
if(_this.timestamp === 0) {
_this.isCode = false
_this.timestamp = 60
}
}, 1000);
},
//
getCode() {
this.isCode = true
//
this.countdown()
},
//
getUser(){
request({
url: 'business/userManager/user/getUser',
method: 'get',
}).then(res => {
if (res.data != null && res.data != "" && res.data != undefined) {
this.form = res.data
}
})
},
//
submit(){
// this.$refs.uForm.validate(valid => {
// if (valid) {
// console.log('');
request({
url: 'business/userManager/user/edit',
method: 'put',
data:this.form,
}).then(res => {
if (res.code == 200) {
uni.navigateTo({
url:"/pagesMy/setup/index"
})
}
})
// } else {
// console.log('');
// }
// });
},
goBack() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.pBox{
width: 90%;
margin: 0 auto;
}
.but-sub{
width: 100%;
height: 45px;
line-height: 45px;
margin: 0 auto;
margin-top: 20px;
background-color: #2b7aff;
color: white;
border-radius: 10px;
text-align: center;
}
.content {
background: white;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.box-hang {
background-color: white;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 15px 10px;
border-bottom: 1px solid #f4f5f6;
}
.touxiang {
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
// background-color: #f4f5f6;
}
.dis {
color: #a69999;
}
</style>

Some files were not shown because too many files have changed in this diff Show More