This commit is contained in:
杜建超 2020-12-07 10:59:53 +08:00
parent d6492015c5
commit 4b45430b95
5 changed files with 25 additions and 6 deletions

View File

@ -26,6 +26,7 @@ import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.Print;
import com.lz.modules.sys.entity.Resource;
import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.entity.app.ResultComment;
import com.lz.modules.sys.entity.app.ResultDetail;
@ -50,6 +51,8 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
@ -123,6 +126,9 @@ public class ResultRecordController extends AbstractController {
@Autowired
private ResourceService resourceService;
private final static String TYPE = "H5_URL";
private final static String SEC_TYPE = "RECORD";
/**
* 列表
*/
@ -1260,20 +1266,23 @@ public class ResultRecordController extends AbstractController {
if(CollectionUtils.isEmpty(reqs)){
return R.error("添加数据为空");
}
String time = LocalDate.now().toString();
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String time = dtf.format(now);
List<Print> prints = Lists.newArrayList();
int i =1;
Resource resource = resourceService.selectResourceByTypeAndSecType(TYPE, SEC_TYPE);
for(RecordDetailExplanReq recordDetailExplanReq:reqs){
Print print = new Print();
BeanUtils.copyProperties(recordDetailExplanReq,print);
print.setBatchNo(time + "_" + recordDetailExplanReq.getRecordId() + "_" + i++);
print.setUrl("");
Optional.ofNullable(resource).ifPresent(resource1 -> print.setUrl(resource1.getValue()));
prints.add(print);
}
/*if(!printService.saveBatch(prints)){
if(!printService.saveBatch(prints)){
return R.error("保存失败");
}*/
}
return R.ok();
}

View File

@ -22,5 +22,6 @@ public interface ResourceMapper extends BaseMapper<Resource> {
int deleteResourceById(@Param("id") Long id);
Resource selectResourceByTypeAndSecType(@Param("type") String Type, @Param("secType") String secType);
}

View File

@ -21,5 +21,7 @@ public interface ResourceService extends IService<Resource> {
int deleteResourceById(Long id);
Resource selectResourceByTypeAndSecType(String type,String secType);
}

View File

@ -49,6 +49,8 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
return resourceMapper.deleteResourceById(id);
}
@Override
public Resource selectResourceByTypeAndSecType(String type, String secType) {
return resourceMapper.selectResourceByTypeAndSecType(type,secType);
}
}

View File

@ -38,6 +38,11 @@
</select>
<select id="selectResourceByTypeAndSecType" resultType="com.lz.modules.sys.entity.Resource">
select * from lz_resource where type=#{type} and sec_type=#{secType} and is_delete = 0 limit 1
</select>
<insert id="insertResource" parameterType="Resource" useGeneratedKeys="true" keyProperty="id" >
insert into lz_resource(
<if test="creator != null">creator, </if>