Merge remote-tracking branch 'origin/master'
commit
0e4c4f3028
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import net.htjs.pt4.core.BaseController;
|
import net.htjs.pt4.core.BaseController;
|
||||||
|
import net.htjs.pt4.zzsxt.service.xxgl.xmkpgl.cgfp.IBoCgfpService;
|
||||||
import net.htjs.pt4.zzsxt.service.xxgl.xmkpgl.kpsq.IBoKpsqService;
|
import net.htjs.pt4.zzsxt.service.xxgl.xmkpgl.kpsq.IBoKpsqService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
@ -26,6 +27,8 @@ public class ApiController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBoKpsqService iBoKpsqService;
|
private IBoKpsqService iBoKpsqService;
|
||||||
|
@Autowired
|
||||||
|
private IBoCgfpService iBoCgfpService;
|
||||||
|
|
||||||
@PostMapping(value = "/list")
|
@PostMapping(value = "/list")
|
||||||
public Object dkpdjzbcx(@RequestBody String jsonStr){
|
public Object dkpdjzbcx(@RequestBody String jsonStr){
|
||||||
|
@ -182,4 +185,21 @@ public class ApiController extends BaseController {
|
||||||
map.put("data",jsonString);
|
map.put("data",jsonString);
|
||||||
return JSON.toJSONString(map);
|
return JSON.toJSONString(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/jxfpts")
|
||||||
|
public Object jxfpts(@RequestBody Map map , HttpSession session){
|
||||||
|
Map mapModel = new HashMap();
|
||||||
|
try {
|
||||||
|
iBoCgfpService.saveZZSGL_XX_JXFP(map);
|
||||||
|
mapModel.put("code","0");
|
||||||
|
mapModel.put("message","成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
mapModel.put("code","-1");
|
||||||
|
mapModel.put("message","失败");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return mapModel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,6 @@ public interface CgfpMapper {
|
||||||
* @date 2022-06-20
|
* @date 2022-06-20
|
||||||
**/
|
**/
|
||||||
Map selectInvoiceById(String invoiceId);
|
Map selectInvoiceById(String invoiceId);
|
||||||
|
|
||||||
|
Map selectInvoiceByFpdmhm(Map userMap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.htjs.pt4.zzsxt.service.impl.xxgl.xmkpgl.cgfp;
|
package net.htjs.pt4.zzsxt.service.impl.xxgl.xmkpgl.cgfp;
|
||||||
|
|
||||||
|
import com.alibaba.druid.support.json.JSONUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import net.htjs.pt4.core.ServiceException;
|
import net.htjs.pt4.core.ServiceException;
|
||||||
|
@ -49,6 +50,37 @@ public class BoCgfpServiceImpl implements IBoCgfpService {
|
||||||
return cgfpMapper.insertZZSGL_XX_JXFP(userMap);
|
return cgfpMapper.insertZZSGL_XX_JXFP(userMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer saveZZSGL_XX_JXFP(Map userMap) {
|
||||||
|
|
||||||
|
String jsonString = JSONUtils.toJSONString(userMap.get("invoices"));
|
||||||
|
|
||||||
|
jsonString = jsonString.replace("\\", "").replace("\"{", "{").replace("}\"", "}");
|
||||||
|
|
||||||
|
Map fpMap = JSON.parseObject(jsonString, Map.class);
|
||||||
|
|
||||||
|
Map<String,Object> fpxx = (Map) fpMap.get("fpxx");
|
||||||
|
|
||||||
|
Map<String,Object> fpxxMap = new HashMap<>();
|
||||||
|
|
||||||
|
fpxxMap.put("fpdm",fpxx.get("fpdm"));
|
||||||
|
fpxxMap.put("fphm",fpxx.get("fphm"));
|
||||||
|
fpxxMap.put("kprq",fpxx.get("kprq"));
|
||||||
|
fpxxMap.put("bhsje",fpxx.get("hjje"));
|
||||||
|
fpxxMap.put("se",fpxx.get("hjse"));
|
||||||
|
fpxxMap.put("fplxdm",fpxx.get("pjlx"));
|
||||||
|
fpxxMap.put("fylx",fpxx.get("fylx"));
|
||||||
|
|
||||||
|
Map map = cgfpMapper.selectInvoiceByFpdmhm(fpxxMap);
|
||||||
|
|
||||||
|
if (map == null){
|
||||||
|
return this.insertZZSGL_XX_JXFP(fpxxMap);
|
||||||
|
}else {
|
||||||
|
fpxxMap.put("fpid",map.get("fpid"));
|
||||||
|
return this.updateZZSGL_XX_JXFP(fpxxMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer deleteZZSGL_XX_JXFP(Map userMap) {
|
public Integer deleteZZSGL_XX_JXFP(Map userMap) {
|
||||||
return cgfpMapper.deleteZZSGL_XX_JXFP(userMap);
|
return cgfpMapper.deleteZZSGL_XX_JXFP(userMap);
|
||||||
|
|
|
@ -12,6 +12,8 @@ public interface IBoCgfpService {
|
||||||
|
|
||||||
Integer insertZZSGL_XX_JXFP(Map userMap);
|
Integer insertZZSGL_XX_JXFP(Map userMap);
|
||||||
|
|
||||||
|
Integer saveZZSGL_XX_JXFP(Map userMap);
|
||||||
|
|
||||||
Integer deleteZZSGL_XX_JXFP(Map userMap);
|
Integer deleteZZSGL_XX_JXFP(Map userMap);
|
||||||
|
|
||||||
Integer updateZZSGL_XX_JXFP(Map userMap);
|
Integer updateZZSGL_XX_JXFP(Map userMap);
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertZZSGL_XX_JXFP" parameterType="map">
|
<insert id="insertZZSGL_XX_JXFP" parameterType="map">
|
||||||
insert into ZZSGL_XX_JXFP (fpid,QYID,fplxdm,fpdm,fphm,kprq,bhsje,se,pzdh) values (#{fpid},#{QYID},#{fplxdm},#{fpdm},#{fphm},#{kprq},#{bhsje},#{se},#{pzdh})
|
insert into ZZSGL_XX_JXFP (fpid,QYID,fplxdm,fpdm,fphm,kprq,bhsje,se,pzdh
|
||||||
|
<if test="fylx!=null">
|
||||||
|
,fylx
|
||||||
|
</if>
|
||||||
|
) values (#{fpid},#{QYID},#{fplxdm},#{fpdm},#{fphm},#{kprq},#{bhsje},#{se},#{pzdh}
|
||||||
|
<if test="fylx!=null">
|
||||||
|
,#{fylx}
|
||||||
|
</if>)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<delete id="deleteZZSGL_XX_JXFP" parameterType="map">
|
<delete id="deleteZZSGL_XX_JXFP" parameterType="map">
|
||||||
|
@ -88,4 +95,11 @@
|
||||||
<select id="selectInvoiceById" resultType="map" parameterType="string">
|
<select id="selectInvoiceById" resultType="map" parameterType="string">
|
||||||
select * from ZZSGL_XX_JXFP where fpid=#{invoiceId}
|
select * from ZZSGL_XX_JXFP where fpid=#{invoiceId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
|
||||||
|
<select id="selectInvoiceByFpdmhm" resultType="map" parameterType="string">
|
||||||
|
select * from ZZSGL_XX_JXFP where fphm=#{fphm}
|
||||||
|
<if test="fpdm!=null and fpdm!=''">
|
||||||
|
and fpdm = #{fpdm}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue