Merge remote-tracking branch 'origin/master'

jg-waiwang-pro
胡川虎 4 months ago
commit c33c5c9909

@ -26,30 +26,32 @@
FROM FROM
( (
SELECT SELECT
COUNT( b.id ) AS avgPurchasePrice, COUNT( a1.id ) AS avgPurchasePrice,-- 磅单采购数
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS todayPurchasePrice IFNULL( SUM( Round( IF ( a2.unit = '千克', a2.net_weight / 1000, net_weight ), 3 )), 0 ) AS todayPurchasePrice
FROM FROM
jg_receipt_order a jg_voucher a1
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id LEFT JOIN jg_voucher_product a2 ON a1.id = a2.voucher_id
AND b.f_delete_mark IS NULL
WHERE WHERE
to_days( a.f_creator_time ) = to_days( to_days( a1.f_creator_time ) = to_days(
now()) now())
AND a.f_delete_mark IS NULL AND a1.business_type = 1
AND a.receipt_type = '1' AND a1.document_type = 1
AND a1.poundlist_time IS NOT NULL
AND a1.f_delete_mark IS NULL
) a, ) a,
( (
SELECT SELECT
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS salesVolumeToday IFNULL( SUM( Round( IF ( a2.unit = '千克', a2.net_weight / 1000, net_weight ), 3 )), 0 ) AS salesVolumeToday
FROM FROM
jg_delivery_order a jg_voucher a1
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id LEFT JOIN jg_voucher_product a2 ON a1.id = a2.voucher_id
AND b.f_delete_mark IS NULL
WHERE WHERE
to_days( a.f_creator_time ) = to_days( to_days( a1.f_creator_time ) = to_days(
now()) now())
AND a.f_delete_mark IS NULL AND a1.business_type = 2
AND a.delivery_type = '2' AND a1.document_type = 2
AND a1.poundlist_time IS NOT NULL
AND a1.f_delete_mark IS NULL
) b, ) b,
( (
SELECT SELECT

@ -2,6 +2,51 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.CwaccountMapper"> <mapper namespace="jnpf.mapper.CwaccountMapper">
<resultMap id="cwaccount" type="jnpf.entity.CwaccountEntity">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="type" property="type"/>
<result column="account_subject_type" property="accountSubjectType"/>
<result column="account_subject_id" property="accountSubjectId"/>
<result column="account_subject_name" property="accountSubjectName"/>
<result column="account_state" property="accountState"/>
<result column="contract_id" property="contractId"/>
<result column="contract_code" property="contractCode"/>
<result column="docment_num" property="docmentNum"/>
<result column="poundlist_num" property="poundlistNum"/>
<result column="product_num" property="productNum"/>
<result column="account_amount" property="accountAmount"/>
<result column="f_creator_time" property="creatorTime"/>
<result column="f_creator_user_id" property="creatorUserId"/>
<result column="f_last_modify_time" property="lastModifyTime"/>
<result column="f_last_modify_user_id" property="lastModifyUserId"/>
<result column="business_type" property="businessType"/>
<result column="summary_type" property="summaryType"/>
<result column="realName" property="realName"/>
<result column="realNameA" property="realNameA"/>
<result column="settlementSum" property="settlementSum"/>
</resultMap>
<select id="queryCwaccount" resultMap="cwaccount">
SELECT
a.*,
i.f_real_name AS realName,
i1.f_real_name AS realNameA,
SUM( b.settlement_sum ) AS settlementSum
FROM
jg_cw_account a
LEFT JOIN jg_cw_account_summary b ON a.id = b.account_id
LEFT JOIN base_user i ON i.f_Id = a.f_creator_user_id
AND i.f_delete_mark
IS NULL LEFT JOIN base_user i1 ON i1.f_Id = a.f_last_modify_user_id
AND i1.f_delete_mark
${ew.customSqlSegment}
GROUP BY
a.id
<if test="cwaccountPagination.sidx != null and cwaccountPagination.sidx != ''">
ORDER BY ${cwaccountPagination.sidx} ${cwaccountPagination.sort}
</if>
</select>
</mapper> </mapper>

@ -1,8 +1,13 @@
package jnpf.mapper; package jnpf.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.entity.CwaccountEntity; import jnpf.entity.CwaccountEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.model.cwaccount.CwaccountPagination;
import org.apache.ibatis.annotations.Param;
/** /**
* Cwaccount * Cwaccount
@ -13,4 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface CwaccountMapper extends BaseMapper<CwaccountEntity> { public interface CwaccountMapper extends BaseMapper<CwaccountEntity> {
IPage<CwaccountEntity> queryCwaccount(@Param("page") Page<CwaccountEntity> page, @Param("cwaccountPagination") CwaccountPagination cwaccountPagination, @Param("ew") Wrapper<CwaccountEntity> cwaccountueryWrapper);
} }

@ -18,7 +18,6 @@ import org.apache.ibatis.annotations.Param;
*/ */
public interface CwsettlementMapper extends BaseMapper<CwsettlementEntity> { public interface CwsettlementMapper extends BaseMapper<CwsettlementEntity> {
//采购订单查询
IPage<CwsettlementEntity> queryCwsettlement(@Param("page") Page<CwsettlementEntity> page, @Param("cwsettlementPagination") CwsettlementPagination cwsettlementPagination, @Param("ew") Wrapper<CwsettlementEntity> cwsettlementQueryWrapper); IPage<CwsettlementEntity> queryCwsettlement(@Param("page") Page<CwsettlementEntity> page, @Param("cwsettlementPagination") CwsettlementPagination cwsettlementPagination, @Param("ew") Wrapper<CwsettlementEntity> cwsettlementQueryWrapper);

@ -30,6 +30,9 @@ import jnpf.util.*;
import java.util.*; import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/** /**
* *
* Cwaccount * Cwaccount
@ -41,7 +44,7 @@ import jnpf.permission.entity.UserEntity;
@Service @Service
public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, CwaccountEntity> implements CwaccountService{ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, CwaccountEntity> implements CwaccountService{
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil2 generaterSwapUtil;
@Autowired @Autowired
private UserProvider userProvider; private UserProvider userProvider;
@ -56,6 +59,8 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
private CwaccountvoucherService cwaccountvoucherService; private CwaccountvoucherService cwaccountvoucherService;
@Autowired @Autowired
private CwaccountsummaryService cwaccountsummaryService; private CwaccountsummaryService cwaccountsummaryService;
@Resource
private CwaccountMapper cwaccountMapper;
@Override @Override
public List<CwaccountEntity> getList(CwaccountPagination cwaccountPagination){ public List<CwaccountEntity> getList(CwaccountPagination cwaccountPagination){
return getTypeList(cwaccountPagination,cwaccountPagination.getDataType()); return getTypeList(cwaccountPagination,cwaccountPagination.getDataType());
@ -349,13 +354,23 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
} }
} }
if(isPc){ if(isPc){
if(ObjectUtil.isNotEmpty(cwaccountPagination.getSettlementSum())){
cwaccountNum++;
String value = cwaccountPagination.getCode() instanceof List ?
JsonUtil.getObjectToString(cwaccountPagination.getSettlementSum()) :
String.valueOf(cwaccountPagination.getSettlementSum());
cwaccountQueryWrapper.like("b.settlement_sum",value);
}
if(ObjectUtil.isNotEmpty(cwaccountPagination.getCode())){ if(ObjectUtil.isNotEmpty(cwaccountPagination.getCode())){
cwaccountNum++; cwaccountNum++;
String value = cwaccountPagination.getCode() instanceof List ? String value = cwaccountPagination.getCode() instanceof List ?
JsonUtil.getObjectToString(cwaccountPagination.getCode()) : JsonUtil.getObjectToString(cwaccountPagination.getCode()) :
String.valueOf(cwaccountPagination.getCode()); String.valueOf(cwaccountPagination.getCode());
cwaccountQueryWrapper.lambda().like(CwaccountEntity::getCode,value); cwaccountQueryWrapper.like("a.code",value);
} }
@ -366,8 +381,8 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
Long fir = Long.valueOf(String.valueOf(PreparationTimeList.get(0))); Long fir = Long.valueOf(String.valueOf(PreparationTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(PreparationTimeList.get(1))); Long sec = Long.valueOf(String.valueOf(PreparationTimeList.get(1)));
cwaccountQueryWrapper.ge("f_creator_time", new Date(fir)) cwaccountQueryWrapper.ge("a.f_creator_time", new Date(fir))
.le("f_creator_time", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); .le("a.f_creator_time", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
} }
@ -375,31 +390,31 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
if(ObjectUtil.isNotEmpty(cwaccountPagination.getType())){ if(ObjectUtil.isNotEmpty(cwaccountPagination.getType())){
cwaccountNum++; cwaccountNum++;
cwaccountQueryWrapper.lambda().eq(CwaccountEntity::getType,cwaccountPagination.getType()); cwaccountQueryWrapper.eq("a.type",cwaccountPagination.getType());
} }
if(ObjectUtil.isNotEmpty(cwaccountPagination.getBusinessType())){ if(ObjectUtil.isNotEmpty(cwaccountPagination.getBusinessType())){
cwaccountNum++; cwaccountNum++;
cwaccountQueryWrapper.lambda().eq(CwaccountEntity::getBusinessType,cwaccountPagination.getBusinessType()); cwaccountQueryWrapper.eq("a.business_type",cwaccountPagination.getBusinessType());
} }
if(cwaccountPagination.getContractCodeList() != null && cwaccountPagination.getContractCodeList().size() > 0){ if(cwaccountPagination.getContractCodeList() != null && cwaccountPagination.getContractCodeList().size() > 0){
cwaccountNum++; cwaccountNum++;
cwaccountQueryWrapper.lambda().in(CwaccountEntity::getContractCode,cwaccountPagination.getContractCodeList()); cwaccountQueryWrapper.in("a.contract_code",cwaccountPagination.getContractCodeList());
} }
if(ObjectUtil.isNotEmpty(cwaccountPagination.getAccountState())){ if(ObjectUtil.isNotEmpty(cwaccountPagination.getAccountState())){
cwaccountNum++; cwaccountNum++;
cwaccountQueryWrapper.lambda().eq(CwaccountEntity::getAccountState,cwaccountPagination.getAccountState()); cwaccountQueryWrapper.eq("a.account_state",cwaccountPagination.getAccountState());
} }
if(cwaccountPagination.getExcludeIdList() != null && cwaccountPagination.getExcludeIdList().size() > 0){ if(cwaccountPagination.getExcludeIdList() != null && cwaccountPagination.getExcludeIdList().size() > 0){
cwaccountNum++; cwaccountNum++;
cwaccountQueryWrapper.lambda().notIn(CwaccountEntity::getId,cwaccountPagination.getExcludeIdList()); cwaccountQueryWrapper.notIn("a.id",cwaccountPagination.getExcludeIdList());
} }
@ -409,7 +424,7 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
String value = cwaccountPagination.getAccountSubjectName() instanceof List ? String value = cwaccountPagination.getAccountSubjectName() instanceof List ?
JsonUtil.getObjectToString(cwaccountPagination.getAccountSubjectName()) : JsonUtil.getObjectToString(cwaccountPagination.getAccountSubjectName()) :
String.valueOf(cwaccountPagination.getAccountSubjectName()); String.valueOf(cwaccountPagination.getAccountSubjectName());
cwaccountQueryWrapper.lambda().like(CwaccountEntity::getAccountSubjectName,value); cwaccountQueryWrapper.like("a.account_subject_name",value);
} }
@ -419,7 +434,7 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
String value = cwaccountPagination.getAccountSubjectType() instanceof List ? String value = cwaccountPagination.getAccountSubjectType() instanceof List ?
JsonUtil.getObjectToString(cwaccountPagination.getAccountSubjectType()) : JsonUtil.getObjectToString(cwaccountPagination.getAccountSubjectType()) :
String.valueOf(cwaccountPagination.getAccountSubjectType()); String.valueOf(cwaccountPagination.getAccountSubjectType());
cwaccountQueryWrapper.lambda().like(CwaccountEntity::getAccountSubjectType,value); cwaccountQueryWrapper.like("a.account_subject_type",value);
} }
@ -474,7 +489,7 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
if (intersection.size()==0){ if (intersection.size()==0){
intersection.add("jnpfNullList"); intersection.add("jnpfNullList");
} }
cwaccountQueryWrapper.lambda().in(CwaccountEntity::getId, intersection); cwaccountQueryWrapper.in("a.id", intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)){ if (StringUtil.isNotEmpty(superOp)){
@ -482,7 +497,7 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
} }
List<String> finalAllSuperIDlist = allSuperIDlist; List<String> finalAllSuperIDlist = allSuperIDlist;
cwaccountQueryWrapper.lambda().and(t->t.in(CwaccountEntity::getId, finalAllSuperIDlist)); cwaccountQueryWrapper.and(t->t.in("a.id", finalAllSuperIDlist));
} }
//是否有数据过滤查询 //是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){ if (StringUtil.isNotEmpty(ruleOp)){
@ -490,14 +505,16 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
} }
List<String> finalAllRuleIDlist = allRuleIDlist; List<String> finalAllRuleIDlist = allRuleIDlist;
cwaccountQueryWrapper.lambda().and(t->t.in(CwaccountEntity::getId, finalAllRuleIDlist)); cwaccountQueryWrapper.and(t->t.in("a.id", finalAllRuleIDlist));
} }
//假删除标志 //假删除标志
cwaccountQueryWrapper.lambda().isNull(CwaccountEntity::getDeleteMark); // cwaccountQueryWrapper.lambda().isNull(CwaccountEntity::getDeleteMark);
cwaccountQueryWrapper.isNull("a.f_delete_mark");
//排序 //排序
if(StringUtil.isEmpty(cwaccountPagination.getSidx())){ if(StringUtil.isEmpty(cwaccountPagination.getSidx())){
cwaccountQueryWrapper.lambda().orderByDesc(CwaccountEntity::getCreatorTime); // cwaccountQueryWrapper.lambda().orderByDesc(CwaccountEntity::getCreatorTime);
cwaccountPagination.setSidx("a.f_creator_time");
cwaccountPagination.setSort("DESC");
}else{ }else{
try { try {
String sidx = cwaccountPagination.getSidx(); String sidx = cwaccountPagination.getSidx();
@ -506,7 +523,9 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
Field declaredField = cwaccountEntity.getClass().getDeclaredField(strs[0]); Field declaredField = cwaccountEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true); declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value(); String value = declaredField.getAnnotation(TableField.class).value();
cwaccountQueryWrapper="asc".equals(cwaccountPagination.getSort().toLowerCase())?cwaccountQueryWrapper.orderByAsc(value):cwaccountQueryWrapper.orderByDesc(value); // cwaccountQueryWrapper="asc".equals(cwaccountPagination.getSort().toLowerCase())?cwaccountQueryWrapper.orderByAsc(value):cwaccountQueryWrapper.orderByDesc(value);
cwaccountPagination.setSidx("a." + value);
} catch (NoSuchFieldException e) { } catch (NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -516,9 +535,11 @@ public class CwaccountServiceImpl extends ServiceImpl<CwaccountMapper, Cwaccount
if((total>0 && AllIdList.size()>0) || total==0){ if((total>0 && AllIdList.size()>0) || total==0){
Page<CwaccountEntity> page=new Page<>(cwaccountPagination.getCurrentPage(), cwaccountPagination.getPageSize()); Page<CwaccountEntity> page=new Page<>(cwaccountPagination.getCurrentPage(), cwaccountPagination.getPageSize());
if("1".equals(cwaccountPagination.getQueryFlowTaskPass())){ if("1".equals(cwaccountPagination.getQueryFlowTaskPass())){
cwaccountQueryWrapper.inSql("id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'"); cwaccountQueryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");
} }
IPage<CwaccountEntity> userIPage=this.page(page, cwaccountQueryWrapper); // IPage<CwaccountEntity> userIPage=this.page(page, cwaccountQueryWrapper);
IPage<CwaccountEntity> userIPage = cwaccountMapper.queryCwaccount(page,cwaccountPagination,cwaccountQueryWrapper);
return cwaccountPagination.setData(userIPage.getRecords(),userIPage.getTotal()); return cwaccountPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{ }else{
List<CwaccountEntity> list = new ArrayList(); List<CwaccountEntity> list = new ArrayList();

@ -121,7 +121,7 @@ public class CwaccountController {
realList.add(cwaccountMap); realList.add(cwaccountMap);
} }
//数据转换 //数据转换
realList = generaterSwapUtil.swapDataList(realList, CwaccountConstant.getFormData(), CwaccountConstant.getColumnData(), cwaccountPagination.getModuleId(),false); // realList = generaterSwapUtil.swapDataList(realList, CwaccountConstant.getFormData(), CwaccountConstant.getColumnData(), cwaccountPagination.getModuleId(),false);
//流程状态添加 //流程状态添加
for(Map<String, Object> vo:realList){ for(Map<String, Object> vo:realList){

@ -70,4 +70,13 @@ public class CwaccountEntity {
private Integer version; private Integer version;
@TableField(value = "summary_type" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "summary_type" , updateStrategy = FieldStrategy.IGNORED)
private String summaryType; private String summaryType;
@TableField(exist = false)
private String realName;
@TableField(exist = false)
private String realNameA;
@TableField(exist = false)
private String settlementSum;
} }

@ -51,4 +51,7 @@ public class CwaccountPagination extends Pagination {
private String queryFlowTaskPass; private String queryFlowTaskPass;
@JsonProperty("preparationTime") @JsonProperty("preparationTime")
private Object preparationTime; private Object preparationTime;
@JsonProperty("settlementSum")
private Object settlementSum;
} }

@ -27,6 +27,14 @@
<el-input v-model="query.accountSubjectName" placeholder="请输入" clearable> </el-input> <el-input v-model="query.accountSubjectName" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="结算数量">
<el-input v-model="query.settlementSum" placeholder="请输入" clearable>
</el-input>
</el-form-item>
</el-col>
<template v-if="showAll"> <template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="对账主体类型"> <el-form-item label="对账主体类型">
@ -109,6 +117,10 @@
</el-table-column> </el-table-column>
<el-table-column prop="productNum" label="商品种类" align="center" width="150"> <el-table-column prop="productNum" label="商品种类" align="center" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="settlementSum" label="结算重量" align="center" width="150">
</el-table-column>
<el-table-column prop="accountAmount" label="对账合计(含税)" align="center" width="150"> <el-table-column prop="accountAmount" label="对账合计(含税)" align="center" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="creatorUserId" label="创建用户" align="center" width="150"> <el-table-column prop="creatorUserId" label="创建用户" align="center" width="150">
@ -238,6 +250,8 @@ export default {
accountSubjectName: undefined, accountSubjectName: undefined,
accountSubjectType: undefined, accountSubjectType: undefined,
preparationTime: undefined, preparationTime: undefined,
settlementSum: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',

Loading…
Cancel
Save