Commit d479a1a7 authored by hehongwei's avatar hehongwei

物资明细清洗修改

parent 41e1732d
......@@ -43,6 +43,12 @@
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.8</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
......
......@@ -14,5 +14,9 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -38,5 +38,18 @@ public class ActSuppliesCleaningRuleController extends BaseController
}
/**
* 获取所有历史数据
*/
@PreAuthorize("@ss.hasPermi('system:cleaningrule:queryAll')")
@GetMapping("/queryAllAcc/{tylkStatus}")
public AjaxResult selectActSuppliesHistorydataAcc(@PathVariable("tylkStatus") Integer tylkStatus)
{
List<ActSuppliesHistorydata> s = actSuppliesHistorydataService.selectActSuppliesHistorydataAcc(tylkStatus);
return AjaxResult.success(s);
}
}
......@@ -104,7 +104,7 @@ public class ActSuppliesHistorydataController extends BaseController
}
/**
* 添加 历史数据
* 添加 通用or六矿历史数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsert')")
@PostMapping("/addInsert")
......@@ -114,6 +114,18 @@ public class ActSuppliesHistorydataController extends BaseController
return toAjax(1);
}
/**
* 添加 通用凭证单历史数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsertAccount')")
@PostMapping("/addInsertAccount")
public AjaxResult addInsertAccount(@RequestBody List<ActSuppliesHistorydata> actSuppliesHistorydata)
{
actSuppliesHistorydataService.addInsertActSuppliesHistorydataAcc(actSuppliesHistorydata);
return toAjax(1);
}
/**
* 数据清洗 六矿生成表数据
*/
......@@ -139,7 +151,7 @@ public class ActSuppliesHistorydataController extends BaseController
}
/**
* 数据清洗 六矿生成表数据
* 数据清洗 凭证单六矿生成表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsertAccount1')")
@PostMapping("/addInsertAccount1")
......@@ -150,7 +162,7 @@ public class ActSuppliesHistorydataController extends BaseController
}
/**
* 数据清洗 六矿导入表数据
* 数据清洗 凭证单六矿导入表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsertAccount2')")
@PostMapping("/addInsertAccount2")
......
......@@ -6,13 +6,22 @@ public class ActDispensing {
private String c;
//行
private String r;
//金额
private String money;
//材料分类
private String material;
//项目分类
private String name;
//与凭证单对应关系
private int[] indexRow;
//项目细分
private String department;
private String accountdate;
private String accountuuid;
//会计编码
private String accountingCode;
......@@ -134,4 +143,36 @@ public class ActDispensing {
public void setMining(String mining) {
this.mining = mining;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getAccountdate() {
return accountdate;
}
public void setAccountdate(String accountdate) {
this.accountdate = accountdate;
}
public String getAccountuuid() {
return accountuuid;
}
public void setAccountuuid(String accountuuid) {
this.accountuuid = accountuuid;
}
public int[] getIndexRow() {
return indexRow;
}
public void setIndexRow(int[] indexRow) {
this.indexRow = indexRow;
}
}
......@@ -30,6 +30,10 @@ public class ActOperation1 extends BaseEntity {
/** 清洗规则 */
private String historyRole;
private String convenRole;
private String exportUuid;
public String getHistoryRole() {
return historyRole;
}
......@@ -98,4 +102,20 @@ public class ActOperation1 extends BaseEntity {
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public String getExportUuid() {
return exportUuid;
}
public void setExportUuid(String exportUuid) {
this.exportUuid = exportUuid;
}
public String getConvenRole() {
return convenRole;
}
public void setConvenRole(String convenRole) {
this.convenRole = convenRole;
}
}
......@@ -36,6 +36,9 @@ public class ActSuppliesHistorydata extends BaseEntity
@Excel(name = "导入")
private String importUuid;
/** 通用凭证单编码*/
private String accountuuid;
/** 规则 */
@Excel(name = "规则")
private Long roleId;
......@@ -56,6 +59,9 @@ public class ActSuppliesHistorydata extends BaseEntity
@Excel(name = "清洗规则")
private String historyRole;
private String convenRole;
/** 导入导出标识 */
@Excel(name = "导入导出标识")
private Long identifyingCode;
......@@ -218,6 +224,22 @@ public class ActSuppliesHistorydata extends BaseEntity
this.historyRole = historyRole;
}
public String getAccountuuid() {
return accountuuid;
}
public void setAccountuuid(String accountuuid) {
this.accountuuid = accountuuid;
}
public String getConvenRole() {
return convenRole;
}
public void setConvenRole(String convenRole) {
this.convenRole = convenRole;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 导入表的清晰表 act_supplies_import_cleaning
*
* @author
* @date 2023-12-15
*/
public class ActSuppliesImportCleaningAcc extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 导入表的清洗ID */
@Excel(name = "导入表的清洗ID")
private String id;
/**所属规则*/
@Excel(name = "所属矿id",readConverterExp = "1、东欢坨矿 2、范矿 3、林西矿 4、吕矿 5、钱家营矿 6、唐山矿 7、宏丰 8、云飞 9、平安")
private String sskId;
/** 日期(年月)*/
private String hdate;
/** 历史表ID*/
private Long hId;
private String kmCode;
private String yyUuid;
/** 所在行*/
private String HeaderRow;
/** 物料名称*/
private String nameColumn;
/** 物料编码*/
private String codeColumn;
/** 部门*/
private String departmentColumn;
/** 数量*/
private String numberColumn;
/** 单价*/
private String moneyColumn;
/** 金额*/
private String moneyColumns;
/** 导入表内日期*/
private String dateColumn;
public String getKmCode() {
return kmCode;
}
public void setKmCode(String kmCode) {
this.kmCode = kmCode;
}
public String getYyUuid() {
return yyUuid;
}
public void setYyUuid(String yyUuid) {
this.yyUuid = yyUuid;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHeaderRow() {
return HeaderRow;
}
public void setHeaderRow(String headerRow) {
HeaderRow = headerRow;
}
public String getSskId() {
return sskId;
}
public void setSskId(String sskId) {
this.sskId = sskId;
}
public Long gethId() {
return hId;
}
public void sethId(Long hId) {
this.hId = hId;
}
public String getHdate() {
return hdate;
}
public void setHdate(String hdate) {
this.hdate = hdate;
}
public String getMoneyColumns() {
return moneyColumns;
}
public void setMoneyColumns(String moneyColumns) {
this.moneyColumns = moneyColumns;
}
public String getNameColumn() {
return nameColumn;
}
public void setNameColumn(String nameColumn) {
this.nameColumn = nameColumn;
}
public String getCodeColumn() {
return codeColumn;
}
public void setCodeColumn(String codeColumn) {
this.codeColumn = codeColumn;
}
public String getDepartmentColumn() {
return departmentColumn;
}
public void setDepartmentColumn(String departmentColumn) {
this.departmentColumn = departmentColumn;
}
public String getNumberColumn() {
return numberColumn;
}
public void setNumberColumn(String numberColumn) {
this.numberColumn = numberColumn;
}
public String getMoneyColumn() {
return moneyColumn;
}
public void setMoneyColumn(String moneyColumn) {
this.moneyColumn = moneyColumn;
}
public String getDateColumn() {
return dateColumn;
}
public void setDateColumn(String dateColumn) {
this.dateColumn = dateColumn;
}
@Override
public String toString() {
return "ActSuppliesImportCleaning{" +
"id='" + id + '\'' +
", sskId='" + sskId + '\'' +
", hId='" + hId + '\'' +
", nameColumn='" + nameColumn + '\'' +
", codeColumn='" + codeColumn + '\'' +
", departmentColumn='" + departmentColumn + '\'' +
", numberColumn='" + numberColumn + '\'' +
", moneyColumn='" + moneyColumn + '\'' +
", dateColumn='" + dateColumn + '\'' +
'}';
}
}
......@@ -26,6 +26,10 @@ public class ActSuppliesImportTable extends BaseEntity
@Excel(name = "所属矿区")
private String mining;
private String kmCode;
private String exportUuid;
private String a1;
private String a2;
private String a3;
......@@ -126,6 +130,14 @@ public class ActSuppliesImportTable extends BaseEntity
this.mining = mining;
}
public String getExportUuid() {
return exportUuid;
}
public void setExportUuid(String exportUuid) {
this.exportUuid = exportUuid;
}
public String getA1() {
return a1;
}
......@@ -630,6 +642,14 @@ public class ActSuppliesImportTable extends BaseEntity
this.a63 = a63;
}
public String getKmCode() {
return kmCode;
}
public void setKmCode(String kmCode) {
this.kmCode = kmCode;
}
@Override
public String toString() {
return "ActSuppliesImportTable{" +
......
......@@ -26,4 +26,6 @@ public interface ActSuppliesAccountMapper
public List<ActDispensing> selectActSuppliesAccpuntByCode();
void installSixMinTable(ActDispensing actDispensings);
}
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.ActSuppliesHistorydata;
import com.ruoyi.system.domain.ActSuppliesImportCleaning;
import com.ruoyi.system.domain.ActSuppliesImportTable;
import com.ruoyi.system.domain.ActSuppliesSixMinesSummaryTable;
import com.ruoyi.system.domain.*;
import java.util.List;
......@@ -32,4 +29,7 @@ public interface ActSuppliesCleaningRuleMapper
void addInsertConvert2(ActSuppliesImportTable actSuppliesImportTable);
void addInsertConvertAcc(ActSuppliesImportTable actSuppliesImportTable);
void addActSuppliesImportCleaningAcc(ActSuppliesImportCleaningAcc actSuppliesImportCleaningAcc);
}
......@@ -87,4 +87,12 @@ public interface ActSuppliesHistorydataMapper
* @return 结果
*/
void insertActSuppliesHistorycontent(ActSuppliesHistorydata actSuppliesHistorydata);
void insertActSuppliesHistorydataAcc(ActSuppliesHistorydata actSuppliesHistorydata1);
void insertActSuppliesHistorycontentAcc(ActSuppliesHistorydata actSuppliesHistorydata1);
void updateActSuppliesHistorydataStatusByIdAcc(Long gethId);
List<ActSuppliesHistorydata> selectActSuppliesHistorydataAcc(Integer tylkStatus);
}
......@@ -86,4 +86,8 @@ public interface IActSuppliesHistorydataService
void addInsertImportAccpunt(List<ActOperation1> actOperation2s);
void addInsertImportssAccounts(List<ActOperation1> actOperation2s);
void addInsertActSuppliesHistorydataAcc(List<ActSuppliesHistorydata> actSuppliesHistorydata);
List<ActSuppliesHistorydata> selectActSuppliesHistorydataAcc(Integer tylkStatus);
}
......@@ -43,9 +43,9 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
actDispensing.get(i).setAccountingNameC(actDispensing.get(i).getAccountingNameC()+','+actDispensing.get(i).getAccountingIdC());
actDispensings.add(actDispensing.get(i));
}
return actDispensings;
}
}
......@@ -7,12 +7,14 @@ import java.util.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.ActSuppliesCleaningRuleMapper;
import com.sun.javafx.collections.MappingChange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActSuppliesHistorydataMapper;
......@@ -610,10 +612,159 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
/**
* 凭证单导入表数据清洗
*
* @return 结果
*/
@Override
@Transactional
public void addInsertImportssAccounts(List<ActOperation1> actOperation2s) {
Thread thread = new Thread() {
public void run() {
//String[] attributes = {"A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "A16", "A17", "A18", "A19", "A20", "A21", "A22", "A23", "A24", "A25", "A26", "A27", "A28", "A29", "A30", "A31", "A32", "A33", "A34", "A35", "A36", "A37", "A38", "A39", "A40", "A41", "A42", "A43", "A44", "A45", "A46", "A47", "A48", "A49", "A50", "A51", "A52", "A53", "A54", "A55", "A56", "A57", "A58", "A59", "A60", "A61", "A62", "A63"};
String[] attributes = new String[200];
for(int i=1;i<=200;i++){
attributes[i-1]= 'A' + String.valueOf(i);
}
for (int i = 0; i < actOperation2s.size(); i++) {
Gson gson = new Gson();
JSONArray parse = (JSONArray) JSONArray.parse(actOperation2s.get(i).getConvenRole());
Map<Integer, String>[] mapArray = gson.fromJson(actOperation2s.get(i).getHistoryRole(), Map[].class);
//获取导入excel表数据存储到生成表实体类中
for (int x = (int)parse.getJSONObject(0).get("HeaderRow"); x < actOperation2s.get(i).getActOperation2().length; x++) {
//判断数据是否为空,为空结束循环
Map<String,String> mapcode = new HashMap<>();
for (Map<Integer, String> map : mapArray) {
mapcode.put(map.get("key"),map.get("value"));
}
String s1 = mapcode.get(String.valueOf(x));
if (actOperation2s.get(i).getActOperation2()[x]!=null){
ActSuppliesImportTable actSuppliesImportTable = new ActSuppliesImportTable();
ActSuppliesImportCleaningAcc actSuppliesImportCleaningAcc = new ActSuppliesImportCleaningAcc();
UUID uuid = UUID.randomUUID();
String s = StringUtils.remove(uuid.toString(), '-');
actSuppliesImportTable.setKmCode(s1);
actSuppliesImportTable.setId(s);
actSuppliesImportTable.sethId(actOperation2s.get(i).gethId());
actSuppliesImportTable.sethDate(actOperation2s.get(i).gethDate());
actSuppliesImportTable.setMining(actOperation2s.get(i).getMining());
actSuppliesImportTable.setExportUuid(actOperation2s.get(i).getExportUuid());
actSuppliesImportCleaningAcc.setKmCode(s1);
actSuppliesImportCleaningAcc.setId(s);
actSuppliesImportCleaningAcc.sethId(actOperation2s.get(i).gethId());
actSuppliesImportCleaningAcc.setHdate(actOperation2s.get(i).gethDate());
actSuppliesImportCleaningAcc.setSskId(actOperation2s.get(i).getMining());
actSuppliesImportCleaningAcc.setYyUuid(actOperation2s.get(i).getExportUuid());
//获取数组x行的真实非空长度
List<Object> actOperation2s1 = Arrays.asList(actOperation2s.get(i).getActOperation2()[x]);
long count = Arrays.stream(actOperation2s.get(i).getActOperation2()[x]).filter(Objects::nonNull).count();
//循环保存到实体类字段中
for (int y = 0; y < count; y++) {
if (actOperation2s.get(i).getActOperation2()[x][y]!=null) {
if (actOperation2s.get(i).getActOperation2()[x][y].getV() != null) {
try {
actSuppliesImportTable.getClass().getMethod("set" + attributes[y], String.class).invoke(actSuppliesImportTable, actOperation2s.get(i).getActOperation2()[x][y].getV());
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
//新增一条生成表数据
actSuppliesCleaningRuleMapper.addInsertConvertAcc(actSuppliesImportTable);
if (actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("CodeColumn") - 1)] != null) {
if (actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("CodeColumn") - 1)].getV() != null) {
//[{"HeaderRow": 1, "CodeColumn": 6, "DateColumn": 5, "NameColumn": 7, "MoneyColumn": 12, "NumberColumn": 11, "DepartmentColumn": 2}]
actSuppliesImportCleaningAcc.setNameColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("NameColumn") - 1)].getV());
actSuppliesImportCleaningAcc.setCodeColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("CodeColumn") - 1)].getV());
actSuppliesImportCleaningAcc.setDepartmentColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("DepartmentColumn") - 1)].getV());
actSuppliesImportCleaningAcc.setNumberColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("NumberColumn") - 1)].getV());
actSuppliesImportCleaningAcc.setMoneyColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("MoneyColumn") - 1)].getV());
actSuppliesImportCleaningAcc.setMoneyColumns(Double.toString(Double.parseDouble(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("MoneyColumn") - 1)].getV()) * Double.parseDouble(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("NumberColumn") - 1)].getV())));
Object dateColumn = parse.getJSONObject(0).get("DateColumn");
if(parse.getJSONObject(0).get("DateColumn").hashCode()>0){
actSuppliesImportCleaningAcc.setDateColumn(actOperation2s.get(i).getActOperation2()[x][((int) parse.getJSONObject(0).get("DateColumn") - 1)].getV());
}
//actSuppliesImportCleaning.setDateColumn(actOperation2s.get(i).getActOperation2()[x][JSON.parseObject(actOperation2s.get(i).getHistoryRole()).getInteger("DateColumn")].getV());
//新增一条生成表数据
actSuppliesCleaningRuleMapper.addActSuppliesImportCleaningAcc(actSuppliesImportCleaningAcc);
}
}
}else {
break;
}
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusByIdAcc(actOperation2s.get(i).gethId());
}
}
};
thread.start();
}
@Override
public void addInsertActSuppliesHistorydataAcc(List<ActSuppliesHistorydata> actSuppliesHistorydata) {
SysUser user = SecurityUtils.getLoginUser().getUser();
ActSuppliesHistorydata actSuppliesHistorydata1 = new ActSuppliesHistorydata();
for (int i = 0; i < actSuppliesHistorydata.size(); i++) {
UUID uuid = UUID.randomUUID();
String uuids = StringUtils.remove(uuid.toString(), '-');
if (actSuppliesHistorydata.get(i).getIdentifyingCode() == 0) {
actSuppliesHistorydata1 = actSuppliesHistorydata.get(i);
actSuppliesHistorydata1.setImportUuid(uuids);
actSuppliesHistorydata1.setStatus(0L);
actSuppliesHistorydata1.setIdentifyingCode(0L);
actSuppliesHistorydataMapper.insertActSuppliesHistorydataAcc(actSuppliesHistorydata1);
actSuppliesHistorydataMapper.insertActSuppliesHistorycontentAcc(actSuppliesHistorydata1);
} else {
actSuppliesHistorydata1 = actSuppliesHistorydata.get(i);
actSuppliesHistorydata1.setImportUuid(uuids);
actSuppliesHistorydata1.setStatus(0L);
actSuppliesHistorydata1.setIdentifyingCode(1L);
actSuppliesHistorydataMapper.insertActSuppliesHistorydataAcc(actSuppliesHistorydata1);
actSuppliesHistorydataMapper.insertActSuppliesHistorycontentAcc(actSuppliesHistorydata1);
}
}
}
@Override
public List<ActSuppliesHistorydata> selectActSuppliesHistorydataAcc(Integer tylkStatus) {
return actSuppliesHistorydataMapper.selectActSuppliesHistorydataAcc(tylkStatus);
}
......
......@@ -105,18 +105,26 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS
//re:导入表的行,ce:导入表的列,se:导入表的sheet;rt:模板表的行,ct:模板表的列,st:模板表的sheet;ys:运算符
// String content1 = "[{\"se\":\"0\",\"re\":\""+actSuppliesRoleDetail.getDetailYH()+"\",\"ce\":\""+actSuppliesRoleDetail.getDetailYL()+"\",\"st\":\"0\",\"rt\":\""+actSuppliesRoleDetail.getDetailMH()+"\",\"ct\":\""+actSuppliesRoleDetail.getDetailML()+"\",\"ys\":\""+actSuppliesRoleDetail.getConvertStatus()+"\"}]" ;
List<String> filteredList = new ArrayList<>();
String content2;
if(actSuppliesRoleDetail.getConvertStatus()==6){
content2="["+actSuppliesRoleDetail.getCleanIng()+"]";
}else {
for (int i =0 ;i<actSuppliesRoleDetail.getDetailMH().length; i++){
filteredList.add("{\"se\":\"0\",\"re\":\""+(Integer.parseInt((actSuppliesRoleDetail.getDetailYH()[i]))-1)+"\",\"ce\":\""+(Integer.parseInt((actSuppliesRoleDetail.getDetailYL()[i]))-1)+"\",\"st\":\"0\",\"rt\":\""+(Integer.parseInt((actSuppliesRoleDetail.getDetailMH()[i]))-1)+"\",\"ct\":\""+(Integer.parseInt((actSuppliesRoleDetail.getDetailML()[i]))-1)+"\",\"ys\":\""+actSuppliesRoleDetail.getConvertStatus()+"\"}") ;
}
String content = String.join(",",filteredList);
String content2 = "["+content+"]";
content2 = "["+content+"]";
}
actSuppliesRoleDetail.setDetailContent(content2);
SysUser user = SecurityUtils.getLoginUser().getUser();
......
......@@ -32,8 +32,8 @@
</select>
<select id="selectActClassificationById" parameterType="Long" resultMap="ActClassificationResult">
<include refid="selectActClassificationVo"/>
where id = #{id}
select a.id, a.name,a.type,a.ssk_id, a.pid, a.status, a.create_by, a.update_by, b.name fname from act_classification a left join act_classification b on a.pid = b.id
where a.id = #{id}
</select>
<select id="savePid" parameterType="Long" resultMap="ActClassificationResult">
......
......@@ -25,6 +25,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from act_supplies_compare where blm = 1
</select>
<insert id="installSixMinTable" parameterType="ActDispensing" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_sixminessummarytable
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="hId != null">h_id,</if>
<if test="projectId != null">project_id,</if>
<if test="projectName != null">project_name,</if>
<if test="departmentName != null">department_name,</if>
<if test="unit != null">unit,</if>
<if test="number != null">number,</if>
<if test="nuitPrice != null">nuit_price,</if>
<if test="money != null">money,</if>
<if test="costChannels != null">cost_channels,</if>
<if test="createBy != null">create_by,</if>
<if test="hDate != null">h_date,</if>
<if test="mining != null">ssk_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="accountdate != null">#{accountdate},</if>
<if test="projectId != null">#{projectId},</if>
<if test="projectName != null">#{projectName},</if>
<if test="departmentName != null">#{departmentName},</if>
<if test="unit != null">#{unit},</if>
<if test="number != null">#{number},</if>
<if test="nuitPrice != null">#{nuitPrice},</if>
<if test="money != null">#{money},</if>
<if test="accountuuid != null">#{accountuuid},</if>
<if test="mining != null">#{mining},</if>
</trim>
</insert>
......
......@@ -228,6 +228,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="addActSuppliesImportCleaningAcc" parameterType="ActSuppliesImportCleaningAcc" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_import_cleaning_copy1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="hId != null">hid,</if>
<if test="sskId != null">ssk_id,</if>
<if test="hdate != null">hdate,</if>
<if test="kmCode != null">km_code,</if>
<if test="yyUuid != null">yy_uuid,</if>
<if test="nameColumn != null">name_column,</if>
<if test="codeColumn != null">code_column,</if>
<if test="departmentColumn != null">department_column,</if>
<if test="numberColumn != null">number_column,</if>
<if test="moneyColumns != null">money_columns,</if>
<if test="moneyColumn != null">money_column,</if>
<if test="dateColumn != null">date_column,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="hId != null">#{hId},</if>
<if test="sskId != null">#{sskId},</if>
<if test="hdate != null">#{hdate},</if>
<if test="kmCode != null">#{kmCode},</if>
<if test="yyUuid != null">#{yyUuid},</if>
<if test="nameColumn != null">#{nameColumn},</if>
<if test="codeColumn != null">#{codeColumn},</if>
<if test="departmentColumn != null">#{departmentColumn},</if>
<if test="numberColumn != null">#{numberColumn},</if>
<if test="moneyColumns != null">#{moneyColumns},</if>
<if test="moneyColumn != null">#{moneyColumn},</if>
<if test="dateColumn != null">#{dateColumn},</if>
</trim>
</insert>
<insert id="addActSuppliesImportCleaning" parameterType="ActSuppliesImportCleaning" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_import_cleaning
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -559,6 +593,154 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteActSuppliesImportTable" parameterType="Long">
delete from act_supplies_import_table where h_id = #{id}
</delete>
<insert id="addInsertConvertAcc" parameterType="ActSuppliesImportTable" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_import_table_copy1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="hId != null">h_id,</if>
<if test="hDate != null">h_date,</if>
<if test="mining != null">ssk_id,</if>
<if test="exportUuid != null">yy_uuid,</if>
<if test="kmCode != null">km_code,</if>
<if test="a1 != null">a1,</if>
<if test="a2 != null">a2,</if>
<if test="a3 != null">a3,</if>
<if test="a4 != null">a4,</if>
<if test="a5 != null">a5,</if>
<if test="a6 != null">a6,</if>
<if test="a7 != null">a7,</if>
<if test="a8 != null">a8,</if>
<if test="a9 != null">a9,</if>
<if test="a10 != null">a10,</if>
<if test="a11 != null">a11,</if>
<if test="a12 != null">a12,</if>
<if test="a13 != null">a13,</if>
<if test="a14 != null">a14,</if>
<if test="a15 != null">a15,</if>
<if test="a16 != null">a16,</if>
<if test="a17 != null">a17,</if>
<if test="a18 != null">a18,</if>
<if test="a19 != null">a19,</if>
<if test="a20 != null">a20,</if>
<if test="a21 != null">a21,</if>
<if test="a22 != null">a22,</if>
<if test="a23 != null">a23,</if>
<if test="a24 != null">a24,</if>
<if test="a25 != null">a25,</if>
<if test="a26 != null">a26,</if>
<if test="a27 != null">a27,</if>
<if test="a28 != null">a28,</if>
<if test="a29 != null">a29,</if>
<if test="a30 != null">a30,</if>
<if test="a31 != null">a31,</if>
<if test="a32 != null">a32,</if>
<if test="a33 != null">a33,</if>
<if test="a34 != null">a34,</if>
<if test="a35 != null">a35,</if>
<if test="a36 != null">a36,</if>
<if test="a37 != null">a37,</if>
<if test="a38 != null">a38,</if>
<if test="a39 != null">a39,</if>
<if test="a40 != null">a40,</if>
<if test="a41 != null">a41,</if>
<if test="a42 != null">a42,</if>
<if test="a43 != null">a43,</if>
<if test="a44 != null">a44,</if>
<if test="a45 != null">a45,</if>
<if test="a46 != null">a46,</if>
<if test="a47 != null">a47,</if>
<if test="a48 != null">a48,</if>
<if test="a49 != null">a49,</if>
<if test="a50 != null">a50,</if>
<if test="a51 != null">a51,</if>
<if test="a52 != null">a52,</if>
<if test="a53 != null">a53,</if>
<if test="a54 != null">a54,</if>
<if test="a55 != null">a55,</if>
<if test="a56 != null">a56,</if>
<if test="a57 != null">a57,</if>
<if test="a58 != null">a58,</if>
<if test="a59 != null">a59,</if>
<if test="a60 != null">a60,</if>
<if test="a61 != null">a61,</if>
<if test="a62 != null">a62,</if>
<if test="a63 != null">a63,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="hId != null">#{hId},</if>
<if test="hDate != null">#{hDate},</if>
<if test="mining != null">#{mining},</if>
<if test="exportUuid != null">#{exportUuid},</if>
<if test="kmCode != null">#{kmCode},</if>
<if test="a1 != null">#{a1},</if>
<if test="a2 != null">#{a2},</if>
<if test="a3 != null">#{a3},</if>
<if test="a4 != null">#{a4},</if>
<if test="a5 != null">#{a5},</if>
<if test="a6 != null">#{a6},</if>
<if test="a7 != null">#{a7},</if>
<if test="a8 != null">#{a8},</if>
<if test="a9 != null">#{a9},</if>
<if test="a10 != null">#{a10},</if>
<if test="a11 != null">#{a11},</if>
<if test="a12 != null">#{a12},</if>
<if test="a13 != null">#{a13},</if>
<if test="a14 != null">#{a14},</if>
<if test="a15 != null">#{a15},</if>
<if test="a16 != null">#{a16},</if>
<if test="a17 != null">#{a17},</if>
<if test="a18 != null">#{a18},</if>
<if test="a19 != null">#{a19},</if>
<if test="a20 != null">#{a20},</if>
<if test="a21 != null">#{a21},</if>
<if test="a22 != null">#{a22},</if>
<if test="a23 != null">#{a23},</if>
<if test="a24 != null">#{a24},</if>
<if test="a25 != null">#{a25},</if>
<if test="a26 != null">#{a26},</if>
<if test="a27 != null">#{a27},</if>
<if test="a28 != null">#{a28},</if>
<if test="a29 != null">#{a29},</if>
<if test="a30 != null">#{a30},</if>
<if test="a31 != null">#{a31},</if>
<if test="a32 != null">#{a32},</if>
<if test="a33 != null">#{a33},</if>
<if test="a34 != null">#{a34},</if>
<if test="a35 != null">#{a35},</if>
<if test="a36 != null">#{a36},</if>
<if test="a37 != null">#{a37},</if>
<if test="a38 != null">#{a38},</if>
<if test="a39 != null">#{a39},</if>
<if test="a40 != null">#{a40},</if>
<if test="a41 != null">#{a41},</if>
<if test="a42 != null">#{a42},</if>
<if test="a43 != null">#{a43},</if>
<if test="a44 != null">#{a44},</if>
<if test="a45 != null">#{a45},</if>
<if test="a46 != null">#{a46},</if>
<if test="a47 != null">#{a47},</if>
<if test="a48 != null">#{a48},</if>
<if test="a49 != null">#{a49},</if>
<if test="a50 != null">#{a50},</if>
<if test="a51 != null">#{a51},</if>
<if test="a52 != null">#{a52},</if>
<if test="a53 != null">#{a53},</if>
<if test="a54 != null">#{a54},</if>
<if test="a55 != null">#{a55},</if>
<if test="a56 != null">#{a56},</if>
<if test="a57 != null">#{a57},</if>
<if test="a58 != null">#{a58},</if>
<if test="a59 != null">#{a59},</if>
<if test="a60 != null">#{a60},</if>
<if test="a61 != null">#{a61},</if>
<if test="a62 != null">#{a62},</if>
<if test="a63 != null">#{a63},</if>
</trim>
</insert>
</mapper>
......@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="roleId" column="role_id" />
<result property="historyName" column="history_name" />
<result property="historyRole" column="history_role" />
<result property="convenRole" column="conven_role" />
<result property="historyContent" column="history_content" />
<result property="identifyingCode" column="identifying_code" />
<result property="cleanStatus" column="clean_status" />
......@@ -90,6 +91,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="insertActSuppliesHistorydataAcc" parameterType="ActSuppliesHistorydata" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_historydata_copy1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="importUuid != null">import_uuid,</if>
<if test="templateId != null">template_id,</if>
<if test="exportUuid != null">export_uuid,</if>
<if test="roleId != null">role_id,</if>
<if test="historyName != null">history_name,</if>
<if test="historyRole != null">history_role,</if>
<if test="convenRole != null">conven_role,</if>
<if test="identifyingCode != null">identifying_code,</if>
clean_status,
<if test="tylkStatus != null">tylk_status,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="date != null">date,</if>
<if test="mining != null">ssk_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="importUuid != null">#{importUuid},</if>
<if test="templateId != null">#{templateId},</if>
<if test="exportUuid != null">#{exportUuid},</if>
<if test="roleId != null">#{roleId},</if>
<if test="historyName != null">#{historyName},</if>
<if test="historyRole != null">#{historyRole},</if>
<if test="convenRole != null">#{convenRole},</if>
<if test="identifyingCode != null">#{identifyingCode},</if>
0,
<if test="tylkStatus != null">#{tylkStatus},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="date != null">#{date},</if>
<if test="mining != null">#{mining},</if>
</trim>
</insert>
<insert id="insertActSuppliesHistorycontent" parameterType="ActSuppliesHistorydata" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_historycontent
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -102,6 +141,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="insertActSuppliesHistorycontentAcc" parameterType="ActSuppliesHistorydata" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_historycontent_copy1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="importUuid != null">hid,</if>
<if test="historyContent != null">history_content,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="importUuid != null">#{importUuid},</if>
<if test="historyContent != null">#{historyContent},</if>
</trim>
</insert>
<update id="updateActSuppliesHistorydata" parameterType="ActSuppliesHistorydata">
update act_supplies_historydata
<trim prefix="SET" suffixOverrides=",">
......@@ -183,6 +234,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
</select>
<select id="selectActSuppliesHistorydataAcc" parameterType="java.lang.Integer" resultMap="ActSuppliesHistorydataResult">
SELECT t1.id,t1.import_uuid, t1.template_id, t1.export_uuid, t1.role_id, t1.history_name, t1.history_role,t1.conven_role,t2.history_content, t1.identifying_code, t1.status, t1.create_by, t1.create_time,t1.date,t1.ssk_id
FROM act_supplies_historydata_copy1 t1
LEFT JOIN act_supplies_historycontent_copy1 t2 ON t1.import_uuid = t2.hid
where t1.clean_status = 0 and t1.tylk_status =#{tylkStatus}
</select>
<update id="updateActSuppliesHistorydataStatusById" parameterType="java.lang.Long">
update act_supplies_historydata
set clean_status = 1
......@@ -190,6 +248,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="gethId != null">and id = #{gethId}</if>
</where>
</update>
<update id="updateActSuppliesHistorydataStatusByIdAcc" parameterType="java.lang.Long">
update act_supplies_historydata_copy1
set clean_status = 1
<where>
<if test="gethId != null">and id = #{gethId}</if>
</where>
</update>
</mapper>
......@@ -3,7 +3,8 @@ import Excel from 'exceljs';
import FileSaver from 'file-saver';
const exportExcel = function(luckysheet, value,contrast) {
const exportExcel = function (luckysheet, value, contrast, id) {
// 函数体
// 参数为luckysheet.getluckysheetfile()获取的对象
// 1.创建工作簿,可以为工作簿添加属性
const workbook = new Excel.Workbook();
......@@ -11,16 +12,24 @@ const exportExcel = function(luckysheet, value,contrast) {
if (Object.prototype.toString.call(luckysheet) === '[object Object]') {
luckysheet = [luckysheet];
}
luckysheet.forEach(function(table) {
luckysheet.forEach(function (table) {
if (table.data.length === 0) { return true; }
// ws.getCell('B2').fill = fills.
const worksheet = workbook.addWorksheet(table.name);
const merge = (table.config && table.config.merge) || {};
const borderInfo = (table.config && table.config.borderInfo) || {};
// 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值
setStyleAndValue(table.data, worksheet,contrast);
setStyleAndValue(table.data, worksheet, contrast);
setMerge(merge, worksheet);
setBorder(borderInfo, worksheet);
if (id === 1248) {
worksheet.getRow(2).hidden = true;
worksheet.getRow(3).hidden = true;
worksheet.getRow(4).hidden = true;
worksheet.getRow(5).hidden = true;
}
return true;
});
......@@ -37,9 +46,9 @@ const exportExcel = function(luckysheet, value,contrast) {
return buffer;
};
var setMerge = function(luckyMerge = {}, worksheet) {
var setMerge = function (luckyMerge = {}, worksheet) {
const mergearr = Object.values(luckyMerge);
mergearr.forEach(function(elem) {
mergearr.forEach(function (elem) {
// elem格式:{r: 0, c: 0, rs: 1, cs: 2}
// 按开始行,开始列,结束行,结束列合并(相当于 K10:M12)
worksheet.mergeCells(
......@@ -51,10 +60,10 @@ var setMerge = function(luckyMerge = {}, worksheet) {
});
};
var setBorder = function(luckyBorderInfo, worksheet) {
var setBorder = function (luckyBorderInfo, worksheet) {
if (!Array.isArray(luckyBorderInfo)) { return; }
// console.log('luckyBorderInfo', luckyBorderInfo)
luckyBorderInfo.forEach(function(elem) {
luckyBorderInfo.forEach(function (elem) {
// 现在只兼容到borderType 为range的情况
// console.log('ele', elem)
if (elem.rangeType === 'range') {
......@@ -88,10 +97,10 @@ var setBorder = function(luckyBorderInfo, worksheet) {
// worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border
});
};
var setStyleAndValue = function(cellArr, worksheet,contrast) {
var setStyleAndValue = function (cellArr, worksheet, contrast) {
if (!Array.isArray(cellArr)) { return; }
cellArr.forEach(function(row, rowid) {
row.every(function(cell, columnid) {
cellArr.forEach(function (row, rowid) {
row.every(function (cell, columnid) {
if (!cell) { return true; }
let fill = fillConvert(cell.bg);
......@@ -123,11 +132,11 @@ var setStyleAndValue = function(cellArr, worksheet,contrast) {
let letter = createCellPos(columnid);
let target = worksheet.getCell(letter + (rowid + 1));
if(contrast){
const column =worksheet.getColumn(1);
const column2 =worksheet.getColumn(2);
column.hidden=true;
column2.hidden=true;
if (contrast) {
const column = worksheet.getColumn(1);
const column2 = worksheet.getColumn(2);
column.hidden = true;
column2.hidden = true;
}
// console.log('1233', letter + (rowid + 1))
for (const key in fill) {
......@@ -143,7 +152,7 @@ var setStyleAndValue = function(cellArr, worksheet,contrast) {
});
};
var fillConvert = function(bg) {
var fillConvert = function (bg) {
if (!bg) {
return {};
}
......@@ -156,7 +165,7 @@ var fillConvert = function(bg) {
return fill;
};
var fontConvert = function(
var fontConvert = function (
ff = 0,
fc = '#000000',
bl = 0,
......@@ -180,7 +189,7 @@ var fontConvert = function(
10: 'Times New Roman ',
11: 'Tahoma ',
12: 'Verdana',
num2bl: function(num) {
num2bl: function (num) {
return num === 0 ? false : true;
}
};
......@@ -200,7 +209,7 @@ var fontConvert = function(
return font;
};
var alignmentConvert = function(
var alignmentConvert = function (
vt = 'default',
ht = 'default',
tb = 'default',
......@@ -247,7 +256,7 @@ var alignmentConvert = function(
return alignment;
};
var borderConvert = function(borderType, style = 1, color = '#000') {
var borderConvert = function (borderType, style = 1, color = '#000') {
// 对应luckysheet的config中borderinfo的的参数
if (!borderType) {
return {};
......
......@@ -9,6 +9,14 @@ export function selectActSuppliesHistorydata(tylkStatus) {
})
}
// 查询通用凭证单表数据
export function selectActSuppliesHistorydataAcc(tylkStatus) {
return request({
url: '/system/cleaningrule/queryAllAcc/'+tylkStatus,
method: 'get'
})
}
......
import request from '@/utils/request'
import LuckyExcel from "luckyexcel";
//查询6矿物聊
export function materialListPZ() {
return request({
url: '/ActSuppliesDetails/ActSuppliesDetails/materialListPZ' ,
method: 'get'
})
}
//小物料转大物料
export function materialConvert(data) {
......@@ -34,7 +40,22 @@ export function getSuppliesrole(id) {
method: 'get'
})
}
//按照矿的id去查部门分类
export function department(sskId){
return request({
url: `/ActClassification/ActClassification/SunDy/${sskId}`,
method: 'get'
})
}
//获取到会计科目编码
export function accountingcode(newData){
return request({
url: `/ActSuppliesAccount/ActSuppliesAccount/options`,
method: 'post',
data: newData
})
}
//展示excel模板
export function listSuppliesTemplateId(id) {
return request({
......@@ -231,13 +252,7 @@ export function materialList() {
})
}
//查询六矿物料
export function materialListPZ() {
return request({
url: '/ActSuppliesDetails/ActSuppliesDetails/materialListPZ' ,
method: 'get'
})
}
// // 查询模板列表
......
......@@ -108,7 +108,6 @@ export function addInsertAccount1(data) {
})
}
//清洗通用凭证单
export function addInsertAccount2(data) {
return request({
url: '/system/historydata/addInsertAccount2',
......@@ -116,3 +115,6 @@ export function addInsertAccount2(data) {
data: data
})
}
......@@ -10,7 +10,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 100000
timeout: 1000000000
})
// request拦截器
service.interceptors.request.use(config => {
......
......@@ -50,26 +50,25 @@
<script>
import { selectActSuppliesHistorydata } from "@/api/Actsupplies/cleaning_rule";
import { getSuppliesTemplate, listSuppliesTemplate, roleList, materialConvert, materialListPZ, accountingcode, department, roleListid, materialList } from "@/api/ruoyi-myLuckyexcel/myluckyexcel";
import { addInsert,addInsertAccount1,addInsertAccount2 } from "@/api/system/historydata"
/*import luckysheet from 'luckysheet'*/
import LuckyExcel from 'luckyexcel'
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
import { exportExcel } from '../../../../public/exportExcel';
import { v4 as uuidv4 } from 'uuid';
import { getInfo } from "@/api/login";
// import moment from 'moment';
import { listSuppliesexpense } from "../../../api/ActClassification/ActClassification";
var fileName = "新建XLSX工作表"; //定义表名
var rule = [];
var tempId;
var roleId;
var uuid1;
var trueORfalse = false;
var modify = false;
export default {
import { selectActSuppliesHistorydata } from "@/api/Actsupplies/cleaning_rule";
import { getSuppliesTemplate, listSuppliesTemplate, roleList, materialConvert, materialListPZ, accountingcode, department, roleListid, materialList } from "@/api/ruoyi-myLuckyexcel/myluckyexcel";
import { addInsert, addInsert1, addInsert2, addInsertAccount1, addInsertAccount2 } from "@/api/system/historydata"
/*import luckysheet from 'luckysheet'*/
import LuckyExcel from 'luckyexcel'
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
/*import {materialList} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";*/
import { exportExcel } from '../../../../public/exportExcel';
import { v4 as uuidv4 } from 'uuid';
import { getInfo } from "@/api/login";
import { listSuppliesexpense } from "../../../api/ActClassification/ActClassification";
var fileName = "新建XLSX工作表"; //定义表名
var rule = [];
var tempId;
var roleId;
var uuid1;
var trueORfalse = false;
var modify = false;
export default {
name: "Mymodule",
data() {
return {
......@@ -170,7 +169,8 @@ export default {
getSuppliesTemplate(1248).then(response => {
const sysSupplies = response.rows;
this.luckysheetData = sysSupplies[0].templateContent;
this.VoucherForm = JSON.parse(sysSupplies[0].templateContent);
let VoucherForm = JSON.parse(sysSupplies[0].templateContent);
this.VoucherForm = JSON.stringify(VoucherForm)
})
getSuppliesTemplate(1257).then(response => {
this.generate.historyName = response.rows[0].templateName + '(生成文件)';
......@@ -196,8 +196,17 @@ export default {
}
},
handledateChange(value) {
// const newDate = moment(value, 'MM/DD/YYYY').format('YYYY-MM');
this.date = value
const date = new Date(value);
// 获取年份和月份
const year = date.getFullYear(); // 获取年份
const month = (date.getMonth() + 1).toString().padStart(2, "0"); // 获取月份并补零处理
// 将年份和月份拼接成 "YYYY-MM" 的格式
const formattedDate = year + "-" + month;
this.date = formattedDate
if (this.date == '' || this.date == null || this.date == undefined) {
this.disableNextButton = true;
} else {
......@@ -224,6 +233,8 @@ export default {
},
/** 下拉选和页面luckysheet绑定 */
handleOptionChange(value) {
this.date = ''
this.mining = ''
this.value = value
this.selectedRule = '';
this.disableNextButton = this.selectedRule === '';
......@@ -364,19 +375,14 @@ export default {
},
async handleFileChange(evt) {
this.zhuan(evt)
if (modify) {
this.$confirm('再次导入将会清空表内数据,是否继续操作?', '注意!!!', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
// 确认继续后刷新页面返回模板
getSuppliesTemplate(7).then(response => {
getSuppliesTemplate(this.selectedOption).then(response => {
const sysSupplies = response.rows;
this.luckysheetData = sysSupplies[0].templateContent;
let json_data = JSON.parse(sysSupplies[0].templateContent);
......@@ -389,38 +395,19 @@ export default {
lang: 'zh',
});
modify = false;
this.zhuan(evt)
}).then(async () => {
this.showMask = true;
//将导入数据替换保存
LuckyExcel.transformExcelToLucky(evt, exportJson => {
this.zhuan(exportJson)
// this.summary(exportJson)
.then(async () => {
// this.submit(exportJson);
})
.catch(error => {
this.$message({
message: error.message,
type: "error"
});
})
.finally(() => {
// 导入完成后关闭遮罩层
this.showMask = false;
});
});
}).catch(() => {
// 处理错误逻辑,这里是一个空的错误处理函数
this.$message.error('查询失败,模板未找到,请联系管理员进行处理!');
});
}).catch(() => {
// 用户点击了取消按钮
this.$message({ type: 'info', message: '操作已取消' });
});
} else {
this.zhuan(evt)
this.showMask = true;
LuckyExcel(evt, exportJson => {
//获取导入表格所有数据exportJson
......@@ -459,9 +446,6 @@ export default {
transformPromise.then((result) => {
let resultJSON = JSON.stringify(result.sheets)
cc = result;
let codess = this.codess
let he = this.jsondata
......@@ -618,7 +602,6 @@ export default {
duplicateData.push(obj);
}
}
//金额所在列和行,去模板表中查找,如果行列一致则替换
for (let i = 0; i < duplicateData.length; i++) {
// // 对比 c 和 r 是否与 he[0]["celldata"] 中相应对象相同
......@@ -639,6 +622,8 @@ export default {
showinfobar: false, //是否显示顶部名称栏
lang: 'zh',
});
modify = true
this.showMask = false;
}
//this.from 往后台村的数据
......@@ -673,21 +658,13 @@ export default {
}
});
});
this.middle = he
this.Vouchers(duplicateData)
this.showMask = false;
} else {
this.open4()
this.showMask = false;
}
});
},
......@@ -715,7 +692,7 @@ export default {
sum[0].v += duplicateData[i].v.v;
}
}
var VoucherForm = this.VoucherForm
var VoucherForm = JSON.parse(this.VoucherForm)
//表头所有数据
let filteredData = VoucherForm[0].celldata.filter(obj => obj.r === 5);
//我所需要的数据
......@@ -740,7 +717,7 @@ export default {
let Classification;
let oldClassification;
if (foundObjects.length >= 2) {
oldClassification=foundObjects[0].c
oldClassification = foundObjects[0].c
Classification = foundObjects[1].c;
} else {
// 处理找不到两个满足条件的对象的情况
......@@ -777,8 +754,15 @@ export default {
"m": ""
}
}
// let date = moment().format('l');
// const newDate = moment(date, 'MM/DD/YYYY').format('YYYY-MM-DD');
const currentDate = new Date();
// 获取年份、月份和日期
const year = currentDate.getFullYear(); // 获取当前的年份
const month = currentDate.getMonth() + 1; // 获取当前的月份,记得要加 1
const day = currentDate.getDate(); // 获取当前的日期
//将年份、月份和日期拼接成 YYYY-MM-DD 的格式
const formattedDate = `${year}-${month}-${day}`;
let isArray = []
function generateUniqueShortUuid() {
return uuidv4().substring(0, 8);
......@@ -786,11 +770,12 @@ export default {
let data1 = [
generateUniqueShortUuid(), this.select, this.select, this.date, '', '熊亚维', '转本月材料分配', 'CNY', 'E001', '1.00000000', newDate, '1'
generateUniqueShortUuid(), this.select, this.select, this.date, '', '熊亚维', '转本月材料分配', 'CNY', 'E001', '1.00000000', formattedDate, '1'
]
let filteredArr;
accountingcode(newData).then(response => {
filteredArr = response.rows.map(obj =>
Object.entries(obj)
......@@ -981,7 +966,10 @@ export default {
showinfobar: false, //是否显示顶部名称栏
lang: 'zh',
});
modify = true
this.showMask = false;
}
VoucherForm[0].celldata = []
})
......@@ -1013,6 +1001,9 @@ export default {
let datastr = fullYear + month;
this.dfrom.date = datastr
this.dfrom.mining = this.mining
this.dfrom.accountingcode
this.dfrom.indexRow
this.from.status = this.dfrom.status = 0;
list.push(this.dfrom);
this.from.historyName = fileName + '(生成文件)';
......@@ -1034,7 +1025,7 @@ export default {
/** 导出设置 */
handleExport: debounce(function () {
// 处理点击事件
exportExcel(luckysheet.getAllSheets(), fileName, trueORfalse);
exportExcel(luckysheet.getAllSheets(), fileName, trueORfalse, this.value);
// 清洗数据
selectActSuppliesHistorydata(3).then(response => {
......@@ -1087,12 +1078,12 @@ export default {
}, 500), // 设置延迟时间,单位为毫秒
}
// 配置项111
};
};
// debounce函数定义
function debounce(func, delay) {
// debounce函数定义
function debounce(func, delay) {
let timer;
return function () {
const context = this;
......@@ -1102,8 +1093,8 @@ function debounce(func, delay) {
func.apply(context, args);
}, delay);
};
}
function getKeyByValue(map, value) {
}
function getKeyByValue(map, value) {
for (let [key, val] of map) {
if (val === value) {
return key;
......@@ -1112,15 +1103,15 @@ function getKeyByValue(map, value) {
return key;
}
}
}
function generateUUID() {
}
function generateUUID() {
let array = new Uint32Array(4);
window.crypto.getRandomValues(array);
return array.join("-");
}
}
</script>
<style>
.mask {
.mask {
position: fixed;
top: 0;
left: 0;
......@@ -1130,9 +1121,9 @@ function generateUUID() {
display: flex;
justify-content: center;
align-items: center;
}
}
.loading-spinner {
.loading-spinner {
/* 添加你的加载动画样式 */
width: 40px;
height: 40px;
......@@ -1140,9 +1131,9 @@ function generateUUID() {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
animation: spin 1s linear infinite;
}
}
@keyframes spin {
@keyframes spin {
0% {
transform: rotate(0deg);
}
......@@ -1150,5 +1141,5 @@ function generateUUID() {
100% {
transform: rotate(360deg);
}
}
}
</style>
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