Commit 2d2166f5 authored by PUPPET17's avatar PUPPET17

历史数据查询列表新增创建人

parent b6282f12
package com.ruoyi.system.controller;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.service.IItemListQueryService;
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;
/**
* @author xyx
* @date 2024/4/22
*/
@RestController
@RequestMapping("/item")
public class ItemListQueryController extends BaseController {
@Autowired
private IItemListQueryService iItemListQueryService;
@PostMapping("/getList")
public TableDataInfo getItems(@RequestBody String sskId){
JSONArray itemList = iItemListQueryService.getItemList(sskId);
return getDataTable(itemList);
}
}
package com.ruoyi.system.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
* @author xyx
* @date 2024/4/22
*/
public interface IItemListQueryService {
JSONArray getItemList(String sskId);
}
package com.ruoyi.system.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.common.ReturnResult;
import com.ruoyi.system.constant.ApiConstant;
import com.ruoyi.system.service.IItemListQueryService;
import com.ruoyi.system.yyinterface.VoucherUtils;
import org.springframework.stereotype.Service;
/**
* @author xyx
* @date 2024/4/22
*/
@Service
public class ItemListQueryServiceImpl implements IItemListQueryService {
@Override
public JSONArray getItemList(String sskId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("pageIndex",1L);
jsonObject.put("pageSize",1000L);
jsonObject.put("code",sskId);
ReturnResult accSubject = VoucherUtils.callVoucherQuery( jsonObject , ApiConstant.YFXM_URL);
JSONObject data = (JSONObject) accSubject.getData().get(0);
return data.getJSONArray("recordList");
}
}
package com.ruoyi.system.utils;
/**
* @author xyx
* @date 2024/4/18
*/
public class AccSubjectReqParamHandler {
/**
*
* @param name 费用来源
* @param material 物料名称
* @param department 部门名称
* @return 科目详情列表中索要查找的 name: ZH_CN
*/
public static String paramHandler(String name, String material, String department) {
switch (name) {
case "基本生产":
return "基本生产_直接材料_" + material;
case "制造费用":
case "销售费用":
return name + "_材料及低值易耗品";
case "其他业务成本":
if ("其他材料".equals(material) || "运输业务".equals(material)) {
return "其他业务成本_" + department;
}
case "管理费用":
return "管理费用_管理费_材料及低值易耗品";
case "专项储备":
return "专项储备_煤炭生产安全费_本年减少_费用性支出";
case "研究费用":
return "研发支出_费用化支出_材料及低值易耗品";
case "内部投资":
return "在建工程_内部投资工程";
}
return null;
}
}
package com.ruoyi.system.utils;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
/**
* @author xyx
* @date 2024/4/18
*/
public class AuxiliaryAccRuleHandler {
private static final Map<String, Function<String, String>> AUXILIARY_ACCOUNTING_RULES = new HashMap<>();
static {
// 唐山矿 param 无论传的是什么都会返回 “非填充开采”
AUXILIARY_ACCOUNTING_RULES.put("010101", param -> "非充填开采");
// 范矿
AUXILIARY_ACCOUNTING_RULES.put("011701", param -> "非充填开采");
// 钱矿
AUXILIARY_ACCOUNTING_RULES.put("010105", param -> "非充填开采");
// 宏丰
AUXILIARY_ACCOUNTING_RULES.put("011502", param -> "非充填开采");
// 林西
AUXILIARY_ACCOUNTING_RULES.put("011704", param -> "非充填开采");
// 单侯
AUXILIARY_ACCOUNTING_RULES.put("011204", param -> "非充填开采");
// 吕矿
AUXILIARY_ACCOUNTING_RULES.put("011702", param -> {
if ("基本生产".equals(param) || "制造费用".equals(param)) {
return "非充填开采";
} else if ("管理费用".equals(param) || "销售费用".equals(param)) {
return null;
}
return null;
});
// 东欢陀
AUXILIARY_ACCOUNTING_RULES.put("010102", param -> {
if ("基本生产".equals(param) || "制造费用".equals(param)){
return "非充填开采";
} else if ("管理费用".equals(param)) {
return "部门_机关";
} else if ("其他业务成本_运输业务".equals(param)){
return "其他业务支出费用要素_通用材料/油类";
}
return null;
});
}
/**
*
* @param sskId 矿id
* @param param 费用来源 [ 基本生产, 制造费用, 管理费用, 销售费用, 其他业务成本_运输业务 ]
* @return 自定义档案 name: ZH_CN
*/
public static String handleAuxiliaryAccounting(String sskId, String param) {
return AUXILIARY_ACCOUNTING_RULES.getOrDefault(sskId, p -> null).apply(param);
}
}
/*
package com.ruoyi.system.yyinterface; package com.ruoyi.system.yyinterface;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -14,13 +13,10 @@ import java.util.Date; ...@@ -14,13 +13,10 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
*/
/** /**
* @Author jiuli * @Author jiuli
* @Date 2024/1/16 * @Date 2024/1/16
*//* */
public class VoucherUtils { public class VoucherUtils {
private static final Logger logger = LoggerFactory.getLogger(VoucherUtils.class); private static final Logger logger = LoggerFactory.getLogger(VoucherUtils.class);
...@@ -67,4 +63,3 @@ public class VoucherUtils { ...@@ -67,4 +63,3 @@ public class VoucherUtils {
return output.format(date); return output.format(date);
} }
} }
*/
...@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<select id="selectActSuppliesCleaningCopy" parameterType="Long" resultMap="ActSuppliesImportCleaningResultAcc"> <select id="selectActSuppliesCleaningCopy" parameterType="Long" resultMap="ActSuppliesImportCleaningResultAcc">
SELECT ssk_id,hdate,department_column,categories,source_of_expenses,SUM(number_column) number_column,SUM(money_column) money_column,SUM(money_columns) money_columns FROM act_supplies_import_cleaning_copy1 WHERE hid = #{id} GROUP BY department_column,categories,hdate,ssk_id,source_of_expenses SELECT ssk_id,hdate,department_column ,categories ,source_of_expenses ,SUM(number_column) number_column,SUM(money_column) money_column,SUM(money_columns) money_columns FROM act_supplies_import_cleaning_copy1 WHERE hid = #{id} GROUP BY department_column,categories,hdate,ssk_id,source_of_expenses
</select> </select>
......
...@@ -49,10 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -49,10 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectActSuppliesHistorydataCopyList" parameterType="ActSuppliesHistorydata" resultMap="ActSuppliesHistorydataResult"> <select id="selectActSuppliesHistorydataCopyList" parameterType="ActSuppliesHistorydata" resultMap="ActSuppliesHistorydataResult">
<!--<include refid="selectActSuppliesHistorydataVo"/>--> <!--<include refid="selectActSuppliesHistorydataVo"/>-->
SELECT t1.id, t1.template_id, t2.template_name, t1.import_uuid, t1.export_uuid, t1.history_name, t1.history_role, t1.identifying_code, t1.status, t1.create_by, t1.create_time, t1.clean_status, t1.date SELECT t1.id, t1.template_id, t2.template_name, t1.import_uuid, t1.export_uuid, t1.history_name, t1.history_role, t1.identifying_code, t1.status, t1.create_by, t1.create_time, t1.clean_status, t1.date,t1.ssk_id
FROM act_supplies_historydata_copy1 t1 FROM act_supplies_historydata_copy1 t1
LEFT JOIN act_supplies_template t2 ON t1.template_id = t2.id LEFT JOIN act_supplies_template t2 ON t1.template_id = t2.id
<where> <where>
<if test="createBy!= 'admin'" >and t1.create_by = #{createBy}</if>
<if test="templateName != null and templateName != ''"> and t2.template_name like concat('%', #{templateName}, '%')</if> <if test="templateName != null and templateName != ''"> and t2.template_name like concat('%', #{templateName}, '%')</if>
<if test="historyName != null and historyName != ''"> and history_name like concat('%', #{historyName}, '%')</if> <if test="historyName != null and historyName != ''"> and history_name like concat('%', #{historyName}, '%')</if>
<if test="identifyingCode != null "> and identifying_code = #{identifyingCode}</if> <if test="identifyingCode != null "> and identifying_code = #{identifyingCode}</if>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment