BUG修改

This commit is contained in:
haozq 2024-11-16 16:53:04 +08:00
parent 41fb2ae361
commit 44b3f74168
5 changed files with 42 additions and 30 deletions

View File

@ -164,17 +164,14 @@ public class PartApplyAppServiceImp {
*/ */
public ServerResponse uploadImage(HttpServletRequest request) { public ServerResponse uploadImage(HttpServletRequest request) {
try{ try{
String id=request.getParameter("params"); String id=request.getParameter("recordId");
String bast64s=request.getParameter("bast64"); String bast64=request.getParameter("bast64");
List<String> files=JSON.parseArray(bast64s,String.class);
if(StringHelper.isEmpty(id)){ if(StringHelper.isEmpty(bast64)){
return ServerResponse.createErroe("请选择申请记录");
}
if(files==null || files.size()<1){
return ServerResponse.createErroe("请先上传文件"); return ServerResponse.createErroe("请先上传文件");
} }
List<FileUploadVo> fileList=uploadService.uploadImageBast64(files,id,"t_part_apply","使用照片"); List<FileUploadVo> fileList=uploadService.uploadImageBast64(bast64,id,"t_part_apply","使用照片");
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.size()){ if(StringUtils.isEmpty(fileList) || fileList.size()<1){
return ServerResponse.createErroe("文件上传失败"); return ServerResponse.createErroe("文件上传失败");
} }
return ServerResponse.createSuccess("文件上传成功","文件上传成功"); return ServerResponse.createSuccess("文件上传成功","文件上传成功");

View File

@ -72,14 +72,14 @@ public class PartApplyServiceImpl implements PartApplyService{
String infoMsg = String.join(",", info); String infoMsg = String.join(",", info);
vo.setInfoMsg(infoMsg); vo.setInfoMsg(infoMsg);
//图片转换 //图片转换
String bast641=transBast64(vo.getLyUrl()); // String bast641=transBast64(vo.getLyUrl());
String bast642=transBast64(vo.getCkUrl()); // String bast642=transBast64(vo.getCkUrl());
String bast643=transBast64(vo.getShUrl()); // String bast643=transBast64(vo.getShUrl());
String bast644=transBast64(vo.getZdUrl()); // String bast644=transBast64(vo.getZdUrl());
vo.setLyUrl(bast641); // vo.setLyUrl(bast641);
vo.setCkUser(bast642); // vo.setCkUser(bast642);
vo.setShUrl(bast643); // vo.setShUrl(bast643);
vo.setZdUrl(bast644); // vo.setZdUrl(bast644);
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_apply",null); List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_apply",null);
vo.setFileList(flieList); vo.setFileList(flieList);
return ServerResponse.createSuccess(vo); return ServerResponse.createSuccess(vo);

View File

@ -37,10 +37,9 @@ public class FileUploadService {
public List<FileUploadVo> uploadImageBast64(List<String> files , String outId, String table,String type){ public List<FileUploadVo> uploadImageBast64(String bast64, String outId, String table,String type){
List<FileUploadVo> list=new ArrayList<>(); List<FileUploadVo> list=new ArrayList<>();
try { try {
for (String bast64 : files) {
String fileName=IDUtils.createID()+".png"; String fileName=IDUtils.createID()+".png";
String filePath= "/"+DateTimeHelper.getNowYMD()+"/"+ fileName; String filePath= "/"+DateTimeHelper.getNowYMD()+"/"+ fileName;
String newPath= SystemUtils.getUploadPath()+filePath; String newPath= SystemUtils.getUploadPath()+filePath;
@ -68,7 +67,6 @@ public class FileUploadService {
} }
list.add(vo); list.add(vo);
mapper.insertFileUpload(vo); mapper.insertFileUpload(vo);
}
}catch (Exception e){ }catch (Exception e){
log.error(e.toString(),e); log.error(e.toString(),e);
} }

View File

@ -5,9 +5,25 @@
<insert id="addPartApply" useGeneratedKeys="true" keyProperty="id"> <insert id="addPartApply" useGeneratedKeys="true" keyProperty="id">
INSERT INTO t_part_apply( INSERT INTO t_part_apply(
code, creator, user_name, create_time, type, remark, status, updater, code, creator, user_name, create_time, type, remark, status, updater,
update_time, dev_id,dev_code, dev_type, pro_id, pro_name, update_time,
apply_num,status_type)values( <if test="deviceId!=null and deviceId!=''">
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),#{deviceId},#{devCode}, #{devType},#{proId},#{proName} dev_id,
</if>
dev_code, dev_type,
<if test="proId!=null and proId!=''">
pro_id ,
</if>
pro_name,
apply_num,status_type)values(
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),
<if test="deviceId!=null and deviceId!=''">
#{deviceId},
</if>
#{devCode}, #{devType},
<if test="proId!=null and proId!=''">
#{proId},
</if>
#{proName}
,#{applyNum},#{statusType}) ,#{applyNum},#{statusType})
</insert> </insert>
<!--差人申请详情--> <!--差人申请详情-->

View File

@ -69,20 +69,21 @@
</select> </select>
<!--以工程为维度查询领料单详情--> <!--以工程为维度查询领料单详情-->
<select id="getProDetailsPage" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo"> <select id="getProDetailsPage" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
select pad.part_id partId,pad.part_type partType,pad.part_name partName,pad.part_model partModel,pad.part_unit partUnit, select pad.part_id partId, ANY_VALUE(pad.part_type) partType,ANY_VALUE(pad.part_name) partName,
sum(pad.apply_num) applyNum,pt.price,sum(pad.apply_num*pt.price) money ANY_VALUE(pad.part_model) partModel,ANY_VALUE(pad.part_unit) partUnit,ANY_VALUE(tpa.remark) remark ,
ANY_VALUE(sum(pad.apply_num)) applyNum,ANY_VALUE(pt.price) price ,ANY_VALUE(sum(pad.apply_num*pt.price)) money
from t_part_apply tpa from t_part_apply tpa
LEFT JOIN t_part_apply_details pad on pad.apply_id=tpa.id LEFT JOIN t_part_apply_details pad on pad.apply_id=tpa.id
left join pa_type pt on pad.part_id=pt.id left join pa_type pt on pad.part_id=pt.id
where tpa.`status`=4 and tpa.pro_id=#{proId} where tpa.`status`=4 and tpa.pro_id=#{proId}
<if test="partType!=null and partType !=''"> <if test="partType!=null and partType !=''">
and tpa.part_type like concat('%',#{partType},'%') and pad.part_type like concat('%',#{partType},'%')
</if> </if>
<if test="partName!=null and partName !=''"> <if test="partName!=null and partName !=''">
and tpa.part_name like concat('%',#{partName},'%') and pad.part_name like concat('%',#{partName},'%')
</if> </if>
<if test="partModel!=null and partModel !=''"> <if test="partModel!=null and partModel !=''">
and tpa.part_model like concat('%',#{partModel},'%') and pad.part_model like concat('%',#{partModel},'%')
</if> </if>
GROUP BY pad.part_id GROUP BY pad.part_id
</select> </select>