Browse Source

收费明细审核

lzm 2 years ago
parent
commit
ee54ff80df

+ 0 - 1
sp-admin/sa-view/tb-fee-statistics/month-statistcs-list.html

@@ -58,7 +58,6 @@
 				</div>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
-					<sa-td type="selection"></sa-td>
 					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="月份" prop="month" ></sa-td>

+ 79 - 0
sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html

@@ -87,6 +87,13 @@
 					<el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
 					<slot></slot>
 				</div>
+				<div class="fast-btn">
+					<el-button class="c-btn" type="success" icon="el-icon" @click="kaiDanConfirm()">开单确认</el-button>
+					<el-button class="c-btn" type="success" icon="el-icon" @click="diaoDuConfirm()">调度确认</el-button>
+					<el-button class="c-btn" type="success" icon="el-icon" @click="jiChaConfirm()">稽查确认</el-button>
+					<el-button class="c-btn" type="danger" icon="el-icon" @click="jiChaCancel()">取消确认</el-button>
+					<slot></slot>
+				</div>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
 					<sa-td type="selection"></sa-td>
@@ -143,6 +150,9 @@
 					<sa-td name="生成时间" prop="createTime" width="150px" ></sa-td>
 					<sa-td name="付款时间" prop="payTime"  width="150px" ></sa-td>
 					<sa-td name="备注" prop="remark" ></sa-td>
+					<sa-td name="开单员" prop="kaiDanPerson" width="80px" ></sa-td>
+					<sa-td name="现场调度员" prop="diaoDuPerson" width="80px" ></sa-td>
+					<sa-td name="统计稽查员" prop="jiChaPerson" width="80px" ></sa-td>
 
 <!--					<el-table-column label="操作" fixed="right"  width="240px">-->
 <!--						<template slot-scope="s">-->
