提交 c08f08ac authored 作者: 133's avatar 133

[报废 维修] 单据数据代码提交

上级 5da40544
......@@ -16,6 +16,7 @@ import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.misc.utils.TaskDisposeUtil;
import io.swagger.annotations.Api;
......@@ -96,6 +97,7 @@ public class DeviceScrapController {
names.forEach(s -> stringBuffer2.append(s).append(","));
stringBuffer2.deleteCharAt(stringBuffer2.length() - 1);
scrapBill.setNames(stringBuffer2.toString());
scrapBill.setScriptJson(JacksonUtil.toJSon(scrapSaveVo.getScriptSaveVos()));
ScrapBill scrapBill1 = scrapBillService.add(scrapBill);
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
......
package com.tykj.dev.device.scrap.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.scrap.repository.ScrapBillDao;
import com.tykj.dev.device.scrap.service.ScrapBillService;
import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
......@@ -69,9 +71,12 @@ public class ScrapBillServiceImpl implements ScrapBillService {
@Override
public ScrapBill getOne(Integer id) {
Optional<ScrapBill> scrapBill = scrapBillDao.findById(id);
if (scrapBill.isPresent()) {
return scrapBill.get();
Optional<ScrapBill> scrapBillOptional = scrapBillDao.findById(id);
if (scrapBillOptional.isPresent()) {
ScrapBill scrapBill=scrapBillOptional.get();
scrapBill.setScripts(JacksonUtil.readValue(scrapBill.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {
}));
return scrapBill;
} else {
throw new ApiException(ResultUtil.failed("查询Id不存在"));
}
......
package com.tykj.dev.device.scrap.subject.domin;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -14,7 +15,9 @@ import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
......@@ -97,6 +100,13 @@ public class ScrapBill {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@Column(name = "script_json",columnDefinition = "TEXT")
private String scriptJson;
@Transient
private List<ScriptSaveVo> scripts = new ArrayList<>();
@ApiModelProperty(value = "区块链记录id")
private String recordId;
}
package com.tykj.dev.device.scrap.subject.vo;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import com.tykj.dev.misc.base.BeanHelper;
import io.swagger.annotations.ApiModel;
......@@ -9,9 +10,11 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import javax.persistence.Transient;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -57,6 +60,8 @@ public class ScrapSaveVo {
@NotEmpty(message = "deviceIds不能为空")
@ApiModelProperty(value = "报废装备Id列表")
private List<Integer> deviceIds;
private List<ScriptSaveVo> scriptSaveVos = new ArrayList<>();
public ScrapBill toDo() {
ModelMapper modelMapper = BeanHelper.getUserMapper();
......
......@@ -17,6 +17,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableJpaAuditing
@EnableTransactionManagement
@EnableScheduling
public class UnionApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(UnionApplication.class, args);
......@@ -26,20 +27,4 @@ public class UnionApplication extends SpringBootServletInitializer {
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
return applicationBuilder.sources(UnionApplication.class);
}
// @Bean
// public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
// return args -> {
//
// System.out.println("Let's inspect the beans provided by Spring Boot:");
//
// String[] beanNames = ctx.getBeanDefinitionNames();
// Arrays.sort(beanNames);
// for (String beanName : beanNames) {
// System.out.println(beanName);
// }
//
// };
// }
}
<config>
<input>
<jar in="confusion-0.0.1-SNAPSHOT.jar" out="confusion-0.0.1-SNAPSHOT-obfuscated.jar"/>
</input>
<keep-names>
<class access="protected+">
<field access="protected+"/>
<method access="protected+"/>
</class>
</keep-names>
<property name="log-file" value="log.xml"/>
</config>
......@@ -3,4 +3,4 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update
file.path=C:/Users/dengdiyi/Documents/file/
\ No newline at end of file
#file.path=C:/Users/dengdiyi/Documents/file/
\ No newline at end of file
spring.datasource.driver-class-name=com.oscar.Driver
spring.datasource.url=jdbc:oscar://192.168.0.80:2003/OSRDB
spring.datasource.url=jdbc:oscar://192.168.0.80:8088/OSRDB
spring.datasource.username=SYSDBA
spring.datasource.password=szoscar55
spring.jpa.database-platform=org.hibernate.dialect.OscarDialect
file.path=/opt/zb/
preview.path=http://192.168.0.80:8088/equip/file/
\ No newline at end of file
......@@ -11,7 +11,7 @@ spring.main.allow-bean-definition-overriding=true
server.servlet.session.timeout=PT1H
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
file.path=/Users/zjm/code/
preview.path=http://192.168.102.26:8087/file/
file.path=/Users/zjm/code/test-tu/
preview.path=http://192.168.102.169:8087/file/
useBlockcha=true
spring.jpa.hibernate.use-new-id-generator-mappings=false
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论