Commit a9907806 authored by lenovo's avatar lenovo

通用转换数据清洗

parent 6c9420b5
......@@ -30,11 +30,11 @@ public class ActSuppliesCleaningRuleController extends BaseController
* 获取所有历史数据
*/
@PreAuthorize("@ss.hasPermi('system:cleaningrule:queryAll')")
@GetMapping("/queryAll")
public AjaxResult selectActSuppliesHistorydata()
@GetMapping("/queryAll/{tylkStatus}")
public AjaxResult selectActSuppliesHistorydata(@PathVariable("tylkStatus") Integer tylkStatus)
{
List<ActSuppliesHistorydata> s = actSuppliesHistorydataService.selectActSuppliesHistorydata();
List<ActSuppliesHistorydata> s = actSuppliesHistorydataService.selectActSuppliesHistorydata(tylkStatus);
return AjaxResult.success(s);
}
......
......@@ -115,7 +115,7 @@ public class ActSuppliesHistorydataController extends BaseController
}
/**
* 数据清洗 历史数据 生成
* 数据清洗 六矿生成表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsert1')")
@PostMapping("/addInsert1")
......@@ -127,7 +127,7 @@ public class ActSuppliesHistorydataController extends BaseController
}
/**
* 数据清洗 历史数据 导入
* 数据清洗 六矿导入表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsert2')")
@PostMapping("/addInsert2")
......@@ -139,6 +139,31 @@ public class ActSuppliesHistorydataController extends BaseController
return toAjax(1);
}
/**
* 数据清洗 通用生成表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsertConvert1')")
@PostMapping("/addInsertConvert1")
public AjaxResult addInsertConvert1(@RequestBody List<ActOperation1> actOperation2s)
{
actSuppliesHistorydataService.addInsertConvert1(actOperation2s);
return toAjax(1);
}
/**
* 数据清洗 通用导入表数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsertConvert2')")
@PostMapping("/addInsertConvert2")
public AjaxResult addInsertConvert2(@RequestBody List<ActOperation1> actOperation2s)
{
actSuppliesHistorydataService.addInsertConvert2(actOperation2s);
return toAjax(1);
}
}
......@@ -59,6 +59,9 @@ public class ActSuppliesHistorydata extends BaseEntity
@Excel(name = "状态")
private Long status;
/** 通用or六矿 */
private Long tylkStatus;
/** 是否清洗 */
private Long cleanStatus;
......@@ -170,6 +173,14 @@ public class ActSuppliesHistorydata extends BaseEntity
return status;
}
public Long getTylkStatus() {
return tylkStatus;
}
public void setTylkStatus(Long tylkStatus) {
this.tylkStatus = tylkStatus;
}
public Long getCleanStatus() {
return cleanStatus;
}
......
......@@ -23,4 +23,8 @@ public interface ActSuppliesCleaningRuleMapper
int deleteActSuppliesSixMinesSummaryTable(Long hId);
int deleteActSuppliesImportTable(Long hId);
void addInsertConvert1(ActSuppliesImportTable actSuppliesImportTable);
void addInsertConvert2(ActSuppliesImportTable actSuppliesImportTable);
}
......@@ -66,12 +66,13 @@ public interface ActSuppliesHistorydataMapper
void insertActSuppliesHistorydatas(ActSuppliesHistorydata actSuppliesHistorydata1);
void updateActSuppliesHistorydatas(ActSuppliesHistorydata actSuppliesHistorydata);
/**
* 获取所有历史数据
*
* @return 结果
*/
List<ActSuppliesHistorydata> selectActSuppliesHistorydata();
List<ActSuppliesHistorydata> selectActSuppliesHistorydata(Integer tylkStatus);
int updateActSuppliesHistorydataStatusById(Long gethId);
}
......@@ -67,7 +67,7 @@ public interface IActSuppliesHistorydataService
*
* @return 结果
*/
List<ActSuppliesHistorydata> selectActSuppliesHistorydata();
List<ActSuppliesHistorydata> selectActSuppliesHistorydata(Integer tylkStatus);
/**
* 修改历史数据通过id
*
......@@ -78,4 +78,8 @@ public interface IActSuppliesHistorydataService
void addInsertImport(List<ActOperation1> actOperation2s);
void addInsertImportss(List<ActOperation1> actOperation2s);
void addInsertConvert1(List<ActOperation1> actOperation2s);
void addInsertConvert2(List<ActOperation1> actOperation2s);
}
......@@ -147,25 +147,22 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
if (actSuppliesHistorydata.get(i).getIdentifyingCode()==0){
actSuppliesHistorydata1.setImportUuid(actSuppliesHistorydata.get(0).getImportUuid());
actSuppliesHistorydata1.setTemplateId(actSuppliesHistorydata.get(0).getTemplateId());
actSuppliesHistorydata1.setRoleId(actSuppliesHistorydata.get(i).getRoleId());
actSuppliesHistorydata1.setStatus(1L);
actSuppliesHistorydata1 = actSuppliesHistorydata.get(i);
actSuppliesHistorydata1.setStatus(0L);
actSuppliesHistorydata1.setIdentifyingCode(0L);
actSuppliesHistorydata1.setDate(actSuppliesHistorydata.get(i).getDate());
actSuppliesHistorydata1.setMining(actSuppliesHistorydata.get(i).getMining());
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
}else {
actSuppliesHistorydata1 = actSuppliesHistorydata.get(i);
actSuppliesHistorydata1.setStatus(0L);
actSuppliesHistorydata1.setIdentifyingCode(1L);
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
}
}
actSuppliesHistorydata1.setImportUuid(actSuppliesHistorydata.get(0).getImportUuid());
actSuppliesHistorydata1.setTemplateId(actSuppliesHistorydata.get(0).getTemplateId());
actSuppliesHistorydata1.setStatus(1L);
actSuppliesHistorydata1.setIdentifyingCode(1L);
actSuppliesHistorydata1.setDate(actSuppliesHistorydata.get(0).getDate());
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
for (int i=0;i<actSuppliesHistorydata.size();i++){
......@@ -186,8 +183,8 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
* @return 结果
*/
@Override
public List<ActSuppliesHistorydata> selectActSuppliesHistorydata() {
return actSuppliesHistorydataMapper.selectActSuppliesHistorydata();
public List<ActSuppliesHistorydata> selectActSuppliesHistorydata(Integer tylkStatus) {
return actSuppliesHistorydataMapper.selectActSuppliesHistorydata(tylkStatus);
}
@Override
......@@ -246,7 +243,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).getId());
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).gethId());
}
......@@ -274,7 +271,16 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
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", "A64", "A65", "A66", "A67", "A68", "A69", "A70", "A71", "A72", "A73", "A74", "A75", "A76", "A77", "A78", "A79", "A80", "A81", "A82", "A83", "A84", "A85", "A86", "A87", "A88", "A89", "A90", "A91", "A92", "A93", "A94", "A95", "A96", "A97", "A98", "A99", "A100"};
//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++) {
//获取导入excel表数据存储到生成表实体类中
for (int x = 0; x < actOperation2s.get(i).getActOperation2().length; x++) {
......@@ -314,11 +320,158 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).getId());
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).gethId());
}
}
};
thread.start();
}
/**
* 通用生成表数据清洗
*
* @return 结果
*/
@Override
@Transactional
public void addInsertConvert1(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++) {
//获取导入excel表数据存储到生成表实体类中
for (int x = 0; x < actOperation2s.get(i).getActOperation2().length; x++) {
//判断数据是否为空,为空结束循环
if (actOperation2s.get(i).getActOperation2()[x]!=null){
ActSuppliesImportTable actSuppliesImportTable = new ActSuppliesImportTable();
UUID uuid = UUID.randomUUID();
String s = StringUtils.remove(uuid.toString(), '-');
actSuppliesImportTable.setId(s);
actSuppliesImportTable.sethId(actOperation2s.get(i).gethId());
actSuppliesImportTable.sethDate(actOperation2s.get(i).gethDate());
actSuppliesImportTable.setMining(actOperation2s.get(i).getMining());
//获取数组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.addInsertConvert1(actSuppliesImportTable);
}else {
break;
}
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).gethId());
}
}
};
thread.start();
}
/**
* 通用导入表数据清洗
*
* @return 结果
*/
@Override
@Transactional
public void addInsertConvert2(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++) {
//获取导入excel表数据存储到生成表实体类中
for (int x = 0; x < actOperation2s.get(i).getActOperation2().length; x++) {
//判断数据是否为空,为空结束循环
if (actOperation2s.get(i).getActOperation2()[x]!=null){
ActSuppliesImportTable actSuppliesImportTable = new ActSuppliesImportTable();
UUID uuid = UUID.randomUUID();
String s = StringUtils.remove(uuid.toString(), '-');
actSuppliesImportTable.setId(s);
actSuppliesImportTable.sethId(actOperation2s.get(i).gethId());
actSuppliesImportTable.sethDate(actOperation2s.get(i).gethDate());
actSuppliesImportTable.setMining(actOperation2s.get(i).getMining());
//获取数组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.addInsertConvert2(actSuppliesImportTable);
}else {
break;
}
}
//修改历史表中的数据状态(是否清洗)
actSuppliesHistorydataMapper.updateActSuppliesHistorydataStatusById(actOperation2s.get(i).gethId());
}
}
};
thread.start();
......
......@@ -176,6 +176,293 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="addInsertConvert1" parameterType="ActSuppliesImportTable" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_generate_six
<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="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="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>
<insert id="addInsertConvert2" parameterType="ActSuppliesImportTable" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_generate_table
<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="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="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>
<delete id="deleteActSuppliesSixMinesSummaryTable" parameterType="Long">
delete from act_supplies_sixminessummarytable where h_id = #{id}
</delete>
......
......@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="historyContent" column="history_content" />
<result property="identifyingCode" column="identifying_code" />
<result property="cleanStatus" column="clean_status" />
<result property="tylkStatus" column="tylk_status" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
......@@ -60,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="historyContent != null">history_content,</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>
......@@ -75,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="historyContent != null">#{historyContent},</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>
......@@ -133,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="historyContent != null">history_content = #{historyContent},</if>
<if test="identifyingCode != null">identifying_code = #{identifyingCode},</if>
clean_status = 0,
<if test="tylkStatus != null">tylk_status = #{tylkStatus},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
......@@ -147,17 +151,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</update>
<select id="selectActSuppliesHistorydata" resultMap="ActSuppliesHistorydataResult">
<select id="selectActSuppliesHistorydata" parameterType="java.lang.Integer" resultMap="ActSuppliesHistorydataResult">
<include refid="selectActSuppliesHistorydataVo"/>
where clean_status = 0
where clean_status = 0 and tylk_status =#{tylkStatus}
</select>
<update id="updateActSuppliesHistorydataStatusById" parameterType="java.lang.Long">
update act_supplies_historydata
set clean_status = 1
<where>
<if test="hId != null">and id = #{hId}</if>
<if test="gethId != null">and id = #{gethId}</if>
</where>
</update>
</mapper>
......
import request from '@/utils/request'
// 查询六矿汇总表数据
export function selectActSuppliesHistorydata() {
export function selectActSuppliesHistorydata(tylkStatus) {
return request({
url: '/system/cleaningrule/queryAll',
url: '/system/cleaningrule/queryAll/'+tylkStatus,
method: 'get'
})
......
......@@ -79,3 +79,21 @@ export function addInsert2(data) {
data: data
})
}
// 数据清洗 历史数据
export function addInsertConvert1(data) {
return request({
url: '/system/historydata/addInsertConvert1',
method: 'post',
data: data
})
}
// 数据清洗 历史数据
export function addInsertConvert2(data) {
return request({
url: '/system/historydata/addInsertConvert2',
method: 'post',
data: data
})
}
......@@ -66,21 +66,23 @@
</div>
</template>
<script>
import {getSuppliesTemplate, listSuppliesTemplate} from "@/api/ruoyi-myLuckyexcel/myluckyexcel";
import {convertRoleList, convertRoleListid} from "@/api/ActSuppliesConvert/convert"
import {addInsert,addInsertConvert1,addInsertConvert2}from "@/api/system/historydata"
/*import luckysheet from 'luckysheet'*/
import LuckyExcel from 'luckyexcel'
//导入库export.js 这个文件是es6的,不能在普通的HTML文件直接引入js文件(虽然都是js文件,但是有区别,具体请百度es6与es5)!需要把es6转es5才可以直接引入使用!
import {exportExcel} from '../../../../public/exportExcel';
import {v4 as uuidv4} from 'uuid';
import {selectActSuppliesHistorydata} from "@/api/Actsupplies/cleaning_rule";
var fileName = "新建XLSX工作表"; //定义表名
var rule = [];
var tempId;
var roleId;
var uuid1;
export default {
name: "Mymodule",
data() {
......@@ -101,6 +103,8 @@ export default {
// 表单参数
from: {},
dfrom: {},
imp:{},
ssd:{},
// 查询参数
queryParams: {
status: 0
......@@ -164,6 +168,7 @@ export default {
roleId = this.selectedRule;
rule = response.rows;
});
uuid1=this.uuid=uuidv4().substring(0,8);
},
/** 回车事件和保存提交绑定 */
handleEnter(event) {
......@@ -234,6 +239,7 @@ export default {
try {
const exportJson = await cons;
await this.summary(exportJson);
this.submit(exportJson);
//console.log('summary 执行完毕');
} catch (Error) {
this.$message({
......@@ -247,6 +253,50 @@ export default {
this.showMask = false;
}
},
/** 保存导入文件和生成文件 */
submit(contents){
const name = contents.info.name;
const obj=contents.sheets;
let list=[];
//导入文件内容转json
let str = JSON.stringify(obj)// 对象转化为字符串
let objsheet = luckysheet.getAllSheets() // 得到表的数据
//生成文件转json
let strsheet = JSON.stringify(objsheet)// 对象转化为字符串
this.from.templateId=this.dfrom.templateId=tempId;
this.from.importUuid=this.dfrom.importUuid=uuid1;
this.from.roleId=this.dfrom.roleId=roleId;
this.dfrom.historyName=name+'(导入文件)';
this.dfrom.historyContent=str;
this.dfrom.identifyingCode=0;
this.dfrom.tylkStatus = 0;
let date = new Date(this.date);
let fullYear = date.getFullYear();
let month = ("0" + (date.getMonth() + 1)).slice(-2);
let datastr = fullYear + month;
this.dfrom.date = datastr
this.dfrom.mining = this.mining
this.from.status=this.dfrom.status=0;
list.push(this.dfrom);
this.from.historyName=fileName+'(生成文件)';
this.from.historyContent=strsheet;
this.from.identifyingCode=1;
this.from.date = datastr;
this.from.tylkStatus = 0;
list.push(this.from);
addInsert(list).then(response=>{
if(response.code==200){
this.$message({
message: '保存成功', type: 'success'
})
}
});
},
/** 物料转换汇总到页面*/
summary(exportJson) {
let sysRules;
......@@ -276,212 +326,280 @@ export default {
//判断模板表行列单元格/1行/2列/3单元格
if (sysRules[i].zt==1){
for (let j=parseInt(sysRules[i].ce),x=parseInt(sysRules[i].ct);j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++,x++){
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')){
luckysheet.setCellValue(parseInt(sysRules[i].rt),x,data[parseInt(sysRules[i].re)][j].v)
}
}
}else if (sysRules[i].zt==2){
for (let j=parseInt(sysRules[i].ce),x=parseInt(sysRules[i].rt);j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++,x++){
luckysheet.setCellValue(x,parseInt(sysRules[i].ct),data[parseInt(sysRules[i].re)][j].v)
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
luckysheet.setCellValue(x, parseInt(sysRules[i].ct), data[parseInt(sysRules[i].re)][j].v)
}
}
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==1){
for (let j=parseInt(sysRules[i].re),x=parseInt(sysRules[i].ct);j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++,x++){
luckysheet.setCellValue(parseInt(sysRules[i].rt),x,data[j][parseInt(sysRules[i].ce)].v)
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
luckysheet.setCellValue(parseInt(sysRules[i].rt), x, data[j][parseInt(sysRules[i].ce)].v)
}
}
}else if (sysRules[i].zt==2){
for (let j=parseInt(sysRules[i].re),x=parseInt(sysRules[i].rt);j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++,x++){
luckysheet.setCellValue(x,parseInt(sysRules[i].ct),data[j][parseInt(sysRules[i].ce)].v)
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
luckysheet.setCellValue(x, parseInt(sysRules[i].ct), data[j][parseInt(sysRules[i].ce)].v)
}
}
}
}else if (sysRules[i].ze==3){
if (sysRules[i].zt==1){
for (let x=parseInt(sysRules[i].ct);x<parseInt(sysRules[i].lt)+parseInt(sysRules[i].ct);x++){
luckysheet.setCellValue(parseInt(sysRules[i].rt),x,data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
luckysheet.setCellValue(parseInt(sysRules[i].rt), x, data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
}
}
}else if (sysRules[i].zt==2){
for (let x=parseInt(sysRules[i].rt);x<parseInt(sysRules[i].lt)+parseInt(sysRules[i].rt);x++){
luckysheet.setCellValue(x,parseInt(sysRules[i].ct),data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
luckysheet.setCellValue(x, parseInt(sysRules[i].ct), data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
}
}
}else if (sysRules[i].zt==3){
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v)
}
}
}
}else if (sysRules[i].ys ==2){//减法
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
sum-=parseInt(data[parseInt(sysRules[i].re)][j].v);
sum -= parseInt(data[parseInt(sysRules[i].re)][j].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
sum-=parseInt(data[j][parseInt(sysRules[i].ce)].v);
sum -= parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
}else if (sysRules[i].ys ==3){//乘法
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
sum*=parseInt(data[parseInt(sysRules[i].re)][j].v);
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
sum *= parseInt(data[parseInt(sysRules[i].re)][j].v);
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
sum*=parseInt(data[j][parseInt(sysRules[i].ce)].v);
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
sum *= parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
}else if (sysRules[i].ys ==4){//除法
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
sum/=parseInt(data[parseInt(sysRules[i].re)][j].v);
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
sum /= parseInt(data[parseInt(sysRules[i].re)][j].v);
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
sum/=parseInt(data[j][parseInt(sysRules[i].ce)].v);
sum /= parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
}else if (sysRules[i].ys ==1){//和
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
debugger
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
sum+=parseInt(data[parseInt(sysRules[i].re)][j].v);
sum += parseInt(data[parseInt(sysRules[i].re)][j].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
sum+=parseInt(data[j][parseInt(sysRules[i].ce)].v);
sum += parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
}else if (sysRules[i].ys==5){//平均值
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
debugger
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
sum+=parseInt(data[parseInt(sysRules[i].re)][j].v);
sum += parseInt(data[parseInt(sysRules[i].re)][j].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum/parseInt(sysRules[i].le));
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum / parseInt(sysRules[i].le));
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
sum+=parseInt(data[j][parseInt(sysRules[i].ce)].v);
sum += parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum/parseInt(sysRules[i].le));
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum / parseInt(sysRules[i].le));
}
}
}
}else if (sysRules[i].ys==6){//最大值
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
debugger
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
if (sum<parseInt(data[parseInt(sysRules[i].re)][j].v)){
if (sum < parseInt(data[parseInt(sysRules[i].re)][j].v)) {
sum = parseInt(data[parseInt(sysRules[i].re)][j].v);
}
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
if (sum<parseInt(data[j][parseInt(sysRules[i].ce)].v)){
if (sum < parseInt(data[j][parseInt(sysRules[i].ce)].v)) {
sum = parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
}else if (sysRules[i].ys==7){//最小值
if (sysRules[i].ze==1){
if (sysRules[i].zt==3){
debugger
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].ce)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].ce);j++){
if (sysRules[i].zt==3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].ce) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].ce); j++) {
if (data[parseInt(sysRules[i].re)][j].hasOwnProperty('v')) {
if (sum<parseInt(data[parseInt(sysRules[i].re)][j].v)){
if (sum < parseInt(data[parseInt(sysRules[i].re)][j].v)) {
sum = parseInt(data[parseInt(sysRules[i].re)][j].v);
}
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}else if (sysRules[i].ze==2){
if (sysRules[i].zt==3){
let sum=parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j=parseInt(sysRules[i].re)+1;j<parseInt(sysRules[i].le)+parseInt(sysRules[i].re);j++){
}
}else if (sysRules[i].ze==2) {
if (sysRules[i].zt == 3) {
if (data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
let sum = parseInt(data[parseInt(sysRules[i].re)][parseInt(sysRules[i].ce)].v);
for (let j = parseInt(sysRules[i].re) + 1; j < parseInt(sysRules[i].le) + parseInt(sysRules[i].re); j++) {
if (data[j][parseInt(sysRules[i].ce)].hasOwnProperty('v')) {
if (sum<parseInt(data[j][parseInt(sysRules[i].ce)].v)){
if (sum < parseInt(data[j][parseInt(sysRules[i].ce)].v)) {
sum = parseInt(data[j][parseInt(sysRules[i].ce)].v);
}
}
}
luckysheet.setCellValue(parseInt(sysRules[i].rt),parseInt(sysRules[i].ct),sum);
luckysheet.setCellValue(parseInt(sysRules[i].rt), parseInt(sysRules[i].ct), sum);
}
}
}
......@@ -498,6 +616,56 @@ export default {
handleExport: debounce(function () {
// 处理点击事件
exportExcel(luckysheet.getAllSheets(), fileName)
selectActSuppliesHistorydata(0).then(response => {
var data = response.data;
let list = [];
let list1 = [];
for (let i = 0; i < data.length; i++) {
if (data[i].identifyingCode == 1) {
let parse = JSON.parse(data[i].historyContent);
let transToCellData = window.luckysheet.transToData(parse[0].celldata);
this.imp.hId = data[i].id;
this.imp.createBy = data[i].createBy;
//this.imp.hDate = data[i].date;
//this.imp.mining = data[i].mining;
this.imp.actOperation2 = transToCellData;
list.push(this.imp);
} else {
let parse = JSON.parse(data[i].historyContent);
let transToCellData = window.luckysheet.transToData(parse[0].celldata);
this.ssd.hId = data[i].id;
this.ssd.createBy = data[i].createBy;
//this.ssd.hDate = data[i].date;
//this.ssd.mining = data[i].mining;
this.ssd.actOperation2 = transToCellData;
list1.push(this.ssd);
}
}
addInsertConvert1(list).then(response => {
});
addInsertConvert2(list1).then(response => {
});
});
}, 500), // 设置延迟时间,单位为毫秒
}
// 配置项111
......
......@@ -1725,6 +1725,7 @@ export default {
this.dfrom.historyName=name+'(导入文件)';
this.dfrom.historyContent=str;
this.dfrom.identifyingCode=0;
this.dfrom.tylkStatus = 1;
let date = new Date(this.date);
......@@ -1739,6 +1740,8 @@ export default {
this.from.historyContent=strsheet;
this.from.identifyingCode=1;
this.from.date = datastr;
this.from.tylkStatus = 1;
this.from.mining = this.mining
list.push(this.from);
addInsert(list).then(response=>{
......@@ -1756,7 +1759,7 @@ export default {
exportExcel(luckysheet.getAllSheets(),fileName,trueORfalse);
// 清洗数据
selectActSuppliesHistorydata().then(response => {
selectActSuppliesHistorydata(1).then(response => {
var data = response.data;
let list=[];
......
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