@@ -242,6 +252,75 @@
 					},
 				},
 				methods: {
+					kaiDanConfirm(){
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						this.$confirm('确定进行开单确认操作?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+						}).then(() => {
+							sa.ajax('/TbFeeDetails/kaiDanConfirm', {ids: ids.join(',')}, function(res) {
+								this.f5();
+							}.bind(this))
+						}).catch(() => {
+
+						});
+					},
+					diaoDuConfirm(){
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						this.$confirm('确定进行调度确认操作?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+						}).then(() => {
+							sa.ajax('/TbFeeDetails/diaoDuConfirm', {ids: ids.join(',')}, function(res) {
+								this.f5();
+							}.bind(this))
+						}).catch(() => {
+
+						});
+					},
+					jiChaConfirm(){
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						this.$confirm('确定进行稽查确认操作?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+						}).then(() => {
+							sa.ajax('/TbFeeDetails/jiChaConfirm', {ids: ids.join(',')}, function(res) {
+								this.f5();
+							}.bind(this))
+						}).catch(() => {
+
+						});
+					},
+					jiChaCancel(){
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						this.$confirm('确定进行开单确认操作?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+							type: 'warning'
+						}).then(() => {
+							sa.ajax('/TbFeeDetails/jiChaCancel', {ids: ids.join(',')}, function(res) {
+								this.f5();
+							}.bind(this))
+						}).catch(() => {
+
+						});
+					},
 					print: function(data) {
 						this.$confirm('确定打印符合条件的数据?', '提示', {
 							confirmButtonText: '确定',

+ 6 - 8
sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html

@@ -62,7 +62,7 @@
 				</div>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
-					<sa-td type="selection"></sa-td>
+<!--					<sa-td type="selection"></sa-td>-->
 					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 <!--					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>-->
@@ -94,13 +94,11 @@
 						</template>
 					</el-table-column>
 					<sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
-<!--					<el-table-column label="操作" fixed="right"  width="240px">-->
-<!--						<template slot-scope="s">-->
-<!--							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>-->
-<!--							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
-<!--							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
-<!--						</template>-->
-<!--					</el-table-column>-->
+
+					<sa-td name="开单员" prop="kaiDanPerson" ></sa-td>
+					<sa-td name="现场调度员" prop="diaoDuPerson" ></sa-td>
+					<sa-td name="统计稽查员" prop="jiChaPerson" ></sa-td>
+
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
 				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>

+ 0 - 1
sp-admin/sa-view/tb-fee-statistics/year-statistcs-list.html

@@ -47,7 +47,6 @@
 				</div>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
-					<sa-td type="selection"></sa-td>
 					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="年份" prop="year"></sa-td>

+ 26 - 0
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java

@@ -175,6 +175,19 @@ public class TbFeeDetails implements Serializable {
     private String businessCarNo;
     private String outTradeNo;
 
+    /**
+     * 开单员
+     */
+    private String kaiDanPerson;
+    /**
+     * 统计稽查员
+     */
+    private String jiChaPerson;
+    /**
+     * 现场调度
+     */
+    private String diaoDuPerson;
+
 
 
     @Getter
@@ -202,6 +215,19 @@ public class TbFeeDetails implements Serializable {
         }
     }
 
+    @Getter
+    @AllArgsConstructor
+    //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)
+    public static enum personEnum{
+        JICHA(1,"统计稽查员"),
+        KAIDAN(2,"开单员"),
+        DIAODU(3,"现场调度员");
+
+        private int code;
+        private String desc;
+
+
+    }
 
 	
 

+ 25 - 0
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsController.java

@@ -91,6 +91,31 @@ public class TbFeeDetailsController {
         return AjaxJson.getSuccessData(tbFeeDetailsService.prePrint(so));
     }
 
+    @RequestMapping("kaiDanConfirm")
+    public AjaxJson kaiDanConfirm(){
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        tbFeeDetailsService.kaiDanConfirm(ids);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("diaoDuConfirm")
+    public AjaxJson diaoDuConfirm(){
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        tbFeeDetailsService.diaoDuConfirm(ids);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("jiChaConfirm")
+    public AjaxJson jiChaConfirm(){
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        tbFeeDetailsService.jiChaConfirm(ids);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("jiChaCancel")
+    public AjaxJson jiChaCancel(){
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        return AjaxJson.getSuccess();
+    }
+
+
     /** 重新计算接口,手动调用 */
     @RequestMapping("calcuAgain")
     public AjaxJson calcuAgain(){

+ 108 - 0
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -19,12 +19,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.wx.bo.PriceBO;
 import com.pj.current.config.MyConfig;
 import com.pj.current.config.PartConfig;
+import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_fee_statistics.TbFeeStatistics;
+import com.pj.project.tb_fee_statistics.TbFeeStatisticsService;
+import com.pj.project4sp.admin.SpAdmin;
+import com.pj.project4sp.global.BusinessException;
+import com.pj.project4sp.role.SpRole;
+import com.pj.project4sp.role.SpRoleMapper;
 import com.pj.project4sp.uploadfile.UploadUtil;
 import com.pj.utils.so.SoMap;
 import lombok.extern.slf4j.Slf4j;
@@ -63,6 +69,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     private MyConfig myConfig;
     @Resource
     private PartConfig partConfig;
+    @Resource
+    SpRoleMapper spRoleMapper;
+    @Resource
+    TbFeeStatisticsService tbFeeStatisticsService;
 
     /**
      * 增
@@ -399,4 +409,102 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 .setAllDayTaxes(allDayTaxes).setAllDayNoTaxFee(allDayNoTaxFee);
         return printData;
     }
+
+    public void jiChaConfirm(List<Long> ids) {
+        SpAdmin admin = StpUserUtil.getAdmin();
+        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
+        if(!StrUtil.equals(TbFeeDetails.personEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())){
+            throw new BusinessException("无操作权限");
+        }
+        List<TbFeeDetails> detailsList = this.listByIds(ids);
+        Set<String> days = new HashSet<>();
+        for (TbFeeDetails detail : detailsList) {
+            detail.setJiChaPerson(admin.getName());
+            String dayStr = DateUtil.format(detail.getCreateTime(), "yyyy-MM-dd");
+            days.add(dayStr);
+        }
+        this.updateBatchById(detailsList);
+        changeStats(days, TbFeeDetails.personEnum.JICHA.getDesc());
+    }
+
+    public void kaiDanConfirm(List<Long> ids) {
+        SpAdmin admin = StpUserUtil.getAdmin();
+        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
+        if(!StrUtil.equals(TbFeeDetails.personEnum.KAIDAN.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())){
+            throw new BusinessException("无操作权限");
+        }
+        List<TbFeeDetails> detailsList = this.listByIds(ids);
+        Set<String> days = new HashSet<>();
+        for (TbFeeDetails detail : detailsList) {
+            detail.setKaiDanPerson(admin.getName());
+            String dayStr = DateUtil.format(detail.getCreateTime(), "yyyy-MM-dd");
+            days.add(dayStr);
+        }
+        this.updateBatchById(detailsList);
+        changeStats(days, TbFeeDetails.personEnum.KAIDAN.getDesc());
+    }
+
+    public void diaoDuConfirm(List<Long> ids) {
+        SpAdmin admin = StpUserUtil.getAdmin();
+        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
+        if(!StrUtil.equals(TbFeeDetails.personEnum.DIAODU.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())){
+            throw new BusinessException("无操作权限");
+        }
+        List<TbFeeDetails> detailsList = this.listByIds(ids);
+        Set<String> days = new HashSet<>();
+        for (TbFeeDetails detail : detailsList) {
+            detail.setDiaoDuPerson(admin.getName());
+            String dayStr = DateUtil.format(detail.getCreateTime(), "yyyy-MM-dd");
+            days.add(dayStr);
+        }
+        this.updateBatchById(detailsList);
+        changeStats(days, TbFeeDetails.personEnum.DIAODU.getDesc());
+    }
+
+    private void changeStats(Set<String> days, String personType) {
+        String personColumn = "";
+        if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+            personColumn = "ji_cha_person";
+        }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+            personColumn = "kai_dan_person";
+        }else{
+            personColumn = "diao_du_person";
+        }
+        for (String day : days) {
+            QueryWrapper<TbFeeDetails> ew1 = new QueryWrapper<>();
+            ew1.like("create_time", day).isNotNull(personColumn);
+            List<TbFeeDetails> confirmList = this.list(ew1);
+            QueryWrapper<TbFeeDetails> ew2 = new QueryWrapper<>();
+            ew2.like("create_time", day);
+            Integer thisDayTotal = tbFeeDetailsMapper.selectCount(ew2);
+            if(confirmList.size() == thisDayTotal){
+                Set<String> names = new TreeSet<>();
+                for (TbFeeDetails detail : confirmList) {
+                    if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+                        names.add(detail.getJiChaPerson());
+                    }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+                        names.add(detail.getKaiDanPerson());
+                    }else{
+                        names.add(detail.getDiaoDuPerson());
+                    }
+                }
+                String personName = StrUtil.join(",", names);
+                QueryWrapper<TbFeeStatistics> ew3= new QueryWrapper<>();
+                ew3.eq("day_time", day);
+                List<TbFeeStatistics> statsList = tbFeeStatisticsService.list(ew3);
+                for (TbFeeStatistics thisDayStats : statsList) {
+                    if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+                        thisDayStats.setJiChaPerson(personName);
+                    }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+                        thisDayStats.setKaiDanPerson(personName);
+                    }else{
+                        thisDayStats.setDiaoDuPerson(personName);
+                    }
+                }
+                tbFeeStatisticsService.updateBatchById(statsList);
+            }else{
+                continue;
+            }
+        }
+    }
 }

+ 13 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatistics.java

@@ -109,6 +109,19 @@ public class TbFeeStatistics implements Serializable {
 	 */
     private Integer payType;
 
+    /**
+     * 开单员
+     */
+    private String kaiDanPerson;
+    /**
+     * 统计稽查员
+     */
+    private String jiChaPerson;
+    /**
+     * 现场调度
+     */
+    private String diaoDuPerson;
+
     @TableField(exist = false)
     private BigDecimal statisticsMoney = new BigDecimal(0);